Download NHK English news podcast automatically. XML Parser "spxml" is used. This application requires mpod mother board. See also http://mbed.org/users/geodenx/notebook/mpod/

Dependencies:   BlinkLed HTTPClient EthernetInterface FatFileSystemCpp MSCFileSystem spxml mbed-rtos mbed

Fork of mpod_nhk_english by Satoshi Togawa

Download NHK English news podcast automatically.
XML Parser "spxml" is used.
This application requires mpod mother board.
See also http://mbed.org/users/geodenx/notebook/mpod/

Committer:
togayan
Date:
Mon Aug 20 13:27:17 2012 +0000
Revision:
4:7dae52cf560f
1st revision

Who changed what in which revision?

UserRevisionLine numberNew contents of line
togayan 4:7dae52cf560f 1 /*
togayan 4:7dae52cf560f 2 * Copyright 2007 Stephen Liu
togayan 4:7dae52cf560f 3 * For license terms, see the file COPYING along with this library.
togayan 4:7dae52cf560f 4 */
togayan 4:7dae52cf560f 5
togayan 4:7dae52cf560f 6 #ifndef __xmlparser_hpp__
togayan 4:7dae52cf560f 7 #define __xmlparser_hpp__
togayan 4:7dae52cf560f 8
togayan 4:7dae52cf560f 9 class SP_XmlPullEvent;
togayan 4:7dae52cf560f 10 class SP_XmlPullEventQueue;
togayan 4:7dae52cf560f 11 class SP_XmlReader;
togayan 4:7dae52cf560f 12 class SP_XmlReaderPool;
togayan 4:7dae52cf560f 13 class SP_XmlArrayList;
togayan 4:7dae52cf560f 14
togayan 4:7dae52cf560f 15 class SP_XmlPullParser {
togayan 4:7dae52cf560f 16 public:
togayan 4:7dae52cf560f 17 SP_XmlPullParser();
togayan 4:7dae52cf560f 18 ~SP_XmlPullParser();
togayan 4:7dae52cf560f 19
togayan 4:7dae52cf560f 20 /// append more input xml source
togayan 4:7dae52cf560f 21 /// @return how much byte has been consumed
togayan 4:7dae52cf560f 22 int append( const char * source, int len );
togayan 4:7dae52cf560f 23
togayan 4:7dae52cf560f 24 /// @return NOT NULL : the pull event
togayan 4:7dae52cf560f 25 /// @return NULL : error or need more input
togayan 4:7dae52cf560f 26 SP_XmlPullEvent * getNext();
togayan 4:7dae52cf560f 27
togayan 4:7dae52cf560f 28 /// @return NOT NULL : the detail error message
togayan 4:7dae52cf560f 29 /// @return NULL : no error
togayan 4:7dae52cf560f 30 const char * getError();
togayan 4:7dae52cf560f 31
togayan 4:7dae52cf560f 32 int getLevel();
togayan 4:7dae52cf560f 33
togayan 4:7dae52cf560f 34 /// default ignoreWhitespace is true
togayan 4:7dae52cf560f 35 void setIgnoreWhitespace( int ignoreWhitespace );
togayan 4:7dae52cf560f 36
togayan 4:7dae52cf560f 37 int getIgnoreWhitespace();
togayan 4:7dae52cf560f 38
togayan 4:7dae52cf560f 39 const char * getEncoding();
togayan 4:7dae52cf560f 40
togayan 4:7dae52cf560f 41 protected:
togayan 4:7dae52cf560f 42 void changeReader( SP_XmlReader * reader );
togayan 4:7dae52cf560f 43
togayan 4:7dae52cf560f 44 SP_XmlReader * getReader( int type );
togayan 4:7dae52cf560f 45
togayan 4:7dae52cf560f 46 void setError( const char * error );
togayan 4:7dae52cf560f 47
togayan 4:7dae52cf560f 48 friend class SP_XmlReader;
togayan 4:7dae52cf560f 49
togayan 4:7dae52cf560f 50 private:
togayan 4:7dae52cf560f 51 SP_XmlPullEventQueue * mEventQueue;
togayan 4:7dae52cf560f 52 SP_XmlReader * mReader;
togayan 4:7dae52cf560f 53 SP_XmlReaderPool * mReaderPool;
togayan 4:7dae52cf560f 54 SP_XmlArrayList * mTagNameStack;
togayan 4:7dae52cf560f 55
togayan 4:7dae52cf560f 56 enum { eRootNone, eRootStart, eRootEnd };
togayan 4:7dae52cf560f 57 int mRootTagState;
togayan 4:7dae52cf560f 58
togayan 4:7dae52cf560f 59 int mLevel;
togayan 4:7dae52cf560f 60
togayan 4:7dae52cf560f 61 int mIgnoreWhitespace;
togayan 4:7dae52cf560f 62
togayan 4:7dae52cf560f 63 char * mError;
togayan 4:7dae52cf560f 64
togayan 4:7dae52cf560f 65 char mErrorSegment[ 32 ];
togayan 4:7dae52cf560f 66 int mErrorIndex;
togayan 4:7dae52cf560f 67 int mColIndex, mRowIndex;
togayan 4:7dae52cf560f 68
togayan 4:7dae52cf560f 69 char mEncoding[ 32 ];
togayan 4:7dae52cf560f 70 };
togayan 4:7dae52cf560f 71
togayan 4:7dae52cf560f 72 #endif