diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-14 11:09:54 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:50 -0400 |
commit | f83705b847c59a8197f5098cb7dc2d484704e24d (patch) | |
tree | 1b314d07bb9f50a75781d703ec6c778056e74684 /src/textual.cc | |
parent | 65af1688382331d91153fb2366026e94feb5afe2 (diff) | |
download | ledger-f83705b847c59a8197f5098cb7dc2d484704e24d.tar.gz ledger-f83705b847c59a8197f5098cb7dc2d484704e24d.tar.bz2 ledger-f83705b847c59a8197f5098cb7dc2d484704e24d.zip |
Changed xpath to use intrusive_ptr; got the xml command working
Diffstat (limited to 'src/textual.cc')
-rw-r--r-- | src/textual.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/textual.cc b/src/textual.cc index ba720187..8fdd4db1 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -275,9 +275,9 @@ bool textual_parser_t::test(std::istream& in) const return true; } -void textual_parser_t::parse(std::istream& in, - const path& pathname, - builder_t& builder) +std::size_t textual_parser_t::parse(std::istream& in, + const path& pathname, + builder_t& builder) { TRACE_START(parsing_total, 1, "Total time spent parsing text:"); @@ -285,6 +285,8 @@ void textual_parser_t::parse(std::istream& in, builder.begin_node(JOURNAL_NODE); + std::size_t count = 0; + while (in.good() && ! in.eof()) { static char line[MAX_LINE + 1]; in.getline(line, MAX_LINE); @@ -460,6 +462,7 @@ void textual_parser_t::parse(std::istream& in, default: TRACE_START(entries, 1, "Time spent handling entries:"); parse_entry(in, builder, line, end_of_line); + count++; TRACE_STOP(entries, 1); break; } @@ -470,6 +473,8 @@ void textual_parser_t::parse(std::istream& in, builder.end_node(JOURNAL_NODE); TRACE_STOP(parsing_total, 1); + + return count; } } // namespace ledger |