// 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);
}}