aboutsummaryrefslogtreecommitdiff
path: root/src/xmlreader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlreader.h')
-rw-r--r--src/xmlreader.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/xmlreader.h b/src/xmlreader.h
new file mode 100644
index 0000000..375dfe3
--- /dev/null
+++ b/src/xmlreader.h
@@ -0,0 +1,54 @@
1#ifndef BU_XML_READER_H
2#define BU_XML_READER_H
3
4#include "bu/fstring.h"
5
6namespace Bu
7{
8 class Stream;
9
10 class XmlReader
11 {
12 public:
13 XmlReader( Stream &rInput );
14 virtual ~XmlReader();
15
16 private:
17 Stream &rInput;
18 int iCurToken;
19 int iNextToken;
20 Bu::FString sBuf;
21 Bu::FString sStr;
22 bool bIgnoreWS;
23 typedef struct StreamPos
24 {
25 StreamPos() : iLine( 1 ), iChar( 1 ) { }
26 int iLine;
27 int iChar;
28 } StreamPos;
29 StreamPos spCurToken;
30 StreamPos spNextToken;
31
32
33 enum
34 {
35 tokXmlDeclHead = 0x100,
36 tokXmlDeclEnd,
37 tokWS,
38 tokIdent,
39 tokString
40 };
41
42 void fillBuffer();
43 void cleanupBuffer( int iUsed );
44 int nextToken();
45
46 void stDocument();
47 void stProlog();
48 void stXmlDecl();
49
50 void error( const char *sMessage );
51 };
52};
53
54#endif