summaryrefslogtreecommitdiff
path: root/src/item.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-02 00:24:26 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-02 00:24:26 -0400
commit9540406af15d522d15c94cc3d63c77b7da7e1423 (patch)
tree6dd912aac2adb018c16a8b506bc0e18eb8444caa /src/item.h
parentef3943c60498ab0fd4de1f1735109b0d103c167a (diff)
downloadfork-ledger-9540406af15d522d15c94cc3d63c77b7da7e1423.tar.gz
fork-ledger-9540406af15d522d15c94cc3d63c77b7da7e1423.tar.bz2
fork-ledger-9540406af15d522d15c94cc3d63c77b7da7e1423.zip
Simplified error context handling.
Diffstat (limited to 'src/item.h')
-rw-r--r--src/item.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/item.h b/src/item.h
index ce86ec6d..78052e81 100644
--- a/src/item.h
+++ b/src/item.h
@@ -51,6 +51,8 @@
namespace ledger {
+class journal_t;
+
/**
* @brief Brief
*
@@ -75,20 +77,25 @@ public:
typedef std::map<string, optional<string> > string_map;
optional<string_map> metadata;
+ journal_t * journal;
+
unsigned short src_idx;
+#if 0
istream_pos_type full_beg_pos;
std::size_t full_beg_line;
+#endif
istream_pos_type beg_pos;
std::size_t beg_line;
istream_pos_type end_pos;
std::size_t end_line;
+#if 0
istream_pos_type full_end_pos;
std::size_t full_end_line;
-
- static bool use_effective_date;
+#endif
item_t(flags_t _flags = ITEM_NORMAL, const optional<string>& _note = none)
- : supports_flags<>(_flags), _state(UNCLEARED), note(_note),
+ : supports_flags<>(_flags),
+ _state(UNCLEARED), note(_note), journal(NULL), src_idx(0),
beg_pos(0), beg_line(0), end_pos(0), end_line(0)
{
TRACE_CTOR(item_t, "flags_t, const string&");
@@ -112,6 +119,8 @@ public:
note = item.note;
+ journal = item.journal;
+ src_idx = item.src_idx;
beg_pos = item.beg_pos;
beg_line = item.beg_line;
end_pos = item.end_pos;
@@ -144,12 +153,7 @@ public:
virtual optional<date_t> effective_date() const {
return _date_eff;
}
- optional<date_t> date() const {
- if (use_effective_date && _date_eff)
- return effective_date();
- else
- return actual_date();
- }
+ optional<date_t> date() const;
void set_state(state_t new_state) {
_state = new_state;
@@ -165,6 +169,8 @@ public:
value_t get_comment(item_t& item);
+string item_context(const item_t& item);
+
} // namespace ledger
#endif // _ITEM_H