aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/graphics/SkBML_WXMLParser.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/graphics/SkBML_WXMLParser.h')
-rw-r--r--include/graphics/SkBML_WXMLParser.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/graphics/SkBML_WXMLParser.h b/include/graphics/SkBML_WXMLParser.h
new file mode 100644
index 0000000000..706b6b1788
--- /dev/null
+++ b/include/graphics/SkBML_WXMLParser.h
@@ -0,0 +1,38 @@
+#ifndef SkBML_WXMLParser_DEFINED
+#define SkBML_WXMLParser_DEFINED
+
+#include "SkString.h"
+#include "SkXMLParser.h"
+
+class SkStream;
+class SkWStream;
+
+class BML_WXMLParser : public SkXMLParser {
+public:
+ BML_WXMLParser(SkWStream& writer);
+ virtual ~BML_WXMLParser();
+ static void Write(SkStream& s, const char filename[]);
+
+ /** @cond UNIT_TEST */
+ SkDEBUGCODE(static void UnitTest();)
+ /** @endcond */
+private:
+ virtual bool onAddAttribute(const char name[], const char value[]);
+ virtual bool onEndElement(const char name[]);
+ virtual bool onStartElement(const char name[]);
+ BML_WXMLParser& operator=(const BML_WXMLParser& src);
+#ifdef SK_DEBUG
+ int fElemsCount, fElemsReused;
+ int fAttrsCount, fNamesReused, fValuesReused;
+#endif
+ SkWStream& fWriter;
+ char* fElems[256];
+ char* fAttrNames[256];
+ char* fAttrValues[256];
+
+ // important that these are U8, so we get automatic wrap-around
+ U8 fNextElem, fNextAttrName, fNextAttrValue;
+};
+
+#endif // SkBML_WXMLParser_DEFINED
+