summaryrefslogtreecommitdiff
path: root/parser.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-20 05:03:54 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-20 05:03:54 -0400
commit52fc9f2e4499e75d17e7f12d32a8391054d8634a (patch)
tree164b6b4cdb6717f2df7d154793499e90bdd3ae3e /parser.cc
parent59f6ffb863b7121b8a49c13dd64f9943ddaf7ed0 (diff)
downloadledger-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.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/parser.cc b/parser.cc
index 434cb0c4..bb00df6a 100644
--- a/parser.cc
+++ b/parser.cc
@@ -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);
}
}