summaryrefslogtreecommitdiff
path: root/src/balpair.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-01 01:48:07 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-01 01:48:07 -0400
commit9f8997f1b52f55225c76cf92461a05940d71a9e7 (patch)
tree180e1d7d9e1692234e3242f66f7e324c0ba32907 /src/balpair.cc
parentcac7d02dd8fa595722faace8aa84be54b49e554b (diff)
downloadfork-ledger-9f8997f1b52f55225c76cf92461a05940d71a9e7.tar.gz
fork-ledger-9f8997f1b52f55225c76cf92461a05940d71a9e7.tar.bz2
fork-ledger-9f8997f1b52f55225c76cf92461a05940d71a9e7.zip
Values can now be streamed to XML, and all the types they refer to.
Diffstat (limited to 'src/balpair.cc')
-rw-r--r--src/balpair.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/balpair.cc b/src/balpair.cc
index 822460b3..40d9b9ef 100644
--- a/src/balpair.cc
+++ b/src/balpair.cc
@@ -53,4 +53,15 @@ balance_pair_t::value(const optional<datetime_t>& moment,
return none;
}
+void balance_pair_t::write_xml(std::ostream& out, const int depth) const
+{
+ out << xml_str("<balance-pair>\n", depth);
+
+ quantity().write_xml(out, depth + 1);
+ if (cost)
+ cost->write_xml(out, depth + 1);
+
+ out << xml_str("</balance-pair>\n", depth);
+}
+
} // namespace ledger