From: Alexander\ Kovalenko Date: Tue, 31 Oct 2017 13:00:04 +0000 (+0200) Subject: TizenRefApp-9740[Gallery] Add doxygen documentation to gallery/helpers.h file X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_4.0;p=profile%2Fwearable%2Fapps%2Fnative%2Fgallery.git TizenRefApp-9740[Gallery] Add doxygen documentation to gallery/helpers.h file Change-Id: If5f8be0b5e5cc0ab854a5937add9fde1b63d95de --- diff --git a/gallery/helpers.h b/gallery/helpers.h index d8d7c00..7fda800 100644 --- a/gallery/helpers.h +++ b/gallery/helpers.h @@ -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 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 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 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 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 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); }}