diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-12 15:42:02 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-12 15:43:00 -0400 |
commit | b1b4e2aadff5983d443d70c09ea86a41b015873f (patch) | |
tree | 2c40305c9f9841a4c3d453a4a5c49ec69056b4b2 /src/timelog.cc | |
parent | 0555e7f61ef14ec667f8ba611e60fd96133a9676 (diff) | |
download | fork-ledger-b1b4e2aadff5983d443d70c09ea86a41b015873f.tar.gz fork-ledger-b1b4e2aadff5983d443d70c09ea86a41b015873f.tar.bz2 fork-ledger-b1b4e2aadff5983d443d70c09ea86a41b015873f.zip |
Add support for typed metadata
The metadata construct 'Key: Value' is now just a special case for
'Key:: "Value"'. Another after a :: in metadata setting is parsed as a
full value expression and typed as such. For example:
; Key:: $400 + $500
ledger -l 'tag("Key") < $1000'
Diffstat (limited to 'src/timelog.cc')
-rw-r--r-- | src/timelog.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/timelog.cc b/src/timelog.cc index 241824cd..698e2420 100644 --- a/src/timelog.cc +++ b/src/timelog.cc @@ -42,7 +42,8 @@ namespace ledger { namespace { void clock_out_from_timelog(std::list<time_xact_t>& time_xacts, time_xact_t out_event, - journal_t& journal) + journal_t& journal, + scope_t& scope) { time_xact_t event; @@ -94,7 +95,7 @@ namespace { curr->pos = event.position; if (! event.note.empty()) - curr->append_note(event.note.c_str()); + curr->append_note(event.note.c_str(), scope); char buf[32]; std::sprintf(buf, "%lds", long((out_event.checkin - event.checkin) @@ -129,7 +130,7 @@ time_log_t::~time_log_t() foreach (account_t * account, accounts) clock_out_from_timelog(time_xacts, time_xact_t(none, CURRENT_TIME(), account), - journal); + journal, scope); assert(time_xacts.empty()); } @@ -152,7 +153,7 @@ void time_log_t::clock_out(time_xact_t event) if (time_xacts.empty()) throw std::logic_error(_("Timelog check-out event without a check-in")); - clock_out_from_timelog(time_xacts, event, journal); + clock_out_from_timelog(time_xacts, event, journal, scope); } } // namespace ledger |