diff options
author | John Wiegley <johnw@newartisans.com> | 2005-11-09 07:11:22 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:21 -0400 |
commit | e1d0dbf220a5301f6125a1548a380492ad488515 (patch) | |
tree | df7a5de60353d3558b00d21ee83cf01e8da56331 /textual.cc | |
parent | 6f4957c8c31395bca44d078972690eb2b3258a8f (diff) | |
download | fork-ledger-e1d0dbf220a5301f6125a1548a380492ad488515.tar.gz fork-ledger-e1d0dbf220a5301f6125a1548a380492ad488515.tar.bz2 fork-ledger-e1d0dbf220a5301f6125a1548a380492ad488515.zip |
Restructed the code that it can build and be used as a shared library.
The command-line version is still statically bound in the build
process by default (for the sake of speed).
Diffstat (limited to 'textual.cc')
-rw-r--r-- | textual.cc | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -211,7 +211,7 @@ transaction_t * parse_transaction(char * line, account_t * account) if (amount == note_str) amount = NULL; - *note_str++ = '\0'; + *note_str++ = '\0'; note_str = skip_ws(note_str); if (char * b = std::strchr(note_str, '[')) @@ -231,22 +231,22 @@ transaction_t * parse_transaction(char * line, account_t * account) throw parse_error(path, linenum, "Failed to parse date"); } - xact->note = skip_ws(note_str); - } + xact->note = skip_ws(note_str); + } if (amount) { price = std::strchr(amount, '@'); if (price) { if (price == amount) - throw parse_error(path, linenum, "Cost specified without amount"); + throw parse_error(path, linenum, "Cost specified without amount"); *price++ = '\0'; if (*price == '@') { - per_unit = false; + per_unit = false; price++; - } + } price = skip_ws(price); - } + } } } } @@ -321,7 +321,6 @@ bool parse_transactions(std::istream& in, } namespace { - TIMER_DEF(entry_finish, "finalizing entry"); TIMER_DEF(entry_xacts, "parsing transactions"); TIMER_DEF(entry_details, "parsing entry details"); TIMER_DEF(entry_date, "parsing entry date"); @@ -817,6 +816,7 @@ unsigned int textual_parser_t::parse(std::istream& in, void write_textual_journal(journal_t& journal, std::string path, item_handler<transaction_t>& formatter, + const std::string& write_hdr_format, std::ostream& out) { unsigned long index = 0; @@ -859,7 +859,7 @@ void write_textual_journal(journal_t& journal, std::string path, istream_pos_type pos = 0; istream_pos_type jump_to; - format_t hdr_fmt(config.write_hdr_format); + format_t hdr_fmt(write_hdr_format); std::ifstream in(found.c_str()); while (! in.eof()) { |