summaryrefslogtreecommitdiff
path: root/src/annotate.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-25 05:13:21 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-11-09 02:17:26 -0500
commit2c80227339538154ad0869e746f52db805325589 (patch)
tree091188e3ad5c8cc41e3f94285969ef9849a97ac4 /src/annotate.h
parent7411c74d6d5bea42cb9fa5b6b0ed90480c954a03 (diff)
downloadfork-ledger-2c80227339538154ad0869e746f52db805325589.tar.gz
fork-ledger-2c80227339538154ad0869e746f52db805325589.tar.bz2
fork-ledger-2c80227339538154ad0869e746f52db805325589.zip
Added basic foundation for XML reporting
Diffstat (limited to 'src/annotate.h')
-rw-r--r--src/annotate.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/annotate.h b/src/annotate.h
index 9ca994c9..37810fb9 100644
--- a/src/annotate.h
+++ b/src/annotate.h
@@ -110,6 +110,29 @@ private:
#endif // HAVE_BOOST_SERIALIZATION
};
+inline void to_xml(std::ostream& out, const annotation_t& details)
+{
+ push_xml x(out, "annotation");
+
+ if (details.price)
+ {
+ push_xml y(out, "ann-price");
+ to_xml(out, *details.price);
+ }
+
+ if (details.date)
+ {
+ push_xml y(out, "ann-date");
+ to_xml(out, *details.date);
+ }
+
+ if (details.tag)
+ {
+ push_xml y(out, "ann-tag");
+ out << y.guard(*details.tag);
+ }
+}
+
struct keep_details_t
{
bool keep_price;