Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
SkXMLParserError Class Reference

#include <SkXMLParser.h>

Public Types

enum  ErrorCode {
  kNoError , kEmptyFile , kUnknownElement , kUnknownAttributeName ,
  kErrorInAttributeValue , kDuplicateIDs , kUnknownError
}
 

Public Member Functions

 SkXMLParserError ()
 
virtual ~SkXMLParserError ()
 
ErrorCode getErrorCode () const
 
virtual void getErrorString (SkString *str) const
 
int getLineNumber () const
 
int getNativeCode () const
 
bool hasError () const
 
bool hasNoun () const
 
void reset ()
 
void setCode (ErrorCode code)
 
void setNoun (const SkString &str)
 
void setNoun (const char *ch)
 
void setNoun (const char *ch, size_t len)
 

Protected Attributes

ErrorCode fCode
 

Friends

class SkXMLParser
 

Detailed Description

Definition at line 20 of file SkXMLParser.h.

Member Enumeration Documentation

◆ ErrorCode

Enumerator
kNoError 
kEmptyFile 
kUnknownElement 
kUnknownAttributeName 
kErrorInAttributeValue 
kDuplicateIDs 
kUnknownError 

Definition at line 22 of file SkXMLParser.h.

Constructor & Destructor Documentation

◆ SkXMLParserError()

SkXMLParserError::SkXMLParserError ( )

Definition at line 28 of file SkXMLParser.cpp.

28 : fCode(kNoError), fLineNumber(-1),
29 fNativeCode(-1)
30{
31 reset();
32}
ErrorCode fCode
Definition SkXMLParser.h:46

◆ ~SkXMLParserError()

SkXMLParserError::~SkXMLParserError ( )
virtual

Definition at line 34 of file SkXMLParser.cpp.

35{
36 // need a virtual destructor for our subclasses
37}

Member Function Documentation

◆ getErrorCode()

ErrorCode SkXMLParserError::getErrorCode ( ) const
inline

Definition at line 34 of file SkXMLParser.h.

34{ return fCode; }

◆ getErrorString()

void SkXMLParserError::getErrorString ( SkString str) const
virtual

Definition at line 39 of file SkXMLParser.cpp.

40{
41 SkASSERT(str);
42 SkString temp;
43 if (fCode != kNoError) {
44 if ((unsigned)fCode < std::size(gErrorStrings))
45 temp.set(gErrorStrings[fCode - 1]);
46 temp.append(fNoun);
47 } else
48 SkXMLParser::GetNativeErrorString(fNativeCode, &temp);
49 str->append(temp);
50}
#define SkASSERT(cond)
Definition SkAssert.h:116
static char const *const gErrorStrings[]
void set(const SkString &src)
Definition SkString.h:186
void append(const char text[])
Definition SkString.h:203
static void GetNativeErrorString(int nativeErrorCode, SkString *str)

◆ getLineNumber()

int SkXMLParserError::getLineNumber ( ) const
inline

Definition at line 36 of file SkXMLParser.h.

36{ return fLineNumber; }

◆ getNativeCode()

int SkXMLParserError::getNativeCode ( ) const
inline

Definition at line 37 of file SkXMLParser.h.

37{ return fNativeCode; }

◆ hasError()

bool SkXMLParserError::hasError ( ) const
inline

Definition at line 38 of file SkXMLParser.h.

38{ return fCode != kNoError || fNativeCode != -1; }

◆ hasNoun()

bool SkXMLParserError::hasNoun ( ) const
inline

Definition at line 39 of file SkXMLParser.h.

39{ return fNoun.size() > 0; }
size_t size() const
Definition SkString.h:131

◆ reset()

void SkXMLParserError::reset ( )

Definition at line 52 of file SkXMLParser.cpp.

52 {
54 fLineNumber = -1;
55 fNativeCode = -1;
56}

◆ setCode()

void SkXMLParserError::setCode ( ErrorCode  code)
inline

Definition at line 41 of file SkXMLParser.h.

41{ fCode = code; }

◆ setNoun() [1/3]

void SkXMLParserError::setNoun ( const char *  ch)
inline

Definition at line 43 of file SkXMLParser.h.

43{ fNoun.set(ch); }

◆ setNoun() [2/3]

void SkXMLParserError::setNoun ( const char *  ch,
size_t  len 
)
inline

Definition at line 44 of file SkXMLParser.h.

44{ fNoun.set(ch, len); }

◆ setNoun() [3/3]

void SkXMLParserError::setNoun ( const SkString str)
inline

Definition at line 42 of file SkXMLParser.h.

42{ fNoun.set(str); }

Friends And Related Symbol Documentation

◆ SkXMLParser

friend class SkXMLParser
friend

Definition at line 51 of file SkXMLParser.h.

Member Data Documentation

◆ fCode

ErrorCode SkXMLParserError::fCode
protected

Definition at line 46 of file SkXMLParser.h.


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