IncredibleXMLParser  3.05
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members

To parse JSON data strings, use the Incredible JSON Pull Parser (see example 12) More...

#include <IXMLParser.h>

Inheritance diagram for IJSONPullParser:
IPullParser

Public Member Functions

 IJSONPullParser (IXMLReader *uReader, int _szByteBuffer=1024 *1024)
 
 ~IJSONPullParser ()
 
void reset ()
 re-start the pull parser (set token=IXMLToken_StartDocument) More...
 
void clear ()
 
IXMLToken nextToken ()
 read the data stream a little bit more to get the next token More...
 
void setTagNameForArrays (IXMLCStr arrayName)
 
IXMLCStr getTagNameForArrays ()
 
- Public Member Functions inherited from IPullParser
 IPullParser (IXMLReader *_uReader, int _szByteBuffer)
 
virtual ~IPullParser ()
 
char setBufferSize (int _szByteBuffer)
 Change the memory buffer size. More...
 
IXMLToken currentToken () const
 get the current token More...
 
bool findPath (IXMLCStr path, IXMLChar sep='/', IXMLResults *r=NULL)
 read the data stream to reach a XML tag with the specified path More...
 
bool findPathNonConst (IXMLStr path, IXMLChar sep='/', IXMLResults *r=NULL)
 read the data stream to reach a XML tag with the specified path More...
 
IXMLCStr getName () const
 if the current token==IXMLToken_StartTag, return the tag name More...
 
bool isEmptyNode () const
 if the current token==IXMLToken_StartTag, tell if the tag is directly closed or not More...
 
bool isArrayStart () const
 used during JSON parsing to separate arrays([) from object({). More...
 
int nAttribute () const
 if the current token==IXMLToken_StartTag, return number of attributes More...
 
IXMLAttributegetAttribute (int i=0) const
 if the current token==IXMLToken_StartTag, return ith attribute More...
 
IXMLCStr getAttributeName (int i=0) const
 if the current token==IXMLToken_StartTag, return ith attribute name More...
 
IXMLCStr getAttributeValue (int i=0) const
 if the current token==IXMLToken_StartTag, return ith attribute value More...
 
int szAttributeValue (int i=0) const
 if the current token==IXMLToken_StartTag, return ith attribute size More...
 
IXMLCStr getText () const
 if the current token==IXMLToken_Text, return the text More...
 
int szText () const
 if the current token==IXMLToken_Text, return the text size in char More...
 
bool isTextWhiteSpace () const
 if the current token==IXMLToken_Text, return true if the text is ignorable (i.e.composed of white space only) More...
 
const IXMLCleargetClear () const
 if the current token==IXMLToken_Clear, return the clear tag More...
 
IXMLError getErrorCode () const
 if the current token==IXMLToken_Error, return the error code More...
 
long long getLineNumber () const
 return the current line number More...
 
virtual int getColumnNumber () const
 return the current column number expressed in byte or wchar More...
 
int getDepth () const
 return the current depth More...
 
void setAutoDetectSourceEncoding (bool autoDetectSource=false)
 
bool getAutoDetectSourceEncoding ()
 
virtual char setCharEncoding (IXMLCharEncoding sourceEncoding=char_encoding_UTF8, IXMLCharEncoding destinationEncoding=char_encoding_UTF8)
 
virtual IXMLCharEncoding getCharEncodingDestination ()
 
IXMLCStr getVersion ()
 Return the IXMLParser library version number. More...
 

Static Public Member Functions

static IXMLCStr guessJSONCharEncoding (unsigned char *b, int l)
 guess the Char Encoding of the text inside the buffer More...
 
static IXMLCharEncoding guessJSONCharEncodingCode (unsigned char *b, int l)
 guess the Char Encoding Code of the text inside the buffer More...
 
- Static Public Member Functions inherited from IPullParser
static IXMLCStr getErrorMessage (IXMLError error)
 this gives you a user-friendly explanation of the parsing error More...
 

Additional Inherited Members

- Public Types inherited from IPullParser
enum  IXMLToken {
  IXMLToken_StartDocument =0, IXMLToken_StartTag =1, IXMLToken_EndTag =2, IXMLToken_Text =3,
  IXMLToken_Clear =4, IXMLToken_ProcessingInstruction =5, IXMLToken_EndDocument =6, IXMLToken_Warning =7,
  IXMLToken_Error =8
}
 
enum  IXMLCharEncoding {
  char_encoding_error =0, char_encoding_UTF16 =1, char_encoding_UTF8 =2, char_encoding_System =3,
  char_encoding_legacy =4, char_encoding_ShiftJIS =5, char_encoding_GB2312 =6, char_encoding_Big5 =7,
  char_encoding_GBK =8
}
 Enumeration for XML character encoding. More...
 
typedef enum IPullParser::IXMLToken IXMLToken
 
typedef enum
IPullParser::IXMLCharEncoding 
IXMLCharEncoding
 Enumeration for XML character encoding. More...
 
- Protected Member Functions inherited from IPullParser
bool skipBranch (int skipVar)
 
char readData (IXMLStr *ptr, IXMLStr *pend, IXMLStr *ptrOut, IXMLStr *pStart)
 
- Protected Attributes inherited from IPullParser
IXMLReaderuReader
 
IXMLReadersourceUReader
 
IXMLAttributeallAttributes
 
int szByteBuffer
 
int _nAttribute
 
IXMLToken curToken
 
int depth
 
int _szText
 
long long nLine
 
bool _isEmptyNode
 
bool _isIgnorableSpace
 
bool _isInArray
 
IXMLError lastError
 
IXMLClear curClearTag
 
IXMLStr pContent
 
bool autoDetectSource
 
IXMLCharEncoding characterEncoding
 
const char * XML_ByteTable
 
IXMLReader_ToUTF16 charEncodingConverterToUTF16
 
IXMLReader_FromUTF16 charEncodingConverterFromUTF16
 
unsigned char * bufferChar
 
IXMLStr pCurrentPos
 
IXMLStr pEndPos
 
IXMLStr pStartOfLine
 
bool isStreamFinished
 

Detailed Description

To parse JSON data strings, use the Incredible JSON Pull Parser (see example 12)

Definition at line 689 of file IXMLParser.h.

Constructor & Destructor Documentation

IJSONPullParser::IJSONPullParser ( IXMLReader uReader,
int  _szByteBuffer = 1024 *1024 
)
IJSONPullParser::~IJSONPullParser ( )

Member Function Documentation

void IJSONPullParser::clear ( )
virtual

Call this function when you have finished using this object to release memory used by the internal buffers.

Implements IPullParser.

IXMLCStr IJSONPullParser::getTagNameForArrays ( )
static IXMLCStr IJSONPullParser::guessJSONCharEncoding ( unsigned char *  b,
int  l 
)
static

guess the Char Encoding of the text inside the buffer

static IXMLCharEncoding IJSONPullParser::guessJSONCharEncodingCode ( unsigned char *  b,
int  l 
)
static

guess the Char Encoding Code of the text inside the buffer

IXMLToken IJSONPullParser::nextToken ( )
virtual

read the data stream a little bit more to get the next token

Implements IPullParser.

void IJSONPullParser::reset ( )
virtual

re-start the pull parser (set token=IXMLToken_StartDocument)

This does not free the memory buffers.

Reimplemented from IPullParser.

void IJSONPullParser::setTagNameForArrays ( IXMLCStr  arrayName)

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