gfx/skia/trunk/include/xml/SkBML_WXMLParser.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/include/xml/SkBML_WXMLParser.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +
     1.5 +/*
     1.6 + * Copyright 2006 The Android Open Source Project
     1.7 + *
     1.8 + * Use of this source code is governed by a BSD-style license that can be
     1.9 + * found in the LICENSE file.
    1.10 + */
    1.11 +
    1.12 +
    1.13 +#ifndef SkBML_WXMLParser_DEFINED
    1.14 +#define SkBML_WXMLParser_DEFINED
    1.15 +
    1.16 +#include "SkString.h"
    1.17 +#include "SkXMLParser.h"
    1.18 +
    1.19 +class SkStream;
    1.20 +class SkWStream;
    1.21 +
    1.22 +class BML_WXMLParser : public SkXMLParser {
    1.23 +public:
    1.24 +    BML_WXMLParser(SkWStream& writer);
    1.25 +    virtual ~BML_WXMLParser();
    1.26 +    static void Write(SkStream& s, const char filename[]);
    1.27 +
    1.28 +  /** @cond UNIT_TEST */
    1.29 +  SkDEBUGCODE(static void UnitTest();)
    1.30 +  /** @endcond */
    1.31 +private:
    1.32 +    virtual bool onAddAttribute(const char name[], const char value[]);
    1.33 +    virtual bool onEndElement(const char name[]);
    1.34 +    virtual bool onStartElement(const char name[]);
    1.35 +    BML_WXMLParser& operator=(const BML_WXMLParser& src);
    1.36 +#ifdef SK_DEBUG
    1.37 +    int fElemsCount, fElemsReused;
    1.38 +    int fAttrsCount, fNamesReused, fValuesReused;
    1.39 +#endif
    1.40 +    SkWStream&  fWriter;
    1.41 +    char*       fElems[256];
    1.42 +    char*       fAttrNames[256];
    1.43 +    char*       fAttrValues[256];
    1.44 +
    1.45 +    // important that these are U8, so we get automatic wrap-around
    1.46 +    U8  fNextElem, fNextAttrName, fNextAttrValue;
    1.47 +};
    1.48 +
    1.49 +#endif // SkBML_WXMLParser_DEFINED

mercurial