aboutsummaryrefslogtreecommitdiff
path: root/daemon/XMLOut.h
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/XMLOut.h')
-rw-r--r--daemon/XMLOut.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/daemon/XMLOut.h b/daemon/XMLOut.h
new file mode 100644
index 0000000..057222c
--- /dev/null
+++ b/daemon/XMLOut.h
@@ -0,0 +1,45 @@
+/**
+ * Copyright (C) ARM Limited 2010-2011. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __XMLOUT_H
+#define __XMLOUT_H
+
+class XMLOut {
+ int indent;
+ bool incomplete;
+ char temp_buffer[4096];
+ char xml_string[64*1024];
+
+ void writeTabs();
+ void encodeAttributeData(const char* data);
+ void writeData(const char *format, ...);
+
+public:
+ XMLOut();
+ ~XMLOut();
+ char* getXmlString() {return xml_string;}
+ void clearXmlString() {xml_string[0]=0;}
+ const XMLOut & xmlHeader(void);
+ const XMLOut & comment(const char* text, const bool newline);
+ const XMLOut & startElement(const char* tag);
+ const XMLOut & startElement(const char* tag, int index);
+ const XMLOut & endElement(const char* tag);
+ const XMLOut & attributeString(const char* name, const char* value);
+ const XMLOut & attributeInt(const char* name, int value);
+ const XMLOut & attributeUInt(const char* name, unsigned int value);
+ const XMLOut & attributeLong(const char* name, long value);
+ const XMLOut & attributeULong(const char* name, unsigned long value);
+ const XMLOut & attributeLongLong(const char* name, long long value);
+ const XMLOut & attributeULongLong(const char* name, unsigned long long value);
+ const XMLOut & attributeDouble(const char* name, double value);
+ const XMLOut & attributeBool(const char* name, bool value);
+ const XMLOut & attributeHex4(const char* name, int value);
+ const XMLOut & attributeHex8(const char* name, int value);
+};
+
+#endif // __XMLOUT_H