#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130226.3]"
+#define OSP_INSTALLER_VERSION "version=[20130227.1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
AccountData::AccountData()
:__pNameList(null)
+,__pCapabilityList(null)
{
- __pNameList = new (std::nothrow) HashMap;
- TryReturn(__pNameList, , "__pNameList is null.");
- __pNameList->Construct();
+
}
AccountData::~AccountData()
{
__pNameList->RemoveAll(true);
delete __pNameList;
+
+ __pCapabilityList->RemoveAll();
+ delete __pCapabilityList;
+}
+
+bool
+AccountData::Construct()
+{
+ result r = E_SUCCESS;
+
+ __pNameList = new (std::nothrow) HashMap;
+ TryReturn(__pNameList, false, "__pNameList is null.");
+
+ r = __pNameList->Construct();
+ TryReturn(!IsFailed(r), false, "__pNameList->Construct() is failed.");
+
+ __pCapabilityList = new (std::nothrow) ArrayListT<String*>;
+ TryReturn(__pCapabilityList, false, "__pCapabilityList is null.");
+
+ return true;
}
public:
AccountData();
virtual ~AccountData();
+ bool Construct();
Tizen::Base::String __providerId;
Tizen::Base::String __multipleAccountsSupport;
Tizen::Base::String __accountIcon;
Tizen::Base::String __accountSmallIcon;
Tizen::Base::Collection::HashMap* __pNameList;
+ Tizen::Base::Collection::IListT<Tizen::Base::String*>* __pCapabilityList;
};
WriteLanguageValue(pAccountData->__pNameList, L"label");
- __pWriter->EndElement(); // end of "account-provider"
+ IListT<String*>* pCapabilityList = pAccountData->__pCapabilityList;
+ TryReturn(pCapabilityList, false, "pCapabilityList is null");
+
+ for (int capa = 0; capa < pCapabilityList->GetCount(); capa++)
+ {
+ String* pCapability = null;
+ pCapabilityList->GetAt(capa, pCapability);
+ TryReturn(pCapability, false, "pCapability is null");
+
+ __pWriter->StartElement("capability");
+ __pWriter->WriteString(*pCapability);
+ __pWriter->EndElement(); // end of "capability"
+ }
+
+ __pWriter->EndElement(); // end of "account-provider"
}
- __pWriter->EndElement(); // end of "account"
+ __pWriter->EndElement(); // end of "account"
return true;
}
{
status = OnIconValue(pCharacters);
}
+ else if (strcasecmp(pName, "Capability") == 0)
+ {
+ status = OnCapabilityValue(pCharacters);
+ }
return true;
}
__pAccountData = new (std::nothrow) AccountData;
TryReturn(__pAccountData, false, "__pAccountData is null");
+ bool res = __pAccountData->Construct();
+ TryReturn(res, false, "__pAccountData->Construct() is failed.");
+
ManifestHandler* pHandler = GetHandler();
TryReturn(pHandler, false, "pHandler is null");
__pAccountData->__providerId = pProviderId;
AppLog(" - ProviderId=%s", pProviderId);
}
+ else
+ {
+ __pAccountData->__providerId = L"none";
+ AppLog(" - ProviderId=%s", "none");
+ }
char *pMultipleAccountsSupport = pAttr->Find("MultipleAccountsSupport");
if (pMultipleAccountsSupport)
__pAccountData->__accountSmallIcon = iconRelPath;
}
+ return true;
+}
+
+bool
+ManifestAccountsParser::OnCapabilityValue(const char *pCharacters)
+{
+ String* pValue = new (std::nothrow) String;
+ TryReturn(pValue, false, "pValue is null.");
+
+ StringUtil::Utf8ToString(pCharacters, *pValue);
+ __pAccountData->__pCapabilityList->Add(pValue);
+
+ AppLog(" <Capability>%s</Capability>", pCharacters);
return true;
}
ManifestAccountsParser(void);
virtual ~ManifestAccountsParser(void);
- virtual bool OnStartElement(const char *pName);
- virtual bool OnEndElement(const char *pName);
- virtual bool OnCharacters(const char *pCharacters);
+ virtual bool OnStartElement(const char* pName);
+ virtual bool OnEndElement(const char* pName);
+ virtual bool OnCharacters(const char* pCharacters);
private:
bool OnAccountsStartElement(void);
bool OnAccountsEndElement(void);
bool OnAccountProviderEndElement(void);
- bool OnDisplayNameValue(const char *pCharacters);
- bool OnIconValue(const char *pCharacters);
+ bool OnDisplayNameValue(const char* pCharacters);
+ bool OnIconValue(const char* pCharacters);
+ bool OnCapabilityValue(const char* pCharacters);
private:
InstallationContext* __pContext;