diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-03 12:21:54 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-03 12:22:10 -0400 |
commit | 3434650848e500d605447388ef7e069ee1515b72 (patch) | |
tree | da05e1bc5dbf5ef321d258f524518e9631dc7574 /src/op.cc | |
parent | 9bdcbffb150387d64e7eff630aaad84fb0d696b1 (diff) | |
download | fork-ledger-3434650848e500d605447388ef7e069ee1515b72.tar.gz fork-ledger-3434650848e500d605447388ef7e069ee1515b72.tar.bz2 fork-ledger-3434650848e500d605447388ef7e069ee1515b72.zip |
Removed the binary caching code, and the XML, QIF and Gnucash parsers.
Diffstat (limited to 'src/op.cc')
-rw-r--r-- | src/op.cc | 76 |
1 files changed, 0 insertions, 76 deletions
@@ -31,7 +31,6 @@ #include "op.h" #include "scope.h" -#include "binary.h" namespace ledger { @@ -501,81 +500,6 @@ void expr_t::op_t::dump(std::ostream& out, const int depth) const } } -void expr_t::op_t::read(const char *& data) -{ - kind = binary::read_long<kind_t>(data); - - if (kind > TERMINALS) { - set_left(new expr_t::op_t()); - left()->read(data); - - if (kind > UNARY_OPERATORS && binary::read_bool(data)) { - set_right(new expr_t::op_t()); - right()->read(data); - } - } - - switch (kind) { - case VALUE: { - value_t temp; - temp.read(data); - set_value(temp); - break; - } - case IDENT: { - string temp; - binary::read_string(data, temp); - set_ident(temp); - break; - } - case INDEX: { - long temp; - binary::read_long(data, temp); - set_index(temp); - break; - } - - default: - assert(false); - break; - } -} - -void expr_t::op_t::write(std::ostream& out) const -{ - binary::write_long<kind_t>(out, kind); - - if (kind > TERMINALS) { - left()->write(out); - - if (kind > UNARY_OPERATORS) { - if (has_right()) { - binary::write_bool(out, true); - right()->write(out); - } else { - binary::write_bool(out, false); - } - } - } else { - switch (kind) { - case VALUE: - as_value().write(out); - break; - case IDENT: - binary::write_string(out, as_ident()); - break; - case INDEX: - binary::write_long(out, as_index()); - break; - - case FUNCTION: - default: - assert(false); - break; - } - } -} - string op_context(const expr_t::ptr_op_t op, const expr_t::ptr_op_t goal) { ostream_pos_type start_pos, end_pos; |