aboutsummaryrefslogtreecommitdiff
path: root/src/xmlstringreader.cpp
blob: aa7174fc76a7a710987c3ea55245258f60675201 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "xmlstringreader.h"
#include <string.h>

XmlStringReader::XmlStringReader( const char *sString, bool bStrip )
	: XmlReader( bStrip )
{
	this->sString = sString;
	
	nIndex = 0;
	nLength = strlen( sString );

	buildDoc();
}

XmlStringReader::~XmlStringReader()
{
}

char XmlStringReader::getChar( int nAdd )
{
	if( nLength >= nIndex+nAdd+1 )
	{
		return sString[nIndex+nAdd];
	}
	else
	{
		return '\0';
	}
}

void XmlStringReader::usedChar()
{
	if( nLength >= nIndex+1 )
	{
		nIndex++;
	}
}