diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-09-01 23:05:31 +0300 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-09-01 23:05:31 +0300 |
| commit | 7f2388194136fc45d204f09fe63a6bd32d7e99ff (patch) | |
| tree | 876718a75ec3dfdc90e893c4af0a0ddd53331abd /indra/llxml | |
| parent | c7a13e5c9f275214f424c0b1c0ceb7c99ae62bfb (diff) | |
| parent | c6ae8017da0cb433b24560c9a721ea25ea3396b7 (diff) | |
Merge branch 'SL-13834' into DRTVWR-513-maint
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) { |
