Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
SkXMLParserWriter Class Reference

#include <SkXMLWriter.h>

Inheritance diagram for SkXMLParserWriter:
SkXMLWriter

Public Member Functions

 SkXMLParserWriter (SkXMLParser *)
 
 ~SkXMLParserWriter () override
 
- Public Member Functions inherited from SkXMLWriter
 SkXMLWriter (bool doEscapeMarkup=true)
 
virtual ~SkXMLWriter ()
 
void addS32Attribute (const char name[], int32_t value)
 
void addAttribute (const char name[], const char value[])
 
void addAttributeLen (const char name[], const char value[], size_t length)
 
void addHexAttribute (const char name[], uint32_t value, int minDigits=0)
 
void addScalarAttribute (const char name[], SkScalar value)
 
void addText (const char text[], size_t length)
 
void endElement ()
 
void startElement (const char elem[])
 
void startElementLen (const char elem[], size_t length)
 
void writeDOM (const SkDOM &, const SkDOM::Node *, bool skipRoot)
 
void flush ()
 
virtual void writeHeader ()
 

Protected Member Functions

void onStartElementLen (const char elem[], size_t length) override
 
void onEndElement () override
 
void onAddAttributeLen (const char name[], const char value[], size_t length) override
 
void onAddText (const char text[], size_t length) override
 
- Protected Member Functions inherited from SkXMLWriter
virtual void onStartElementLen (const char elem[], size_t length)=0
 
virtual void onAddAttributeLen (const char name[], const char value[], size_t length)=0
 
virtual void onAddText (const char text[], size_t length)=0
 
virtual void onEndElement ()=0
 
void doEnd (Elem *elem)
 
bool doStart (const char name[], size_t length)
 
ElemgetEnd ()
 
const char * getHeader ()
 

Additional Inherited Members

- Protected Attributes inherited from SkXMLWriter
SkTDArray< Elem * > fElems
 

Detailed Description

Definition at line 88 of file SkXMLWriter.h.

Constructor & Destructor Documentation

◆ SkXMLParserWriter()

SkXMLParserWriter::SkXMLParserWriter ( SkXMLParser parser)

Definition at line 274 of file SkXMLWriter.cpp.

275 : SkXMLWriter(false), fParser(*parser)
276{
277}
SkXMLWriter(bool doEscapeMarkup=true)
Definition: SkXMLWriter.cpp:13
parser
Definition: zip.py:78

◆ ~SkXMLParserWriter()

SkXMLParserWriter::~SkXMLParserWriter ( )
override

Definition at line 279 of file SkXMLWriter.cpp.

279 {
280 this->flush();
281}
void flush()
Definition: SkXMLWriter.cpp:20

Member Function Documentation

◆ onAddAttributeLen()

void SkXMLParserWriter::onAddAttributeLen ( const char  name[],
const char  value[],
size_t  length 
)
overrideprotectedvirtual

Implements SkXMLWriter.

Definition at line 283 of file SkXMLWriter.cpp.

283 {
284 SkASSERT(fElems.empty() || (!fElems.back()->fHasChildren && !fElems.back()->fHasText));
285 SkString str(value, length);
286 fParser.addAttribute(name, str.c_str());
287}
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool addAttribute(const char name[], const char value[])
SkTDArray< Elem * > fElems
Definition: SkXMLWriter.h:56
uint8_t value
size_t length
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ onAddText()

void SkXMLParserWriter::onAddText ( const char  text[],
size_t  length 
)
overrideprotectedvirtual

Implements SkXMLWriter.

Definition at line 289 of file SkXMLWriter.cpp.

289 {
290 fParser.text(text, SkToInt(length));
291}
constexpr int SkToInt(S x)
Definition: SkTo.h:29
bool text(const char text[], int len)
std::u16string text

◆ onEndElement()

void SkXMLParserWriter::onEndElement ( )
overrideprotectedvirtual

Implements SkXMLWriter.

Definition at line 293 of file SkXMLWriter.cpp.

293 {
294 Elem* elem = this->getEnd();
295 fParser.endElement(elem->fName.c_str());
296 this->doEnd(elem);
297}
bool endElement(const char elem[])
void doEnd(Elem *elem)
Definition: SkXMLWriter.cpp:58
Elem * getEnd()
Definition: SkXMLWriter.cpp:73

◆ onStartElementLen()

void SkXMLParserWriter::onStartElementLen ( const char  elem[],
size_t  length 
)
overrideprotectedvirtual

Implements SkXMLWriter.

Definition at line 299 of file SkXMLWriter.cpp.

299 {
300 (void)this->doStart(name, length);
301 SkString str(name, length);
302 fParser.startElement(str.c_str());
303}
bool startElement(const char elem[])
bool doStart(const char name[], size_t length)
Definition: SkXMLWriter.cpp:62

The documentation for this class was generated from the following files: