summaryrefslogtreecommitdiff
path: root/journal.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-03-08 23:00:53 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:29 -0400
commit47e2a341764b1747a0b010b3304233f7643f2a70 (patch)
tree593daa0b64c83657dc0d5e2dfcea9b78e37ca0c2 /journal.cc
parentf1d5716b95e770b53a43a5794782a34c78f0ae9f (diff)
downloadfork-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.cc26
1 files changed, 25 insertions, 1 deletions
diff --git a/journal.cc b/journal.cc
index 54d2a82a..b1292907 100644
--- a/journal.cc
+++ b/journal.cc
@@ -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