michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #ifndef SkBML_WXMLParser_DEFINED michael@0: #define SkBML_WXMLParser_DEFINED michael@0: michael@0: #include "SkString.h" michael@0: #include "SkXMLParser.h" michael@0: michael@0: class SkStream; michael@0: class SkWStream; michael@0: michael@0: class BML_WXMLParser : public SkXMLParser { michael@0: public: michael@0: BML_WXMLParser(SkWStream& writer); michael@0: virtual ~BML_WXMLParser(); michael@0: static void Write(SkStream& s, const char filename[]); michael@0: michael@0: /** @cond UNIT_TEST */ michael@0: SkDEBUGCODE(static void UnitTest();) michael@0: /** @endcond */ michael@0: private: michael@0: virtual bool onAddAttribute(const char name[], const char value[]); michael@0: virtual bool onEndElement(const char name[]); michael@0: virtual bool onStartElement(const char name[]); michael@0: BML_WXMLParser& operator=(const BML_WXMLParser& src); michael@0: #ifdef SK_DEBUG michael@0: int fElemsCount, fElemsReused; michael@0: int fAttrsCount, fNamesReused, fValuesReused; michael@0: #endif michael@0: SkWStream& fWriter; michael@0: char* fElems[256]; michael@0: char* fAttrNames[256]; michael@0: char* fAttrValues[256]; michael@0: michael@0: // important that these are U8, so we get automatic wrap-around michael@0: U8 fNextElem, fNextAttrName, fNextAttrValue; michael@0: }; michael@0: michael@0: #endif // SkBML_WXMLParser_DEFINED