Choreonoid  1.8
FileUtil.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_UTIL_FILE_UTIL_H
7 #define CNOID_UTIL_FILE_UTIL_H
8 
9 #include <cnoid/stdx/filesystem>
10 #include <string>
11 #include "exportdecl.h"
12 
13 namespace cnoid {
14 
15 extern CNOID_EXPORT const char* DLL_PREFIX;
16 extern CNOID_EXPORT const char* DLL_SUFFIX;
17 extern CNOID_EXPORT const char* DLL_EXTENSION;
18 extern CNOID_EXPORT const char* EXEC_SUFFIX;
19 extern CNOID_EXPORT const char* EXEC_EXTENSION;
20 extern CNOID_EXPORT const char* PATH_DELIMITER;
21 
22 
23 [[deprecated("Use filesystem::lexically_normal(path).")]]
24 CNOID_EXPORT stdx::filesystem::path getCompactPath(const stdx::filesystem::path& path);
25 
26 [[deprecated("Use filesystem::lexically_normal(path).")]]
27 CNOID_EXPORT void makePathCompact(stdx::filesystem::path& io_path);
28 
29 
30 CNOID_EXPORT int findSubDirectory(
31  const stdx::filesystem::path& directory,
32  const stdx::filesystem::path& path,
33  stdx::filesystem::path& out_subdirectory);
34 
35 CNOID_EXPORT bool findRelativePath(
36  const stdx::filesystem::path& from,
37  const stdx::filesystem::path& to,
38  stdx::filesystem::path& out_relativePath);
39 
40 
44 [[deprecated("Use path.extension().string(). Note that the dot character is added to the beginning of the string.")]]
45 CNOID_EXPORT std::string getExtension(const stdx::filesystem::path& path);
46 
47 [[deprecated("Use path.generic_string().")]]
48 CNOID_EXPORT std::string getGenericPathString(const stdx::filesystem::path& path);
49 
50 [[deprecated("Use path.isAbsolute().")]]
51 CNOID_EXPORT bool checkAbsolute(const stdx::filesystem::path& path);
52 
53 [[deprecated("Use filesystem::absolute(path).")]]
54 CNOID_EXPORT stdx::filesystem::path getAbsolutePath(const stdx::filesystem::path& path);
55 
56 [[deprecated("Use filesystem::absolute(path).string().")]]
57 CNOID_EXPORT std::string getAbsolutePathString(const stdx::filesystem::path& path);
58 
59 [[deprecated("Use path.filename().string().")]]
60 CNOID_EXPORT std::string getFilename(const stdx::filesystem::path& path);
61 
62 [[deprecated("Make a filesystem::path object and use filename().string().")]]
63 CNOID_EXPORT std::string getFilename(const std::string& pathString);
64 
65 [[deprecated("Use path.stem().string().")]]
66 CNOID_EXPORT std::string getBasename(const stdx::filesystem::path& path);
67 
68 [[deprecated("Use path.string().")]]
69 CNOID_EXPORT std::string getPathString(const stdx::filesystem::path& path);
70 
71 [[deprecated("Use path.make_preferred().string().")]]
72 CNOID_EXPORT std::string getNativePathString(const stdx::filesystem::path& path);
73 
74 [[deprecated("Use the original string value passed as an argument.")]]
75 CNOID_EXPORT std::string toActualPathName(const std::string& pathName);
76 
77 }
78 
79 #endif
cnoid::DLL_PREFIX
const char * DLL_PREFIX
Definition: FileUtil.cpp:29
cnoid::findRelativePath
bool findRelativePath(const filesystem::path &from_, const filesystem::path &to, filesystem::path &out_relativePath)
Definition: FileUtil.cpp:97
cnoid::toActualPathName
std::string toActualPathName(const std::string &path)
Definition: FileUtil.cpp:195
cnoid::getExtension
std::string getExtension(const stdx::filesystem::path &path)
Definition: FileUtil.cpp:135
cnoid::checkAbsolute
bool checkAbsolute(const stdx::filesystem::path &path)
Definition: FileUtil.cpp:153
cnoid::EXEC_SUFFIX
const char * EXEC_SUFFIX
Definition: FileUtil.cpp:32
cnoid::getFilename
std::string getFilename(const stdx::filesystem::path &path)
Definition: FileUtil.cpp:168
cnoid::DLL_SUFFIX
const char * DLL_SUFFIX
Definition: FileUtil.cpp:30
cnoid::makePathCompact
void makePathCompact(filesystem::path &io_path)
Definition: FileUtil.cpp:55
cnoid::getPathString
std::string getPathString(const stdx::filesystem::path &path)
Definition: FileUtil.cpp:184
cnoid::getAbsolutePathString
std::string getAbsolutePathString(const stdx::filesystem::path &path)
Definition: FileUtil.cpp:163
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::getBasename
std::string getBasename(const stdx::filesystem::path &path)
Definition: FileUtil.cpp:179
cnoid::getNativePathString
std::string getNativePathString(const stdx::filesystem::path &path)
Definition: FileUtil.cpp:189
cnoid::getCompactPath
filesystem::path getCompactPath(const filesystem::path &path)
Definition: FileUtil.cpp:38
cnoid::DLL_EXTENSION
const char * DLL_EXTENSION
Definition: FileUtil.cpp:31
cnoid::EXEC_EXTENSION
const char * EXEC_EXTENSION
Definition: FileUtil.cpp:33
cnoid::PATH_DELIMITER
const char * PATH_DELIMITER
Definition: FileUtil.cpp:34
cnoid::findSubDirectory
int findSubDirectory(const filesystem::path &directory, const filesystem::path &path, filesystem::path &out_subdirectory)
Definition: FileUtil.cpp:65
cnoid::getAbsolutePath
stdx::filesystem::path getAbsolutePath(const stdx::filesystem::path &path)
Definition: FileUtil.cpp:158
cnoid::getGenericPathString
std::string getGenericPathString(const stdx::filesystem::path &path)
Definition: FileUtil.cpp:148