enh(Path): ensure directory path ends with separator (#4679)

This commit is contained in:
siren186
2024-09-12 15:58:12 +08:00
committed by GitHub
parent 2163c2044d
commit 94a693dff5
4 changed files with 97 additions and 2 deletions

View File

@@ -290,6 +290,22 @@ public:
/// this is the semicolon ';'. On OpenVMS systems, this is the
/// comma ','.
static std::string addDirectorySeparator(const std::string& path);
/// Adds a separator to the end of a string to create the correct syntax for a path.
/// If the source path already has a trailing separator, no separator will be added.
///
/// On Unix systems, this is the slash '/'. On Windows systems,
/// this is the backslash '\'. On OpenVMS systems, this is the
/// period '.'.
static std::string addDirectorySeparator(const std::string& path, Style style);
/// Adds a separator to the end of a string to create the correct syntax for a path.
/// If the source path already has a trailing separator, no separator will be added.
///
/// On Unix systems, this is the slash '/'. On Windows systems,
/// this is the backslash '\'. On OpenVMS systems, this is the
/// period '.'.
static std::string self();
/// Return path to the executable file, empty string if failed.
/// The path is absolute one.