1
0

XMLString.cpp 935 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /** (c) Nullsoft, Inc. C O N F I D E N T I A L
  2. ** Filename:
  3. ** Project:
  4. ** Description:
  5. ** Author: Ben Allison [email protected]
  6. ** Created:
  7. **/
  8. #include "XMLString.h"
  9. #include "../nu/strsafe.h"
  10. XMLString::XMLString()
  11. {
  12. data[0]=0;
  13. }
  14. void XMLString::Reset()
  15. {
  16. data[0]=0;
  17. }
  18. const wchar_t *XMLString::GetString()
  19. {
  20. return data;
  21. }
  22. void XMLString::StartTag(const wchar_t *xmlpath, const wchar_t *xmltag, ifc_xmlreaderparams *params)
  23. {
  24. data[0]=0;
  25. }
  26. void XMLString::TextHandler(const wchar_t *xmlpath, const wchar_t *xmltag, const wchar_t *str)
  27. {
  28. StringCchCatW(data, XMLSTRING_SIZE, str);
  29. }
  30. void XMLString::ManualSet(const wchar_t *string)
  31. {
  32. StringCchCatW(data, XMLSTRING_SIZE, string);
  33. }
  34. uint32_t XMLString::GetUInt32()
  35. {
  36. return wcstoul(data, 0, 10);
  37. }
  38. #ifdef CBCLASS
  39. #undef CBCLASS
  40. #endif
  41. #define CBCLASS XMLString
  42. START_DISPATCH;
  43. VCB(ONSTARTELEMENT, StartTag)
  44. VCB(ONCHARDATA, TextHandler)
  45. END_DISPATCH;