summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h12
1 files changed, 12 insertions, 0 deletions
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(); \