Add Io examples
authorSunwook Bae <sunwook45.bae@samsung.com>
Thu, 18 Apr 2013 00:30:37 +0000 (09:30 +0900)
committerSunwook Bae <sunwook45.bae@samsung.com>
Thu, 18 Apr 2013 00:30:37 +0000 (09:30 +0900)
Change-Id: Ib8db4845deacba6a351950e9778b9aa37367ceb5
Signed-off-by: Sunwook Bae <sunwook45.bae@samsung.com>
inc/FAppMapDataControl.h
inc/FAppSqlDataControl.h
inc/FIoFileEventManager.h
inc/FIoMemoryMappedFile.h
inc/FIoMmcStorageManager.h
inc/FIoRemoteMessagePort.h

index a840b03..988203b 100755 (executable)
@@ -53,8 +53,49 @@ class IMapDataControlResponseListener;
  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/app/data_controls.htm">Data Controls</a>.
  *
  * @see        Tizen::App::AppManager
+ *
+ * @code
+ *
+ * #include <FBase.h>
+ * #include <FApp.h>
+ *
+ * using namespace Tizen::Base;
+ * using namespace Tizen::App;
+ *
+ * class MyMapDataControlResponseListener:
+ *     : public Tizen::App::IMapDataControlResponseListener
+ * {
+ * public:
+ *     void OnMapDataControlGetValueResponseReceived(RequestId reqId, const String& providerId, const String& dataId, IList& resultValueList, bool providerResult, const String* pErrorMsg)
+ *     {
+ *             int count = resultValueList.GetCount();
+ *             for (int i = 0; i < count; i++)
+ *             {
+ *                     String pPerson = static_cast< String* >(resultValueList.GetAt(i));
+ *                     AppLog("%dth person: %ls", i, pPerson->GetPointer());
+ *             }
+ *     }
+ * };
+ *
+ * void
+ * MyClass::Execute(void)
+ * {
+ *             String providerId(L"http://tizen.org/datacontrol/provider/example");
+ *             MapDataControl* pDc = AppManager::GetMapDataControlN(providerId);
+ *
+ *             MyMapDataControlResponseListener* pResponseListener = new MyMapDataControlResponseListener();
+ *
+ *             pDc->SetMapDataControlResponseListener(pResponseListener);
+ *
+ *             String dataId(L"test");
+ *             String person(L"person");
+ *             RequestId reqId;
+ *
+ *             pDc->GetValue(dataId, person, reqId);
+ * }
+ *
+ * @endcode
  */
