LocalesInfo.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <precomp.h>
  2. #include "LocalesInfo.h"
  3. #include "../xml/obj_xml.h"
  4. #include <api/xml/XMLAutoInclude.h>
  5. #include <api/xml/LoadXML.h>
  6. #include <api/service/waservicefactory.h>
  7. LocalesInfosXmlReader::LocalesInfosXmlReader(const wchar_t *localename) : LocaleItem(localename)
  8. {
  9. parser = 0;
  10. waServiceFactory *parserFactory = WASABI_API_SVC->service_getServiceByGuid(obj_xmlGUID);
  11. if (parserFactory)
  12. {
  13. parser = (obj_xml *)parserFactory->getInterface();
  14. if (parser)
  15. {
  16. {
  17. XMLAutoInclude include(parser, L"Locales");
  18. parser->xmlreader_registerCallback(L"WinampLocaleDefinition", this);
  19. parser->xmlreader_open();
  20. StringPathCombine fn(L"Locales", localename);
  21. LoadXmlFile(parser, fn);
  22. parser->xmlreader_unregisterCallback(this);
  23. }
  24. parser->xmlreader_close();
  25. parserFactory->releaseInterface(parser);
  26. parser = 0;
  27. }
  28. }
  29. }
  30. void LocalesInfosXmlReader::xmlReaderOnStartElementCallback(const wchar_t *xmlpath, const wchar_t *xmltag, ifc_xmlreaderparams *params)
  31. {
  32. language = params->getItemValue(L"language");
  33. author = params->getItemValue(L"author");
  34. }