diff options
Diffstat (limited to 'src/XmlHandler/Parser')
-rwxr-xr-x | src/XmlHandler/Parser/ManifestAccountsParser.cpp | 272 | ||||
-rwxr-xr-x | src/XmlHandler/Parser/ManifestAccountsParser.h | 69 | ||||
-rwxr-xr-x | src/XmlHandler/Parser/ManifestLiveboxesParser.cpp | 243 | ||||
-rwxr-xr-x | src/XmlHandler/Parser/ManifestLiveboxesParser.h | 70 | ||||
-rwxr-xr-x | src/XmlHandler/Parser/ManifestParser.cpp | 77 | ||||
-rwxr-xr-x | src/XmlHandler/Parser/ManifestParser.h | 60 |
6 files changed, 791 insertions, 0 deletions
diff --git a/src/XmlHandler/Parser/ManifestAccountsParser.cpp b/src/XmlHandler/Parser/ManifestAccountsParser.cpp new file mode 100755 index 0000000..a50d680 --- /dev/null +++ b/src/XmlHandler/Parser/ManifestAccountsParser.cpp @@ -0,0 +1,272 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file ManifestAccountsParser.cpp + * @brief This is the implementation file for %ManifestAccountsParser class. + */ + +#include <FIoFile.h> +#include <FSys_SystemInfoImpl.h> +#include <FAppPkg_PackageInfoImpl.h> +#include <FBase_StringConverter.h> + +#include "ManifestAccountsParser.h" +#include "InstallerUtil.h" +#include "InstallationContext.h" +#include "ManifestHandler.h" + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Base::Utility; +using namespace Tizen::App::Package; +using namespace Tizen::Io; +using namespace Tizen::System; + +ManifestAccountsParser::ManifestAccountsParser(void) +:__pContext(null) +,__pAccountData(null) +,__isAccountIconSelected(false) +,__isAccountSmallIconSelected(false) +{ +} + +ManifestAccountsParser::~ManifestAccountsParser(void) +{ + delete __pAccountData; +} + +bool +ManifestAccountsParser::OnStartElement(const char *pName) +{ + TryReturn(pName, true, "[osp-installer] pName is null"); + bool status = true; + + if (strcasecmp(pName, "Accounts") == 0) + { + status = OnAccountsStartElement(); + } + else if (strcasecmp(pName, "AccountProvider") == 0) + { + status = OnAccountProviderStartElement(); + } + + return status; +} + +bool +ManifestAccountsParser::OnEndElement(const char *pName) +{ + TryReturn(pName, true, "[osp-installer] pName is null"); + bool status = true; + + if (strcasecmp(pName, "Accounts") == 0) + { + status = OnAccountsEndElement(); + } + else if (strcasecmp(pName, "AccountProvider") == 0) + { + status = OnAccountProviderEndElement(); + } + + return true; +} + +bool +ManifestAccountsParser::OnCharacters(const char *pCharacters) +{ + TryReturn(pCharacters, true, "[osp-installer] pCharacters is null"); + bool status = true; + + ManifestHandler* pHandler = GetHandler(); + TryReturn(pHandler, false, "[osp-installer] pHandler is null"); + + char *pName = pHandler->GetElementName(); + TryReturn(pName, false, "[osp-installer] pName is null"); + + if (strcasecmp(pName, "DisplayName") == 0) + { + status = OnDisplayNameValue(pCharacters); + } + else if (strcasecmp(pName, "Icon") == 0) + { + status = OnIconValue(pCharacters); + } + + return true; +} + +bool +ManifestAccountsParser::OnAccountsStartElement(void) +{ + ManifestHandler* __pHandler = GetHandler(); + TryReturn(__pHandler, false, "[osp-installer] __pHandler is null"); + + __pContext = __pHandler->GetContext(); + TryReturn(__pContext, false, "[osp-installer] __pContext is null"); + + AppLogTag(OSP_INSTALLER, " <Accounts>"); + + return true; +} + +bool +ManifestAccountsParser::OnAccountProviderStartElement(void) +{ + XmlAttribute *pAttr = null; + + __pAccountData = new (std::nothrow) AccountData; + TryReturn(__pAccountData, false, "[osp-installer] __pAccountData is null"); + + ManifestHandler* pHandler = GetHandler(); + TryReturn(pHandler, false, "[osp-installer] pHandler is null"); + + pAttr = pHandler->GetAttribute(); + TryReturn(pAttr, true, "[osp-installer] pAttr is null"); + + AppLogTag(OSP_INSTALLER, " <AccountProvider>"); + + char *pProviderId = pAttr->Find("ProviderId"); + if (pProviderId) + { + __pAccountData->__providerId = pProviderId; + AppLogTag(OSP_INSTALLER, " - ProviderId=%s", pProviderId); + } + + char *pMultipleAccountsSupport = pAttr->Find("MultipleAccountsSupport"); + if (pMultipleAccountsSupport) + { + __pAccountData->__multipleAccountsSupport = pMultipleAccountsSupport; + AppLogTag(OSP_INSTALLER, " - MultipleAccountsSupport=%s", pMultipleAccountsSupport); + } + + return true; +} + +bool +ManifestAccountsParser::OnAccountsEndElement(void) +{ + AppLogTag(OSP_INSTALLER, " </Accounts>"); + + return true; +} + +bool +ManifestAccountsParser::OnAccountProviderEndElement(void) +{ + ManifestHandler* pHandler = GetHandler(); + TryReturn(pHandler, false, "[osp-installer] pHandler is null"); + + AppData* pAppData = pHandler->GetAppData(); + TryReturn(pAppData, false, "[osp-installer] pAppData is null"); + + pAppData->__pAccountDataList->Add(__pAccountData); + __pAccountData = null; + AppLogTag(OSP_INSTALLER, " </AccountProvider>"); + + return true; +} + +bool +ManifestAccountsParser::OnDisplayNameValue(const char *pCharacters) +{ + XmlAttribute* pAttr = 0; + char* pAttrValue = 0; + + ManifestHandler* pHandler = GetHandler(); + TryReturn(pHandler, false, "[osp-installer] pHandler is null"); + + pAttr = pHandler->GetAttribute(); + TryReturn(pAttr, true, "[osp-installer] pAttr is null"); + + pAttrValue = pAttr->Find("Locale"); + TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null"); + + String* pValue = new (std::nothrow) String; + StringUtil::Utf8ToString(pCharacters, *pValue); + __pAccountData->__pNameList->Add(new (std::nothrow) String(pAttrValue), pValue); + + AppLogTag(OSP_INSTALLER, " <DisplayName>%s</DisplayName>", pCharacters); + + return true; +} + +bool +ManifestAccountsParser::OnIconValue(const char *pCharacters) +{ + XmlAttribute* pAttr = 0; + char* pSectionValue = 0; + char* pTypeValue = 0; + + ManifestHandler* pHandler = GetHandler(); + TryReturn(pHandler, false, "[osp-installer] pHandler is null"); + + pAttr = pHandler->GetAttribute(); + TryReturn(pAttr, true, "[osp-installer] pAttr is null"); + + pSectionValue = pAttr->Find("Section"); + TryReturn(pSectionValue, true, "[osp-installer] pSectionValue is null"); + + pTypeValue = pAttr->Find("Type"); + TryReturn(pTypeValue, true, "[osp-installer] pTypeValue is null"); + + char* pDefaultIconType = pHandler->GetDefaultIconType(); + TryReturn(pDefaultIconType, false, "[osp-installer] pDefaultIconType is null"); + + String icon; + if (strcasecmp(pTypeValue, "Xhigh") == 0) + { + icon.Format(1024, L"%s/%s", "screen-density-xhigh", pCharacters); + } + else if (strcasecmp(pTypeValue, "High") == 0) + { + icon.Format(1024, L"%s/%s", "screen-density-high", pCharacters); + } + else + { + AppLogTag(OSP_INSTALLER, "Invalid Type [%s]", pDefaultIconType); + return false; + } + + if (strcasecmp(pSectionValue, "Account") == 0) + { + if (__isAccountIconSelected == false) + { + __pAccountData->__accountIcon = icon; + } + + if (strcasecmp(pTypeValue, pDefaultIconType) == 0) + { + __isAccountIconSelected = true; + } + } + else if (strcasecmp(pSectionValue, "AccountSmall") == 0) + { + if (__isAccountSmallIconSelected == false) + { + __pAccountData->__accountSmallIcon = icon; + } + + if (strcasecmp(pTypeValue, pDefaultIconType) == 0) + { + __isAccountSmallIconSelected = true; + } + } + + AppLogTag(OSP_INSTALLER, " <Icon Section=\"%s\" Type=\"%s\">%s</Icon>", pSectionValue, pTypeValue, pCharacters); + + return true; +} diff --git a/src/XmlHandler/Parser/ManifestAccountsParser.h b/src/XmlHandler/Parser/ManifestAccountsParser.h new file mode 100755 index 0000000..74e90cb --- /dev/null +++ b/src/XmlHandler/Parser/ManifestAccountsParser.h @@ -0,0 +1,69 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file ManifestAccountsParser.h + * @brief This is the header file for the %ManifestAccountsParser class. + * + * This header file contains the declarations of the %ManifestAccountsParser class. + */ +#ifndef _MANIFEST_ACCOUNTS_PARSER_H_ +#define _MANIFEST_ACCOUNTS_PARSER_H_ + +#include <FBaseString.h> + +#include <FAppPkg_PackageInfoImpl.h> + +#include "ManifestParser.h" +#include "InstallationContext.h" + +/** + * @class ManifestAccountsParser + * @brief This class represents the class of ManifestAccountsParser. + * @since 1.0 + * + * This class represents the class of ManifestAccountsParser. + * + */ +class ManifestAccountsParser + : public ManifestParser +{ +public: + ManifestAccountsParser(void); + virtual ~ManifestAccountsParser(void); + + virtual bool OnStartElement(const char *pName); + virtual bool OnEndElement(const char *pName); + virtual bool OnCharacters(const char *pCharacters); + +private: + bool OnAccountsStartElement(void); + bool OnAccountProviderStartElement(void); + bool OnAccountsEndElement(void); + bool OnAccountProviderEndElement(void); + + bool OnDisplayNameValue(const char *pCharacters); + bool OnIconValue(const char *pCharacters); + +private: + InstallationContext* __pContext; + AccountData* __pAccountData; + bool __isAccountIconSelected; + bool __isAccountSmallIconSelected; + +}; // ManifestAccountsParser + +#endif // _MANIFEST_ACCOUNTS_PARSER_H_ diff --git a/src/XmlHandler/Parser/ManifestLiveboxesParser.cpp b/src/XmlHandler/Parser/ManifestLiveboxesParser.cpp new file mode 100755 index 0000000..ce03cbc --- /dev/null +++ b/src/XmlHandler/Parser/ManifestLiveboxesParser.cpp @@ -0,0 +1,243 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file ManifestLiveboxesParser.cpp + * @brief This is the implementation file for %ManifestLiveboxesParser class. + */ + +#include <FIoFile.h> +#include <FSys_SystemInfoImpl.h> +#include <FAppPkg_PackageInfoImpl.h> +#include <FBase_StringConverter.h> + +#include "ManifestLiveboxesParser.h" +#include "InstallerUtil.h" +#include "XmlAttribute.h" +#include "ManifestHandler.h" +#include "InstallationContextData.h" + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Base::Utility; +using namespace Tizen::App::Package; +using namespace Tizen::Io; +using namespace Tizen::System; + +ManifestLiveboxesParser::ManifestLiveboxesParser(void) +:__pContext(null) +,__pLiveboxDataList(null) +,__pLiveboxData(null) +{ +} + +ManifestLiveboxesParser::~ManifestLiveboxesParser(void) +{ +} + +bool +ManifestLiveboxesParser::OnStartElement(const char *pName) +{ + TryReturn(pName, true, "[osp-installer] pName is null"); + + bool status = true; + + if (strcasecmp(pName, "Liveboxes") == 0) + { + status = OnLiveboxesStartElement(); + } + else if (strcasecmp(pName, "Livebox") == 0) + { + status = OnLiveboxStartElement(); + } + + return status; +} + +bool +ManifestLiveboxesParser::OnEndElement(const char *pName) +{ + TryReturn(pName, true, "[osp-installer] pName is null"); + + bool status = true; + + if (strcasecmp(pName, "Liveboxes") == 0) + { + status = OnLiveboxesEndElement(); + } + else if (strcasecmp(pName, "Livebox") == 0) + { + status = OnLiveboxEndElement(); + } + + return status; +} + +bool +ManifestLiveboxesParser::OnCharacters(const char *pCharacters) +{ + TryReturn(pCharacters, true, "[osp-installer] pCharacters is null"); + + bool status = true; + + ManifestHandler* pHandler = GetHandler(); + TryReturn(pHandler, false, "[osp-installer] pHandler is null"); + + char *pName = pHandler->GetElementName(); + TryReturn(pName, false, "[osp-installer] pName is null"); + + if (strcasecmp(pName, "DisplayName") == 0) + { + status = OnDisplayNameValue(pCharacters); + } + else if (strcasecmp(pName, "Size") == 0) + { + status = OnSizeValue(pCharacters); + } + else if (strcasecmp(pName, "ConfigurationAppControlAppId") == 0) + { + status = OnConfigurationAppControlAppIdValue(pCharacters); + } + + return status; +} + +bool +ManifestLiveboxesParser::OnLiveboxesStartElement() +{ + ManifestHandler* __pHandler = GetHandler(); + TryReturn(__pHandler, false, "[osp-installer] __pHandler is null"); + + __pContext = __pHandler->GetContext(); + TryReturn(__pContext, false, "[osp-installer] __pContext is null"); + + __pLiveboxDataList = new (std::nothrow) ArrayList; + TryReturn(__pLiveboxDataList, false, "[osp-installer] __pLiveboxDataList is null"); + + AppLogTag(OSP_INSTALLER, " <Liveboxes>"); + + return true; +} + +bool +ManifestLiveboxesParser::OnLiveboxStartElement(void) +{ + XmlAttribute *pAttr = null; + + __pLiveboxData = new (std::nothrow) LiveboxData; + TryReturn(__pLiveboxData, false, "[osp-installer] __pLiveboxData is null"); + + ManifestHandler* pHandler = GetHandler(); + TryReturn(pHandler, false, "[osp-installer] pHandler is null"); + + pAttr = pHandler->GetAttribute(); + TryReturn(pAttr, true, "[osp-installer] pAttr is null"); + + AppLogTag(OSP_INSTALLER, " <Livebox>"); + + char *pProviderName = pAttr->Find("ProviderName"); + if (pProviderName) + { + __pLiveboxData->SetName(pProviderName); + AppLogTag(OSP_INSTALLER, " - ProviderName=%s", pProviderName); + } + + char *pUpdatePeriod = pAttr->Find("UpdatePeriod"); + if (pUpdatePeriod) + { + long long updatePeriod = atoll(pUpdatePeriod); + __pLiveboxData->SetUpdatePeriod(updatePeriod); + AppLogTag(OSP_INSTALLER, " - UpdatePeriod=%lld", updatePeriod); + } + + char *pLiveboxPopupEnabled = pAttr->Find("LiveboxPopupEnabled"); + if (pLiveboxPopupEnabled) + { + __pLiveboxData->SetPopupEnabled(pLiveboxPopupEnabled); + AppLogTag(OSP_INSTALLER, " - LiveboxPopupEnabled=%s", pLiveboxPopupEnabled); + } + + char *pMain = pAttr->Find("Main"); + if (pMain) + { + __pLiveboxData->__main = pMain; + AppLogTag(OSP_INSTALLER, " - Main=%s", pMain); + } + + return true; +} + +bool +ManifestLiveboxesParser::OnLiveboxesEndElement(void) +{ + __pContext->SetLiveboxDataList(__pLiveboxDataList); + __pLiveboxDataList = null; + AppLogTag(OSP_INSTALLER, " </Liveboxes>"); + + return true; +} + +bool +ManifestLiveboxesParser::OnLiveboxEndElement(void) +{ + __pLiveboxDataList->Add(*__pLiveboxData); + __pLiveboxData = null; + AppLogTag(OSP_INSTALLER, " </Livebox>"); + + return true; +} + +bool +ManifestLiveboxesParser::OnSizeValue(const char *pCharacters) +{ + __pLiveboxData->AddSize(*(new (std::nothrow) String(pCharacters))); + + AppLogTag(OSP_INSTALLER, " <Size>%s</Size>", pCharacters); + return true; +} + +bool +ManifestLiveboxesParser::OnDisplayNameValue(const char *pCharacters) +{ + XmlAttribute* pAttr = 0; + char* pAttrValue = 0; + + ManifestHandler* pHandler = GetHandler(); + TryReturn(pHandler, false, "[osp-installer] pHandler is null"); + + pAttr = pHandler->GetAttribute(); + TryReturn(pAttr, true, "[osp-installer] pAttr is null"); + + pAttrValue = pAttr->Find("Locale"); + TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null"); + + String* pValue = new (std::nothrow) String; + StringUtil::Utf8ToString(pCharacters, *pValue); + __pLiveboxData->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue); + + AppLogTag(OSP_INSTALLER, " <DisplayName>%s</DisplayName>", pCharacters); + + return true; +} + +bool +ManifestLiveboxesParser::OnConfigurationAppControlAppIdValue(const char* pCharacters) +{ + __pLiveboxData->__configurationAppControlAppId = pCharacters; + AppLogTag(OSP_INSTALLER, " <ConfigurationAppControlAppId>%s</ConfigurationAppControlAppId>", pCharacters); + + return true; +} diff --git a/src/XmlHandler/Parser/ManifestLiveboxesParser.h b/src/XmlHandler/Parser/ManifestLiveboxesParser.h new file mode 100755 index 0000000..ad61c64 --- /dev/null +++ b/src/XmlHandler/Parser/ManifestLiveboxesParser.h @@ -0,0 +1,70 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file ManifestLiveboxesParser.h + * @brief This is the header file for the %ManifestLiveboxesParser class. + * + * This header file contains the declarations of the %ManifestLiveboxesParser class. + */ +#ifndef _MANIFEST_LIVEBOXES_PARSER_H_ +#define _MANIFEST_LIVEBOXES_PARSER_H_ + +#include <FBaseString.h> + +#include <FAppPkg_PackageInfoImpl.h> + +#include "ManifestParser.h" +#include "InstallationContext.h" + +/** + * @class ManifestLiveboxesParser + * @brief This class represents the class of ManifestLiveboxesParser. + * @since 1.0 + * + * This class represents the class of ManifestLiveboxesParser. + * + */ +class ManifestLiveboxesParser + : public ManifestParser +{ +public: + ManifestLiveboxesParser(void); + virtual ~ManifestLiveboxesParser(void); + + virtual bool OnStartElement(const char *pName); + virtual bool OnEndElement(const char *pName); + virtual bool OnCharacters(const char *pCharacters); + +private: + bool OnLiveboxesStartElement(void); + bool OnLiveboxStartElement(void); + + bool OnLiveboxesEndElement(void); + bool OnLiveboxEndElement(void); + + bool OnSizeValue(const char *pCharacters); + bool OnDisplayNameValue(const char *pCharacters); + bool OnConfigurationAppControlAppIdValue(const char* pCharacters); + +private: + InstallationContext* __pContext; + Tizen::Base::Collection::ArrayList* __pLiveboxDataList; + LiveboxData* __pLiveboxData; + +}; // ManifestLiveboxesParser + +#endif // _MANIFEST_LIVEBOXES_PARSER_H_ diff --git a/src/XmlHandler/Parser/ManifestParser.cpp b/src/XmlHandler/Parser/ManifestParser.cpp new file mode 100755 index 0000000..f5be175 --- /dev/null +++ b/src/XmlHandler/Parser/ManifestParser.cpp @@ -0,0 +1,77 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file ManifestParser.cpp + * @brief This is the implementation file for %ManifestParser class. + */ + +#include <FIoFile.h> +#include <FSys_SystemInfoImpl.h> +#include <FAppPkg_PackageInfoImpl.h> +#include <FBase_StringConverter.h> + +#include "ManifestParser.h" +#include "InstallerUtil.h" + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Base::Utility; +using namespace Tizen::App::Package; +using namespace Tizen::Io; +using namespace Tizen::System; + +ManifestParser::ManifestParser(void) +:__pManifestHandler(null) +{ +} + +ManifestParser::~ManifestParser(void) +{ +} + +bool +ManifestParser::Construct(ManifestHandler* pManifestHandler) +{ + __pManifestHandler = pManifestHandler; + + return true; +} + +ManifestHandler* +ManifestParser::GetHandler(void) +{ + return __pManifestHandler; +} + +bool +ManifestParser::OnStartElement(const char *pName) +{ + return true; +} + +bool +ManifestParser::OnEndElement(const char *pName) +{ + return true; +} + +bool +ManifestParser::OnCharacters(const char *pCharacters) +{ + return true; +} + diff --git a/src/XmlHandler/Parser/ManifestParser.h b/src/XmlHandler/Parser/ManifestParser.h new file mode 100755 index 0000000..2033d6f --- /dev/null +++ b/src/XmlHandler/Parser/ManifestParser.h @@ -0,0 +1,60 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file ManifestParser.h + * @brief This is the header file for the %ManifestParser class. + * + * This header file contains the declarations of the %ManifestParser class. + */ +#ifndef _MANIFEST_PARSER_H_ +#define _MANIFEST_PARSER_H_ + +#include <FBaseString.h> + +#include <FAppPkg_PackageInfoImpl.h> + +#include "InstallationContext.h" + +class ManifestHandler; + +/** + * @class ManifestParser + * @brief This class represents the class of ManifestParser. + * @since 1.0 + * + * This class represents the class of ManifestParser. + * + */ +class ManifestParser +{ +public: + ManifestParser(void); + virtual ~ManifestParser(void); + + bool Construct(ManifestHandler* pManifestHandler); + ManifestHandler* GetHandler(void); + + virtual bool OnStartElement(const char *pName); + virtual bool OnEndElement(const char *pName); + virtual bool OnCharacters(const char *pCharacters); + +private: + ManifestHandler* __pManifestHandler; + +}; // ManifestParser + +#endif // _MANIFEST_PARSER_H_ |