X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=NativeLauncher%2Finc%2Futils.h;h=38c636187a06c27b0d14c283a713853800be8a83;hb=refs%2Fheads%2Ftizen;hp=c7910e253b2b3e32b303df1f2cf3d62ee65031b2;hpb=23c891d9f19cd800c2ab4b18be3f6fcb4c5dca17;p=platform%2Fcore%2Fdotnet%2Flauncher.git diff --git a/NativeLauncher/inc/utils.h b/NativeLauncher/inc/utils.h index c7910e2..6dd5467 100644 --- a/NativeLauncher/inc/utils.h +++ b/NativeLauncher/inc/utils.h @@ -17,6 +17,7 @@ #ifndef __UTILS_H__ #define __UTILS_H__ +#include #include #include #include @@ -25,6 +26,8 @@ #include +#include + #ifndef PATH_SEPARATOR #define PATH_SEPARATOR '/' #endif @@ -44,6 +47,10 @@ enum FSFlag : int { FS_PRESERVE_OWNERSHIP_AND_PERMISSIONS = (1 << 3) }; +#ifndef PR_TASK_PERF_USER_TRACE +#define PR_TASK_PERF_USER_TRACE 666 +#endif + /** * @brief concat path with PATH_SEPARATOR * @param[in] destination path @@ -121,6 +128,28 @@ std::string changeExtension(const std::string& path, const std::string& from, co bool isReadOnlyArea(const std::string& path); /** + * @brief check the package is 'readonly' or not + * @param[in] package ID + * @return bool package readonly value + */ +bool isReadOnlyPkg(const std::string& pkgId); + +/** + * @brief get db path of tac + * @param[in] tac readonly flag + * @param[in] db file name + * @return tac db path + */ +std::string tacDBPath(bool isReadonly, const std::string& dbName); + +/** + * @brief get library path of tlc + * @param[in] tlac readonly flag + * @return tlc library path + */ +std::string tlcLBPath(bool isReadonly); + +/** * @brief split path with ":" delimiter and put that in the vector * @param[in] source path * @param[out] string vector @@ -152,10 +181,9 @@ bool isDirectory(const std::string& path); /** * @brief check the file is managed assembly or not. * @param[in] file path - * @return return true when the file is managed assembly. - * otherwise return false including native image case. - */ -bool isManagedAssembly(const std::string& filePath); + * @return return true when the file is managed assembly even if it includes a native image. + */ +bool isManagedAssembly(const std::string& fileName); /** * @brief check the file is native image or not. @@ -289,15 +317,60 @@ int pkgmgrGetPkgInfo(const std::string& pkgId, pkgmgrinfo_pkginfo_h* handle); int pkgmgrGetAppInfo(const std::string& appId, pkgmgrinfo_appinfo_h* handle); /** - * @brief Executes the metadata filter query for all the installed packages. + * @brief Executes the metadata filter query for appinfo. * This function is a wrapper of pkgmgrinfo_appinfo_metadata_filter_foreach() to handle multi-user case * @param[in] metadata filter handle * @param[in] callback function * @param[in] user data * @return 0 if success, otherwise -1 */ -int pkgmgrMDFilterForeach(pkgmgrinfo_appinfo_metadata_filter_h handle, +int pkgmgrAppMDFilterForeach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data); +/** + * @brief Executes the metadata filter query for pkginfo. + * This function is a wrapper of pkgmgrinfo_pkginfo_metadata_filter_foreach() + * @param[in] metadata filter handle + * @param[in] callback function + * @param[in] user data + * @return 0 if success, otherwise -1 + */ +int pkgmgrPkgMDFilterForeach(pkgmgrinfo_pkginfo_metadata_filter_h handle, + pkgmgrinfo_pkg_list_cb app_cb, + void *user_data); + +/** + * @brief Prints HW Clock log + * @param[in] format `printf`-like format string + * @param[in] ... `printf`-like variadic list of arguments corresponding to the format string + */ +void printHWClockLog(const char* format, ...); + +/** + * @brief Return NCDB startup hook + * @return NCDB startup hook + */ +const char* getNCDBStartupHook(); + +/** + * @brief Check is NCDB startup hook provided in DOTNET_STARTUP_HOOKS env + * @return `true` if provided, otherwise `false` + */ +bool isNCDBStartupHookProvided(); + +/** + * @brief get paths where the resource dll is located in RPK package + * @param[in] root path + * @return std::string colon-separated string of rpk target paths + */ +std::string getResourcePaths(const std::string& rootPath); + +/** + * @brief check the package is rpk type + * @param[in] pkgId package ID + * @return return true when package is rpk type + */ +bool isRPK(const std::string& pkgId); + #endif /* __UTILS_H__ */