summaryrefslogtreecommitdiff
path: root/src/item.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-02-29 14:43:16 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-02-29 14:43:16 -0600
commit520ece21644c4f3a97f722e351fce382c1661183 (patch)
tree1247ef37d801e3fe29254924640008c4dbf4d587 /src/item.h
parent5517871144e61ec1c7bad8f4dd96e0672e63f9d1 (diff)
downloadfork-ledger-520ece21644c4f3a97f722e351fce382c1661183.tar.gz
fork-ledger-520ece21644c4f3a97f722e351fce382c1661183.tar.bz2
fork-ledger-520ece21644c4f3a97f722e351fce382c1661183.zip
Fixed problem with the Python build
Diffstat (limited to 'src/item.h')
-rw-r--r--src/item.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/item.h b/src/item.h
index 62575d8b..af3992c0 100644
--- a/src/item.h
+++ b/src/item.h
@@ -151,6 +151,19 @@ public:
return ! (*this == xact);
}
+ string id() const {
+ if (optional<value_t> ref = get_tag(_("UUID"))) {
+ return ref->to_string();
+ } else {
+ std::ostringstream buf;
+ buf << seq();
+ return buf.str();
+ }
+ }
+ std::size_t seq() const {
+ return pos ? pos->sequence : 0L;
+ }
+
virtual bool has_tag(const string& tag,
bool inherit = true) const;
virtual bool has_tag(const mask_t& tag_mask,