aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/llsd.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llcommon/llsd.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/linden/indra/llcommon/llsd.cpp b/linden/indra/llcommon/llsd.cpp
index fa0531b..2c32184 100644
--- a/linden/indra/llcommon/llsd.cpp
+++ b/linden/indra/llcommon/llsd.cpp
@@ -42,10 +42,11 @@
42#endif 42#endif
43 43
44#ifdef NAME_UNNAMED_NAMESPACE 44#ifdef NAME_UNNAMED_NAMESPACE
45namespace LLSDUnnamedNamespace { 45namespace LLSDUnnamedNamespace
46#else 46#else
47namespace { 47namespace
48#endif 48#endif
49{
49 class ImplMap; 50 class ImplMap;
50 class ImplArray; 51 class ImplArray;
51} 52}
@@ -127,10 +128,10 @@ public:
127 virtual void erase(Integer) { } 128 virtual void erase(Integer) { }
128 virtual const LLSD& ref(Integer) const { return undef(); } 129 virtual const LLSD& ref(Integer) const { return undef(); }
129 130
130 virtual LLSD::map_const_iterator beginMap() const { return LLSD::map_const_iterator(); } 131 virtual LLSD::map_const_iterator beginMap() const { return endMap(); }
131 virtual LLSD::map_const_iterator endMap() const { return LLSD::map_const_iterator(); } 132 virtual LLSD::map_const_iterator endMap() const { static const std::map<String, LLSD> empty; return empty.end(); }
132 virtual LLSD::array_const_iterator beginArray() const { return LLSD::array_const_iterator(); } 133 virtual LLSD::array_const_iterator beginArray() const { return endArray(); }
133 virtual LLSD::array_const_iterator endArray() const { return LLSD::array_const_iterator(); } 134 virtual LLSD::array_const_iterator endArray() const { static const std::vector<LLSD> empty; return empty.end(); }
134 135
135 static const LLSD& undef(); 136 static const LLSD& undef();
136 137
@@ -139,10 +140,11 @@ public:
139}; 140};
140 141
141#ifdef NAME_UNNAMED_NAMESPACE 142#ifdef NAME_UNNAMED_NAMESPACE
142namespace LLSDUnnamedNamespace { 143namespace LLSDUnnamedNamespace
143#else 144#else
144namespace { 145namespace
145#endif 146#endif
147{
146 template<LLSD::Type T, class Data, class DataRef = Data> 148 template<LLSD::Type T, class Data, class DataRef = Data>
147 class ImplBase : public LLSD::Impl 149 class ImplBase : public LLSD::Impl
148 ///< This class handles most of the work for a subclass of Impl 150 ///< This class handles most of the work for a subclass of Impl
@@ -185,6 +187,11 @@ namespace {
185 }; 187 };
186 188
187 LLSD::String ImplBoolean::asString() const 189 LLSD::String ImplBoolean::asString() const
190 // *NOTE: The reason that false is not converted to "false" is
191 // because that would break roundtripping,
192 // e.g. LLSD(false).asString().asBoolean(). There are many
193 // reasons for wanting LLSD("false").asBoolean() == true, such
194 // as "everything else seems to work that way".
188 { return mValue ? "true" : ""; } 195 { return mValue ? "true" : ""; }
189 196
190 197
@@ -650,10 +657,11 @@ U32 LLSD::Impl::sOutstandingCount = 0;
650 657
651 658
652#ifdef NAME_UNNAMED_NAMESPACE 659#ifdef NAME_UNNAMED_NAMESPACE
653namespace LLSDUnnamedNamespace { 660namespace LLSDUnnamedNamespace
654#else 661#else
655namespace { 662namespace
656#endif 663#endif
664{
657 inline LLSD::Impl& safe(LLSD::Impl* impl) 665 inline LLSD::Impl& safe(LLSD::Impl* impl)
658 { return LLSD::Impl::safe(impl); } 666 { return LLSD::Impl::safe(impl); }
659 667