aboutsummaryrefslogtreecommitdiff
path: root/src/xmlstringreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlstringreader.cpp')
-rw-r--r--src/xmlstringreader.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/xmlstringreader.cpp b/src/xmlstringreader.cpp
new file mode 100644
index 0000000..aa7174f
--- /dev/null
+++ b/src/xmlstringreader.cpp
@@ -0,0 +1,37 @@
1#include "xmlstringreader.h"
2#include <string.h>
3
4XmlStringReader::XmlStringReader( const char *sString, bool bStrip )
5 : XmlReader( bStrip )
6{
7 this->sString = sString;
8
9 nIndex = 0;
10 nLength = strlen( sString );
11
12 buildDoc();
13}
14
15XmlStringReader::~XmlStringReader()
16{
17}
18
19char XmlStringReader::getChar( int nAdd )
20{
21 if( nLength >= nIndex+nAdd+1 )
22 {
23 return sString[nIndex+nAdd];
24 }
25 else
26 {
27 return '\0';
28 }
29}
30
31void XmlStringReader::usedChar()
32{
33 if( nLength >= nIndex+1 )
34 {
35 nIndex++;
36 }
37}