mc_rtc  2.14.0
path.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2024 CNRS-UM LIRMM, CNRS-AIST JRL
3  */
4 
5 #pragma once
6 
7 #ifdef MC_RTC_HAS_ROS_SUPPORT
8 # ifdef MC_RTC_ROS_IS_ROS2
9 # include <ament_index_cpp/get_package_share_directory.hpp>
10 # else
11 # include <ros/package.h>
12 # endif
13 #endif
14 
15 #include <mc_rtc/utils_api.h>
16 
17 #include <filesystem>
18 #include <string>
19 
20 namespace fs = std::filesystem;
21 
22 namespace mc_rtc
23 {
24 
29 MC_RTC_UTILS_DLLAPI std::string temp_directory_path(const std::string & suffix = "");
30 
39 MC_RTC_UTILS_DLLAPI std::string user_config_directory_path(const std::string & suffix = "");
40 
51 MC_RTC_UTILS_DLLAPI std::string local_share_directory(const std::string & suffix = "");
52 
63 MC_RTC_UTILS_DLLAPI std::string filename(const fs::path & path, bool keepExtension = false);
64 
81 MC_RTC_UTILS_DLLAPI fs::path convertURI(const std::string & uri, [[maybe_unused]] std::string_view default_dir = "");
82 
93 MC_RTC_UTILS_DLLAPI std::string make_temporary_path(const std::string & prefix);
94 
95 } // namespace mc_rtc
Definition: Contact.h:88
MC_RTC_UTILS_DLLAPI std::string user_config_directory_path(const std::string &suffix="")
MC_RTC_UTILS_DLLAPI fs::path convertURI(const std::string &uri, [[maybe_unused]] std::string_view default_dir="")
MC_RTC_UTILS_DLLAPI std::string temp_directory_path(const std::string &suffix="")
MC_RTC_UTILS_DLLAPI std::string local_share_directory(const std::string &suffix="")
MC_RTC_UTILS_DLLAPI std::string make_temporary_path(const std::string &prefix)
Creates a unique temporary directory path with the given prefix.
MC_RTC_UTILS_DLLAPI std::string filename(const fs::path &path, bool keepExtension=false)
#define MC_RTC_UTILS_DLLAPI
Definition: utils_api.h:50