diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-14 11:09:39 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:50 -0400 |
commit | 65af1688382331d91153fb2366026e94feb5afe2 (patch) | |
tree | 47ffab623ab62e893377c4bd8037fe67c0ec2eb2 | |
parent | 687ee1a7c34f7484b715ac6d88b84a980247f6ac (diff) | |
download | fork-ledger-65af1688382331d91153fb2366026e94feb5afe2.tar.gz fork-ledger-65af1688382331d91153fb2366026e94feb5afe2.tar.bz2 fork-ledger-65af1688382331d91153fb2366026e94feb5afe2.zip |
document_builder_t is now working.
-rw-r--r-- | src/builder.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/builder.h b/src/builder.h index ea340242..1952fe63 100644 --- a/src/builder.h +++ b/src/builder.h @@ -33,8 +33,10 @@ public: : offset(_offset), linenum(_linenum) {} }; +protected: position_t current_position; +public: virtual void set_start_position(std::istream& in) {} virtual void set_position(const position_t& position) {} virtual position_t& position() { return current_position; } @@ -72,20 +74,20 @@ public: */ class document_builder_t : public builder_t { -public: typedef std::list<std::pair<node_t::nameid_t, string> > attrs_list; - document_t& document; + document_t& document_; attrs_list current_attrs; node_t * current; string current_text; +public: document_builder_t(document_t& _document) - : document(_document), current(&document) {} + : document_(_document), current(&document_) {} virtual void push_attr(const string& name, const string& value) { - push_attr(document.register_name(name), value); + push_attr(document().register_name(name), value); } virtual void push_attr(const node_t::nameid_t name_id, const string& value) { @@ -93,7 +95,7 @@ public: } virtual void begin_node(const string& name, bool terminal = false) { - begin_node(document.register_name(name), terminal); + begin_node(document().register_name(name), terminal); } virtual void begin_node(const node_t::nameid_t name_id, bool terminal = false) { @@ -118,6 +120,9 @@ public: end_node(name_id, end_pos); } + virtual document_t& document() { + return document_; + } virtual node_t * current_node() { return current; } |