diff options
author | Duyoung Jang <duyoung.jang@samsung.com> | 2013-02-13 14:40:21 +0900 |
---|---|---|
committer | Duyoung Jang <duyoung.jang@samsung.com> | 2013-02-14 09:45:25 +0900 |
commit | 392184fd45bc4e6cd2cfda482c13bd3dda6b8c1f (patch) | |
tree | b28ecd02b929caae371119ad57a0380ad5a047f6 /src/XmlHandler/ManifestHandler.cpp | |
parent | 57f8cc00a58ba07c6a6687f878c6d8d324d37cb1 (diff) | |
download | installer-392184fd45bc4e6cd2cfda482c13bd3dda6b8c1f.tar.gz installer-392184fd45bc4e6cd2cfda482c13bd3dda6b8c1f.tar.bz2 installer-392184fd45bc4e6cd2cfda482c13bd3dda6b8c1f.zip |
Add Database Manager
Change-Id: Ib830a8a503af8f699fd505b4417524ffee46b0da
Signed-off-by: Duyoung Jang <duyoung.jang@samsung.com>
Diffstat (limited to 'src/XmlHandler/ManifestHandler.cpp')
-rwxr-xr-x | src/XmlHandler/ManifestHandler.cpp | 307 |
1 files changed, 104 insertions, 203 deletions
diff --git a/src/XmlHandler/ManifestHandler.cpp b/src/XmlHandler/ManifestHandler.cpp index 9f58b52..b26d7f7 100755 --- a/src/XmlHandler/ManifestHandler.cpp +++ b/src/XmlHandler/ManifestHandler.cpp @@ -21,7 +21,6 @@ #include <FIoFile.h> #include <FSys_SystemInfoImpl.h> -#include <FAppPkg_PackageInfoImpl.h> #include <FBase_StringConverter.h> #include "ManifestHandler.h" @@ -34,7 +33,7 @@ using namespace Tizen::Base; using namespace Tizen::Base::Collection; using namespace Tizen::Base::Utility; -using namespace Tizen::App::Package; +using namespace Tizen::App; using namespace Tizen::Io; using namespace Tizen::System; @@ -42,15 +41,11 @@ ManifestHandler::ManifestHandler(void) :__pContext(null) ,__pPrivilegeList(null) ,__pContentDataList(null) -,__pPackageInfoImpl(null) -,__pPackageAppInfoImpl(null) ,__pAppControlInfoImpl(null) ,__pAppControlCapabilityInfoImpl(null) ,__pAppControlResolutionInfoImpl(null) -,__pDataControlInfoImpl(null) -,__pDataControlTypeImpl(null) -,__pLaunchConditionImpl(null) -,__pNotificationImpl(null) +,__pDataControlInfo(null) +,__pDataControlType(null) ,__pContentData(null) ,__pDefaultIconType(null) ,__isDefaultMainmenu(false) @@ -61,8 +56,8 @@ ManifestHandler::ManifestHandler(void) ,__isDefaultName(false) ,__isDefaultAppDetected(false) ,__pAppData(null) -,__pSubModeAppControlDataList(null) ,__isParserMode(false) +,__pParser(null) { } @@ -70,19 +65,12 @@ ManifestHandler::~ManifestHandler(void) { delete[] __pDefaultIconType; __pDefaultIconType = null; - - if (__pPackageAppInfoImpl) - { - delete __pPackageAppInfoImpl; - __pPackageAppInfoImpl = null; - } } bool ManifestHandler::Construct(InstallationContext* pContext) { __pContext = pContext; - __pPackageInfoImpl = pContext->GetPackageInfoImpl(); return true; } @@ -229,14 +217,6 @@ ManifestHandler::OnEndElement(const char *pName) { status = OnDataControlTypeEndElement(); } - else if (strcasecmp(pName, "Condition") == 0) - { - status = OnConditionEndElement(); - } - else if (strcasecmp(pName, "Notification") == 0) - { - status = OnNotificationEndElement(); - } else if (strcasecmp(pName, "Apps") == 0) { status = OnAppsEndElement(); @@ -371,12 +351,12 @@ ManifestHandler::OnPrivilegesStartElement(void) bool ManifestHandler::OnUiAppStartElement(void) { - __pPackageAppInfoImpl = new (std::nothrow) _PackageAppInfoImpl; - TryReturn(__pPackageAppInfoImpl, false, "__pPackageAppInfoImpl is null"); - __pAppData = new (std::nothrow) AppData; TryReturn(__pAppData, false, "__pAppData is null"); + InstallerError error = __pAppData->Construct(); + TryReturn(error == INSTALLER_ERROR_NONE, false, "pAppData->Construct() failed."); + AppLog("<UiApp>"); XmlAttribute *pAttr = GetAttribute(); @@ -390,12 +370,12 @@ ManifestHandler::OnUiAppStartElement(void) bool ManifestHandler::OnServiceAppStartElement(void) { - __pPackageAppInfoImpl = new (std::nothrow) _PackageAppInfoImpl; - TryReturn(__pPackageAppInfoImpl, false, "__pPackageAppInfoImpl is null"); - __pAppData = new (std::nothrow) AppData; TryReturn(__pAppData, false, "__pAppData is null"); + InstallerError error = __pAppData->Construct(); + TryReturn(error == INSTALLER_ERROR_NONE, false, "pAppData->Construct() failed."); + AppLog("<ServiceApp>"); XmlAttribute *pAttr = GetAttribute(); @@ -446,9 +426,9 @@ bool ManifestHandler::OnUiScalabilityStartElement(void) { XmlAttribute *pAttr = null; - char *pCoordinateSystem = null; - char *pBaseScreenSize = null; - char *pLogicalCoordinate = null; + char* pCoordinateSystem = null; + char* pBaseScreenSize = null; + char* pLogicalCoordinate = null; AppLog("<UiScalability>"); @@ -458,42 +438,36 @@ ManifestHandler::OnUiScalabilityStartElement(void) pCoordinateSystem = pAttr->Find("CoordinateSystem"); if (pCoordinateSystem) { - _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl; - TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null"); - - pAppFeatureInfo->SetName("CoordinateSystem"); - pAppFeatureInfo->SetValue(pCoordinateSystem); - - __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo); + String* pKey = new (std::nothrow) String("CoordinateSystem"); + TryReturn(pKey, false, "pKey is null"); + String* pValue = new (std::nothrow) String(pCoordinateSystem); + TryReturn(pValue, false, "pValue is null"); + __pAppData->__pFeatureList->Add(pKey, pValue); AppLog("<CoordinateSystem=%s>", pCoordinateSystem); } pBaseScreenSize = pAttr->Find("BaseScreenSize"); if (pBaseScreenSize) { - _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl; - TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null"); - - pAppFeatureInfo->SetName("BaseScreenSize"); - pAppFeatureInfo->SetValue(pBaseScreenSize); - - __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo); + String* pKey = new (std::nothrow) String("BaseScreenSize"); + TryReturn(pKey, false, "pKey is null"); + String* pValue = new (std::nothrow) String(pBaseScreenSize); + TryReturn(pValue, false, "pValue is null"); + __pAppData->__pFeatureList->Add(pKey, pValue); AppLog("<BaseScreenSize=%s>", pBaseScreenSize); } pLogicalCoordinate = pAttr->Find("LogicalCoordinate"); if (pLogicalCoordinate) { - _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl; - TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null"); - - pAppFeatureInfo->SetName("LogicalCoordinate"); - pAppFeatureInfo->SetValue(pLogicalCoordinate); - - __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo); + String* pKey = new (std::nothrow) String("LogicalCoordinate"); + TryReturn(pKey, false, "pKey is null"); + String* pValue = new (std::nothrow) String(pLogicalCoordinate); + TryReturn(pValue, false, "pValue is null"); + __pAppData->__pFeatureList->Add(pKey, pValue); AppLog("<LogicalCoordinate=%s>", pLogicalCoordinate); } @@ -515,40 +489,35 @@ ManifestHandler::OnUiThemeStartElement(void) pSystemTheme = pAttr->Find("SystemTheme"); if (pSystemTheme) { - _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl; - TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null"); - - pAppFeatureInfo->SetName("SystemTheme"); - pAppFeatureInfo->SetValue(pSystemTheme); - - __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo); + String* pKey = new (std::nothrow) String("SystemTheme"); + TryReturn(pKey, false, "pKey is null"); + String* pValue = new (std::nothrow) String(pSystemTheme); + TryReturn(pValue, false, "pValue is null"); + __pAppData->__pFeatureList->Add(pKey, pValue); AppLog("<SystemTheme=%s>", pSystemTheme); } pUserDefinedTheme = pAttr->Find("UserDefinedTheme"); if (pUserDefinedTheme) { - _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl; - TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null"); - - pAppFeatureInfo->SetName("UserDefinedTheme"); - pAppFeatureInfo->SetValue(pUserDefinedTheme); - - __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo); + String* pKey = new (std::nothrow) String("UserDefinedTheme"); + TryReturn(pKey, false, "pKey is null"); + String* pValue = new (std::nothrow) String(pUserDefinedTheme); + TryReturn(pValue, false, "pValue is null"); + __pAppData->__pFeatureList->Add(pKey, pValue); AppLog("<UserDefinedTheme=%s>", pUserDefinedTheme); } return true; } - bool ManifestHandler::OnDataControlStartElement(void) { - XmlAttribute *pAttr = null; - char *pProviderId = null; + XmlAttribute* pAttr = null; + char* pProviderId = null; pAttr = GetAttribute(); TryReturn(pAttr, true, "pAttr is null"); @@ -556,10 +525,10 @@ ManifestHandler::OnDataControlStartElement(void) pProviderId = pAttr->Find("ProviderId"); TryReturn(pProviderId, true, "pProviderId is null"); - __pDataControlInfoImpl = new (std::nothrow) _DataControlInfoImpl; - TryReturn(__pDataControlInfoImpl, false, "__pDataControlInfoImpl is null"); + __pDataControlInfo = new (std::nothrow) DataControlInfo; + TryReturn(__pDataControlInfo, false, "__pDataControlInfo is null"); - __pDataControlInfoImpl->SetProviderId(pProviderId); + __pDataControlInfo->__providerId = pProviderId; AppLog("<DataControl ProviderId=\"%s\">", pProviderId); @@ -666,11 +635,12 @@ ManifestHandler::OnPrivilegesEndElement(void) result r = E_SUCCESS; String privileges; String hmacPrivileges; - String appId = __pPackageInfoImpl->GetId(); - r = PrivilegeHandler::GenerateCipherPrivilege(appId, *__pPrivilegeList, privileges, hmacPrivileges); + PackageId packageId = __pContext->__packageId; + r = PrivilegeHandler::GenerateCipherPrivilege(packageId, *__pPrivilegeList, privileges, hmacPrivileges); TryReturn(!IsFailed(r), false, "privMgr.GeneratePrivilegeString() failed"); - __pPackageInfoImpl->SetPrivilegesValue(privileges, hmacPrivileges); + __pContext->__privileges = privileges; + __pContext->__hmacPrivileges = hmacPrivileges; } __pContext->SetPrivilegeList(__pPrivilegeList); @@ -683,16 +653,13 @@ ManifestHandler::OnPrivilegesEndElement(void) bool ManifestHandler::OnUiAppEndElement(void) { - if (__pContext->__isSubMode == true) + if (__pAppData->__isSubMode == true) { - __pSubModeAppControlDataList = __pAppData->__pAppControlDataList; + __pAppData->__pSubModeAppControlDataList = __pAppData->__pAppControlDataList; __pAppData->__pAppControlDataList = null; - __pContext->__subModeAppName = __pPackageAppInfoImpl->GetName(); + __pAppData->__subModeAppName = __pAppData->__name; } - __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl); - __pPackageAppInfoImpl = null; - __isDefaultName = false; __pContext->__pAppDataList->Add(__pAppData); @@ -706,16 +673,13 @@ ManifestHandler::OnUiAppEndElement(void) bool ManifestHandler::OnServiceAppEndElement(void) { - if (__pContext->__isSubMode == true) + if (__pAppData->__isSubMode == true) { - __pSubModeAppControlDataList = __pAppData->__pAppControlDataList; + __pAppData->__pSubModeAppControlDataList = __pAppData->__pAppControlDataList; __pAppData->__pAppControlDataList = null; - __pContext->__subModeAppName = __pPackageAppInfoImpl->GetName(); + __pAppData->__subModeAppName = __pAppData->__name; } - __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl); - __pPackageAppInfoImpl = null; - __isDefaultName = false; __pContext->__pAppDataList->Add(__pAppData); @@ -729,17 +693,6 @@ ManifestHandler::OnServiceAppEndElement(void) bool ManifestHandler::OnAppsEndElement(void) { - if (__pContext->__isSubMode == true) - { - __pAppData = new (std::nothrow) AppData; - TryReturn(__pAppData, false, "__pAppData is null"); - - __pAppData->__pAppControlDataList = __pSubModeAppControlDataList; - __pSubModeAppControlDataList = null; - - __pContext->__pAppDataList->Add(__pAppData); - } - AppLog("</Apps>"); return true; @@ -756,8 +709,8 @@ ManifestHandler::OnIconsEndElement(void) bool ManifestHandler::OnDataControlEndElement(void) { - __pPackageAppInfoImpl->AddDataControl(__pDataControlInfoImpl); - __pDataControlInfoImpl = null; + __pAppData->__pDataControlList->Add(__pDataControlInfo); + __pDataControlInfo = null; AppLog("</DataControl>"); return true; @@ -766,34 +719,14 @@ ManifestHandler::OnDataControlEndElement(void) bool ManifestHandler::OnDataControlTypeEndElement(void) { - __pDataControlInfoImpl->AddControlType(__pDataControlTypeImpl); - __pDataControlTypeImpl = null; + __pDataControlInfo->__pControlTypeList->Add(__pDataControlType); + __pDataControlType = null; AppLog("</DataControlType>"); return true; } bool -ManifestHandler::OnConditionEndElement(void) -{ - __pPackageAppInfoImpl->AddLaunchCondition(*__pLaunchConditionImpl); - __pLaunchConditionImpl = null; - AppLog("</Condition>"); - - return true; -} - -bool -ManifestHandler::OnNotificationEndElement(void) -{ - __pPackageAppInfoImpl->AddNotification(*__pNotificationImpl); - __pNotificationImpl = null; - AppLog("</Notification>"); - - return true; -} - -bool ManifestHandler::OnContentsEndElement(void) { __pContext->SetContentDataList(__pContentDataList); @@ -856,7 +789,7 @@ bool ManifestHandler::OnIdValue(const char *pCharacters) { AppLog("<Id>%s</Id>", pCharacters); - __pPackageInfoImpl->SetId(pCharacters); + __pContext->__packageId = pCharacters; return true; } @@ -865,7 +798,7 @@ bool ManifestHandler::OnVersionValue(const char *pCharacters) { AppLog("<Version>%s</Version>", pCharacters); - __pPackageInfoImpl->SetVersion(pCharacters); + __pContext->__version = pCharacters; return true; } @@ -874,11 +807,10 @@ bool ManifestHandler::OnTypeValue(const char *pCharacters) { AppLog("<Type>%s</Type>", pCharacters); - //__pPackageInfoImpl->SetAppType(pCharacters); if (strcasecmp(pCharacters, "Contents") == 0) { - __pPackageInfoImpl->SetAppApiVersion("3.0"); + __pContext->__apiVersion = L"3.0"; } return true; @@ -887,23 +819,8 @@ ManifestHandler::OnTypeValue(const char *pCharacters) bool ManifestHandler::OnAuthorValue(const char *pCharacters) { -// XmlAttribute *pAttr = 0; -// char *pAttrValue = 0; -// -// pAttr = GetAttribute(); -// TryReturn(pAttr, true, "pAttr is null"); -// -// pAttrValue = pAttr->Find("Locale"); -// TryReturn(pAttrValue, true, "pAttrValue is null"); -// -// if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0) -// { -// // Set default name -// __pPackageInfoImpl->SetAppVendor(pCharacters); -// } - AppLog("<Author>%s</Author>", pCharacters); - __pPackageInfoImpl->SetAuthor(pCharacters); + __pContext->__author = pCharacters; return true; } @@ -911,7 +828,7 @@ ManifestHandler::OnAuthorValue(const char *pCharacters) bool ManifestHandler::OnUrlValue(const char *pCharacters) { - __pPackageInfoImpl->SetUrl(pCharacters); + __pContext->__url = pCharacters; AppLog("<Url>%s</Url>", pCharacters); return true; @@ -920,7 +837,7 @@ ManifestHandler::OnUrlValue(const char *pCharacters) bool ManifestHandler::OnApiVersionValue(const char *pCharacters) { - __pPackageInfoImpl->SetAppApiVersion(pCharacters); + __pContext->__apiVersion = pCharacters; AppLog("<ApiVersion>%s</ApiVersion>", pCharacters); XmlAttribute *pAttr = GetAttribute(); @@ -1006,15 +923,15 @@ ManifestHandler::OnIconValue(const char *pCharacters) { if (strcasecmp(pSection, "MainMenu") == 0) { - __pPackageAppInfoImpl->SetMainmenuIcon(iconRelPath); + __pAppData->__mainmenuIcon = iconRelPath; } else if (strcasecmp(pSection, "Setting") == 0) { - __pPackageAppInfoImpl->SetSettingIcon(iconRelPath); + __pAppData->__settingIcon = iconRelPath; } else if (strcasecmp(pSection, "Notification") == 0) { - __pPackageAppInfoImpl->SetQuickpanelIcon(iconRelPath); + __pAppData->__notificationIcon = iconRelPath; } } else // legacy @@ -1023,7 +940,7 @@ ManifestHandler::OnIconValue(const char *pCharacters) { if (__isDefaultMainmenu == false) { - __pPackageAppInfoImpl->SetMainmenuIcon(iconRelPath); + __pAppData->__mainmenuIcon = iconRelPath; } if (strcasecmp(pType, __pDefaultIconType) == 0) @@ -1035,7 +952,7 @@ ManifestHandler::OnIconValue(const char *pCharacters) { if (__isDefaultSetting == false) { - __pPackageAppInfoImpl->SetSettingIcon(iconRelPath); + __pAppData->__settingIcon = iconRelPath; } if (strcasecmp(pType, __pDefaultIconType) == 0) @@ -1047,7 +964,7 @@ ManifestHandler::OnIconValue(const char *pCharacters) { if (__isDefaultQuickpanel == false) { - __pPackageAppInfoImpl->SetQuickpanelIcon(iconRelPath); + __pAppData->__notificationIcon = iconRelPath; } if (strcasecmp(pType, __pDefaultIconType) == 0) @@ -1087,16 +1004,14 @@ ManifestHandler::OnNameValue(const char *pCharacters) { if (__isDefaultName == true) { - __pPackageInfoImpl->SetDisplayName(pCharacters); + __pContext->__displayName = pCharacters; } } - if (__pPackageAppInfoImpl) - { - String* pValue = new (std::nothrow) String; - StringUtil::Utf8ToString(pCharacters, *pValue); - __pPackageAppInfoImpl->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue); - } + String* pValue = new (std::nothrow) String; + StringUtil::Utf8ToString(pCharacters, *pValue); + + __pAppData->__pNameList->Add((new (std::nothrow) String(pAttrValue)), pValue); } AppLog("<DisplayName Locale=\"%s\">%s</DisplayName>", pAttrValue, pCharacters); @@ -1118,8 +1033,7 @@ ManifestHandler::OnDescriptionValue(const char *pCharacters) if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0) { - // Set default name - __pPackageInfoImpl->SetDescription(pCharacters); + __pContext->__description = pCharacters; } AppLog("<Description Locale=\"%s\">%s</Description>", pAttrValue, pCharacters); @@ -1130,8 +1044,8 @@ ManifestHandler::OnDescriptionValue(const char *pCharacters) bool ManifestHandler::OnDataControlTypeValue(const char *pCharacters) { - XmlAttribute *pAttr = null; - char *pAccessValue = null; + XmlAttribute* pAttr = null; + char* pAccessValue = null; pAttr = GetAttribute(); TryReturn(pAttr, true, "pAttr is null"); @@ -1139,11 +1053,11 @@ ManifestHandler::OnDataControlTypeValue(const char *pCharacters) pAccessValue = pAttr->Find("Access"); TryReturn(pAccessValue, true, "pAccessValue is null"); - __pDataControlTypeImpl = new (std::nothrow) _DataControlTypeImpl; - TryReturn(__pDataControlTypeImpl, false, "__pDataControlTypeImpl is null"); + __pDataControlType = new (std::nothrow) DataControlType; + TryReturn(__pDataControlType, false, "__pDataControlType is null"); - __pDataControlTypeImpl->SetType(pCharacters); - __pDataControlTypeImpl->SetAccess(pAccessValue); + __pDataControlType->__type = pCharacters; + __pDataControlType->__access = pAccessValue; AppLog("<DataControlType Access=\"%s\", Type=\"%s\">", pAccessValue, pCharacters); @@ -1162,12 +1076,12 @@ ManifestHandler::OnConditionValue(const char *pCharacters) pName = pAttr->Find("Name"); TryReturn(pName, true, "pName is null"); - __pLaunchConditionImpl = new (std::nothrow) _LaunchConditionInfoImpl; - TryReturn(__pLaunchConditionImpl, false, "__pLaunchConditionImpl is null"); - - __pLaunchConditionImpl->SetName(pName); - __pLaunchConditionImpl->SetValue(pCharacters); + String* pKey = new (std::nothrow) String(pName); + TryReturn(pKey, false, "pKey is null"); + String* pValue = new (std::nothrow) String(pCharacters); + TryReturn(pValue, false, "pValue is null"); + __pAppData->__pLaunchConditionList->Add(pKey, pValue); AppLog("<LaunchCondition Name=\"%s\", Value=\"%s\">", pName, pCharacters); return true; @@ -1185,12 +1099,6 @@ ManifestHandler::OnNotificationValue(const char *pCharacters) pName = pAttr->Find("Name"); TryReturn(pName, true, "pName is null"); - __pNotificationImpl = new (std::nothrow) _NotificationInfoImpl; - TryReturn(__pNotificationImpl, false, "__pNotificationImpl is null"); - - __pNotificationImpl->SetName(pName); - __pNotificationImpl->SetValue(pCharacters); - AppLog("<Notification Name=\"%s\", Value=\"%s\">", pName, pCharacters); return true; @@ -1206,7 +1114,6 @@ ManifestHandler::OnInstallationLocationValue(const char *pCharacters) { AppLog("INSTALLATION_STORAGE = [EXTERNAL]"); __pContext->__storage = INSTALLATION_STORAGE_EXTERNAL; - __pPackageInfoImpl->SetInstalledInExternalStorage(true); } return true; @@ -1221,7 +1128,7 @@ ManifestHandler::OnCategoryValue(const char *pCharacters) if (strcasecmp(pCharacters, TIZEN_CATEGORY_IME) == 0) { - __pPackageAppInfoImpl->SetAppFeature(CATEGORY_TYPE_IME); + __pAppData->__feature = CATEGORY_TYPE_IME; } return true; @@ -1258,13 +1165,12 @@ ManifestHandler::FindElement(const char *pName) bool ManifestHandler::AddAppFeature(const Tizen::Base::String& name, const Tizen::Base::String& value) { - _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl; - TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null"); - - pAppFeatureInfo->SetName(name); - pAppFeatureInfo->SetValue(value); - __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo); + String* pKey = new (std::nothrow) String(name); + TryReturn(pKey, false, "pKey is null"); + String* pValue = new (std::nothrow) String(value); + TryReturn(pValue, false, "pValue is null"); + __pAppData->__pFeatureList->Add(pKey, pValue); return true; } @@ -1280,8 +1186,8 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp) if (pName) { AppLog(" - Name=%s", pName); - __pPackageAppInfoImpl->SetName(pName); - __pAppData->__appId = __pPackageInfoImpl->GetId() + L"." + pName; + __pAppData->__name = pName; + __pAppData->__appId = __pContext->__packageId + L"." + pName; } char* pMain = pAttr->Find("Main"); @@ -1293,8 +1199,7 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp) if (pMain) { AppLog(" - Main=%s", pMain); - - __pPackageAppInfoImpl->SetDefault(pMain); + __pAppData->__main = pMain; if (strcasecmp(pMain, "True") == 0) { @@ -1305,7 +1210,7 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp) } else { - __pPackageAppInfoImpl->SetDefault("False"); + __pAppData->__main = L"False"; } char* pHwAcceleration = pAttr->Find("HwAcceleration"); @@ -1343,7 +1248,7 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp) } int categoryType = InstallerUtil::GetCategoryType(pCategory); - __pPackageAppInfoImpl->SetAppFeature(categoryType); + __pAppData->__feature = categoryType; } char* pSubMode = pAttr->Find("SubMode"); @@ -1351,14 +1256,14 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp) { if (strcasecmp(pSubMode, "True") == 0) { - __pContext->__isSubMode = true; + __pAppData->__isSubMode = true; AppLog(" - SubMode=%s", pSubMode); } } if (isUiApp == true) { - __pPackageAppInfoImpl->SetType("UiApp"); + __pAppData->__type = L"UiApp"; char* pMenuIconVisible = pAttr->Find("MenuIconVisible"); if (pMenuIconVisible == null) @@ -1370,11 +1275,11 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp) { if (strcasecmp(pMenuIconVisible, "True") == 0) { - __pPackageAppInfoImpl->SetMainmenuVisible(true); + __pAppData->__mainmenuVisible = true; } else { - __pPackageAppInfoImpl->SetMainmenuVisible(false); + __pAppData->__mainmenuVisible = false; } AddAppFeature("MenuIconVisible", pMenuIconVisible); @@ -1383,8 +1288,8 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp) } else { - __pPackageAppInfoImpl->SetType("ServiceApp"); - __pPackageAppInfoImpl->SetMainmenuVisible(false); + __pAppData->__type = L"ServiceApp"; + __pAppData->__mainmenuVisible = false; char *pUseUi = pAttr->Find("UseUi"); if (pUseUi) @@ -1425,11 +1330,7 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp) } } - String appId; - appId.Format(1024, PACKAGE_NAME_RULE, __pPackageInfoImpl->GetId().GetPointer(), pName); - __pPackageAppInfoImpl->SetPackageName(appId); - - AppLog(" - appId=%ls", appId.GetPointer()); + AppLog(" - appId=%ls", __pAppData->__appId.GetPointer()); return true; } |