BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
FileSystemUtils.h File Reference

Description

Defines namespace FileSystemUtils.

Homepage:\n http://www.bornagainproject.org
License:\n GNU General Public License v3 or higher (see COPYING)
Authors
Scientific Computing Group at MLZ (see CITATION, AUTHORS)

Definition in file FileSystemUtils.h.

Include dependency graph for FileSystemUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 BaseUtils
 
 BaseUtils::Filesystem
 Utility functions to deal with file system.
 

Macros

#define BORNAGAIN_BASE_UTIL_FILESYSTEMUTILS_H
 

Functions

std::wstring BaseUtils::Filesystem::convert_utf8_to_utf16 (const std::string &str)
 Converts utf8 string represented by std::string to utf16 string represented by std::wstring. More...
 
bool BaseUtils::Filesystem::createDirectories (const std::string &dir_name)
 Creates directories in current directory for any element of dir_name which doesn't exist. More...
 
bool BaseUtils::Filesystem::createDirectory (const std::string &dir_name)
 Creates directory in current directory. More...
 
std::string BaseUtils::Filesystem::extension (const std::string &path)
 Returns extension of given filename. "/home/user/filename.int" -> ".int", "/home/user/filename.int.gz" -> ".gz". More...
 
std::string BaseUtils::Filesystem::extensions (const std::string &path)
 Returns extension(s) of given filename. "/home/user/filename.int" -> ".int", "/home/user/filename.int.gz" -> ".int.gz". More...
 
std::string BaseUtils::Filesystem::filename (const std::string &path)
 Returns path without directory part ("Foo/Bar/Doz.int.gz" -> "Doz.int.gz") More...
 
std::vector< std::string > BaseUtils::Filesystem::filesInDirectory (const std::string &dir_name)
 Returns filenames of files in directory. More...
 
std::vector< std::string > BaseUtils::Filesystem::glob (const std::string &dir, const std::string &pattern)
 Returns file names that agree with a regex glob pattern. More...
 
bool BaseUtils::Filesystem::hasExtension (const std::string &path, const std::string &ref_extension)
 Returns true if extension of path, converted to lower case, matches given reference extension. More...
 
bool BaseUtils::Filesystem::IsFileExists (const std::string &path)
 Returns true if file with given name exists on disk. More...
 
std::string BaseUtils::Filesystem::jointPath (const std::string &path1, const std::string &path2)
 Returns joint path name. Argument path1 may be empty, argument path2 not. More...
 
std::string BaseUtils::Filesystem::stem (const std::string &path)
 Returns filename without (last) extension. "/home/user/filename.int" -> "filename", "/home/user/filename.int.gz" -> "filename.int". More...
 
std::string BaseUtils::Filesystem::stem_ext (const std::string &path)
 Returns filename without extension(s). "/home/user/filename.int" -> "filename", "/home/user/filename.int.gz" -> "filename". More...
 

Macro Definition Documentation

◆ BORNAGAIN_BASE_UTIL_FILESYSTEMUTILS_H

#define BORNAGAIN_BASE_UTIL_FILESYSTEMUTILS_H

Definition at line 21 of file FileSystemUtils.h.