diff options
author | John Wiegley <johnw@newartisans.com> | 2006-03-08 23:00:53 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:29 -0400 |
commit | 47e2a341764b1747a0b010b3304233f7643f2a70 (patch) | |
tree | 593daa0b64c83657dc0d5e2dfcea9b78e37ca0c2 /journal.cc | |
parent | f1d5716b95e770b53a43a5794782a34c78f0ae9f (diff) | |
download | fork-ledger-47e2a341764b1747a0b010b3304233f7643f2a70.tar.gz fork-ledger-47e2a341764b1747a0b010b3304233f7643f2a70.tar.bz2 fork-ledger-47e2a341764b1747a0b010b3304233f7643f2a70.zip |
*** empty log message ***
Diffstat (limited to 'journal.cc')
-rw-r--r-- | journal.cc | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -2,7 +2,7 @@ #include "datetime.h" #include "valexpr.h" #include "mask.h" -#include "error.h" +#include "format.h" #include "acconf.h" #include <fstream> @@ -546,4 +546,28 @@ bool journal_t::valid() const return true; } +void entry_context::describe(std::ostream& out) const throw() +{ + if (! desc.empty()) + out << desc << std::endl; + + print_entry(out, entry, " "); +} + +xact_context::xact_context(const ledger::transaction_t& _xact, + const std::string& desc) throw() + : xact(_xact), file_context("", 0, desc) +{ + const ledger::strings_list& sources(xact.entry->journal->sources); + int x = 0; + for (ledger::strings_list::const_iterator i = sources.begin(); + i != sources.end(); + i++, x++) + if (x == xact.entry->src_idx) { + file = *i; + break; + } + line = xact.beg_line; +} + } // namespace ledger |