summaryrefslogtreecommitdiff
path: root/src/timelog.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-11 02:01:34 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-11 02:01:34 -0500
commited9209cc2794eeef2a363947ab9b89be83aefe6b (patch)
tree7a2834e89138a16e792400c20da1d11e1603cab1 /src/timelog.h
parenta4b1e7c5ab70fc846b0ec4762f2e9f8ee242ca11 (diff)
downloadfork-ledger-ed9209cc2794eeef2a363947ab9b89be83aefe6b.tar.gz
fork-ledger-ed9209cc2794eeef2a363947ab9b89be83aefe6b.tar.bz2
fork-ledger-ed9209cc2794eeef2a363947ab9b89be83aefe6b.zip
Timeclock events now record their file position
Diffstat (limited to 'src/timelog.h')
-rw-r--r--src/timelog.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/timelog.h b/src/timelog.h
index d0519ce4..83256dfa 100644
--- a/src/timelog.h
+++ b/src/timelog.h
@@ -44,6 +44,7 @@
#include "utils.h"
#include "times.h"
+#include "item.h"
namespace ledger {
@@ -57,20 +58,24 @@ public:
account_t * account;
string desc;
string note;
+ position_t position;
time_xact_t() : account(NULL) {
TRACE_CTOR(time_xact_t, "");
}
- time_xact_t(const datetime_t& _checkin,
- account_t * _account = NULL,
- const string& _desc = "",
- const string& _note = "")
- : checkin(_checkin), account(_account), desc(_desc), note(_note) {
- TRACE_CTOR(time_xact_t, "const datetime_t&, account_t *, string, string");
+ time_xact_t(const optional<position_t>& _position,
+ const datetime_t& _checkin,
+ account_t * _account = NULL,
+ const string& _desc = "",
+ const string& _note = "")
+ : checkin(_checkin), account(_account), desc(_desc), note(_note),
+ position(_position ? *_position : position_t()) {
+ TRACE_CTOR(time_xact_t,
+ "position_t, datetime_t, account_t *, string, string");
}
time_xact_t(const time_xact_t& xact)
: checkin(xact.checkin), account(xact.account),
- desc(xact.desc), note(xact.note) {
+ desc(xact.desc), note(xact.note), position(xact.position) {
TRACE_CTOR(time_xact_t, "copy");
}
~time_xact_t() throw() {
@@ -89,15 +94,8 @@ public:
}
~time_log_t();
- void clock_in(const datetime_t& checkin,
- account_t * account = NULL,
- const string& desc = "",
- const string& note = "");
-
- void clock_out(const datetime_t& checkin,
- account_t * account = NULL,
- const string& desc = "",
- const string& note = "");
+ void clock_in(time_xact_t event);
+ void clock_out(time_xact_t event);
};
} // namespace ledger