diff options
author | Dave Houlton <euclid@lindenlab.com> | 2021-02-02 16:11:44 +0000 |
---|---|---|
committer | Dave Houlton <euclid@lindenlab.com> | 2021-02-02 16:11:44 +0000 |
commit | de711c213820521aa8afcf991b4af561db54aede (patch) | |
tree | 108e7d0dcb12f6f827d78a0a30b28e33a8cb95f0 /indra/llxml | |
parent | 25186d07acdeb3ba079594f8f0f8677626b1baf6 (diff) | |
parent | 7af677ab442b4bb28f009f3715b8913aecd565fa (diff) |
Merged in DV528-rebase-6.4.13 (pull request #461)
DRTVWR-528 rebase to 6.4.13
Diffstat (limited to 'indra/llxml')
-rw-r--r-- | indra/llxml/llcontrol.cpp | 18 | ||||
-rw-r--r-- | indra/llxml/llcontrol.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 80a414d00f..ead8634df4 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -641,6 +641,24 @@ LLSD LLControlGroup::getLLSD(const std::string& name) return get<LLSD>(name); } +LLSD LLControlGroup::asLLSD(bool diffs_only) +{ + // Dump all stored values as LLSD + LLSD result = LLSD::emptyArray(); + for (ctrl_name_table_t::iterator iter = mNameTable.begin(); + iter != mNameTable.end(); iter++) + { + LLControlVariable *control = iter->second; + if (!control || control->isType(TYPE_STRING) || (diffs_only && control->isDefault())) + { + continue; + } + const std::string& name = iter->first; + result[name] = getLLSD(name); + } + return result; +} + BOOL LLControlGroup::controlExists(const std::string& name) { ctrl_name_table_t::iterator iter = mNameTable.find(name); diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 99946607f4..19508becc3 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -242,6 +242,8 @@ public: LLColor4 getColor4(const std::string& name); LLColor3 getColor3(const std::string& name); + LLSD asLLSD(bool diffs_only); + // generic getter template<typename T> T get(const std::string& name) { |