#ifndef _INSTALLER_DEFS_H_
#define _INSTALLER_DEFS_H_
-#define OSP_INSTALLER_VERSION "osp-installer version = [2012/12/26]_RC[2]"
+#define OSP_INSTALLER_VERSION "osp-installer version = [2012/12/27]_RC[1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
break;
case INSTALLER_STEP_CHECK_SYSTEM:
- __pStep = new SystemCheckStep();
+ __pStep = new (std::nothrow) SystemCheckStep();
TryReturn(__pStep, false, "[osp-installer] SystemCheckStep is failed.");
break;
case INSTALLER_STEP_CHECK_PACKAGE:
- __pStep = new PackageCheckStep();
+ __pStep = new (std::nothrow) PackageCheckStep();
TryReturn(__pStep, false, "[osp-installer] PackageCheckStep is failed.");
break;
case INSTALLER_STEP_UNPACK:
- __pStep = new UnpackStep();
+ __pStep = new (std::nothrow) UnpackStep();
TryReturn(__pStep, false, "[osp-installer] UnpackStep is failed.");
break;
case INSTALLER_STEP_PARSE_MANIFEST:
- __pStep = new ManifestXmlStep();
+ __pStep = new (std::nothrow) ManifestXmlStep();
TryReturn(__pStep, false, "[osp-installer] ManifestXmlStep is failed.");
break;
case INSTALLER_STEP_PARSE_SIGNATURE:
- __pStep = new SignatureStep();
+ __pStep = new (std::nothrow) SignatureStep();
TryReturn(__pStep, false, "[osp-installer] SignatureStep is failed.");
break;
case INSTALLER_STEP_UNINSTALL:
- __pStep = new UninstallStep();
+ __pStep = new (std::nothrow) UninstallStep();
TryReturn(__pStep, false, "[osp-installer] UninstallStep is failed.");
break;
case INSTALLER_STEP_LICENSE:
- __pStep = new LicenseStep();
+ __pStep = new (std::nothrow) LicenseStep();
TryReturn(__pStep, false, "[osp-installer] LicenseStep is failed.");
break;
case INSTALLER_STEP_DRM:
- __pStep = new DrmStep();
+ __pStep = new (std::nothrow) DrmStep();
TryReturn(__pStep, false, "[osp-installer] DrmStep is failed.");
break;
path = pPackageInfoImpl->GetAppRootPath() + DIR_INFO;
- pDir = new Directory; // Allocate %Directory instance
+ pDir = new (std::nothrow) Directory; // Allocate %Directory instance
TryCatch(pDir, res = false, "[osp-installer] pDir is null");
r = pDir->Construct(path);
return true;
CATCH:
- delete pDirEnum;
+ // delete pDirEnum;
delete pDir;
return false;
}
char*
ConfigurationManager::GetCertValueN(ICertificate* pCert) const
{
- bool result = true;
+ result r = E_SUCCESS;
ByteBuffer* pEncodedData = null;
String base64Value;
char* pEncodedValue = null;
pEncodedData = pCert->GetEncodedDataN();
- TryCatch(pEncodedData, result = false, "[osp-installer] pEncodedData is null.");
+ TryCatch(pEncodedData, , "[osp-installer] pEncodedData is null.");
+
+ r = StringUtil::EncodeToBase64String(*pEncodedData, base64Value);
+ TryCatch(!IsFailed(r), , "[osp-installer] StringUtil::EncodeToBase64String is failed.");
- StringUtil::EncodeToBase64String(*pEncodedData, base64Value);
pEncodedValue = _StringConverter::CopyToCharArrayN(base64Value);
- TryCatch(pEncodedValue, result = false, "[osp-installer] pEncodedValue is null");
+ TryCatch(pEncodedValue, , "[osp-installer] pEncodedValue is null");
CATCH:
delete pEncodedData;
r = webXml.Construct(webXmlPath, L"r");
TryReturn(!IsFailed(r), false, "[osp-installer] webXmlPath.Construct is failed");
- std::unique_ptr<char[]> pMergedBuf(new char[mergedSize + 1]);
+ std::unique_ptr<char[]> pMergedBuf(new (std::nothrow) char[mergedSize + 1]);
TryReturn(pMergedBuf, false, "[osp-installer] pMergedBuf is null");
memset(pMergedBuf.get(), 0, mergedSize + 1);
r = serviceXml.Construct(serviceXmlPath, L"r");
TryReturn(!IsFailed(r), false, "[osp-installer] serviceXmlPath.Construct is failed");
- std::unique_ptr<char[]> pServiceBuf(new char[serviceXmlFileSize + 1]);
+ std::unique_ptr<char[]> pServiceBuf(new (std::nothrow) char[serviceXmlFileSize + 1]);
TryReturn(pServiceBuf, false, "[osp-installer] pServiceBuf is null");
memset(pServiceBuf.get(), 0, serviceXmlFileSize + 1);
{
case INSTALLER_TYPE_INSTALLER:
AppLogTag(OSP_INSTALLER, "InstallerType = [Installer]");
- pInstaller = new Installer();
+ pInstaller = new (std::nothrow) Installer();
break;
case INSTALLER_TYPE_PACKAGE:
AppLogTag(OSP_INSTALLER, "InstallerType = [PackageInstaller]");
- pInstaller = new PackageInstaller();
+ pInstaller = new (std::nothrow) PackageInstaller();
break;
case INSTALLER_TYPE_DIRECTORY:
AppLogTag(OSP_INSTALLER, "InstallerType = [DirectoryInstaller]");
- pInstaller = new DirectoryInstaller();
+ pInstaller = new (std::nothrow) DirectoryInstaller();
break;
case INSTALLER_TYPE_GUEST:
AppLogTag(OSP_INSTALLER, "InstallerType = [GuestInstaller]");
- pInstaller = new GuestInstaller();
+ pInstaller = new (std::nothrow) GuestInstaller();
break;
case INSTALLER_TYPE_PRELOADED:
AppLogTag(OSP_INSTALLER, "InstallerType = [PreloadedInstaller]");
- pInstaller = new PreloadedInstaller();
+ pInstaller = new (std::nothrow) PreloadedInstaller();
break;
case INSTALLER_TYPE_IDE:
AppLogTag(OSP_INSTALLER, "InstallerType = [IDEInstaller]");
- pInstaller = new IDEInstaller();
+ pInstaller = new (std::nothrow) IDEInstaller();
break;
case INSTALLER_TYPE_RESTORATION:
AppLogTag(OSP_INSTALLER, "InstallerType = [RestorationInstaller]");
- pInstaller = new RestorationInstaller();
+ pInstaller = new (std::nothrow) RestorationInstaller();
break;
default:
int successCount = 0;
int failureCount = 0;
- pDir = new Directory; // Allocate %Directory instance
+ pDir = new (std::nothrow) Directory; // Allocate %Directory instance
TryCatch(pDir, res = false, "[osp-installer] pDir is null");
r = pDir->Construct(path);
char* pSignaturePath = _StringConverter::CopyToCharArrayN(__pContext->GetSignatureXmlPath());
char* pAuthorSignaturePath = _StringConverter::CopyToCharArrayN(__pContext->GetAuthorSignatureXmlPath());
- __pDistributorSignature = new SignatureHandler;
+ __pDistributorSignature = new (std::nothrow) SignatureHandler;
TryCatch(__pDistributorSignature, ret = false, "[osp-installer] __pDistributorSignature is null");
ret = __pDistributorSignature->Construct(__pContext);
ret = __pDistributorSignature->Parse(pSignaturePath);
TryCatch(ret == true, ret = false, "[osp-installer] __pDistributorSignature->Parse is failed.");
- __pAuthorSignature = new SignatureHandler;
+ __pAuthorSignature = new (std::nothrow) SignatureHandler;
TryCatch(__pAuthorSignature, ret = false, "[osp-installer] __pAuthorSignature is null");
ret = __pAuthorSignature->Construct(__pContext);
{
AppLogTag(OSP_INSTALLER, "AddCertificate - AuthorCertChain");
- __pAuthorCertPath = new X509CertificatePath();
+ __pAuthorCertPath = new (std::nothrow) X509CertificatePath();
TryCatch(__pAuthorCertPath, ret = false, "[osp-installer] __pAuthorCertPath is null.");
ret = AddCertificate(__pAuthorCertPath, pAuthorCertChain);
{
AppLogTag(OSP_INSTALLER, "AddCertificate - DistributorCert");
- __pDistributorCertPath = new X509CertificatePath();
+ __pDistributorCertPath = new (std::nothrow) X509CertificatePath();
TryCatch(__pDistributorCertPath, ret = false, "[osp-installer] __pDistributorCertPath is null.");
ret = AddCertificate(__pDistributorCertPath, pDistributorCertChain);
{
AppLogTag(OSP_INSTALLER, "[cert][%d]", i);
- pCertificate = new X509Certificate;
+ pCertificate = new (std::nothrow) X509Certificate;
TryCatch(pCertificate, ret = false, "[osp-installer] pCertificate is null.");
r = pCertificate->Construct(*pByteBuffer);
InstallerError error = INSTALLER_ERROR_NONE;
bool ret = true;
- __pSignatureManager = new SignatureManager();
+ __pSignatureManager = new (std::nothrow) SignatureManager();
TryCatch(__pSignatureManager, error = INSTALLER_ERROR_MEMORY, "[osp-installer] __pSignatureManager is null.");
ret = __pSignatureManager->Construct(__pContext);
while((r = entryName.IndexOf(L'/', startIndex, indexOf)) == E_SUCCESS)
{
- String* pCurDirectory = new String;
+ String* pCurDirectory = new (std::nothrow) String;
TryReturn(pCurDirectory, false, "[osp-installer] pCurDirectory is null.");
entryName.SubString(0, indexOf, *pCurDirectory);
bool
InstallerUtil::Copy(const String& srcFilePath, const String& destFilePath)
{
- const int bufSize = 4096;
+ int bufSize = 4096;
int readBytes = 0;
result r = E_SUCCESS;
File srcFile;
File destFile;
- std::unique_ptr<char[]> pBuf(new char[bufSize]);
+ std::unique_ptr<char[]> pBuf(new (std::nothrow) char[bufSize]);
TryReturn(pBuf, false, "[osp-installer] pBuf is null");
r = srcFile.Construct(srcFilePath, L"r");
AppLogTag(OSP_INSTALLER, "+ CopyDirectory(): src=[%ls], dest=[%ls]", srcFilePath.GetPointer(), destFilePath.GetPointer());
- std::unique_ptr<Directory> pDir(new Directory);
+ std::unique_ptr<Directory> pDir(new (std::nothrow) Directory);
TryReturn(pDir, false, "[osp-installer] pDir is null.");
r = pDir->Construct(srcFilePath);
return true;
}
- std::unique_ptr<Directory> pDir(new Directory);
+ std::unique_ptr<Directory> pDir(new (std::nothrow) Directory);
TryReturn(pDir, false, "[osp-installer] pDir is null.");
r = pDir->Construct(filePath);
__pContext = pContext;
__pPackageInfoImpl = pContext->GetPackageInfoImpl();
- __pWriter = new XmlWriter;
+ __pWriter = new (std::nothrow) XmlWriter;
TryReturn(__pWriter, false, "[osp-installer] __pWriter is null.");
return true;
__pWriter->WriteAttribute("xml:lang", launguage);
__pWriter->WriteString(*pValue);
__pWriter->EndElement();
-
- AppLogTag(OSP_INSTALLER, "Lang [%ls]->[%ls], value=[%ls]", pLanguage->GetPointer(), launguage.GetPointer(), pValue->GetPointer());
}
delete pMapEnum;
bool
ManifestHandler::OnPrivilegesStartElement(void)
{
- __pPrivilegeList = new ArrayList;
+ __pPrivilegeList = new (std::nothrow) ArrayList;
TryReturn(__pPrivilegeList, false, "[osp-installer] __pPrivilegeList is null");
AppLogTag(OSP_INSTALLER, "<Privileges>");
{
XmlAttribute *pAttr = null;
- __pPackageAppInfoImpl = new _PackageAppInfoImpl;
+ __pPackageAppInfoImpl = new (std::nothrow) _PackageAppInfoImpl;
TryReturn(__pPackageAppInfoImpl, false, "[osp-installer] __pPackageAppInfoImpl is null");
__pAppData = new (std::nothrow) AppData;
{
XmlAttribute *pAttr = null;
- __pPackageAppInfoImpl = new _PackageAppInfoImpl;
+ __pPackageAppInfoImpl = new (std::nothrow) _PackageAppInfoImpl;
TryReturn(__pPackageAppInfoImpl, false, "[osp-installer] __pPackageAppInfoImpl is null");
__pAppData = new (std::nothrow) AppData;
pCoordinateSystem = pAttr->Find("CoordinateSystem");
if (pCoordinateSystem)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
+ _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
pAppFeatureInfo->SetName("CoordinateSystem");
pBaseScreenSize = pAttr->Find("BaseScreenSize");
if (pBaseScreenSize)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
+ _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
pAppFeatureInfo->SetName("BaseScreenSize");
pLogicalCoordinate = pAttr->Find("LogicalCoordinate");
if (pLogicalCoordinate)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
+ _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
pAppFeatureInfo->SetName("LogicalCoordinate");
pSystemTheme = pAttr->Find("SystemTheme");
if (pSystemTheme)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
+ _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
pAppFeatureInfo->SetName("SystemTheme");
pUserDefinedTheme = pAttr->Find("UserDefinedTheme");
if (pUserDefinedTheme)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
+ _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
pAppFeatureInfo->SetName("UserDefinedTheme");
pAttrValue2 = pAttr->Find("Category");
TryReturn(pAttrValue2, true, "[osp-installer] pAttrValue2 is null");
- __pAppControlInfoImpl = new _AppControlInfoImpl;
+ __pAppControlInfoImpl = new (std::nothrow) _AppControlInfoImpl;
TryReturn(__pAppControlInfoImpl, false, "[osp-installer] __pAppControlInfoImpl is null");
__pAppControlInfoImpl->SetProviderId(pAttrValue1);
pAttrValue = pAttr->Find("OperationId");
TryReturn(pAttrValue, true, "[osp-installer] pAttrValue1 is null");
- __pAppControlCapabilityInfoImpl = new _AppControlCapabilityInfoImpl;
+ __pAppControlCapabilityInfoImpl = new (std::nothrow) _AppControlCapabilityInfoImpl;
TryReturn(__pAppControlCapabilityInfoImpl, false, "[osp-installer] __pAppControlCapabilityInfoImpl is null");
__pAppControlCapabilityInfoImpl->SetOperationId(pAttrValue);
pAttrValue1 = pAttr->Find("MimeType");
pAttrValue2 = pAttr->Find("UriScheme");
- __pAppControlResolutionInfoImpl = new _AppControlResolutionInfoImpl;
+ __pAppControlResolutionInfoImpl = new (std::nothrow) _AppControlResolutionInfoImpl;
TryReturn(__pAppControlResolutionInfoImpl, false, "[osp-installer] __pAppControlResolutionInfoImpl is null");
if (pAttrValue1)
{
- String* pMimeType = new String(pAttrValue1);
+ String* pMimeType = new (std::nothrow) String(pAttrValue1);
__pAppControlResolutionInfoImpl->SetMimeType(pMimeType);
}
if (pAttrValue2)
{
- String* pUriScheme = new String(pAttrValue2);
+ String* pUriScheme = new (std::nothrow) String(pAttrValue2);
__pAppControlResolutionInfoImpl->SetUriScheme(pUriScheme);
}
pProviderId = pAttr->Find("ProviderId");
TryReturn(pProviderId, true, "[osp-installer] pProviderId is null");
- __pDataControlInfoImpl = new _DataControlInfoImpl;
+ __pDataControlInfoImpl = new (std::nothrow) _DataControlInfoImpl;
TryReturn(__pDataControlInfoImpl, false, "[osp-installer] __pDataControlInfoImpl is null");
__pDataControlInfoImpl->SetProviderId(pProviderId);
bool
ManifestHandler::OnContentsStartElement(void)
{
- __pContentInfoList = new ArrayList;
+ __pContentInfoList = new (std::nothrow) ArrayList;
TryReturn(__pContentInfoList, false, "[osp-installer] __pContentInfoList is null");
AppLogTag(OSP_INSTALLER, "<Contents>");
XmlAttribute *pAttr = null;
char *pDefault = null;
- __pContentInfo = new ContentInfo;
+ __pContentInfo = new (std::nothrow) ContentInfo;
TryReturn(__pContentInfo, false, "[osp-installer] __pLiveboxInfo is null");
pAttr = GetAttribute();
bool
ManifestHandler::OnLiveBoxesStartElement(void)
{
- __pLiveBoxList = new ArrayList;
+ __pLiveBoxList = new (std::nothrow) ArrayList;
TryReturn(__pLiveBoxList, false, "[osp-installer] __pLiveBoxList is null");
AppLogTag(OSP_INSTALLER, "<LiveBoxes>");
char *pPopupEnabled = null;
char *pName = null;
- __pLiveboxInfo = new LiveboxInfo;
+ __pLiveboxInfo = new (std::nothrow) LiveboxInfo;
TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
pAttr = GetAttribute();
bool
ManifestHandler::OnPrivilegeValue(const char *pCharacters)
{
- __pPrivilegeList->Add(*new String(pCharacters));
+ __pPrivilegeList->Add(*new (std::nothrow) String(pCharacters));
AppLogTag(OSP_INSTALLER, "<Privilege>%s</Privilege>", pCharacters);
return true;
{
TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
- String* pValue = new String;
+ String* pValue = new (std::nothrow) String;
StringUtil::Utf8ToString(pCharacters, *pValue);
- __pLiveboxInfo->AddName(*(new String(pAttrValue)), *pValue);
+ __pLiveboxInfo->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
}
else if (FindElement("Content") == true)
{
TryReturn(__pContentInfo, false, "[osp-installer] __pContentInfo is null");
- String* pValue = new String;
+ String* pValue = new (std::nothrow) String;
StringUtil::Utf8ToString(pCharacters, *pValue);
- __pContentInfo->AddName(*(new String(pAttrValue)), *pValue);
+ __pContentInfo->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
}
else
{
if (__pPackageAppInfoImpl)
{
- String* pValue = new String;
+ String* pValue = new (std::nothrow) String;
StringUtil::Utf8ToString(pCharacters, *pValue);
- __pPackageAppInfoImpl->AddName(*(new String(pAttrValue)), *pValue);
+ __pPackageAppInfoImpl->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
}
}
pAccessValue = pAttr->Find("Access");
TryReturn(pAccessValue, true, "[osp-installer] pAccessValue is null");
- __pDataControlTypeImpl = new _DataControlTypeImpl;
+ __pDataControlTypeImpl = new (std::nothrow) _DataControlTypeImpl;
TryReturn(__pDataControlTypeImpl, false, "[osp-installer] __pDataControlTypeImpl is null");
__pDataControlTypeImpl->SetType(pCharacters);
pName = pAttr->Find("Name");
TryReturn(pName, true, "[osp-installer] pName is null");
- __pLaunchConditionImpl = new _LaunchConditionInfoImpl;
+ __pLaunchConditionImpl = new (std::nothrow) _LaunchConditionInfoImpl;
TryReturn(__pLaunchConditionImpl, false, "[osp-installer] __pLaunchConditionImpl is null");
__pLaunchConditionImpl->SetName(pName);
pName = pAttr->Find("Name");
TryReturn(pName, true, "[osp-installer] pName is null");
- __pNotificationImpl = new _NotificationInfoImpl;
+ __pNotificationImpl = new (std::nothrow) _NotificationInfoImpl;
TryReturn(__pNotificationImpl, false, "[osp-installer] __pNotificationImpl is null");
__pNotificationImpl->SetName(pName);
{
TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
- __pLiveboxInfo->AddSize(*(new String(pCharacters)));
+ __pLiveboxInfo->AddSize(*(new (std::nothrow) String(pCharacters)));
AppLogTag(OSP_INSTALLER, "<Size>%s</Size>", pCharacters);
return true;
{
TryReturn(__pAppData, false, "[osp-installer] __pAppData is null");
- __pAppData->__pCategoryList->Add(new String(pCharacters));
+ __pAppData->__pCategoryList->Add(new (std::nothrow) String(pCharacters));
return true;
}
bool
ManifestHandler::AddAppFeature(const Tizen::Base::String& name, const Tizen::Base::String& value)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
+ _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
pAppFeatureInfo->SetName(name);
if (strcasecmp(pCategory, "home-screen") == 0)
{
- __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/homescreen"));
+ __pAppData->__pCategoryList->Add(new (std::nothrow) String("http://tizen.org/category/homescreen"));
}
else if (strcasecmp(pCategory, "lock-screen") == 0)
{
- __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/lockscreen"));
+ __pAppData->__pCategoryList->Add(new (std::nothrow) String("http://tizen.org/category/lockscreen"));
}
else if (strcasecmp(pCategory, "Ime") == 0)
{
- __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/ime"));
+ __pAppData->__pCategoryList->Add(new (std::nothrow) String("http://tizen.org/category/ime"));
}
CategoryType categoryType = InstallerUtil::GetCategoryType(pCategory);
CATCH:
delete pEnum;
-
- if (pResult)
- {
- free(pResult);
- }
+ free(pResult);
SysLog(NID_SEC, "Exit.");
return null;
CATCH:
delete pEnum;
-
- if (pResult)
- {
- free(pResult);
- }
+ free(pResult);
SysLog(NID_SEC, "Exit.");
return r;
{
if (__pAuthorCertChain == null)
{
- __pAuthorCertChain = new ArrayList;
+ __pAuthorCertChain = new (std::nothrow) ArrayList;
TryCatch(__pAuthorCertChain, res = false, "[osp-installer] __pAuthorCertChain is null");
}
- pByteBuffer = new ByteBuffer;
+ pByteBuffer = new (std::nothrow) ByteBuffer;
TryCatch(pByteBuffer, res = false, "[osp-installer] pByteBuffer is null");
int length = strlen(pCharacters);
{
if (__pDistributorCertChain == null)
{
- __pDistributorCertChain = new ArrayList;
+ __pDistributorCertChain = new (std::nothrow) ArrayList;
TryCatch(__pDistributorCertChain, res = false, "[osp-installer] __pDistributorCertChain is null");
}
- pByteBuffer = new ByteBuffer;
+ pByteBuffer = new (std::nothrow) ByteBuffer;
TryCatch(pByteBuffer, res = false, "[osp-installer] pByteBuffer is null");
int length = strlen(pCharacters);
return true;
}
- __pName = new char[strlen(pName)+1];
+ __pName = new (std::nothrow) char[strlen(pName)+1];
TryReturn(__pName, false, "[osp-installer] __pName is null");
strcpy(__pName, pName);
- __pValue = new char[strlen(pValue)+1];
+ __pValue = new (std::nothrow) char[strlen(pValue)+1];
TryReturn(__pValue, false, "[osp-installer] __pValue is null");
strcpy(__pValue, pValue);
}
else
{
- __pNext = new XmlAttribute();
+ __pNext = new (std::nothrow) XmlAttribute();
TryReturn(__pNext, false, "[osp-installer] __pNext is null");
__pNext->Construct(pName, pValue);
__pElementName = null;
}
- __pElementName = new char[strlen(pElementName)+1];
+ __pElementName = new (std::nothrow) char[strlen(pElementName)+1];
TryReturn(__pElementName, false, "[osp-installer] __pElementName is null");
strcpy(__pElementName, pElementName);
- __elementStack.Push(*new String(pElementName));
+ __elementStack.Push(*new (std::nothrow) String(pElementName));
return true;
}
XmlWriter::~XmlWriter(void)
{
result r = E_SUCCESS;
+ int err = 0;
- xmlTextWriterEndDocument(__pXmlWriter);
+ err = xmlTextWriterEndDocument(__pXmlWriter);
+ if (err != 0)
+ {
+ AppLogTag(OSP_INSTALLER, "xmlTextWriterEndDocument() is failed");
+ }
File file;
r = file.Construct(__xmlFilePath, "w");
XmlWriter::StartElement(const Tizen::Base::String& name)
{
ByteBuffer* pNameBuf = null;
+ int err = 0;
+ bool res = true;
pNameBuf = StringUtil::StringToUtf8N(name);
if (pNameBuf)
{
- xmlTextWriterStartElement(__pXmlWriter, (xmlChar *)pNameBuf->GetPointer());
+ err = xmlTextWriterStartElement(__pXmlWriter, (xmlChar *)pNameBuf->GetPointer());
+ if (err != 0)
+ {
+ res = false;
+ }
}
delete pNameBuf;
- return true;
+ return res;
}
bool
{
ByteBuffer* pNameBuf = null;
ByteBuffer* pContentBuf = null;
+ int err = 0;
+ bool res = true;
pNameBuf = StringUtil::StringToUtf8N(name);
pContentBuf = StringUtil::StringToUtf8N(content);
if (pNameBuf && pContentBuf)
{
- xmlTextWriterWriteAttribute(__pXmlWriter, (xmlChar *)pNameBuf->GetPointer(), (xmlChar *)pContentBuf->GetPointer());
+ err = xmlTextWriterWriteAttribute(__pXmlWriter, (xmlChar *)pNameBuf->GetPointer(), (xmlChar *)pContentBuf->GetPointer());
+ if (err != 0)
+ {
+ res = false;
+ }
}
delete pNameBuf;
delete pContentBuf;
- return true;
+ return res;
}
bool
XmlWriter::WriteString(const Tizen::Base::String& content)
{
ByteBuffer* pContentBuf = null;
+ int err = 0;
+ bool res = true;
pContentBuf = StringUtil::StringToUtf8N(content);
if (pContentBuf)
{
- xmlTextWriterWriteString(__pXmlWriter, (xmlChar *)pContentBuf->GetPointer());
+ err = xmlTextWriterWriteString(__pXmlWriter, (xmlChar *)pContentBuf->GetPointer());
+ if (err != 0)
+ {
+ res = false;
+ }
}
delete pContentBuf;
- return true;
+ return res;
}
bool