summaryrefslogtreecommitdiff
path: root/report.h
blob: 505eafbaf306878472fbf3dc954bd483df873bf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef _REPORT_H
#define _REPORT_H

#include "ledger.h"

#include <iostream>
#include <memory>
#include <list>

namespace ledger {

class report_t
{
 public:
  path output_file;

  string predicate;
  string secondary_predicate;
  string display_predicate;
  string report_period;
  string report_period_sort;
  string format_string;
  string sort_string;
  string amount_expr;
  string total_expr;
  string descend_expr;
  string forecast_limit;
  string reconcile_balance;
  string reconcile_date;
  string date_output_format;

  unsigned long budget_flags;

  int head_entries;
  int tail_entries;

  bool show_collapsed;
  bool show_subtotal;
  bool show_totals;
  bool show_related;
  bool show_all_related;
  bool show_inverted;
  bool show_empty;
  bool days_of_the_week;
  bool by_payee;
  bool comm_as_payee;
  bool code_as_payee;
  bool show_revalued;
  bool show_revalued_only;
  bool keep_price;
  bool keep_date;
  bool keep_tag;
  bool entry_sort;
  bool sort_all;

  report_t();

  void regexps_to_predicate(const string& command,
			    std::list<string>::const_iterator begin,
			    std::list<string>::const_iterator end,
			    const bool account_regexp	       = false,
			    const bool add_account_short_masks = false,
			    const bool logical_and             = true);

  void process_options(const string&     command,
		       strings_list::iterator arg,
		       strings_list::iterator args_end);

  item_handler<transaction_t> *
  chain_xact_handlers(const string& command,
		      item_handler<transaction_t> * base_formatter,
		      journal_t * journal,
		      account_t * master,
		      std::list<item_handler<transaction_t> *>& ptrs);
};

} // namespace ledger

#endif // _REPORT_H