#include <FAppPkg_PackageParser.h>
#include <FBase_StringConverter.h>
+using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
-using namespace Tizen::App;
using namespace Tizen::Io;
using namespace Tizen::System;
}
__pName = new (std::nothrow) char[strlen(pName)+1];
- SysTryReturn(NID_APP, __pName, false, E_OUT_OF_MEMORY, "__pName is null");
+ SysTryReturn(NID_APP, __pName, false, E_OUT_OF_MEMORY, "__pName is null.");
strcpy(__pName, pName);
__pValue = new (std::nothrow) char[strlen(pValue)+1];
- SysTryReturn(NID_APP, __pValue, false, E_OUT_OF_MEMORY, "__pValue is null");
+ SysTryReturn(NID_APP, __pValue, false, E_OUT_OF_MEMORY, "__pValue is null.");
strcpy(__pValue, pValue);
return true;
else
{
__pNext = new (std::nothrow) _PackageXmlAttribute();
- SysTryReturn(NID_APP, __pNext, false, E_OUT_OF_MEMORY, "__pNext is null");
+ SysTryReturn(NID_APP, __pNext, false, E_OUT_OF_MEMORY, "__pNext is null.");
__pNext->Construct(pName, pValue);
}
TryCatch(size > 0, ret = false, "size is invalid. [%s]", pFilepath);
pBuf = new (std::nothrow) char[size+1];
- TryCatch(pBuf, ret = false, "pBuf is null");
+ TryCatch(pBuf, ret = false, "pBuf is null.");
pNormalizedBuf = new (std::nothrow) char[size+1];
- TryCatch(pNormalizedBuf, ret = false, "pNormalizedBuf is null");
+ TryCatch(pNormalizedBuf, ret = false, "pNormalizedBuf is null.");
memset(pBuf, 0, size+1);
memset(pNormalizedBuf, 0, size+1);
TryCatch(ctxt, ret = false, "invalid xml file, %s", pFilepath);
pSAXHandler = new (std::nothrow) xmlSAXHandler;
- TryCatch(pSAXHandler, ret = false, "pSAXHandler is null");
+ TryCatch(pSAXHandler, ret = false, "pSAXHandler is null.");
memset(pSAXHandler, 0, sizeof(xmlSAXHandler));
ctxt->userData = (void *)this;
bool
_PackageXmlHandler::SetElementName(const char* pElementName)
{
- SysTryReturn(NID_APP, pElementName, false, E_SYSTEM, "pElementName is null");
+ SysTryReturn(NID_APP, pElementName, false, E_SYSTEM, "pElementName is null.");
if (__pElementName)
{
}
__pElementName = new (std::nothrow) char[strlen(pElementName)+1];
- SysTryReturn(NID_APP, __pElementName, false, E_OUT_OF_MEMORY, "__pElementName is null");
+ SysTryReturn(NID_APP, __pElementName, false, E_OUT_OF_MEMORY, "__pElementName is null.");
strcpy(__pElementName, pElementName);
__elementStack.Push(*new (std::nothrow) String(pElementName));
bool
_PackageXmlHandler::SetCharacters(const char* pCharacter)
{
- SysTryReturn(NID_APP, pCharacter, false, E_SYSTEM, "pCharacter is null");
+ SysTryReturn(NID_APP, pCharacter, false, E_SYSTEM, "pCharacter is null.");
if (__pCharacters == null)
{
__pCharacters = new (std::nothrow) char[4096];
- SysTryReturn(NID_APP, __pCharacters, false, E_OUT_OF_MEMORY, "__pCharacters is null");
+ SysTryReturn(NID_APP, __pCharacters, false, E_OUT_OF_MEMORY, "__pCharacters is null.");
memset(__pCharacters, 0, 4096);
}
SysTryReturn(NID_APP, pPackageAppInfoImpl, false, E_SYSTEM, "pPackageAppInfoImpl is null.");
_PackageXmlAttribute* pAttr = GetAttribute();
- SysTryReturn(NID_APP, pAttr, true, E_SYSTEM, "pAttr is null");
+ SysTryReturn(NID_APP, pAttr, true, E_SYSTEM, "pAttr is null.");
ParseAppAttribute(pAttr, true);
SysTryReturn(NID_APP, pPackageAppInfoImpl, false, E_SYSTEM, "pPackageAppInfoImpl is null.");
_PackageXmlAttribute* pAttr = GetAttribute();
- SysTryReturn(NID_APP, pAttr, true, E_SYSTEM, "pAttr is null");
+ SysTryReturn(NID_APP, pAttr, true, E_SYSTEM, "pAttr is null.");
ParseAppAttribute(pAttr, false);
bool
_PackageParser::OnIconValue(const char* pCharacters)
{
- SysTryReturn(NID_APP, __pDefaultIconType, false, E_SYSTEM, "__pDefaultIconType is null");
+ SysTryReturn(NID_APP, __pDefaultIconType, false, E_SYSTEM, "__pDefaultIconType is null.");
_PackageAppInfoImpl* pPackageAppInfoImpl = _PackageAppInfoImpl::GetInstance(__pAppInfo);
SysTryReturn(NID_APP, pPackageAppInfoImpl, false, E_SYSTEM, "pPackageAppInfoImpl is null.");
_PackageXmlAttribute* pAttr = GetAttribute();
- SysTryReturn(NID_APP, pAttr, true, E_SYSTEM, "pAttr is null");
+ SysTryReturn(NID_APP, pAttr, true, E_SYSTEM, "pAttr is null.");
+
+ if ((FindElement("Accounts") == true) || (FindElement("AppWidgets") == true))
+ {
+ AppLog("Skip icon value.");
+ return true;
+ }
+ else
+ {
+ AppLog("It's icon value for UiApp, ServiceApp");
+ }
char* pSection = pAttr->Find("Section");
- SysTryReturn(NID_APP, pSection, true, E_SYSTEM, "pSection is null");
+ SysTryReturn(NID_APP, pSection, true, E_SYSTEM, "pSection is null.");
String iconRelPath;
String tempIconPath;
pAttr = GetAttribute();
SysTryReturn(NID_APP, pAttr, true, E_SYSTEM, "pAttr is null");
+ if ((FindElement("Accounts") == true) || (FindElement("AppWidgets") == true))
+ {
+ AppLog("Skip display name.");
+ return true;
+ }
+ else
+ {
+ AppLog("It's display name for UiApp, ServiceApp");
+ }
+
pAttrValue = pAttr->Find("Locale");
SysTryReturn(NID_APP, pAttrValue, true, E_SYSTEM, "pAttrValue is null");
return true;
}
+bool
+_PackageParser::FindElement(const char* pName)
+{
+ bool res = false;
+ IEnumerator* pEnum = GetElementEnumeratorN();
+
+ if (pEnum)
+ {
+ while(pEnum->MoveNext() == E_SUCCESS)
+ {
+ String* pStr = static_cast< String* >(pEnum->GetCurrent());
+ if (pStr)
+ {
+ if (pStr->Equals(pName, false) == true)
+ {
+ AppLog("[%s] is matched.", pName);
+ res = true;
+ break;
+ }
+ }
+ }
+
+ delete pEnum;
+ }
+
+ return res;
+}
+
} } } // Tizen::App::Package