aboutsummaryrefslogtreecommitdiff
path: root/src/xmlreader.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2008-09-04 22:09:51 +0000
committerMike Buland <eichlan@xagasoft.com>2008-09-04 22:09:51 +0000
commit5dbc8f155b16759b4ebb82aceb3759c686489e3b (patch)
tree01b7a1fa8b79614614508d335daa1f3116dd15a1 /src/xmlreader.h
parent0047991313fd7c67b45c59d58e3fde0236bf3872 (diff)
downloadlibbu++-5dbc8f155b16759b4ebb82aceb3759c686489e3b.tar.gz
libbu++-5dbc8f155b16759b4ebb82aceb3759c686489e3b.tar.bz2
libbu++-5dbc8f155b16759b4ebb82aceb3759c686489e3b.tar.xz
libbu++-5dbc8f155b16759b4ebb82aceb3759c686489e3b.zip
XML is important, I guess...
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