From 094c64b67cedc080bf8dcf218105f31f5b479296 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 28 Jan 2009 20:49:44 -0400 Subject: amount_t and commodity_t objects can now stream themselves to XML. --- src/utils.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/utils.h') diff --git a/src/utils.h b/src/utils.h index 0d511a38..c761f277 100644 --- a/src/utils.h +++ b/src/utils.h @@ -535,6 +535,18 @@ inline char peek_next_nonws(std::istream& in) { return c; } +inline void xml_space(std::ostream& out, const int depth = 0) { + for (int i = 0; i < depth; i++) + out << " "; +} + +inline void xml_print(std::ostream& out, + const string& str, + const int depth = 0) { + xml_space(out, depth); + out << str; +} + #define READ_INTO(str, targ, size, var, cond) { \ char * _p = targ; \ var = str.peek(); \ -- cgit v1.2.3