summaryrefslogtreecommitdiff
path: root/indra/llcommon/llsd.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llsd.h')
-rw-r--r--indra/llcommon/llsd.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h
index d2b3548831..7fa193e035 100644
--- a/indra/llcommon/llsd.h
+++ b/indra/llcommon/llsd.h
@@ -335,6 +335,20 @@ public:
{
return c ? (*this)[std::string_view(c)] : *this;
}
+
+ template<typename T>
+ LLSD(const std::map<String, T>& map, bool exclude_empty = false)
+ {
+ assign(emptyMap());
+ for (const std::pair<String, T>& pair : map)
+ {
+ LLSD value(pair.second);
+ if (!exclude_empty || !value.isEmpty())
+ {
+ insert(pair.first, value);
+ }
+ }
+ }
//@}
/** @name Array Values */
@@ -420,6 +434,7 @@ public:
bool isBinary() const { return type() == TypeBinary; }
bool isMap() const { return type() == TypeMap; }
bool isArray() const { return type() == TypeArray; }
+ bool isEmpty() const;
//@}
/** @name Automatic Cast Protection