diff options
| author | dolphin <dolphin@lindenlab.com> | 2014-06-17 13:09:15 -0700 |
|---|---|---|
| committer | dolphin <dolphin@lindenlab.com> | 2014-06-17 13:09:15 -0700 |
| commit | 299921de323eb9b6844cd7b6f6b8da3490ee3747 (patch) | |
| tree | dcb4c5c257622c20014a0b986dc8e2d1c25a10c7 /indra/llcommon/llsd.cpp | |
| parent | 89ea1cbc7acee8878c36a5795dd3df12a913c513 (diff) | |
| parent | 977476171ddcc057d7c28b6c14ae988b8189ed75 (diff) | |
Merge with 3.7.9-release
Diffstat (limited to 'indra/llcommon/llsd.cpp')
| -rwxr-xr-x | indra/llcommon/llsd.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index f962485284..d8bbb3a74f 100755 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -126,7 +126,9 @@ public: virtual UUID asUUID() const { return LLUUID(); } virtual Date asDate() const { return LLDate(); } virtual URI asURI() const { return LLURI(); } - virtual Binary asBinary() const { return std::vector<U8>(); } + virtual const Binary& asBinary() const { static const std::vector<U8> empty; return empty; } + + virtual const String& asStringRef() const { static const std::string empty; return empty; } virtual bool has(const String&) const { return false; } virtual LLSD get(const String&) const { return LLSD(); } @@ -270,6 +272,7 @@ namespace virtual LLSD::Date asDate() const { return LLDate(mValue); } virtual LLSD::URI asURI() const { return LLURI(mValue); } virtual int size() const { return mValue.size(); } + virtual const LLSD::String& asStringRef() const { return mValue; } }; LLSD::Integer ImplString::asInteger() const @@ -348,7 +351,7 @@ namespace public: ImplBinary(const LLSD::Binary& v) : Base(v) { } - virtual LLSD::Binary asBinary() const{ return mValue; } + virtual const LLSD::Binary& asBinary() const{ return mValue; } }; @@ -840,7 +843,9 @@ LLSD::String LLSD::asString() const { return safe(impl).asString(); } LLSD::UUID LLSD::asUUID() const { return safe(impl).asUUID(); } LLSD::Date LLSD::asDate() const { return safe(impl).asDate(); } LLSD::URI LLSD::asURI() const { return safe(impl).asURI(); } -LLSD::Binary LLSD::asBinary() const { return safe(impl).asBinary(); } +const LLSD::Binary& LLSD::asBinary() const { return safe(impl).asBinary(); } + +const LLSD::String& LLSD::asStringRef() const { return safe(impl).asStringRef(); } // const char * helpers LLSD::LLSD(const char* v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } |
