TryReturn(pEnum, false, "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
String* pValue = static_cast< String* > (pEnum->GetValue());
- TryReturn(pEnum, false, "GetValue() failed. [%s]", GetErrorMessage(GetLastResult()));
__pWriter->StartElement("metadata");
__pWriter->WriteAttribute("key", *pKey);
- __pWriter->WriteAttribute("value", *pValue);
+
+ if (pValue && (pValue->IsEmpty() == false))
+ {
+ __pWriter->WriteAttribute("value", *pValue);
+ }
+
__pWriter->EndElement();
}
{
status = OnContentStartElement();
}
+ else if (strcasecmp(pName, "Metadata") == 0)
+ {
+ status = OnMetadataStartElement();
+ }
else if ((strcasecmp(pName, "Liveboxes") == 0) || strcasecmp(pName, "AppWidgets") == 0)
{
status = OnLiveboxesStartElement(pName);
{
status = OnContentEndElement();
}
+ else if (strcasecmp(pName, "Metadata") == 0)
+ {
+ status = OnMetadataEndElement();
+ }
else if (strcasecmp(pName, "Manifest") == 0)
{
status = OnManifestEndElement();
}
bool
+ManifestHandler::OnMetadataStartElement()
+{
+ AppLog("<Metadata>");
+ __metadataKey.Clear();
+
+ XmlAttribute* pAttr = GetAttribute();
+ TryReturn(pAttr, true, "pAttr is null");
+
+ char* pKey = pAttr->Find("Key");
+ if (pKey)
+ {
+ __metadataKey = pKey;
+ }
+
+ return true;
+}
+
+bool
ManifestHandler::OnLiveboxesStartElement(const char *pName)
{
__pParser = new (std::nothrow) ManifestLiveboxesParser;
}
bool
+ManifestHandler::OnMetadataEndElement(void)
+{
+ AppLog("</Metadata>");
+
+ if (__metadataKey.IsEmpty() == false)
+ {
+ __pAppData->__pMetadataMap->Add(*(new (std::nothrow) String(__metadataKey)), *(new (std::nothrow) String(L"")));
+ __metadataKey.Clear();
+ }
+
+ return true;
+}
+
+bool
ManifestHandler::OnLiveboxesEndElement(void)
{
delete __pParser;
TryReturn(pKey, true, "pKey is null.");
__pAppData->__pMetadataMap->Add(*(new (std::nothrow) String(pKey)), *(new (std::nothrow) String(pCharacters)));
+ __metadataKey.Clear();
AppLog("<Metadata Key=\"%s\">%s</Metadata>", pKey, pCharacters);
bool OnContentsStartElement(void);
bool OnContentStartElement(void);
+ bool OnMetadataStartElement(void);
+
// Parsers
bool OnLiveboxesStartElement(const char* pName);
bool OnAccountsStartElement(const char* pName);
bool OnContentsEndElement(void);
bool OnContentEndElement(void);
+ bool OnMetadataEndElement(void);
// Parsers
bool OnLiveboxesEndElement(void);
bool __isParserMode;
ManifestParser* __pParser;
+ Tizen::Base::String __metadataKey;
+
friend class ManifestAppControlsParser;
}; // ManifestHandler