diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-19 20:31:46 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:28 -0400 |
commit | 0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c (patch) | |
tree | 0a2c2aca7100d045f491b03f0a5bda92378d3ef9 /register.h | |
parent | 176b3044e355398a0c31e0c42a3cd7b8a2e3f3e5 (diff) | |
download | fork-ledger-0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c.tar.gz fork-ledger-0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c.tar.bz2 fork-ledger-0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c.zip |
Made the amount/balance/value interface a bit more rational; added
back a useless version of the register command (just to prove the
command sequence); and added smart XML semantics to the XPath
implementation so that nodes can be coerced to values.
Diffstat (limited to 'register.h')
-rw-r--r-- | register.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/register.h b/register.h new file mode 100644 index 00000000..73078892 --- /dev/null +++ b/register.h @@ -0,0 +1,25 @@ +#ifndef _REGISTER_H +#define _REGISTER_H + +#include "xpath.h" + +namespace ledger { + +class register_command : public xml::xpath_t::functor_t +{ + public: + register_command() : xml::xpath_t::functor_t("register") {} + + virtual void operator()(value_t&, xml::xpath_t::scope_t * locals) { + std::ostream * out = get_ptr<std::ostream>(locals, 0); + xml::document_t * doc = get_ptr<xml::document_t>(locals, 1); + + print_document(*out, doc); + } + + virtual void print_document(std::ostream& out, xml::document_t * doc); +}; + +} // namespace ledger + +#endif // _REGISTER_H |