diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-16 05:37:46 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:52 -0400 |
commit | 8a2b87e6e1f5cd8784130f3cfcd1911b214c55cc (patch) | |
tree | b34a2bee1fa2772050ace252a4c691ffcf927c68 /src/session.cc | |
parent | 023f28630f7ed8f845eab00b137d58cc79b4445b (diff) | |
download | ledger-8a2b87e6e1f5cd8784130f3cfcd1911b214c55cc.tar.gz ledger-8a2b87e6e1f5cd8784130f3cfcd1911b214c55cc.tar.bz2 ledger-8a2b87e6e1f5cd8784130f3cfcd1911b214c55cc.zip |
Changed scope resolution to use the new value_t.
Diffstat (limited to 'src/session.cc')
-rw-r--r-- | src/session.cc | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/session.cc b/src/session.cc index 4bb88e4e..a93fb755 100644 --- a/src/session.cc +++ b/src/session.cc @@ -173,41 +173,35 @@ std::size_t session_t::read_data(xml::builder_t& builder, return entry_count; } -bool session_t::resolve(const string& name, value_t& result, - xml::xpath_t::scope_t * locals) +optional<value_t> +session_t::resolve(const string& name, xml::xpath_t::scope_t * locals) { const char * p = name.c_str(); switch (*p) { case 'd': +#if 0 if (name == "date_format") { // jww (2007-04-18): What to do here? -#if 0 - result.set_string(moment_t::output_format); -#endif - return true; + return value_t(moment_t::output_format, true); } +#endif break; case 'n': switch (*++p) { case 'o': - if (name == "now") { - result = now; - return true; - } + if (name == "now") + return value_t(now); break; } break; case 'r': - if (name == "register_format") { - result = register_format; - return true; - } + if (name == "register_format") + return value_t(register_format, true); break; } - - return xml::xpath_t::scope_t::resolve(name, result, locals); + return xml::xpath_t::scope_t::resolve(name, locals); } xml::xpath_t::ptr_op_t session_t::lookup(const string& name) |