16 #error no need to expose this header to Swig
20 #ifndef BORNAGAIN_BASE_UTILS_FILESYSTEMUTILS_H
21 #define BORNAGAIN_BASE_UTILS_FILESYSTEMUTILS_H
32 std::string
extension(
const std::string& path);
36 std::string
extensions(
const std::string& path);
48 std::string
jointPath(
const std::string& path1,
const std::string& path2);
51 std::string
filename(
const std::string& path);
55 std::string
stem(
const std::string& path);
59 std::string
stem_ext(
const std::string& path);
62 std::vector<std::string>
glob(
const std::string& dir,
const std::string& pattern);
Utility functions to deal with file system.
std::string extensions(const std::string &path)
Returns extension(s) of given filename.
std::wstring convert_utf8_to_utf16(const std::string &str)
Converts utf8 string represented by std::string to utf16 string represented by std::wstring.
std::string stem_ext(const std::string &path)
Returns filename without extension(s).
bool IsFileExists(const std::string &path)
Returns true if file with given name exists on disk.
std::string extension(const std::string &path)
Returns extension of given filename.
std::string jointPath(const std::string &path1, const std::string &path2)
Returns joint path name.
std::string filename(const std::string &path)
Returns path without directory part ("Foo/Bar/Doz.int.gz" -> "Doz.int.gz")
std::vector< std::string > glob(const std::string &dir, const std::string &pattern)
Returns file names that agree with a regex glob pattern.
std::string stem(const std::string &path)
Returns filename without (last) extension.
std::vector< std::string > filesInDirectory(const std::string &dir_name)
Returns filenames of files in directory.
bool createDirectories(const std::string &dir_name)
Creates directories in current directory for any element of dir_name which doesn't exist.
bool createDirectory(const std::string &dir_name)
Creates directory in current directory.