summaryrefslogtreecommitdiff
path: root/src/annotate.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-09 13:25:45 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-09 13:25:45 -0500
commit865c0ff828f88ed1d00eea73a3fc55b3e57d21b3 (patch)
tree5acdfae32811b25fb46271bf349a216bea41fddb /src/annotate.h
parent55c7792c9329f97dd19fc5aeca466cb2de4fbf9c (diff)
parent9b396b41220646cf73fcd2a8afebcee06dde2a29 (diff)
downloadfork-ledger-865c0ff828f88ed1d00eea73a3fc55b3e57d21b3.tar.gz
fork-ledger-865c0ff828f88ed1d00eea73a3fc55b3e57d21b3.tar.bz2
fork-ledger-865c0ff828f88ed1d00eea73a3fc55b3e57d21b3.zip
Merge branch 'next'
Diffstat (limited to 'src/annotate.h')
-rw-r--r--src/annotate.h33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/annotate.h b/src/annotate.h
index 0f940849..38ebaeae 100644
--- a/src/annotate.h
+++ b/src/annotate.h
@@ -48,11 +48,6 @@
namespace ledger {
-/**
- * @brief Brief
- *
- * Long.
- */
struct annotation_t : public supports_flags<>,
public equality_comparable<annotation_t>
{
@@ -115,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, "price");
+ to_xml(out, *details.price);
+ }
+
+ if (details.date)
+ {
+ push_xml y(out, "date");
+ to_xml(out, *details.date, false);
+ }
+
+ if (details.tag)
+ {
+ push_xml y(out, "tag");
+ out << y.guard(*details.tag);
+ }
+}
+
struct keep_details_t
{
bool keep_price;
@@ -174,11 +192,6 @@ inline std::ostream& operator<<(std::ostream& out,
return out;
}
-/**
- * @brief Brief
- *
- * Long.
- */
class annotated_commodity_t
: public commodity_t,
public equality_comparable<annotated_commodity_t,