diff options
author | Richard Linden <none@none> | 2012-11-02 20:03:44 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2012-11-02 20:03:44 -0700 |
commit | f8eaee753174d0cab4e4edcf795f422706d6f302 (patch) | |
tree | 7f16a502c6a8c4df57dfa74303a04d66eed74fa7 /indra/llcommon/llsdparam.h | |
parent | bb6bda9eef48f5b08b56af46321b79fe7f1d49d7 (diff) |
SH-3499 Ensure asset stats output is correct
improvements to predicate API
default rules encapsulated in LLInitParam
removed empty flag from viewer asset stats
Diffstat (limited to 'indra/llcommon/llsdparam.h')
-rw-r--r-- | indra/llcommon/llsdparam.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/indra/llcommon/llsdparam.h b/indra/llcommon/llsdparam.h index 032e506fd8..1181c2d433 100644 --- a/indra/llcommon/llsdparam.h +++ b/indra/llcommon/llsdparam.h @@ -50,11 +50,28 @@ typedef LLInitParam::Parser parser_t; public: LLParamSDParser(); void readSD(const LLSD& sd, LLInitParam::BaseBlock& block, bool silent = false); - void writeSD(LLSD& sd, const LLInitParam::BaseBlock& block, LLInitParam::predicate_rule_t rules = LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT); + template<typename BLOCK> + void writeSD(LLSD& sd, + 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>(); + } + writeSDImpl(sd, block, rules, diff_block); + } /*virtual*/ std::string getCurrentElementName(); private: + void writeSDImpl(LLSD& sd, + const LLInitParam::BaseBlock& block, + const LLInitParam::predicate_rule_t, + const LLInitParam::BaseBlock* diff_block); + void submit(LLInitParam::BaseBlock& block, const LLSD& sd, LLInitParam::Parser::name_stack_t& name_stack); template<typename T> |