Enable build with iniparser v 3.1
[platform/framework/native/appfw.git] / inc / FIoMemoryMappedFile.h
index 30bcb64..857e0ee 100644 (file)
@@ -1,5 +1,4 @@
 //
-// Open Service Platform
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Apache License, Version 2.0 (the License);
@@ -40,9 +39,9 @@ namespace Tizen { namespace Io
  */
 enum MemoryMappedFileFlag
 {
-       MEMORY_MAPPED_FILE_FLAG_SHARED = 0x01,  /**< Changes are shared with other processes mapping the same file */
-       MEMORY_MAPPED_FILE_FLAG_PRIVATE = 0x02, /**< Changes are not visible to other processes mapping the same file */
-       MEMORY_MAPPED_FILE_FLAG_FIXED = 0x10    /**< This forces the system to use the specified mapping address exactly,
+       MEMORY_MAPPED_FILE_FLAG_SHARED = 0x01,  /**< The changes are shared with other processes mapping the same file */
+       MEMORY_MAPPED_FILE_FLAG_PRIVATE = 0x02, /**< The changes are not visible to other processes mapping the same file */
+       MEMORY_MAPPED_FILE_FLAG_FIXED = 0x10    /**< The system is forced to use the specified mapping address exactly,
                                                                                          which should be a multiple of the page size */
 };
 
@@ -61,13 +60,13 @@ enum MemoryMappedFileSyncFlag
 
 /**
  * @class      MemoryMappedFile
- * @brief      This class provides features mapping a file to virtual address space.
+ * @brief      This class provides methods for mapping a file to virtual address space.
  *
  * @since      2.0
  *
  * @final      This class is not intended for extension.
  *
- * The %MemoryMappedFile class provides features for using a memory mapped file,
+ * The %MemoryMappedFile class provides methods for using a memory mapped file,
  * which maps the data of a file to an application's virtual address space.
  *
  * @code
@@ -77,6 +76,7 @@ enum MemoryMappedFileSyncFlag
  * #include <FApp.h>
  *
  * using namespace Tizen::Base;
+ * using namespace Tizen::Base::Runtime;
  * using namespace Tizen::Base::Collection;
  * using namespace Tizen::Io;
  * using namespace Tizen::App;
@@ -84,6 +84,7 @@ enum MemoryMappedFileSyncFlag
  * result
  * MyApp::Execute(void)
  * {
+ *     File file;
  *     String filePath(App::GetInstance()->GetAppDataPath() + L”myFile.txt”);
  *     file.Construct(filePath, “w+);
  *
@@ -109,7 +110,8 @@ class _OSP_EXPORT_ MemoryMappedFile
 
 public:
        /**
-       * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
+       * The object is not fully constructed after this constructor is called. @n
+       * For full construction, the Construct() method must be called right after calling this constructor.
        *
        * @since        2.0
        */
@@ -123,7 +125,7 @@ public:
        ~MemoryMappedFile(void);
 
        /**
-       * Initializes this instance of %MemoryMappedFile with a specified file.
+       * Initializes this instance of %MemoryMappedFile with the specified file.
        *
        * @since                2.0
        *
@@ -132,7 +134,7 @@ public:
        * @exception    E_SUCCESS                       The method is successful.
        * @exception    E_INVALID_ARG           The specified @c file is not opened for reading. @n
        *                                                                       The opening mode should not be "w" or "a".
-       * @remarks              The specified @c file should be initialized by the Io::File::Construct() method.
+       * @remarks              The specified @c file should be initialized by the Tizen::Io::File::Construct() method.
        * @see                  Tizen::Io::File
        */
        result Construct(const File& file);
@@ -143,8 +145,8 @@ public:
        * @since                2.0
        *
        * @return               The mapped address space, @n
-       *                               else @c null pointer if this method fails
-       * @param[in]    address                                 A starting address of the mapping @n
+       *                               else @c null pointer if it fails
+       * @param[in]    address                                 The starting address of the mapping @n
        *                                                                               If the specified @c address is @c null, the system chooses the address.
        *                                                                               It should be a multiple of the page size.
        * @param[in]    length                                  The length of the mapping space
@@ -156,27 +158,28 @@ public:
        * @param[in]    offset                                  The start offset of the specified file @n
        *                                                                               It should be a multiple of the page size.
        * @exception    E_SUCCESS                               The method is successful.
-       * @exception    E_ILLEGAL_ACCESS                The specified @c flag is MEMORY_MAPPED_FILE_FLAG_SHARED and the specified @c
-       *                                                                               protection is MEMORY_PROTECTION_MODE_WRITE, but the specified file of
+       * @exception    E_ILLEGAL_ACCESS                The specified @c flag is ::MEMORY_MAPPED_FILE_FLAG_SHARED and the specified @c
+       *                                                                               protection is Base::Runtime::MEMORY_PROTECTION_MODE_WRITE, but the specified file of
        *                                                                               MemoryMappedFile::Construct() is not opened with read-write mode.
-       * @exception    E_INVALID_ARG                   Either of the following conditions has occurred: @n
-       *                                                                               - The specified @c address or @c offset is not aligned on a page boundary. @n
-       *                                                                               - The specified @c length is not positive. @n
-       *                                                                               - The specified @c protection, @c flag, or @c offset @ is invalid. @n
-       *                                                                               - The specified @c flag cannot contain both MEMORY_MAPPED_FILE_FLAG_PRIVATE and
-       *                                                                                 MEMORY_MAPPED_FILE_FLAG_SHARED.
+       * @exception    E_INVALID_ARG                   Either of the following conditions has occurred:
+       *                                                                               - The specified @c address or @c offset is not aligned on a page boundary.
+       *                                                                               - The specified @c length is not positive.
+       *                                                                               - The specified @c protection, @c flag, or @c offset is invalid.
+       *                                                                               - The specified @c flag cannot contain both ::MEMORY_MAPPED_FILE_FLAG_PRIVATE and
+       *                                                                               ::MEMORY_MAPPED_FILE_FLAG_SHARED.
        * @exception    E_MAX_EXCEEDED                  The number of mapped regions has exceeded the maximum limit.
        * @exception    E_OBJECT_LOCKED                 The mapped file has been locked.
-       * @exception    E_OUT_OF_MEMORY                 Either of the following conditions has occurred: @n
-       *                                                                               - The memory is insufficient. @n
-       *                                                                               - The specified @c flag is MEMORY_MAPPED_FILE_FLAG_FIXED, and the specified address
-       *                                                                                 range exceeds that allowed for the address space of a current process.
-       * @exception    E_IO                                    Either of the following conditions has occurred: @n
-       *                                                                               - The underlying file system does not support memory mapping. @n
-       *                                                                               - The specified @c protection is MEMORY_PROTECTION_MODE_EXEC, but the mapped file
-       *                                                                                 exists on a file system that has been mounted no-exec.
-       * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
-       *                               When this instance is destructed, all mappings are deleted automatically.
+       * @exception    E_OUT_OF_MEMORY                 Either of the following conditions has occurred:
+       *                                                                               - The memory is insufficient.
+       *                                                                               - The specified @c flag is ::MEMORY_MAPPED_FILE_FLAG_FIXED, and the specified @c address
+       *                                                                               range exceeds that allowed for the address space of a current process.
+       * @exception    E_IO                                    Either of the following conditions has occurred:
+       *                                                                               - The underlying file system does not support memory mapping.
+       *                                                                               - The specified @c protection is Base::Runtime::MEMORY_PROTECTION_MODE_EXEC, but the mapped file
+       *                                                                               exists on a file system that has been mounted no-exec.
+       * @remarks
+       *                               - The specific error code can be accessed using the GetLastResult() method.
+       *                               - When this instance is destructed, all mappings are deleted automatically.
        * @see                  Tizen::Base::Runtime::MemoryManager
        */
        void* Map(void* address, long long length, unsigned long protection, unsigned long flag, long long offset);
@@ -184,7 +187,7 @@ public:
        /**
        * Deletes the mapping of the specified address space. @n
        * Further references to the addresses within the range result in generation of an invalid memory access. @n
-       * This method flushes all changes of a shared mapping to the correlated file on the permanent storage.
+       * This method flushes all the changes of a shared mapping to the correlated file on the permanent storage.
        *
        * @since                2.0
        *
@@ -192,16 +195,16 @@ public:
        * @param[in]    address                         The memory mapping address to unmap
        * @param[in]    length                          The length of the mapping space
        * @exception    E_SUCCESS                       The method is successful.
-       * @exception    E_INVALID_ARG           Either of the following conditions has occurred: @n
-       *                                                                       - The specified @c address is not aligned on a page boundary. @n
-       *                                                                       - The specified @c length is not positive. @n
-       *                                                                       - The specified address range is out of the valid address space of a current process.
+       * @exception    E_INVALID_ARG           Either of the following conditions has occurred:
+       *                                                                       - The specified @c address is not aligned on a page boundary.
+       *                                                                       - The specified @c length is not positive.
+       *                                                                       - The specified address range is out of the valid address space of the current process.
        * @remarks              When this instance is destructed, all mappings of the instance are not unmapped automatically.
        */
        result Unmap(void* address, long long length);
 
        /**
-       * Flushes all changes of an address range to the correlated file on the permanent storage.
+       * Flushes all the changes of an address range to the correlated file on the permanent storage.
        *
        * @since                2.0
        *
@@ -210,13 +213,13 @@ public:
        * @param[in]    length                          The length of the mapping space
        * @param[in]    syncFlag                        The synchronization option
        * @exception    E_SUCCESS                       The method is successful.
-       * @exception    E_INVALID_ARG           Either of the following conditions has occurred: @n
-       *                                                                       - The specified @c address is not aligned on a page boundary. @n
-       *                                                                       - The specified @c length is not positive. @n
-       *                                                                       - The specified @c syncFlag is invalid. @n
+       * @exception    E_INVALID_ARG           Either of the following conditions has occurred:
+       *                                                                       - The specified @c address is not aligned on a page boundary.
+       *                                                                       - The specified @c length is not positive.
+       *                                                                       - The specified @c syncFlag is invalid.
        *                                                                       - The specified @c address space is not mapped.
-       * @exception    E_IO                            Either of the following conditions has occurred: @n
-       *                                                                       - An unexpected device failure has occurred as the media ejected suddenly. @n
+       * @exception    E_IO                            Either of the following conditions has occurred:
+       *                                                                       - An unexpected device failure has occurred as the media ejected suddenly.
        *                                                                       - %File corruption is detected.
        * @remarks              The specific page size of a current file system is provided by Tizen::System::SystemInfo class with
        *                               "StorageInfo" key.