BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Functions | |
std::string | extension (const std::string &path) |
std::string | extensions (const std::string &path) |
bool | createDirectory (const std::string &dir_name) |
bool | createDirectories (const std::string &dir_name) |
std::vector< std::string > | filesInDirectory (const std::string &dir_name) |
std::string | jointPath (const std::string &spath1, const std::string &spath2) |
std::string | filename (const std::string &path) |
std::string | stem (const std::string &path) |
std::string | stem_ext (const std::string &path) |
std::vector< std::string > | glob (const std::string &dir, const std::string &pattern) |
std::wstring | convert_utf8_to_utf16 (const std::string &str) |
bool | IsFileExists (const std::string &str) |
Utility functions to deal with file system.
std::string FileSystemUtils::extension | ( | const std::string & | path | ) |
Returns extension of given filename.
"/home/user/filename.int" -> ".int", "/home/user/filename.int.gz" -> ".gz"
Definition at line 24 of file FileSystemUtils.cpp.
Referenced by DataFormatUtils::GetFileMainExtension(), DataFormatUtils::isBZipped(), and DataFormatUtils::isGZipped().
std::string FileSystemUtils::extensions | ( | const std::string & | path | ) |
Returns extension(s) of given filename.
"/home/user/filename.int" -> ".int", "/home/user/filename.int.gz" -> ".int.gz"
Definition at line 29 of file FileSystemUtils.cpp.
References filename().
bool FileSystemUtils::createDirectory | ( | const std::string & | dir_name | ) |
Creates directory in current directory.
Definition at line 36 of file FileSystemUtils.cpp.
References convert_utf8_to_utf16().
bool FileSystemUtils::createDirectories | ( | const std::string & | dir_name | ) |
Creates directories in current directory for any element of dir_name which doesn't exist.
Definition at line 46 of file FileSystemUtils.cpp.
References convert_utf8_to_utf16().
std::vector< std::string > FileSystemUtils::filesInDirectory | ( | const std::string & | dir_name | ) |
Returns filenames of files in directory.
Definition at line 56 of file FileSystemUtils.cpp.
Referenced by glob().
std::string FileSystemUtils::jointPath | ( | const std::string & | spath1, |
const std::string & | spath2 | ||
) |
std::string FileSystemUtils::filename | ( | const std::string & | path | ) |
Returns path without directory part ("Foo/Bar/Doz.int.gz" -> "Doz.int.gz")
Definition at line 83 of file FileSystemUtils.cpp.
Referenced by IHistogram::createFrom(), extensions(), IHistogram::load(), IHistogram::save(), and stem_ext().
std::string FileSystemUtils::stem | ( | const std::string & | path | ) |
Returns filename without extension.
"/home/user/filename.int" -> "filename", "/home/user/filename.int.gz" -> "filename.int"
Definition at line 97 of file FileSystemUtils.cpp.
std::string FileSystemUtils::stem_ext | ( | const std::string & | path | ) |
Returns filename without extension(s).
"/home/user/filename.int" -> "filename", "/home/user/filename.int.gz" -> "filename"
Definition at line 102 of file FileSystemUtils.cpp.
References filename().
std::vector< std::string > FileSystemUtils::glob | ( | const std::string & | dir, |
const std::string & | pattern | ||
) |
Returns file names that agree with a regex glob pattern.
Definition at line 88 of file FileSystemUtils.cpp.
References filesInDirectory().
std::wstring FileSystemUtils::convert_utf8_to_utf16 | ( | const std::string & | str | ) |
Converts utf8 string represented by std::string to utf16 string represented by std::wstring.
Definition at line 109 of file FileSystemUtils.cpp.
Referenced by createDirectories(), createDirectory(), OutputDataReader::getOutputData(), IsFileExists(), and OutputDataWriter::writeOutputData().
bool FileSystemUtils::IsFileExists | ( | const std::string & | str | ) |
Returns true if file with given name exists on disk.
Definition at line 115 of file FileSystemUtils.cpp.
References convert_utf8_to_utf16().
Referenced by IntensityDataIOFactory::readOutputData(), and IntensityDataIOFactory::readReflectometryData().