diff options
Diffstat (limited to 'src/experimental/xmlreader.h')
-rw-r--r-- | src/experimental/xmlreader.h | 64 |
1 files changed, 64 insertions, 0 deletions
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 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
8 | #ifndef BU_XML_READER_H | ||
9 | #define BU_XML_READER_H | ||
10 | |||
11 | #include "bu/string.h" | ||
12 | #include "bu/exceptionbase.h" | ||
13 | |||
14 | namespace Bu | ||
15 | { | ||
16 | class Stream; | ||
17 | |||
18 | subExceptionDecl( XmlException ); | ||
19 | |||
20 | class XmlReader | ||
21 | { | ||
22 | public: | ||
23 | XmlReader( Stream &rInput ); | ||
24 | virtual ~XmlReader(); | ||
25 | |||
26 | private: | ||
27 | Stream &rInput; | ||
28 | int iCurToken; | ||
29 | int iNextToken; | ||
30 | Bu::String sBuf; | ||
31 | Bu::String sStr; | ||
32 | bool bIgnoreWS; | ||
33 | typedef struct StreamPos | ||
34 | { | ||
35 | StreamPos() : iLine( 1 ), iChar( 1 ) { } | ||
36 | int iLine; | ||
37 | int iChar; | ||
38 | } StreamPos; | ||
39 | StreamPos spCurToken; | ||
40 | StreamPos spNextToken; | ||
41 | |||
42 | |||
43 | enum | ||
44 | { | ||
45 | tokXmlDeclHead = 0x100, | ||
46 | tokXmlDeclEnd, | ||
47 | tokWS, | ||
48 | tokIdent, | ||
49 | tokString | ||
50 | }; | ||
51 | |||
52 | void fillBuffer(); | ||
53 | void cleanupBuffer( int iUsed ); | ||
54 | int nextToken(); | ||
55 | |||
56 | void stDocument(); | ||
57 | void stProlog(); | ||
58 | void stXmlDecl(); | ||
59 | |||
60 | void error( const char *sMessage ); | ||
61 | }; | ||
62 | }; | ||
63 | |||
64 | #endif | ||