Merge "Remove build warning and add temporary getter of privacy name" into tizen_2.1
authorLEE, Jaewon <jaewon613.lee@samsung.com>
Wed, 10 Apr 2013 05:45:25 +0000 (14:45 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 10 Apr 2013 05:45:25 +0000 (14:45 +0900)
37 files changed:
inc/FApp.h
inc/FAppApp.h
inc/FAppAppManager.h
inc/FAppIAppControlResponseListener.h
inc/FBase.h
inc/FBaseColIteratorT.h
inc/FBaseColPairIteratorT.h
inc/FBaseColRandomIteratorT.h
inc/FBaseColStlConverter.h
inc/FBaseLog.h
inc/FBaseRtEventDrivenThread.h
inc/FBaseSysLog.h
inc/FBaseTimeSpan.h
inc/FBaseUtilFileUnzipper.h
inc/FIoDatabase.h
inc/FIoFile.h
inc/FIoRegistry.h
inc/FSecAccessController.h
inc/FTextEncoding.h
inc/Framework.h
src/app/FApp_AppControlImpl.cpp [changed mode: 0644->0755]
src/app/FApp_AppEntry.cpp
src/app/FApp_AppImpl.cpp
src/app/FApp_AppInfo.cpp
src/app/FApp_AppResourceString.cpp
src/app/package/FAppPkgPackageInfo.cpp
src/app/package/FAppPkgPackageManager.cpp
src/base/FBaseDoubleMatrix.cpp
src/base/FBaseFloatMatrix.cpp
src/base/FBaseIntMatrix.cpp
src/io/FIo_DataRowImpl.cpp
src/io/FIo_DataSetEnumeratorImpl.cpp
src/io/FIo_DataSetImpl.cpp [changed mode: 0644->0755]
src/io/inc/FIo_DataSetEnumeratorImpl.h [changed mode: 0644->0755]
src/io/inc/FIo_DataSetImpl.h [changed mode: 0644->0755]
src/locales/FLcl_LocaleData.cpp
src/locales/FLcl_NumberFormatterImpl.cpp

index d88fdb7..1a4034d 100755 (executable)
@@ -64,7 +64,7 @@
  *                             @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>.
index ac83a45..792660b 100755 (executable)
@@ -42,7 +42,7 @@ class AppResource;
 
 /**
  * @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
  *
index 95432f5..92f8ad5 100755 (executable)
@@ -96,7 +96,7 @@ public:
         * @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.
         *
index 566a04e..001e724 100755 (executable)
@@ -65,7 +65,7 @@ public:
         * @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
index ba85af3..7c2334c 100644 (file)
@@ -76,7 +76,7 @@
  *  @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>.
index 0b35d66..9a0e3aa 100644 (file)
@@ -41,7 +41,7 @@ namespace Tizen { namespace Base { namespace Collection
  *
  * @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.
  */
 
index 8d957c1..72a298d 100644 (file)
@@ -43,7 +43,7 @@ namespace Tizen { namespace Base { namespace Collection
  *
  * @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.
  */
 
index 6024733..90baf13 100644 (file)
@@ -40,7 +40,7 @@ namespace Tizen { namespace Base { namespace Collection
  *
  * @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.
  */
 
@@ -55,7 +55,7 @@ public:
         * @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()
         */
index 20dc372..24a5ba3 100644 (file)
@@ -44,11 +44,11 @@ class IMultiMap;
 
 /**
  *     @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
index 9c06eeb..6426fa4 100644 (file)
@@ -757,11 +757,11 @@ extern "C" {
  */
 #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
 /**
index c44a1ff..d45dd7f 100644 (file)
@@ -41,7 +41,7 @@ namespace Tizen { namespace Base { namespace Runtime
  * @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>.
  *
index 75f3c35..17e74e8 100644 (file)
@@ -597,11 +597,11 @@ case condition: \
 // 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
 
index 841df25..76db340 100644 (file)
@@ -37,7 +37,7 @@ namespace Tizen { namespace Base
  *     @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>.
  *
index c71b239..a34bd43 100644 (file)
@@ -113,7 +113,7 @@ public:
         *                                                                              - 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.
index bc7c416..394d80b 100644 (file)
@@ -291,8 +291,8 @@ public:
        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.
        *
@@ -333,14 +333,14 @@ public:
        * @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.
        *
@@ -377,8 +377,8 @@ public:
        *                                                                               - 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);
 
index e7361e9..57b9b2e 100644 (file)
@@ -216,8 +216,8 @@ public:
        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.
        *
@@ -265,8 +265,8 @@ public:
        * @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);
 
index 284b98d..6dba5f3 100644 (file)
@@ -163,8 +163,8 @@ public:
        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.
        *
@@ -202,14 +202,14 @@ public:
        * @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.
        *
@@ -250,8 +250,8 @@ public:
        *                                                                               - %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);
 
index 79477f3..901ef7b 100644 (file)
@@ -81,7 +81,7 @@ public:
     *
     * @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.
index 8654e27..c3fd881 100644 (file)
@@ -48,7 +48,7 @@ namespace Tizen { namespace Text
  *
  * 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.
  *
@@ -509,7 +509,7 @@ public:
         *                      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);
index fd2c4ae..ef2efcb 100644 (file)
 #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
 {
old mode 100644 (file)
new mode 100755 (executable)
index dfeb082..eb6139a
@@ -628,7 +628,7 @@ _AppControlImpl::StartNative(const String* pUriData, const String* pMimeType, co
                        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)
        {
@@ -693,7 +693,10 @@ _AppControlImpl::InvokeStartAppControl(_LibraryImpl& lib, int req, const String&
        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
index 338c5be..2453678 100644 (file)
@@ -146,7 +146,7 @@ GetAppIdAppExecutableNameFromPathNew(const char appName[], char* appId, char* ex
 {
        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);
index a6179bf..d942872 100644 (file)
@@ -68,6 +68,7 @@ namespace
 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
@@ -711,6 +712,11 @@ _AppImpl::OnAppControlRequestReceived(const _AppArg& arg, RequestId reqId)
        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());
index 69c3740..892a4f8 100644 (file)
@@ -79,8 +79,10 @@ namespace Tizen { namespace App
 
 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";
@@ -147,15 +149,35 @@ _AppInfo::Construct(const char* appId, const char* exeName, int argc, char* argv
        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);
index 26cb559..ad6bab3 100644 (file)
@@ -162,13 +162,17 @@ CATCH:
 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());
@@ -262,6 +266,17 @@ _AppResourceString::InitializeStringInfo(String& resourceFolder)
                                pXmlNodeMap->Add(*pKey, *pValue);
                                pKey.release();
                                pValue.release();
+
+                               if (pContent)
+                               {
+                                       xmlFree(pContent);
+                               }
+                       }
+
+                       if (pxmlValue)
+                       {
+                               xmlFree(pxmlValue);
+                               pxmlValue = null;
                        }
 
                }
index bf2dfdc..63e3243 100755 (executable)
@@ -153,7 +153,7 @@ PackageInfo::GetType(void) const
 {
        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();
@@ -162,9 +162,6 @@ PackageInfo::GetType(void) const
 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();
 }
 
index f762709..2b41a69 100755 (executable)
@@ -59,7 +59,7 @@ PackageManager::AddPackageInstallationEventListener(IPackageInstallationEventLis
 
        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);
@@ -75,7 +75,7 @@ PackageManager::RemovePackageInstallationEventListener(IPackageInstallationEvent
 
        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);
@@ -92,7 +92,7 @@ PackageManager::GetPackageInfoN(const PackageId& packageId) const
        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);
@@ -108,7 +108,7 @@ PackageManager::GetPackageAppInfoN(const AppId& appId) const
        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);
@@ -123,7 +123,7 @@ PackageManager::GetPackageInfoListN(void) const
 
        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();
@@ -136,7 +136,7 @@ PackageManager::IsPackageInstalled(const PackageId& packageId) const
 
        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);
@@ -165,7 +165,7 @@ PackageManager::MoveToExternalStorage(const PackageId& 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);
@@ -178,7 +178,7 @@ PackageManager::MoveToInternalStorage(const PackageId& 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);
@@ -189,8 +189,8 @@ PackageManager::GetPackageInfoFromFileN(const String& packagePath) const
 {
        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);
 }
@@ -200,8 +200,8 @@ PackageManager::GetPackageInfoListN(const IMap& packageFilterMap) const
 {
        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);
 }
@@ -211,8 +211,8 @@ PackageManager::GetPackageAppInfoListN(const IMap& packageAppFilterMap) const
 {
        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);
 }
@@ -222,8 +222,8 @@ PackageManager::GetPackageAppInfoListN(const IMap& packageFilterMap, const IMap&
 {
        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);
 }
index 1e03362..df65b25 100644 (file)
@@ -73,7 +73,7 @@ DoubleMatrix::DoubleMatrix(int rowCount, int columnCount, const double* pArray,
                        {
                                for (int j = 0; j < __column; j++)
                                {
-                                       __pMatrix[i][j] = pArray[i * __row + j];
+                                       __pMatrix[i][j] = pArray[i * __column + j];
                                }
                        }
                }
@@ -83,7 +83,7 @@ DoubleMatrix::DoubleMatrix(int rowCount, int columnCount, const double* pArray,
                        {
                                for (int j = 0; j < __row; j++)
                                {
-                                       __pMatrix[j][i] = pArray[i * __column + j];
+                                       __pMatrix[j][i] = pArray[i * __row + j];
                                }
                        }
                }
@@ -813,7 +813,7 @@ DoubleMatrix::SetValue(const double* pArray, bool rowMajor)
                {
                        for (int j = 0; j < __column; j++)
                        {
-                               __pMatrix[i][j] = pArray[i * __row + j];
+                               __pMatrix[i][j] = pArray[i * __column + j];
                        }
                }
        }
@@ -823,7 +823,7 @@ DoubleMatrix::SetValue(const double* pArray, bool rowMajor)
                {
                        for (int j = 0; j < __row; j++)
                        {
-                               __pMatrix[j][i] = pArray[i * __column + j];
+                               __pMatrix[j][i] = pArray[i * __row + j];
                        }
                }
        }
index 0ba1c1c..c9f99e8 100644 (file)
@@ -73,7 +73,7 @@ FloatMatrix::FloatMatrix(int rowCount, int columnCount, const float* pArray, boo
                        {
                                for (int j = 0; j < __column; j++)
                                {
-                                       __pMatrix[i][j] = pArray[i * __row + j];
+                                       __pMatrix[i][j] = pArray[i * __column + j];
                                }
                        }
                }
@@ -83,7 +83,7 @@ FloatMatrix::FloatMatrix(int rowCount, int columnCount, const float* pArray, boo
                        {
                                for (int j = 0; j < __row; j++)
                                {
-                                       __pMatrix[j][i] = pArray[i * __column + j];
+                                       __pMatrix[j][i] = pArray[i * __row + j];
                                }
                        }
                }
@@ -812,7 +812,7 @@ FloatMatrix::SetValue(const float* pArray, bool rowMajor)
                {
                        for (int j = 0; j < __column; j++)
                        {
-                               __pMatrix[i][j] = pArray[i * __row + j];
+                               __pMatrix[i][j] = pArray[i * __column + j];
                        }
                }
        }
@@ -822,7 +822,7 @@ FloatMatrix::SetValue(const float* pArray, bool rowMajor)
                {
                        for (int j = 0; j < __row; j++)
                        {
-                               __pMatrix[j][i] = pArray[i * __column + j];
+                               __pMatrix[j][i] = pArray[i * __row + j];
                        }
                }
        }
index 681f957..22a9b64 100644 (file)
@@ -73,7 +73,7 @@ IntMatrix::IntMatrix(int rowCount, int columnCount, const int* pArray, bool rowM
                        {
                                for (int j = 0; j < __column; j++)
                                {
-                                       __pMatrix[i][j] = pArray[i * __row + j];
+                                       __pMatrix[i][j] = pArray[i * __column + j];
                                }
                        }
                }
@@ -83,7 +83,7 @@ IntMatrix::IntMatrix(int rowCount, int columnCount, const int* pArray, bool rowM
                        {
                                for (int j = 0; j < __row; j++)
                                {
-                                       __pMatrix[j][i] = pArray[i * __column + j];
+                                       __pMatrix[j][i] = pArray[i * __row + j];
                                }
                        }
                }
@@ -811,7 +811,7 @@ IntMatrix::SetValue(const int* pArray, bool rowMajor)
                {
                        for (int j = 0; j < __column; j++)
                        {
-                               __pMatrix[i][j] = pArray[i * __row + j];
+                               __pMatrix[i][j] = pArray[i * __column + j];
                        }
                }
        }
@@ -821,7 +821,7 @@ IntMatrix::SetValue(const int* pArray, bool rowMajor)
                {
                        for (int j = 0; j < __row; j++)
                        {
-                               __pMatrix[j][i] = pArray[i * __column + j];
+                               __pMatrix[j][i] = pArray[i * __row + j];
                        }
                }
        }
index 2bfaa6b..19b0e99 100755 (executable)
@@ -114,17 +114,12 @@ _DataRowImpl::SetBlobAt(int columnIndex, Tizen::Base::ByteBuffer* pValue)
        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;
 }
@@ -156,17 +151,12 @@ _DataRowImpl::SetDateTimeAt(int columnIndex, const Tizen::Base::DateTime& value)
        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;
 
@@ -196,17 +186,12 @@ _DataRowImpl::SetDoubleAt(int columnIndex, double value)
        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;
 
@@ -236,17 +221,12 @@ _DataRowImpl::SetIntAt(int columnIndex, int value)
        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;
 }
@@ -275,17 +255,12 @@ _DataRowImpl::SetInt64At(int columnIndex, long long value)
        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;
 }
@@ -314,17 +289,12 @@ _DataRowImpl::SetStringAt(int columnIndex, const Tizen::Base::String& value)
        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;
 }
@@ -372,9 +342,7 @@ _DataRowImpl::Clone(const ArrayList* pOthersRowArrayList) const
                        pItem->pObj = pBuffer;
                }
 
-               _DataItem* pOldItem = static_cast<_DataItem*>(__pDataRow->GetAt(i));
                r = __pDataRow->SetAt(pItem.release(), i);
-               delete pOldItem;
                if (r != E_SUCCESS)
                        break;
        }
index b3e5d8f..40320e5 100755 (executable)
@@ -57,19 +57,28 @@ _DataSetEnumeratorImpl::_DataSetEnumeratorImpl(void)
        __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;
 
@@ -85,6 +94,11 @@ _DataSetEnumeratorImpl::MoveNext(void)
 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;
 
@@ -100,6 +114,11 @@ _DataSetEnumeratorImpl::MovePrevious(void)
 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));
 
@@ -112,6 +131,11 @@ _DataSetEnumeratorImpl::MoveFirst(void)
 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));
 
@@ -124,6 +148,11 @@ _DataSetEnumeratorImpl::MoveLast(void)
 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;
 
@@ -136,7 +165,9 @@ _DataSetEnumeratorImpl::GetIntAt(int columnIndex, int& value) const
        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,
@@ -166,7 +197,9 @@ _DataSetEnumeratorImpl::GetInt64At(int columnIndex, long long& value) const
        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,
@@ -196,7 +229,9 @@ _DataSetEnumeratorImpl::GetDoubleAt(int columnIndex, double& value) const
        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,
@@ -226,7 +261,9 @@ _DataSetEnumeratorImpl::GetStringAt(int columnIndex, String& value) const
        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,
@@ -256,7 +293,9 @@ _DataSetEnumeratorImpl::GetBlobAt(int columnIndex, ByteBuffer& value) const
        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,
@@ -290,7 +329,9 @@ _DataSetEnumeratorImpl::GetBlobAt(int columnIndex, void* buffer, int size) const
        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,
@@ -329,7 +370,9 @@ _DataSetEnumeratorImpl::GetDateTimeAt(int columnIndex, DateTime& value) const
        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,
@@ -357,8 +400,10 @@ CATCH:
 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;
 }
@@ -369,8 +414,9 @@ _DataSetEnumeratorImpl::GetColumnType(int columnIndex) const
        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.");
 
@@ -383,10 +429,10 @@ _DataSetEnumeratorImpl::GetColumnType(int columnIndex) const
                        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:
@@ -407,8 +453,9 @@ String
 _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.");
 
@@ -429,13 +476,13 @@ _DataSetEnumeratorImpl::GetColumnSize(int columnIndex) const
 {
        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));
old mode 100644 (file)
new mode 100755 (executable)
index 5f5c250..1e64390
@@ -37,14 +37,21 @@ using namespace Tizen::Base::Collection;
 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
@@ -52,21 +59,28 @@ _DataSetImpl::Construct(const IList& columnNames)
 {
        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);
 
@@ -77,18 +91,18 @@ DataRow*
 _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();
@@ -98,15 +112,22 @@ _DataSetImpl::CreateDataRowN(void)
 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();
 }
 
@@ -114,26 +135,22 @@ DataSet*
 _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");
@@ -161,7 +178,7 @@ _DataSetImpl::GetHashCode(void) const
 
        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);
        }
 
old mode 100644 (file)
new mode 100755 (executable)
index 9586c4a..85f1264
@@ -162,11 +162,11 @@ private:
        Tizen::Base::Collection::ArrayList* __pCurrentRow;
 
        int __columnCount;
-
        int __rowCount;
-
        int __currentRowIndex;
 
+       int __dataSetDeleted;
+       Tizen::Base::Collection::LinkedList* __pEnumImplList;
        friend class _DataSetImpl;
 
 }; // _DataSetEnumeratorImpl
old mode 100644 (file)
new mode 100755 (executable)
index fa1a3a6..541cafd
@@ -67,12 +67,14 @@ private:
 
        _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
index 8c249f8..91f1861 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 // Includes
-#include <locale.h>
 #include <memory>
 #include <stdlib.h>
 #include <unistd.h>
@@ -87,17 +86,14 @@ _LocaleData::GetIcuString(const String& ospStr)
 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("");
 }
 
index 661899f..a1cb821 100644 (file)
@@ -132,10 +132,14 @@ _NumberFormatterImpl::Format(long number, String& str, _FieldPosition pos) const
 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;
 }