-
 class _OSP_EXPORT_ MapDataControl
        : public Tizen::Base::Object
 {
index 9c3d38e..baee6a8 100755 (executable)
@@ -59,6 +59,54 @@ class ISqlDataControlResponseListener;
  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/app/data_controls.htm">Data Controls</a>.
  *
  * @see        Tizen::App::AppManager
+ *
+ * @code
+ *
+ * #include <FBase.h>
+ * #include <FIo.h>
+ *
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Io;
+ *
+ * class MySqlDataControlResponseListener:
+ *     : public Tizen::App::ISqlDataControlResponseListener
+ * {
+ * public:
+ *     void OnSqlDataControlInsertResponseReceived(RequestId reqId, const String& providerId, const String& dataId, long long insertRowId, bool providerResult, const String* pErrorMsg)
+ *     {
+ *             AppLog("Row Id = %d", insertRowId);
+ *     }
+ * };
+ *
+ * void
+ * MyClass::Execute(void)
+ * {
+ *             String providerId(L"http://tizen.org/datacontrol/provider/example");
+ *             SqlDataControl* pDc = AppManager::GetSqlDataControlN(providerId);
+ *
+ *             MySqlDataControlResponseListener* pResponseListener = new MySqlDataControlResponseListener();
+ *
+ *             pDc->SetSqlDataControlResponseListener(pResponseListener);
+ *
+ *             String dataId(L"test");
+ *             String person(L"person");
+ *             String number(L"number");
+ *             RequestId reqId;
+ *
+ *             ArrayList columnList(SingleObjectDeleter);
+ *             columnList.Construct();
+ *
+ *             columnList.Add(person);
+ *             columnList.Add(number);
+ *
+ *             String where(L"group = 'friend'");
+ *             String order(L"person ASC");
+ *
+ *             pDc->Select(dataId, &columnList, &where, &order, reqId);
+ * }
+ *
+ * @endcode
+
  */
 
 class _OSP_EXPORT_ SqlDataControl
index c07e6cb..6e30ef6 100644 (file)
@@ -79,6 +79,43 @@ static const unsigned long FILE_EVENT_TYPE_ALL = FILE_EVENT_TYPE_ACCESS | FILE_E
  * @final      This class is not intended for extension.
  *
  * The %FileEventManager class can be used to monitor individual files or directories. When a directory is monitored, this class will send an event for the directory or file itself, and for sub-files or sub-directories inside the observed directory.
+ *
+ * @code
+ *
+ * #include <FBase.h>
+ * #include <FIo.h>
+ * #include <FApp.h>
+ *
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Io;
+ * using namespace Tizen::App;
+ *
+ * class MyFileEventListener
+ * : public Tizen::Io::IFileEventListener
+ * {
+ * public:
+ *     void OnFileEventOccured(const unsigned long events, const Tizen::Base::String &path, const unsigned int eventId)
+ *     {
+ *             if (events & FILE_EVENT_TYPE_DELETE)
+ *             {
+ *                     AppLog(“File path (%ls) is deleted.”, path.GetPointer());
+ *             }
+ *     }
+ * };
+ *
+ * void
+ * MyClass::Initialize(void)
+ * {
+ *     MyFileEventListener* pMyFileEventListener = new MyFileEventListener();
+ *
+ *     FileEventManager* pFileEventMgr = new FileEventManager();
+ *     pFileEventMgr->Construct(*pMyFileEventListener);
+ *
+ *     String filePath(App::GetInstance()->GetAppDataPath() + L”myFile.txt”);
+ *     pFileEventMgr->AppPath(filePath, FILE_EVENT_TYPE_DELETE);
+ * }
+ *
+ * @endcode
  */
 class _OSP_EXPORT_ FileEventManager
        : public Tizen::Base::Object
index c60f6d6..30bcb64 100644 (file)
@@ -69,6 +69,39 @@ enum MemoryMappedFileSyncFlag
  *
  * The %MemoryMappedFile class provides features for using a memory mapped file,
  * which maps the data of a file to an application's virtual address space.
+ *
+ * @code
+ *
+ * #include <FBase.h>
+ * #include <FIo.h>
+ * #include <FApp.h>
+ *
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Base::Collection;
+ * using namespace Tizen::Io;
+ * using namespace Tizen::App;
+ *
+ * result
+ * MyApp::Execute(void)
+ * {
+ *     String filePath(App::GetInstance()->GetAppDataPath() + L”myFile.txt”);
+ *     file.Construct(filePath, “w+);
+ *
+ *     String testMsg(L”MemoryMappedFileTest”);
+ *     file.Write(testMsg);
+ *     file.Flush();
+ *
+ *     long long mapLength = 4096;
+ *     MemoryMappedFile mapFile;
+ *     mapFile.Construct(file);
+ *     void* pMappedAddr = mapFile.Map(null, mapLength, MEMORY_PROTECTION_MODE_READ | MEMORY_PROTECTION_MODE_WRITE, MEMORY_MAPPED_FILE_FLAG_SHARED, 0);
+ *
+ *     char* pBuffer = new char[testMsg.GetLength() + 1];
+ *     memcpy(pBuffer, pMappedAddr, testMsg.GetLength());
+ *
+ * }
+ *
+ * @endcode
  */
 class _OSP_EXPORT_ MemoryMappedFile
        : public Tizen::Base::Object
index b5182d6..f062738 100644 (file)
@@ -34,18 +34,63 @@ namespace Tizen { namespace Io
 {
 
 /**
-* @class       MmcStorageManager
-* @brief       This class provides methods to mount, unmount, and format external MMC.
-*
-* @since       2.0
-*
-* @final       This class is not intended for extension.
-*
-* The %MmcStorageManager class provides methods to mount, unmount, and format external MMC.
-*
-* @see IMmcStorageMountListener
-* @see IMmcStorageFormatListener
-*/
+ * @class      MmcStorageManager
+ * @brief      This class provides methods to mount, unmount, and format external MMC.
+ *
+ * @since      2.0
+ *
+ * @final      This class is not intended for extension.
+ *
+ * The %MmcStorageManager class provides methods to mount, unmount, and format external MMC.
+ *
+ * @see IMmcStorageMountListener
+ * @see IMmcStorageFormatListener
+ *
+ * @code
+ *
+ * #include <FBase.h>
+ * #include <FIo.h>
+ *
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Io;
+ *
+ * class MyMmcStorageMountListener
+ * : public Tizen::Io::IMmcStorageMountListener
+ * {
+ * public:
+ *     void OnMmcStorageMounted (result r)
+ *     {
+ *             if (!IsFailed(r))
+ *             {
+ *                     AppLog(“External MMC is mounted”);
+ *             }
+ *     }
+ *
+ *     void OnMmcStorageUnmounted (result r)
+ *     {
+ *             if (!IsFailed(r))
+ *             {
+ *                 AppLog(“External MMC is unmounted”);
+ *             }
+ *     }
+ * };
+ *
+ * void
+ * MyClass::Execute(void)
+ * {
+ *             MyMmcStorageMountListener* pMyMmcStorageMountListener = new MyMmcStorageMountListener();
+ *
+ *             MmcStorageManager* pMmcStorageMgr = new MmcStorageManager();
+ *
+ *             pMmcStorageMgr->AddMmcStorageMountListener(*pMyMmcStorageMountListener);
+ *
+ *             pMmcStorageMgr->Mount();
+ *
+ *             pMmcStorageMgr->Unmount();
+ * }
+ *
+ * @endcode
+ */
 class _OSP_EXPORT_ MmcStorageManager
            : public Tizen::Base::Object
 {
index 6ac2304..8096273 100644 (file)
@@ -90,7 +90,7 @@ class LocalMessagePort;
 *
 *      delete pMessage;
 * }
-
+*
 * void
 * MyAppClass::GetOnlineFriends(void)
 * {