diff options
author | John Wiegley <johnw@newartisans.com> | 2008-07-20 05:03:54 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-07-20 05:03:54 -0400 |
commit | 52fc9f2e4499e75d17e7f12d32a8391054d8634a (patch) | |
tree | 164b6b4cdb6717f2df7d154793499e90bdd3ae3e /parser.cc | |
parent | 59f6ffb863b7121b8a49c13dd64f9943ddaf7ed0 (diff) | |
download | ledger-52fc9f2e4499e75d17e7f12d32a8391054d8634a.tar.gz ledger-52fc9f2e4499e75d17e7f12d32a8391054d8634a.tar.bz2 ledger-52fc9f2e4499e75d17e7f12d32a8391054d8634a.zip |
Brought in the final round of 3.0 code, although it does not compile yet:
report, session, parts of xpath, main, journal, option.
Diffstat (limited to 'parser.cc')
-rw-r--r-- | parser.cc | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -127,7 +127,7 @@ unsigned int parse_ledger_data(config_t& config, if (boost::filesystem::exists(config.cache_file)) { boost::filesystem::ifstream stream(config.cache_file); if (cache_parser && cache_parser->test(stream)) { - path price_db_orig = journal->price_db; + optional<path> price_db_orig = journal->price_db; journal->price_db = config.price_db; entry_count += cache_parser->parse(stream, config, journal, NULL, &config.data_file); @@ -145,13 +145,13 @@ unsigned int parse_ledger_data(config_t& config, acct = journal->find_account(config.account); journal->price_db = config.price_db; - if (! journal->price_db.empty() && - boost::filesystem::exists(journal->price_db)) { - if (parse_journal_file(journal->price_db, config, journal)) { + if (journal->price_db && + boost::filesystem::exists(*journal->price_db)) { + if (parse_journal_file(*journal->price_db, config, journal)) { throw new error("Entries not allowed in price history file"); } else { DEBUG("ledger.config.cache", - "read price database " << journal->price_db); + "read price database " << *journal->price_db); journal->sources.pop_back(); } } @@ -172,8 +172,8 @@ unsigned int parse_ledger_data(config_t& config, else if (boost::filesystem::exists(config.data_file)) { entry_count += parse_journal_file(config.data_file, config, journal, acct); - if (! journal->price_db.empty()) - journal->sources.push_back(journal->price_db); + if (journal->price_db) + journal->sources.push_back(*journal->price_db); } } |