TizenRefApp-9740[Gallery] Add doxygen documentation to gallery/helpers.h file 91/158391/5 tizen_4.0
authorAlexander\ Kovalenko <al.kovalenko@samsung.com>
Tue, 31 Oct 2017 13:00:04 +0000 (15:00 +0200)
committerAlexander\ Kovalenko <al.kovalenko@samsung.com>
Tue, 7 Nov 2017 12:16:38 +0000 (14:16 +0200)
Change-Id: If5f8be0b5e5cc0ab854a5937add9fde1b63d95de

gallery/helpers.h

index d8d7c0096073399adf207ce4079823ea2efefa9c..7fda8005629f20f360cc823baae492af111ba77a 100644 (file)
@@ -23,42 +23,124 @@ namespace gallery { namespace util {
 
        // Tizen C API helpers //
 
+       /**
+        * @brief Calls provided Tizen C API getter function and checks execution
+        *        of that function
+        * @param[in] getter Getter function
+        * @param[out] result Result of getter function operation
+        * @param[inout] args Functional arguments passed into getter
+        * @return RES_OK on success, RES_FAIL on failure
+        */
        template <class GETTER, class V, class ...ARGS>
        ucl::Result get(GETTER &&getter, V &result, ARGS &&...args);
 
+       /**
+        * @brief Calls provided Tizen C API getter function and checks execution
+        *        of that function
+        * @param[in] getter Getter function
+        * @param[out] result Result of getter function operation
+        * @param[inout] args Functional arguments passed into getter
+        * @return RES_OK on success, RES_FAIL on failure
+        */
        template <class GETTER, class V, class ...ARGS>
        ucl::Result getNz(GETTER &&getter, V &result, ARGS &&...args);
 
+       /**
+        * @brief Calls function with set of arguments, result is translated to
+        *        ucl::Result
+        * @param[in] func Function
+        * @param[in] args Arguments
+        * @return Result code
+        */
        template <class FUNC, class ...ARGS>
        ucl::Result call(FUNC &&func, ARGS &&...args);
 
+       /**
+        * @brief Calls function with set of arguments, result is translated to
+        *        ucl::Result via another provided function
+        * @param[in] func Function
+        * @param[in] toResult Translator function
+        * @param[in] args Arguments
+        * @return Result code
+        */
        template <class FUNC, class TO_RESULT, class ...ARGS>
        ucl::Result callEx(FUNC &&func, TO_RESULT &&toResult, ARGS &&...args);
 
        // Misc helpers //
 
+       /**
+        * @brief Returns index of value in container. Utilizes std::find
+        * @param[in] collection Container
+        * @param[in] value Value
+        * @return Index of value
+        */
        template <class COLLECTION, class VALUE>
        int indexOf(const COLLECTION &collection, const VALUE &value);
 
        // File path helpers //
 
+       /**
+        * @brief Extracts file name from path
+        * @param[in] path File path
+        * @return File name
+        */
        std::string extractFileName(const std::string &path);
 
+       /**
+        * @brief Extracts file extension from file name
+        * @param[in] name File name
+        * @return File extension
+        */
        std::string extractFileExtension(const std::string &name);
 
+       /**
+        * @brief Sptlits path into directory path, file name and file
+        *        extension
+        * @param[in] path File path
+        * @param[out] directory Directory path
+        * @param[out] baseName File name
+        * @param[out] extension File extension
+        */
        void splitFilePath(const std::string &path, std::string &directory,
                        std::string &baseName, std::string &extension);
 
+       /**
+        * @brief Sptlits path into file name and file extension
+        * @param[in] path File path
+        * @param[out] baseName File name
+        * @param[out] extension File extension
+        */
        void splitFileName(const std::string &path,
                        std::string &baseName, std::string &extension);
 
+       /**
+        * @brief Makes unique file path
+        * @param[in] srcPath Source path
+        * @param[in] dstDir Destination directory
+        * @return File path
+        */
        std::string makeUniqueFilePath(const std::string &srcPath,
                        const std::string &dstDir);
 
        // String helpers //
 
+       /**
+        * @brief Checks if string begins with specific prefix
+        * @param[in] str String
+        * @param[in] prefix Prefix
+        * @param[in] caseSensitive Case sensitivity flag
+        * @return true if fully matches prefix, false otherwise
+        */
        bool beginsWith(const std::string &str, const std::string &prefix,
                        bool caseSensitive = true);
+
+       /**
+        * @brief Removes specific prefix
+        * @param[inout] str String
+        * @param[in] prefix Prefix
+        * @param[in] caseSensitive Case sensitivity flag
+        * @return true if prefix removed, false if prefix doesn't match
+        */
        bool removePrefix(std::string &str, const std::string &prefix,
                        bool caseSensitive = true);
 }}