* @b Library : @b osp-appfw
*
* The %App namespace contains classes for application development, including application life-cycle management, usage of
- * functionality exported by other applications through AppControl, and access to application registry and resources. Tizen
+ * functionality exported by other applications through AppControl, and access to application registry and resources. %Tizen
* also provides various macros for debugging purposes.
* @n
* For more information on the %App namespace features and the macros, see <a href="../org.tizen.native.appprogramming/html/guide/app/app_namespace.htm">App Guide</a> and <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/debugging_macros.htm">Debugging Macros</a>.
/**
* @class App
- * @brief This class is the base class of a Tizen native application.
+ * @brief This class is the base class of a %Tizen native application.
*
* @since 2.0
*
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @remarks %Tizen platform defines platform-defined alias for application ID and this aliased application ID
* can be used to find the AppControl. For more information, see
- * <a href="../org.tizen.native.appprogramming/html/guide/app/app_control.htm">here</a>.
+ * <a href="../org.tizen.native.appprogramming/html/guide/app/app_controls.htm">here</a>.
*
* The following example demonstrates how to use the %FindAppControlN() method to find the application control.
*
* @param[in] appId The ID of the requested application
* @param[in] operationId The operation ID used in application control invocation
* @param[in] appControlResult The application control result
- * @param[in] pExtraData A pointer to an result map of key and value pair where the key of type String and the value of type ArrayList of String
+ * @param[in] pExtraData A pointer to an result map of key and value pair where the key of type String and the value of type String or of type ArrayList of String
* @remarks The application control completion result is received when the requested application control
* sends the result using AppControlProviderManager::SendAppControlResult().
* @see AppControl
* @remarks @b Header @b %file: @b \#include @b <FBase.h> @n
* @b Library : @b osp-appfw
*
- * The %Base namespace contains classes and interfaces around which the entire Tizen platform is built.
+ * The %Base namespace contains classes and interfaces around which the entire %Tizen platform is built.
* The main features of the namespace include basic data types, collections, runtime libraries, and various utilities.
*
* For more information on the %Base namespace features, see <a href="../org.tizen.native.appprogramming/html/guide/base/base_namespace.htm">Base Guide</a>.
*
* @since 2.1
*
- * @remarks The %IteratorT class satisfies only requirements of C++ standard library InputIterator concept due to limitations of Tizen Collection.
+ * @remarks The %IteratorT class satisfies only requirements of C++ standard library InputIterator concept due to limitations of %Tizen Collection.
* So, this class can be used with C++ standard library algorithms which requires only InputIterator concept for their arguments.
*/
*
* @since 2.1
*
- * @remarks The %PairIteratorT class satisfies only requirements of C++ standard library InputIterator concept due to limitations of Tizen Collection.
+ * @remarks The %PairIteratorT class satisfies only requirements of C++ standard library InputIterator concept due to limitations of %Tizen Collection.
* So, this class can be used with C++ standard library algorithms which requires only InputIterator concept for their arguments.
*/
*
* @since 2.1
*
- * @remarks The %RandomIteratorT class satisfies only requirements of C++ standard library InputIterator concept due to limitations of Tizen Collection.
+ * @remarks The %RandomIteratorT class satisfies only requirements of C++ standard library InputIterator concept due to limitations of %Tizen Collection.
* So, this class can be used with C++ standard library algorithms which requires only InputIterator concept for their arguments.
*/
* @since 2.1
*
* @param[in] list A reference to the IList instance to convert
- * @param[in] position A start position
+ * @param[in] index A start index
* @remarks %RandomIteratorT only supports random accessible collection for performance.
* @see Tizen::Base::Collection::IList::IsRandomAccessible()
*/
/**
* @class StlConverter
- * @brief This class provides static methods to convert Tizen Collection to STL Container and vice versa.
+ * @brief This class provides static methods to convert %Tizen Collection to STL Container and vice versa.
*
* @since 2.1
*
- * The %StlConverter class provides static methods to convert Tizen Collection to STL Container and vice versa.
+ * The %StlConverter class provides static methods to convert %Tizen Collection to STL Container and vice versa.
* The following example demonstrates how to use the %StlConverter class.
*
* @code
*/
#if (defined(_APP_LOG) || defined(_OSP_DEBUG_) || defined(_DEBUG)) && defined(_SECURE_LOG)
-#define AppSecureLog(...) AppLogInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
-#define AppSecureLogException(...) AppLogExceptionInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
+#define AppSecureLog(...) AppLogInternal(__PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
+#define AppSecureLogException(...) AppLogExceptionInternal(__PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
-#define AppSecureLogTag(tag, ...) AppLogTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
-#define AppSecureLogExceptionTag(tag, ...) AppLogExceptionTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
+#define AppSecureLogTag(tag, ...) AppLogTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
+#define AppSecureLogExceptionTag(tag, ...) AppLogExceptionTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
#else
/**
* @since 2.0
*
* The %EventDrivenThread class is the fundamental class for the asynchronous execution of a thread.
- * A Tizen native application can execute several threads during its operation from the multi-threading view.
+ * A %Tizen native application can execute several threads during its operation from the multi-threading view.
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/thread.htm">Thread</a>.
*
// Secure Macros
#if defined(_SECURE_LOG)
-#define SysSecureLog(NID, ...) SysLogInternal(NID, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
-#define SysSecureLogException(NID, r,...) SysLogExceptionInternal(NID, r, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
+#define SysSecureLog(NID, ...) SysLogInternal(NID, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
+#define SysSecureLogException(NID, r,...) SysLogExceptionInternal(NID, r, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
-#define SysSecureLogTag(NID, tag, ...) SysLogTagInternal(NID, tag, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
-#define SysSecureLogExceptionTag(NID, tag, r, ...) SysLogExceptionTagInternal(NID, tag, r, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
+#define SysSecureLogTag(NID, tag, ...) SysLogTagInternal(NID, tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
+#define SysSecureLogExceptionTag(NID, tag, r, ...) SysLogExceptionTagInternal(NID, tag, r, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
#else
* @since 2.0
*
* The %TimeSpan class represents a time interval. An instance of %TimeSpan represents a period of time measured in ticks. A tick is the smallest
- * unit of time used by the platform or system. In Tizen, it is a millisecond.
+ * unit of time used by the platform or system. In %Tizen, it is a millisecond.
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/datetime_timespan.htm">DateTime and TimeSpan</a>.
*
* - The length of the specified path is @c 0 or exceeds system limitations. @n
* - The specified path contains prohibited character(s). @n
* - The specified path is invalid.
- * @exception E_ILLEGAL_ACCESS The specified file path is inaccessible as per the Tizen platform policy.
+ * @exception E_ILLEGAL_ACCESS The specified file path is inaccessible as per the %Tizen platform policy.
* @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
* @exception E_IO An unexpected device failure has occurred.
* @remarks The paths for @b Tizen::App::AppManager::GetAppSharedPath(appId) + L"data" and @b Tizen::App::AppManager::GetAppSharedPath(appId) + L"trusted" are not supported.
virtual ~Database(void);
/**
- * @if OSPDEPREC
* @{
+ * @if OSPDEPREC
* Initializes this instance of %Database with the specified parameters. @n
* This method creates a new database file or opens an existing database file in the read-write mode.
*
* @remarks To open the database file in the read-only mode,
* use the Database::Construct(const Tizen::Base::String& dbPath, const char* pOpenMode) method
* with "r" as the value for the open mode flag.
- * @}
* @endif
+ * @}
*/
result Construct(const Tizen::Base::String& dbPath, bool createIfNotExist);
/**
- * @if OSPDEPREC
* @{
+ * @if OSPDEPREC
* Initializes this instance of %Database with the specified parameters. @n
* This method creates a new database file or opens an existing database file in the read-only or the read-write mode.
*
* - The method has failed to open or create a file. @n
* - An unexpected device failure has occurred as the media ejected suddenly. @n
* - %File corruption is detected.
- * @}
* @endif
+ * @}
*/
result Construct(const Tizen::Base::String& dbPath, long openMode, long option);
virtual ~File(void);
/**
- * @if OSPDEPREC
* @{
+ * @if OSPDEPREC
* Initializes this instance of %File with the specified parameters. @n
* This method opens an existing file or creates a new one according to the specified file opening mode.
*
* @remarks The following file opening mode strings are recognized by this method: "w+", "wb+", "w+b", "w", "wb", "a+",
* "ab+", "a+b", "a", "ab", "r+", "rb+", "r+b", "r", "rb". @n
* Other strings lead to E_INVALID_ARG. However, "b"(binary) open mode is ignored internally.
- * @}
* @endif
+ * @}
*/
result Construct(const Tizen::Base::String& filePath, const Tizen::Base::String& openMode, bool createParentDirectories);
virtual ~Registry(void);
/**
- * @if OSPDEPREC
* @{
+ * @if OSPDEPREC
* Initializes this instance of %Registry with the specified parameters. @n
* This method loads a registry file in the read-write mode.
*
* @exception E_PARSING_FAILED The method has failed to parse the registry file.
* @remarks To load the registry in read-only mode, use the Registry::Construct(const Tizen::Base::String& regPath,
* long openMode, long option) method with REG_OPEN_READ_ONLY as a value for the open mode flag.
- * @}
* @endif
+ * @}
*/
result Construct(const Tizen::Base::String& regPath, bool createIfNotExist);
/**
- * @if OSPDEPREC
* @{
+ * @if OSPDEPREC
* Initializes this instance of %Registry with the specified parameters. @n
* This method loads a registry file in the read-only or the read-write mode.
*
* - %File corruption is detected.
* @exception E_INVALID_FORMAT The input registry file contains '0x00' in the middle of the file.
* @exception E_PARSING_FAILED The method has failed to parse the registry file.
- * @}
* @endif
+ * @}
*/
result Construct(const Tizen::Base::String& regPath, long openMode, long option);
*
* @since 2.1
* @return An error code
- * @param[in] appId The package ID
+ * @param[in] packageId The package ID
* @param[in] privilege A string of the specified privilege
* @exception E_SUCCESS The method is successful and the request is granted.
* @exception E_INVALID_ARG The specified @c privilege is invalid privilege string.
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/text/converting_all_text_data.htm">Converting All Text Data at Once</a>.
*
- * For more information on the supported encoding types, see <a href="../org.tizen.native.appprogramming/html/guide/text/text.htm>Encoding standards in Tizen</a>.
+ * For more information on the supported encoding types, see <a href="../org.tizen.native.appprogramming/html/guide/text/text.htm">Encoding standards in %Tizen</a>.
*
* The following example demonstrates how to use the %Encoding class.
*
* The supported encoding types are ASCII, GSM, UCS-2, UCS-2LE, UCS-2BE, UCS-4, UCS-4LE, UCS-4BE, UTF-8, UTF-16, UTF-16LE, UTF-16BE, @n
* UTF-32, UTF-32LE, UTF-32BE, ISO-8859-1~16 (except ISO-8859-12), Windows-874, Windows-1250 ~ Windows-1258, @n
* KSC5601, BIG5, GB2312, Shift-JIS and ISO-2022-jp. @n
- * For more information on the supported encoding types, see <a href="../org.tizen.native.appprogramming/html/guide/text/text.htm>Encoding standards in Tizen</a>.
+ * For more information on the supported encoding types, see <a href="../org.tizen.native.appprogramming/html/guide/text/text.htm">Encoding standards in %Tizen</a>.
* @see Tizen::Text::Encoding::GetAvailableEncodingsN()
*/
static Encoding* GetEncodingN(const Tizen::Base::String& encodingType);
#define _FRAMEWORK_H_
/**
* @namespace Tizen
- * @brief This namespace is the root namespace of the Tizen native framework.
+ * @brief This namespace is the root namespace of the %Tizen native framework.
*
* The %Tizen namespace is the top-level namespace that encompasses all other
- * C++ namespaces in Tizen.
+ * C++ namespaces in %Tizen.
*/
namespace Tizen
{
req = _AppControlManager::GetInstance()->__inAppManager.InsertItem(pItem);
}
}
- r = InvokeStartAppControl(*pLib, req, _provider, _opId, null, null, pDataList);
+ r = InvokeStartAppControl(*pLib, req, _provider, _opId, pUriData, pMimeType, pDataList);
if (pListener == null)
{
pFunc =
reinterpret_cast<result (*)(int, const String&, const String&, const String*, const String*, const IMap*)>(lib.GetProcAddress(L"StartAppControl"));
SysTryReturnResult(NID_APP, pFunc != null, E_OBJ_NOT_FOUND, "Entry \"StartAppControl\" not found for %ls", appId.GetPointer());
- return (*pFunc)(req, appId, oId, pUri, pMime, pMap);
+
+ const String* pActualUri = (pUri && !(pUri->IsEmpty())) ? pUri : null;
+ const String* pActualMime = (pMime && !(pMime->IsEmpty())) ? pMime : null;
+ return (*pFunc)(req, appId, oId, pActualUri, pActualMime, pMap);
}
static bool
{
char buffer[PATH_MAX];
- // path is "/opt/apps/[appid]/bin/[executable_name]"
+ // path is ".../[appid]/bin/[executable_name]"
memset(buffer, 0, PATH_MAX);
const char* pRet = realpath(appName, buffer);
const int HEARTBEAT_WAIT_COUNT = 3;
const wchar_t SERVICE_APPID[] = L"aospd00043.osp-app-service";
const char SELECTOR_RESPONSE_KEY[] = "__APP_SVC_START_INFO__";
+const wchar_t FILE_SCHEME_WITH_DELIMITER[] = L"file://";
#ifndef VCONFKEY_APPSERVICE_STATUS
#define VCONFKEY_APPSERVICE_STATUS "memory/appservice/status"
#endif
if (p)
{
uri = p;
+ if (uri[0] == L'/')
+ {
+ // SLP deals with the URI as plain /opt/.../a.jpg.
+ uri.Insert(FILE_SCHEME_WITH_DELIMITER, 0);
+ }
pUri = &uri;
SysLog(NID_APP, "Delivered uri is [%ls].", pUri->GetPointer());
const int MAX_APIVERSION = 8;
const int MAX_APPID = 10;
+const char PACKAGE_PATH_FORMAT[] = "/opt/usr/apps/0000000000/";
const char PACKAGE_PATH_FORMAT2[] = "/opt/apps/0000000000/";
-const char PATH_ROOT[] = "/opt/apps/";
+const char PATH_ROOT[] = "/opt/usr/apps/";
+const char PATH_ROOT2[] = "/opt/apps/";
const char APPINFO_FILE_PATH[] = "info/version.info";
const char COMPAT_FILE_PATH[] = "info/compat.info";
const char TYPE_FILE_PATH[] = "info/type.info";
FILE* pFile = NULL;
{
+ char appInfoPath[PATH_MAX] = {0, };
+#if 0
const int len = strlen(PACKAGE_PATH_FORMAT2);
- char appInfoPath[len + 1];
strncpy(appInfoPath, PACKAGE_PATH_FORMAT2, len);
appInfoPath[len] = '\0';
// due to possible dependency problem, FIoFile is not used
// app root path first
- strncpy(appInfoPath + strlen(PATH_ROOT), appId, MAX_APPID);
+ strncpy(appInfoPath + strlen(PATH_ROOT2), appId, MAX_APPID);
+#else
+ // [FIXME] temporary code for directory location migration
+ int len = strlen(PACKAGE_PATH_FORMAT2);
+ strncpy(appInfoPath, PACKAGE_PATH_FORMAT2, len);
+ appInfoPath[len] = '\0';
+
+ if (access(appInfoPath, R_OK) != 0)
+ {
+ len = strlen(PACKAGE_PATH_FORMAT);
+ strncpy(appInfoPath, PACKAGE_PATH_FORMAT, len);
+ appInfoPath[len] = '\0';
+
+ strncpy(appInfoPath + strlen(PATH_ROOT), appId, MAX_APPID);
+ }
+ else
+ {
+ strncpy(appInfoPath + strlen(PATH_ROOT2), appId, MAX_APPID);
+ }
+#endif
// app root directory file descriptor
__appRootDirFd = open(appInfoPath, O_RDONLY | O_CLOEXEC | O_DIRECTORY);
result
_AppResourceString::InitializeStringInfo(String& resourceFolder)
{
- char* pValue = null;
- int ret = runtime_info_get_value_string(RUNTIME_INFO_KEY_LANGUAGE, &pValue);
+ char* pVal = null;
+ int ret = runtime_info_get_value_string(RUNTIME_INFO_KEY_LANGUAGE, &pVal);
SysTryReturnResult(NID_APP, ret == 0, E_SYSTEM, "runtime_info_get_value_string returns %d.", ret);
- U_ICU_NAMESPACE::Locale icuLcl(pValue);
+ U_ICU_NAMESPACE::Locale icuLcl(pVal);
String language(icuLcl.getISO3Language());
String country(icuLcl.getCountry());
+ if (pVal)
+ {
+ free(pVal);
+ }
String resFilename;
result r = resFilename.Format(256 * 2 + 10, L"%ls-%ls.xml", language.GetPointer(), country.GetPointer());
pXmlNodeMap->Add(*pKey, *pValue);
pKey.release();
pValue.release();
+
+ if (pContent)
+ {
+ xmlFree(pContent);
+ }
+ }
+
+ if (pxmlValue)
+ {
+ xmlFree(pxmlValue);
+ pxmlValue = null;
}
}
{
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_PACKAGESETTING);
+ r = _AccessController::CheckUserPrivilege(_PRV_PACKAGESETTING, _PRV_PACKAGEMANAGER_SETTING);
SysTryReturn(NID_APP, r == E_SUCCESS, PACKAGE_TYPE_TPK, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
return __pPackageInfoImpl->GetType();
IList*
PackageInfo::GetPrivilegeListN(void) const
{
- //result r = _AccessController::CheckUserPrivilege(_PRV_PACKAGESETTING);
- //SysTryReturn(NID_APP, r == E_SUCCESS, PACKAGE_TYPE_TPK, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
-
return __pPackageInfoImpl->GetPrivilegeListN();
}
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO);
+ r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO, _PRV_PACKAGE_INFO);
SysTryReturnResult(NID_APP, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
r = __pPackageManagerImpl->AddEventListener(&listener);
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO);
+ r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO, _PRV_PACKAGE_INFO);
SysTryReturnResult(NID_APP, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
__pPackageManagerImpl->RemoveEventListener(&listener);
result r = E_SUCCESS;
PackageInfo* pPackageInfo = null;
- r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO);
+ r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO, _PRV_PACKAGE_INFO);
SysTryReturn(NID_APP, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
pPackageInfo = __pPackageManagerImpl->GetPackageInfoN(packageId);
result r = E_SUCCESS;
PackageAppInfo* pPackageAppInfo = null;
- r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO);
+ r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO, _PRV_PACKAGE_INFO);
SysTryReturn(NID_APP, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
pPackageAppInfo = __pPackageManagerImpl->GetPackageAppInfoN(appId);
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO);
+ r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO, _PRV_PACKAGE_INFO);
SysTryReturn(NID_APP, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
return __pPackageManagerImpl->GetPackageInfoListN();
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO);
+ r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO, _PRV_PACKAGE_INFO);
SysTryReturn(NID_APP, r == E_SUCCESS, false, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
return __pPackageManagerImpl->IsPackageInstalled(packageId);
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_PACKAGESETTING);
+ r = _AccessController::CheckUserPrivilege(_PRV_PACKAGESETTING, _PRV_PACKAGEMANAGER_SETTING);
SysTryReturnResult(NID_APP, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
return __pPackageManagerImpl->MoveToExternalStorage(packageId);
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_PACKAGESETTING);
+ r = _AccessController::CheckUserPrivilege(_PRV_PACKAGESETTING, _PRV_PACKAGEMANAGER_SETTING);
SysTryReturnResult(NID_APP, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
return __pPackageManagerImpl->MoveToInternalStorage(packageId);
{
SysAssertf(__pPackageManagerImpl != null, "Not yet constructed. GetInstance() should be called before use.");
- //result r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO);
- //SysTryReturn(NID_APP, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+ result r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEMANAGER_INFO);
+ SysTryReturn(NID_APP, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
return __pPackageManagerImpl->GetPackageInfoFromFileN(packagePath);
}
{
SysAssertf(__pPackageManagerImpl != null, "Not yet constructed. GetInstance() should be called before use.");
- //result r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO);
- //SysTryReturn(NID_APP, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+ result r = _AccessController::CheckUserPrivilege(_PRV_PACKAGE_INFO);
+ SysTryReturn(NID_APP, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
return __pPackageManagerImpl->GetPackageInfoListN(packageFilterMap);
}
{
SysAssertf(__pPackageManagerImpl != null, "Not yet constructed. GetInstance() should be called before use.");
- //result r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO);
- //SysTryReturn(NID_APP, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+ result r = _AccessController::CheckUserPrivilege(_PRV_PACKAGE_INFO);
+ SysTryReturn(NID_APP, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
return __pPackageManagerImpl->GetPackageAppInfoListN(packageAppFilterMap);
}
{
SysAssertf(__pPackageManagerImpl != null, "Not yet constructed. GetInstance() should be called before use.");
- //result r = _AccessController::CheckUserPrivilege(_PRV_PACKAGEINFO);
- //SysTryReturn(NID_APP, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+ result r = _AccessController::CheckUserPrivilege(_PRV_PACKAGE_INFO);
+ SysTryReturn(NID_APP, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
return __pPackageManagerImpl->GetPackageAppInfoListN(packageFilterMap, packageAppFilterMap);
}
{
for (int j = 0; j < __column; j++)
{
- __pMatrix[i][j] = pArray[i * __row + j];
+ __pMatrix[i][j] = pArray[i * __column + j];
}
}
}
{
for (int j = 0; j < __row; j++)
{
- __pMatrix[j][i] = pArray[i * __column + j];
+ __pMatrix[j][i] = pArray[i * __row + j];
}
}
}
{
for (int j = 0; j < __column; j++)
{
- __pMatrix[i][j] = pArray[i * __row + j];
+ __pMatrix[i][j] = pArray[i * __column + j];
}
}
}
{
for (int j = 0; j < __row; j++)
{
- __pMatrix[j][i] = pArray[i * __column + j];
+ __pMatrix[j][i] = pArray[i * __row + j];
}
}
}
{
for (int j = 0; j < __column; j++)
{
- __pMatrix[i][j] = pArray[i * __row + j];
+ __pMatrix[i][j] = pArray[i * __column + j];
}
}
}
{
for (int j = 0; j < __row; j++)
{
- __pMatrix[j][i] = pArray[i * __column + j];
+ __pMatrix[j][i] = pArray[i * __row + j];
}
}
}
{
for (int j = 0; j < __column; j++)
{
- __pMatrix[i][j] = pArray[i * __row + j];
+ __pMatrix[i][j] = pArray[i * __column + j];
}
}
}
{
for (int j = 0; j < __row; j++)
{
- __pMatrix[j][i] = pArray[i * __column + j];
+ __pMatrix[j][i] = pArray[i * __row + j];
}
}
}
{
for (int j = 0; j < __column; j++)
{
- __pMatrix[i][j] = pArray[i * __row + j];
+ __pMatrix[i][j] = pArray[i * __column + j];
}
}
}
{
for (int j = 0; j < __row; j++)
{
- __pMatrix[j][i] = pArray[i * __column + j];
+ __pMatrix[j][i] = pArray[i * __row + j];
}
}
}
{
for (int j = 0; j < __column; j++)
{
- __pMatrix[i][j] = pArray[i * __row + j];
+ __pMatrix[i][j] = pArray[i * __column + j];
}
}
}
{
for (int j = 0; j < __row; j++)
{
- __pMatrix[j][i] = pArray[i * __column + j];
+ __pMatrix[j][i] = pArray[i * __row + j];
}
}
}
pItem->size = pValue->GetLimit();
pItem->pObj = pValue;
- _DataItem* pOldItem = static_cast<_DataItem*>(__pDataRow->GetAt(columnIndex));
r = __pDataRow->SetAt(pItem.release(), columnIndex);
SysTryReturnResult(NID_IO, r == E_SUCCESS, E_OUT_OF_MEMORY,
"The memory is insufficient. Set failed");
- delete pOldItem;
if (nColumnType == DB_COLUMNTYPE_NULL)
- {
__pColumnTypeList->SetAt(new Integer(DB_COLUMNTYPE_BLOB), columnIndex);
- delete pColumnType;
- }
return r;
}
pItem->size = pString->GetLength();
pItem->pObj = pString.release();
- _DataItem* pOldItem = static_cast<_DataItem*>(__pDataRow->GetAt(columnIndex));
r = __pDataRow->SetAt(pItem.release(), columnIndex);
SysTryReturnResult(NID_IO, r == E_SUCCESS, E_OUT_OF_MEMORY,
"The memory is insufficient. Set failed");
- delete pOldItem;
if (nColumnType == DB_COLUMNTYPE_NULL)
- {
__pColumnTypeList->SetAt(new Integer(DB_COLUMNTYPE_TEXT), columnIndex);
- delete pColumnType;
- }
return r;
pItem->size = size;
pItem->doubleValue = value;
- _DataItem* pOldItem = static_cast<_DataItem*>(__pDataRow->GetAt(columnIndex));
r = __pDataRow->SetAt(pItem.release(), columnIndex);
SysTryReturnResult(NID_IO, r == E_SUCCESS, E_OUT_OF_MEMORY,
"The memory is insufficient. Set failed");
- delete pOldItem;
if (nColumnType == DB_COLUMNTYPE_NULL)
- {
__pColumnTypeList->SetAt(new Integer(DB_COLUMNTYPE_DOUBLE), columnIndex);
- delete pColumnType;
- }
return r;
pItem->size = size;
pItem->intValue = value;
- _DataItem* pOldItem = static_cast<_DataItem*>(__pDataRow->GetAt(columnIndex));
r = __pDataRow->SetAt(pItem.release(), columnIndex);
SysTryReturnResult(NID_IO, r == E_SUCCESS, E_OUT_OF_MEMORY,
"The memory is insufficient. Set failed");
- delete pOldItem;
if (nColumnType == DB_COLUMNTYPE_NULL)
- {
__pColumnTypeList->SetAt(new Integer(DB_COLUMNTYPE_INT), columnIndex);
- delete pColumnType;
- }
return r;
}
pItem->size = size;
pItem->int64Value = value;
- _DataItem* pOldItem = static_cast<_DataItem*>(__pDataRow->GetAt(columnIndex));
r = __pDataRow->SetAt(pItem.release(), columnIndex);
SysTryReturnResult(NID_IO, r == E_SUCCESS, E_OUT_OF_MEMORY,
"The memory is insufficient. Set failed");
- delete pOldItem;
if (nColumnType == DB_COLUMNTYPE_NULL)
- {
__pColumnTypeList->SetAt(new Integer(DB_COLUMNTYPE_INT64), columnIndex);
- delete pColumnType;
- }
return r;
}
pItem->size = value.GetLength();
pItem->pObj = pString.release();
- _DataItem* pOldItem = static_cast<_DataItem*>(__pDataRow->GetAt(columnIndex));
r = __pDataRow->SetAt(pItem.release(), columnIndex);
SysTryReturnResult(NID_IO, r == E_SUCCESS, E_OUT_OF_MEMORY,
"The memory is insufficient. Set failed");
- delete pOldItem;
if (nColumnType == DB_COLUMNTYPE_NULL)
- {
__pColumnTypeList->SetAt(new Integer(DB_COLUMNTYPE_TEXT), columnIndex);
- delete pColumnType;
- }
return r;
}
pItem->pObj = pBuffer;
}
- _DataItem* pOldItem = static_cast<_DataItem*>(__pDataRow->GetAt(i));
r = __pDataRow->SetAt(pItem.release(), i);
- delete pOldItem;
if (r != E_SUCCESS)
break;
}
__pCurrentRow(null),
__columnCount(0),
__rowCount(0),
- __currentRowIndex(-1)
+ __currentRowIndex(-1),
+ __dataSetDeleted(0)
{
}
_DataSetEnumeratorImpl::~_DataSetEnumeratorImpl(void)
{
-
+ if (__dataSetDeleted == 0)
+ {
+ __pEnumImplList->Remove(*this);
+ }
}
result
_DataSetEnumeratorImpl::MoveNext(void)
{
+ SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
+
if (__currentRowIndex +1 == __rowCount)
return E_OUT_OF_RANGE;
result
_DataSetEnumeratorImpl::MovePrevious(void)
{
+ SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
+
if (__currentRowIndex == 0)
return E_OUT_OF_RANGE;
result
_DataSetEnumeratorImpl::MoveFirst(void)
{
+ SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
+
__currentRowIndex = 0;
__pCurrentRow = static_cast<ArrayList*>(__pDataSet->GetAt(__currentRowIndex));
result
_DataSetEnumeratorImpl::MoveLast(void)
{
+ SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
+
__currentRowIndex = __rowCount -1;
__pCurrentRow = static_cast<ArrayList*>(__pDataSet->GetAt(__currentRowIndex));
result
_DataSetEnumeratorImpl::Reset(void)
{
+ SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
+
__currentRowIndex = -1;
__pCurrentRow = null;
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
result r = E_SUCCESS;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
ByteBuffer* pBuffer = null;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
ByteBuffer* pBuffer = null;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
String* pStr = null;
SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The instance is not constructed or the dataset is already been deleted.");
+ "The Object is not constructed.");
+ SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+ "The dataset is already been deleted.");
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Given column index is out of range.");
SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
int
_DataSetEnumeratorImpl::GetColumnCount(void) const
{
- SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
- "The Object is not constructed or the dataset is already been deleted.");
+ SysTryReturn(NID_IO, __pDataSet != null, -1, E_INVALID_STATE,
+ "[E_INVALID_STATE] The Object is not constructed.");
+ SysTryReturn(NID_IO, __dataSetDeleted != 1, -1, E_INVALID_STATE,
+ "[E_INVALID_STATE] The dataset is already been deleted.");
return __columnCount;
}
DbColumnType type = DB_COLUMNTYPE_UNDEFINED;
SysTryReturn(NID_IO, __pDataSet != null, DB_COLUMNTYPE_UNDEFINED, E_INVALID_STATE,
- "[E_INVALID_STATE] The instance is not constructed or the dataset is already been deleted.");
-
+ "[E_INVALID_STATE] The instance is not constructed.");
+ SysTryReturn(NID_IO, __dataSetDeleted != 1, DB_COLUMNTYPE_UNDEFINED, E_INVALID_STATE,
+ "[E_INVALID_STATE] The dataset is already been deleted.");
SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, DB_COLUMNTYPE_UNDEFINED, E_INVALID_ARG,
"[E_INVALID_ARG] Given column index is out of range.");
return DB_COLUMNTYPE_UNDEFINED;
}
- type = pDataItem->type;
- switch (type)
+ switch (pDataItem->type)
{
case DB_COLUMNTYPE_INT:
+ case DB_COLUMNTYPE_INT64:
case DB_COLUMNTYPE_DOUBLE:
case DB_COLUMNTYPE_TEXT:
case DB_COLUMNTYPE_BLOB:
_DataSetEnumeratorImpl::GetColumnName(int columnIndex) const
{
SysTryReturn(NID_IO, __pDataSet != null, null, E_INVALID_STATE,
- "[E_INVALID_STATE] The instance is not constructed or the dataset is already been deleted.");
-
+ "[E_INVALID_STATE] The instance is not constructed.");
+ SysTryReturn(NID_IO, __dataSetDeleted != 1, null, E_INVALID_STATE,
+ "[E_INVALID_STATE] The dataset is already been deleted.");
SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, null, E_INVALID_ARG,
"[E_INVALID_ARG] Given column index is out of range.");
{
int bytes = 0;
- SysTryReturn(NID_IO, __pDataSet != null, 0, E_INVALID_STATE,
- "[E_INVALID_STATE] The instance is not constructed or the dataset is already been deleted.");
-
- SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, 0, E_INVALID_ARG,
+ SysTryReturn(NID_IO, __pDataSet != null, -1, E_INVALID_STATE,
+ "[E_INVALID_STATE] The instance is not constructed.");
+ SysTryReturn(NID_IO, __dataSetDeleted != 1, -1, E_INVALID_STATE,
+ "[E_INVALID_STATE] The dataset is already been deleted.");
+ SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, -1, E_INVALID_ARG,
"[E_INVALID_ARG] Given column index is out of range.");
-
- SysTryReturn(NID_IO, __pCurrentRow != null, 0, E_INVALID_STATE,
+ SysTryReturn(NID_IO, __pCurrentRow != null, -1, E_INVALID_STATE,
"[E_INVALID_STATE] The method has tried to fetch the column data of a result set that is not activated.");
_DataItem* pDataItem = dynamic_cast < _DataItem* >(__pCurrentRow->GetAt(columnIndex));
namespace Tizen { namespace Io
{
_DataSetImpl::_DataSetImpl(void)
- :__rowCount(0)
+ :__rowCount(0),
+ __pDataSet(null),
+ __pColumnList(null),
+ __pColumnTypeList(null)
{
-
}
_DataSetImpl::~_DataSetImpl(void)
{
+ for (int i = 0; i< __enumImplList.GetCount() ; i++)
+ (static_cast<_DataSetEnumeratorImpl*>(__enumImplList.GetAt(i)))->__dataSetDeleted = 1;
+ delete __pDataSet;
+ delete __pColumnList;
+ delete __pColumnTypeList;
}
result
{
result r = E_SUCCESS;
+ __pDataSet = new (std::nothrow) LinkedList(SingleObjectDeleter);
+ SysTryReturnResult(NID_IO, __pDataSet != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
+ __pColumnList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ SysTryReturnResult(NID_IO, __pColumnList != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
+ __pColumnTypeList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ SysTryReturnResult(NID_IO, __pColumnTypeList != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
+
__columnCount = columnNames.GetCount();
- SysTryReturn(NID_IO, __columnCount > 0, E_INVALID_ARG, r, "[E_INVALID_ARG] column count is 0.");
+ SysTryReturnResult(NID_IO, __columnCount > 0, E_INVALID_ARG, "column count is 0.");
- r = __columnList.Construct(__columnCount);
+ r = __pColumnList->Construct(__columnCount);
SysTryReturn(NID_IO, r == E_SUCCESS, E_OUT_OF_MEMORY, r, "[E_OUT_OF_MEMORY] column list construct failed");
- r = __columnTypeList.Construct(__columnCount);
+ r = __pColumnTypeList->Construct(__columnCount);
SysTryReturn(NID_IO, r == E_SUCCESS, E_OUT_OF_MEMORY, r, "[E_OUT_OF_MEMORY] column type list construct failed");
for (int i = 0 ; i < __columnCount ; i++)
{
- r = __columnList.Add(new (std::nothrow) String(*(String*)(columnNames.GetAt(i))));
- SysTryReturn(NID_IO, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ r = __pColumnList->Add(new (std::nothrow) String(*(String*)(columnNames.GetAt(i))));
+ SysTryReturnResult(NID_IO, r == E_SUCCESS, E_OUT_OF_MEMORY, "The memory is insufficient.");
- r = __columnTypeList.Add(new (std::nothrow) Integer(DB_COLUMNTYPE_NULL));
- SysTryReturn(NID_IO, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ r = __pColumnTypeList->Add(new (std::nothrow) Integer(DB_COLUMNTYPE_NULL));
+ SysTryReturnResult(NID_IO, r == E_SUCCESS, E_OUT_OF_MEMORY, "The memory is insufficient.");
}
//SysLog(NID_IO, "column count is %d", __columnCount);
_DataSetImpl::CreateDataRowN(void)
{
result r;
- unique_ptr<ArrayList> pNewRowArrayList(new (std::nothrow) ArrayList);
+ unique_ptr<ArrayList> pNewRowArrayList(new (std::nothrow) ArrayList(SingleObjectDeleter));
SysTryReturn(NID_IO, pNewRowArrayList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
unique_ptr<DataRow> pDataRow(_DataRowImpl::CreateDataRowInstanceN(__columnCount, pNewRowArrayList.get()));
SysTryReturn(NID_IO, pDataRow != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- r = __dataSet.Add(pNewRowArrayList.release());
+ r = __pDataSet->Add(pNewRowArrayList.release());
SysTryReturn(NID_IO, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Add Row to DataSet is failed");
- _DataRowImpl::GetInstance(*pDataRow)->__pColumnTypeList = &__columnTypeList;
+ _DataRowImpl::GetInstance(*pDataRow)->__pColumnTypeList = __pColumnTypeList;
- __rowCount = __dataSet.GetCount();
+ __rowCount = __pDataSet->GetCount();
//SysLog(NID_IO, "row count is %d", __rowCount);
return pDataRow.release();
DataSetEnumerator*
_DataSetImpl::GetDataSetEnumeratorN(void)
{
+ result r;
+
unique_ptr<DataSetEnumerator> pDataSetEnum(_DataSetEnumeratorImpl::CreateDataSetEnumeratorInstanceN());
- _DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__pDataSet = &__dataSet;
- _DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__pColumnList = &__columnList;
+ _DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__pDataSet = __pDataSet;
+ _DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__pColumnList = __pColumnList;
_DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__columnCount = __columnCount;
_DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__rowCount = __rowCount;
//SysLog(NID_IO, "row count is %d, column count is %d", __rowCount, __columnCount);
+ r = __enumImplList.Add(_DataSetEnumeratorImpl::GetInstance(*pDataSetEnum));
+ SysTryReturn(NID_IO, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Add to LinkedList Falied");
+
+ _DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__pEnumImplList = &__enumImplList;
+
return pDataSetEnum.release();
}
_DataSetImpl::CloneN(void) const
{
result r;
- Integer* pColumnType = null;
unique_ptr< DataSet > pDataSet(new (std::nothrow) DataSet());
SysTryReturn(NID_IO, pDataSet != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- pDataSet->Construct(__columnList);
+ pDataSet->Construct(*__pColumnList);
for (int i = 0; i < __columnCount; i++)
{
- pColumnType = static_cast<Integer*>(_DataSetImpl::GetInstance(*pDataSet)->__columnTypeList.GetAt(i));
- r = _DataSetImpl::GetInstance(*pDataSet)->__columnTypeList.SetAt(new Integer(*(Integer*)__columnTypeList.GetAt(i)), i);
- delete pColumnType;
-
+ r = _DataSetImpl::GetInstance(*pDataSet)->__pColumnTypeList->SetAt(new Integer(*(Integer*)__pColumnTypeList->GetAt(i)), i);
SysTryReturn(NID_IO, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] ColumnTypeList Copy Falied");
}
for (int i = 0; i < __rowCount; i++)
{
DataRow* pNewRow = pDataSet->CreateDataRowN();
- r = _DataRowImpl::GetInstance(*pNewRow)->Clone((const ArrayList*)(__dataSet.GetAt(i)));
+ r = _DataRowImpl::GetInstance(*pNewRow)->Clone((const ArrayList*)(__pDataSet->GetAt(i)));
delete pNewRow;
SysTryReturn(NID_IO, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] DataRow Clone Falied");
for (int i = 0; i < __rowCount; i++)
{
- const ArrayList* pDataRowArrayList = static_cast<const ArrayList*>(__dataSet.GetAt(i));
+ const ArrayList* pDataRowArrayList = static_cast<const ArrayList*>(__pDataSet->GetAt(i));
hash += _DataRowImpl::GetHashCode(pDataRowArrayList);
}
Tizen::Base::Collection::ArrayList* __pCurrentRow;
int __columnCount;
-
int __rowCount;
-
int __currentRowIndex;
+ int __dataSetDeleted;
+ Tizen::Base::Collection::LinkedList* __pEnumImplList;
friend class _DataSetImpl;
}; // _DataSetEnumeratorImpl
_DataSetImpl& operator =(const _DataSetImpl& dataSetImpl);
- Tizen::Base::Collection::LinkedList __dataSet;
- Tizen::Base::Collection::ArrayList __columnList;
- Tizen::Base::Collection::ArrayList __columnTypeList;
+ Tizen::Base::Collection::LinkedList* __pDataSet;
+ Tizen::Base::Collection::ArrayList* __pColumnList;
+ Tizen::Base::Collection::ArrayList* __pColumnTypeList;
int __columnCount;
int __rowCount;
+
+ Tizen::Base::Collection::LinkedList __enumImplList;
}; // _DataSetImpl
}} // Tizen::Io
*/
// Includes
-#include <locale.h>
#include <memory>
#include <stdlib.h>
#include <unistd.h>
String
_LocaleData::GetOspString(const IcuUnicodeString& icuStr)
{
- setlocale(LC_ALL, "C");
int len = icuStr.length(); // get length
if (len) // if icuStr is not empty
{
char out[len * 3 + 1]; // Create buffer of thrice the icuStr length
int end = icuStr.extract(0, len, out);
out[end] = 0; // icuStr.extract() converts Unicode to UTF8
- setlocale(LC_ALL, "");
return String(out);
}
- setlocale(LC_ALL, "");
return String("");
}
result
_NumberFormatterImpl::Format(double number, String& str, _FieldPosition pos) const
{
+ /*TODO: ICU 4.8 did not replace "," by a locale. So, it returns NaN even if a number is not NaN.
+ We are setting and restoring a system locale to "C".
+ It should be removed if ICU version is up.*/
setlocale(LC_ALL, "C");
IcuUnicodeString icuStr;
IcuFieldPosition icuPos = _LocaleData::GetIcuFieldPosition(pos);
icuStr = __pIcuNumberFormatter->format(number, icuStr, icuPos);
+ setlocale(LC_ALL, "");
str = _LocaleData::GetOspString(icuStr);
return E_SUCCESS;
}