diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/llcommon/llsd.cpp | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/llcommon/llsd.cpp')
-rw-r--r-- | linden/indra/llcommon/llsd.cpp | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/linden/indra/llcommon/llsd.cpp b/linden/indra/llcommon/llsd.cpp index 19471a0..2cc94c2 100644 --- a/linden/indra/llcommon/llsd.cpp +++ b/linden/indra/llcommon/llsd.cpp | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -349,7 +350,7 @@ namespace | |||
349 | 350 | ||
350 | virtual bool has(const LLSD::String&) const; | 351 | virtual bool has(const LLSD::String&) const; |
351 | virtual LLSD get(const LLSD::String&) const; | 352 | virtual LLSD get(const LLSD::String&) const; |
352 | void insert(const LLSD::String& k, const LLSD& v); | 353 | LLSD& insert(const LLSD::String& k, const LLSD& v); |
353 | virtual void erase(const LLSD::String&); | 354 | virtual void erase(const LLSD::String&); |
354 | LLSD& ref(const LLSD::String&); | 355 | LLSD& ref(const LLSD::String&); |
355 | virtual const LLSD& ref(const LLSD::String&) const; | 356 | virtual const LLSD& ref(const LLSD::String&) const; |
@@ -388,9 +389,14 @@ namespace | |||
388 | return (i != mData.end()) ? i->second : LLSD(); | 389 | return (i != mData.end()) ? i->second : LLSD(); |
389 | } | 390 | } |
390 | 391 | ||
391 | void ImplMap::insert(const LLSD::String& k, const LLSD& v) | 392 | LLSD& ImplMap::insert(const LLSD::String& k, const LLSD& v) |
392 | { | 393 | { |
393 | mData.insert(DataMap::value_type(k, v)); | 394 | mData.insert(DataMap::value_type(k, v)); |
395 | #ifdef LL_MSVC7 | ||
396 | return *((LLSD*)this); | ||
397 | #else | ||
398 | return *dynamic_cast<LLSD*>(this); | ||
399 | #endif | ||
394 | } | 400 | } |
395 | 401 | ||
396 | void ImplMap::erase(const LLSD::String& k) | 402 | void ImplMap::erase(const LLSD::String& k) |
@@ -436,7 +442,7 @@ namespace | |||
436 | virtual int size() const; | 442 | virtual int size() const; |
437 | virtual LLSD get(LLSD::Integer) const; | 443 | virtual LLSD get(LLSD::Integer) const; |
438 | void set(LLSD::Integer, const LLSD&); | 444 | void set(LLSD::Integer, const LLSD&); |
439 | void insert(LLSD::Integer, const LLSD&); | 445 | LLSD& insert(LLSD::Integer, const LLSD&); |
440 | void append(const LLSD&); | 446 | void append(const LLSD&); |
441 | virtual void erase(LLSD::Integer); | 447 | virtual void erase(LLSD::Integer); |
442 | LLSD& ref(LLSD::Integer); | 448 | LLSD& ref(LLSD::Integer); |
@@ -485,9 +491,15 @@ namespace | |||
485 | mData[index] = v; | 491 | mData[index] = v; |
486 | } | 492 | } |
487 | 493 | ||
488 | void ImplArray::insert(LLSD::Integer i, const LLSD& v) | 494 | LLSD& ImplArray::insert(LLSD::Integer i, const LLSD& v) |
489 | { | 495 | { |
490 | if (i < 0) { return; } | 496 | if (i < 0) { |
497 | #ifdef LL_MSVC7 | ||
498 | return *((LLSD*)this); | ||
499 | #else | ||
500 | return *dynamic_cast<LLSD*>(this); | ||
501 | #endif | ||
502 | } | ||
491 | DataVector::size_type index = i; | 503 | DataVector::size_type index = i; |
492 | 504 | ||
493 | if (index >= mData.size()) | 505 | if (index >= mData.size()) |
@@ -496,6 +508,11 @@ namespace | |||
496 | } | 508 | } |
497 | 509 | ||
498 | mData.insert(mData.begin() + index, v); | 510 | mData.insert(mData.begin() + index, v); |
511 | #ifdef LL_MSVC7 | ||
512 | return *((LLSD*)this); | ||
513 | #else | ||
514 | return *dynamic_cast<LLSD*>(this); | ||
515 | #endif | ||
499 | } | 516 | } |
500 | 517 | ||
501 | void ImplArray::append(const LLSD& v) | 518 | void ImplArray::append(const LLSD& v) |
@@ -739,8 +756,11 @@ LLSD LLSD::emptyMap() | |||
739 | bool LLSD::has(const String& k) const { return safe(impl).has(k); } | 756 | bool LLSD::has(const String& k) const { return safe(impl).has(k); } |
740 | LLSD LLSD::get(const String& k) const { return safe(impl).get(k); } | 757 | LLSD LLSD::get(const String& k) const { return safe(impl).get(k); } |
741 | 758 | ||
742 | void LLSD::insert(const String& k, const LLSD& v) | 759 | LLSD& LLSD::insert(const String& k, const LLSD& v) |
743 | { makeMap(impl).insert(k, v); } | 760 | { |
761 | makeMap(impl).insert(k, v); | ||
762 | return *dynamic_cast<LLSD*>(this); | ||
763 | } | ||
744 | void LLSD::erase(const String& k) { makeMap(impl).erase(k); } | 764 | void LLSD::erase(const String& k) { makeMap(impl).erase(k); } |
745 | 765 | ||
746 | LLSD& LLSD::operator[](const String& k) | 766 | LLSD& LLSD::operator[](const String& k) |
@@ -761,8 +781,11 @@ int LLSD::size() const { return safe(impl).size(); } | |||
761 | LLSD LLSD::get(Integer i) const { return safe(impl).get(i); } | 781 | LLSD LLSD::get(Integer i) const { return safe(impl).get(i); } |
762 | void LLSD::set(Integer i, const LLSD& v){ makeArray(impl).set(i, v); } | 782 | void LLSD::set(Integer i, const LLSD& v){ makeArray(impl).set(i, v); } |
763 | 783 | ||
764 | void LLSD::insert(Integer i, const LLSD& v) | 784 | LLSD& LLSD::insert(Integer i, const LLSD& v) |
765 | { makeArray(impl).insert(i, v); } | 785 | { |
786 | makeArray(impl).insert(i, v); | ||
787 | return *this; | ||
788 | } | ||
766 | void LLSD::append(const LLSD& v) { makeArray(impl).append(v); } | 789 | void LLSD::append(const LLSD& v) { makeArray(impl).append(v); } |
767 | void LLSD::erase(Integer i) { makeArray(impl).erase(i); } | 790 | void LLSD::erase(Integer i) { makeArray(impl).erase(i); } |
768 | 791 | ||