summaryrefslogtreecommitdiff
path: root/item.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-07-26 23:33:51 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-07-26 23:33:51 -0400
commit161d6f79bd6f4ab45afa1cbae77548c8e508809a (patch)
tree55391f4997e20de173579d90b43316a968b27c9e /item.h
parentfde56d0f1214b8fb9de5ba4d42d683ed494c45b0 (diff)
downloadfork-ledger-161d6f79bd6f4ab45afa1cbae77548c8e508809a.tar.gz
fork-ledger-161d6f79bd6f4ab45afa1cbae77548c8e508809a.tar.bz2
fork-ledger-161d6f79bd6f4ab45afa1cbae77548c8e508809a.zip
initial rev of 2.0
Diffstat (limited to 'item.h')
-rw-r--r--item.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/item.h b/item.h
new file mode 100644
index 00000000..f14e7f8e
--- /dev/null
+++ b/item.h
@@ -0,0 +1,57 @@
+#ifndef _REPORT_H
+#define _REPORT_H
+
+#include "ledger.h"
+#include "balance.h"
+
+#include <deque>
+
+namespace ledger {
+
+struct node_t;
+struct item_t;
+typedef std::deque<item_t *> items_deque;
+
+struct item_t
+{
+ struct item_t * parent;
+ unsigned int index;
+ std::time_t date;
+ std::string payee;
+ const account_t * account;
+ balance_pair_t value;
+ balance_pair_t total;
+
+ items_deque subitems;
+
+ item_t() : parent(NULL), index(0), date(-1), account(NULL) {}
+
+ ~item_t() {
+ for (items_deque::iterator i = subitems.begin();
+ i != subitems.end();
+ i++)
+ delete *i;
+ }
+
+ void sort(const node_t * sort_order);
+};
+
+class constraints_t;
+
+item_t * walk_accounts(const account_t * account,
+ const constraints_t& constraints,
+ const bool compute_subtotals);
+
+item_t * walk_items(const item_t * top,
+ const account_t * account,
+ const constraints_t& constraints,
+ const bool compute_subtotals);
+
+item_t * walk_entries(entries_list::const_iterator begin,
+ entries_list::const_iterator end,
+ const constraints_t& constraints,
+ const format_t& format);
+
+} // namespace report
+
+#endif // _REPORT_H