diff options
author | Richard Linden <none@none> | 2012-11-19 19:06:36 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2012-11-19 19:06:36 -0800 |
commit | c0224cc47a2994956f20e8f65177b60cc709e434 (patch) | |
tree | 01d305fff69ca9cec713631d04aa76a4a33c79ca /indra/llui/llxuiparser.h | |
parent | 2d1a903d39a971775436ba4e1dfb7f630226c15c (diff) | |
parent | 6db6cb39f41e921e75970d1570a74cf35d353a35 (diff) |
merge with viewer-development
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); |