15 #ifndef BORNAGAIN_BASE_UTILS_FILESYSTEMUTILS_H
16 #define BORNAGAIN_BASE_UTILS_FILESYSTEMUTILS_H
28 std::string
extension(
const std::string& path);
32 std::string
extensions(
const std::string& path);
44 std::string
jointPath(
const std::string& spath1,
const std::string& spath2);
47 std::string
filename(
const std::string& path);
51 std::string
stem(
const std::string& path);
55 std::string
stem_ext(
const std::string& path);
58 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).
std::string extension(const std::string &path)
Returns extension of given filename.
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.
bool IsFileExists(const std::string &str)
Returns true if file with given name exists on disk.
std::string stem(const std::string &path)
Returns filename without extension.
std::vector< std::string > filesInDirectory(const std::string &dir_name)
Returns filenames of files in directory.
std::string jointPath(const std::string &spath1, const std::string &spath2)
Returns joint path name.
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.