From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/Wasabi/api/locales/LocalesInfo.cpp | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Src/Wasabi/api/locales/LocalesInfo.cpp (limited to 'Src/Wasabi/api/locales/LocalesInfo.cpp') diff --git a/Src/Wasabi/api/locales/LocalesInfo.cpp b/Src/Wasabi/api/locales/LocalesInfo.cpp new file mode 100644 index 00000000..667fb25b --- /dev/null +++ b/Src/Wasabi/api/locales/LocalesInfo.cpp @@ -0,0 +1,41 @@ +#include +#include "LocalesInfo.h" +#include "../xml/obj_xml.h" +#include +#include +#include + +LocalesInfosXmlReader::LocalesInfosXmlReader(const wchar_t *localename) : LocaleItem(localename) +{ + parser = 0; + + waServiceFactory *parserFactory = WASABI_API_SVC->service_getServiceByGuid(obj_xmlGUID); + if (parserFactory) + { + parser = (obj_xml *)parserFactory->getInterface(); + + if (parser) + { + { + XMLAutoInclude include(parser, L"Locales"); + parser->xmlreader_registerCallback(L"WinampLocaleDefinition", this); + parser->xmlreader_open(); + + StringPathCombine fn(L"Locales", localename); + LoadXmlFile(parser, fn); + parser->xmlreader_unregisterCallback(this); + } + parser->xmlreader_close(); + parserFactory->releaseInterface(parser); + parser = 0; + } + + } +} + + +void LocalesInfosXmlReader::xmlReaderOnStartElementCallback(const wchar_t *xmlpath, const wchar_t *xmltag, ifc_xmlreaderparams *params) +{ + language = params->getItemValue(L"language"); + author = params->getItemValue(L"author"); +} -- cgit