[EEP] LLSD Changes
This commit is contained in:
@@ -131,6 +131,7 @@ public:
|
|||||||
|
|
||||||
virtual bool has(const String&) const { return false; }
|
virtual bool has(const String&) const { return false; }
|
||||||
virtual LLSD get(const String&) const { return LLSD(); }
|
virtual LLSD get(const String&) const { return LLSD(); }
|
||||||
|
virtual LLSD getKeys() const { return LLSD::emptyArray(); }
|
||||||
virtual void erase(const String&) { }
|
virtual void erase(const String&) { }
|
||||||
virtual const LLSD& ref(const String&) const{ return undef(); }
|
virtual const LLSD& ref(const String&) const{ return undef(); }
|
||||||
|
|
||||||
@@ -379,6 +380,7 @@ namespace
|
|||||||
using LLSD::Impl::erase; // Unhiding erase(LLSD::Integer)
|
using LLSD::Impl::erase; // Unhiding erase(LLSD::Integer)
|
||||||
using LLSD::Impl::ref; // Unhiding ref(LLSD::Integer)
|
using LLSD::Impl::ref; // Unhiding ref(LLSD::Integer)
|
||||||
virtual LLSD get(const LLSD::String&) const;
|
virtual LLSD get(const LLSD::String&) const;
|
||||||
|
virtual LLSD getKeys() const;
|
||||||
void insert(const LLSD::String& k, const LLSD& v);
|
void insert(const LLSD::String& k, const LLSD& v);
|
||||||
virtual void erase(const LLSD::String&);
|
virtual void erase(const LLSD::String&);
|
||||||
LLSD& ref(const LLSD::String&);
|
LLSD& ref(const LLSD::String&);
|
||||||
@@ -421,6 +423,18 @@ namespace
|
|||||||
return (i != mData.end()) ? i->second : LLSD();
|
return (i != mData.end()) ? i->second : LLSD();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLSD ImplMap::getKeys() const
|
||||||
|
{
|
||||||
|
LLSD keys = LLSD::emptyArray();
|
||||||
|
DataMap::const_iterator iter = mData.begin();
|
||||||
|
while (iter != mData.end())
|
||||||
|
{
|
||||||
|
keys.append((*iter).first);
|
||||||
|
iter++;
|
||||||
|
}
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
|
||||||
void ImplMap::insert(const LLSD::String& k, const LLSD& v)
|
void ImplMap::insert(const LLSD::String& k, const LLSD& v)
|
||||||
{
|
{
|
||||||
mData.insert(DataMap::value_type(k, v));
|
mData.insert(DataMap::value_type(k, v));
|
||||||
@@ -501,7 +515,7 @@ namespace
|
|||||||
virtual LLSD get(LLSD::Integer) const;
|
virtual LLSD get(LLSD::Integer) const;
|
||||||
void set(LLSD::Integer, const LLSD&);
|
void set(LLSD::Integer, const LLSD&);
|
||||||
void insert(LLSD::Integer, const LLSD&);
|
void insert(LLSD::Integer, const LLSD&);
|
||||||
void append(const LLSD&);
|
LLSD& append(const LLSD&);
|
||||||
virtual void erase(LLSD::Integer);
|
virtual void erase(LLSD::Integer);
|
||||||
LLSD& ref(LLSD::Integer);
|
LLSD& ref(LLSD::Integer);
|
||||||
virtual const LLSD& ref(LLSD::Integer) const;
|
virtual const LLSD& ref(LLSD::Integer) const;
|
||||||
@@ -569,9 +583,10 @@ namespace
|
|||||||
mData.insert(mData.begin() + index, v);
|
mData.insert(mData.begin() + index, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImplArray::append(const LLSD& v)
|
LLSD& ImplArray::append(const LLSD& v)
|
||||||
{
|
{
|
||||||
mData.push_back(v);
|
mData.push_back(v);
|
||||||
|
return mData.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImplArray::erase(LLSD::Integer i)
|
void ImplArray::erase(LLSD::Integer i)
|
||||||
@@ -862,6 +877,7 @@ LLSD LLSD::emptyMap()
|
|||||||
|
|
||||||
bool LLSD::has(const String& k) const { return safe(impl).has(k); }
|
bool LLSD::has(const String& k) const { return safe(impl).has(k); }
|
||||||
LLSD LLSD::get(const String& k) const { return safe(impl).get(k); }
|
LLSD LLSD::get(const String& k) const { return safe(impl).get(k); }
|
||||||
|
LLSD LLSD::getKeys() const { return safe(impl).getKeys(); }
|
||||||
void LLSD::insert(const String& k, const LLSD& v) { makeMap(impl).insert(k, v); }
|
void LLSD::insert(const String& k, const LLSD& v) { makeMap(impl).insert(k, v); }
|
||||||
|
|
||||||
LLSD& LLSD::with(const String& k, const LLSD& v)
|
LLSD& LLSD::with(const String& k, const LLSD& v)
|
||||||
@@ -895,7 +911,7 @@ LLSD& LLSD::with(Integer i, const LLSD& v)
|
|||||||
makeArray(impl).insert(i, v);
|
makeArray(impl).insert(i, v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
void LLSD::append(const LLSD& v) { makeArray(impl).append(v); }
|
LLSD& LLSD::append(const LLSD& v) { return makeArray(impl).append(v); }
|
||||||
void LLSD::erase(Integer i) { makeArray(impl).erase(i); }
|
void LLSD::erase(Integer i) { makeArray(impl).erase(i); }
|
||||||
|
|
||||||
LLSD& LLSD::operator[](Integer i)
|
LLSD& LLSD::operator[](Integer i)
|
||||||
|
|||||||
@@ -287,6 +287,7 @@ public:
|
|||||||
|
|
||||||
bool has(const String&) const;
|
bool has(const String&) const;
|
||||||
LLSD get(const String&) const;
|
LLSD get(const String&) const;
|
||||||
|
LLSD getKeys() const; // Return an LLSD array with keys as strings
|
||||||
void insert(const String&, const LLSD&);
|
void insert(const String&, const LLSD&);
|
||||||
void erase(const String&);
|
void erase(const String&);
|
||||||
LLSD& with(const String&, const LLSD&);
|
LLSD& with(const String&, const LLSD&);
|
||||||
@@ -304,7 +305,7 @@ public:
|
|||||||
LLSD get(Integer) const;
|
LLSD get(Integer) const;
|
||||||
void set(Integer, const LLSD&);
|
void set(Integer, const LLSD&);
|
||||||
void insert(Integer, const LLSD&);
|
void insert(Integer, const LLSD&);
|
||||||
void append(const LLSD&);
|
LLSD& append(const LLSD&);
|
||||||
void erase(Integer);
|
void erase(Integer);
|
||||||
LLSD& with(Integer, const LLSD&);
|
LLSD& with(Integer, const LLSD&);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user