summaryrefslogtreecommitdiffstats
path: root/Src/auth/XMLString.cpp
blob: 2987de4e651f4119386c5632a70c9108ee04f91a (plain) (blame)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/** (c) Nullsoft, Inc.         C O N F I D E N T I A L
 ** Filename: 
 ** Project:
 ** Description:
 ** Author: Ben Allison benski@nullsoft.com
 ** Created:
 **/

#include "XMLString.h"
#include "../nu/strsafe.h"

XMLString::XMLString() 
{
	data[0]=0;
}

void XMLString::Reset()
{
	data[0]=0;
}

const wchar_t *XMLString::GetString()
{
	return data;
}

void XMLString::StartTag(const wchar_t *xmlpath, const wchar_t *xmltag, ifc_xmlreaderparams *params)
{
	data[0]=0;
}


void XMLString::TextHandler(const wchar_t *xmlpath, const wchar_t *xmltag, const wchar_t *str)
{
	StringCchCatW(data, XMLSTRING_SIZE, str);
}


void XMLString::ManualSet(const wchar_t *string)
{
StringCchCatW(data, XMLSTRING_SIZE, string);
}

uint32_t XMLString::GetUInt32()
{
	return wcstoul(data, 0, 10);
}

#ifdef CBCLASS
#undef CBCLASS
#endif

#define CBCLASS XMLString
START_DISPATCH;
VCB(ONSTARTELEMENT, StartTag)
VCB(ONCHARDATA, TextHandler)
END_DISPATCH;