diff options
| author | Richard Linden <none@none> | 2013-03-22 00:44:59 -0700 |
|---|---|---|
| committer | Richard Linden <none@none> | 2013-03-22 00:44:59 -0700 |
| commit | 68f9f656cd22332e46959a90347e38f79c19a66c (patch) | |
| tree | 531d87287b69f500c5901f785e60483555b415f9 /indra/llui/llxuiparser.h | |
| parent | e87000ba0750e55d9d6b55feccc4124f5d2b4b74 (diff) | |
| parent | 368dd542bec7c31e14673b83d3342c35717d2920 (diff) | |
merge with viewer-release
Diffstat (limited to 'indra/llui/llxuiparser.h')
| -rw-r--r-- | indra/llui/llxuiparser.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/llui/llxuiparser.h b/indra/llui/llxuiparser.h index d7cd256967..8d0276a8ad 100644 --- a/indra/llui/llxuiparser.h +++ b/indra/llui/llxuiparser.h @@ -109,9 +109,25 @@ public: /*virtual*/ void parserError(const std::string& message); void readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, const std::string& filename = LLStringUtil::null, bool silent=false); - void writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const LLInitParam::BaseBlock* diff_block = NULL); + template<typename BLOCK> + void writeXUI(LLXMLNodePtr node, + const BLOCK& block, + const LLInitParam::predicate_rule_t rules = LLInitParam::default_parse_rules(), + const LLInitParam::BaseBlock* diff_block = NULL) + { + if (!diff_block + && !rules.isAmbivalent(LLInitParam::HAS_DEFAULT_VALUE)) + { + diff_block = &LLInitParam::defaultValue<BLOCK>(); + } + writeXUIImpl(node, block, rules, diff_block); + } private: + void writeXUIImpl(LLXMLNodePtr node, + const LLInitParam::BaseBlock& block, + const LLInitParam::predicate_rule_t rules, + const LLInitParam::BaseBlock* diff_block); bool readXUIImpl(LLXMLNodePtr node, LLInitParam::BaseBlock& block); bool readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& block); |
