From 469bbcf0701e1eb8a6670c23145b0da87357e178 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 25 Mar 2012 20:00:08 +0000 Subject: Code is all reorganized. We're about ready to release. I should write up a little explenation of the arrangement. --- src/experimental/xmlreader.h | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/experimental/xmlreader.h (limited to 'src/experimental/xmlreader.h') diff --git a/src/experimental/xmlreader.h b/src/experimental/xmlreader.h new file mode 100644 index 0000000..7cb44c9 --- /dev/null +++ b/src/experimental/xmlreader.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2007-2011 Xagasoft, All rights reserved. + * + * This file is part of the libbu++ library and is released under the + * terms of the license contained in the file LICENSE. + */ + +#ifndef BU_XML_READER_H +#define BU_XML_READER_H + +#include "bu/string.h" +#include "bu/exceptionbase.h" + +namespace Bu +{ + class Stream; + + subExceptionDecl( XmlException ); + + class XmlReader + { + public: + XmlReader( Stream &rInput ); + virtual ~XmlReader(); + + private: + Stream &rInput; + int iCurToken; + int iNextToken; + Bu::String sBuf; + Bu::String sStr; + bool bIgnoreWS; + typedef struct StreamPos + { + StreamPos() : iLine( 1 ), iChar( 1 ) { } + int iLine; + int iChar; + } StreamPos; + StreamPos spCurToken; + StreamPos spNextToken; + + + enum + { + tokXmlDeclHead = 0x100, + tokXmlDeclEnd, + tokWS, + tokIdent, + tokString + }; + + void fillBuffer(); + void cleanupBuffer( int iUsed ); + int nextToken(); + + void stDocument(); + void stProlog(); + void stXmlDecl(); + + void error( const char *sMessage ); + }; +}; + +#endif -- cgit v1.2.3