15 #ifndef BORNAGAIN_MVVM_MODEL_MVVM_UTILS_FILEUTILS_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_UTILS_FILEUTILS_H
18 #include "mvvm/model_export.h"
27 MVVM_MODEL_EXPORT
bool exists(
const std::string& fileName);
30 MVVM_MODEL_EXPORT std::string
join(
const std::string& part1,
const std::string& part2);
37 MVVM_MODEL_EXPORT
bool remove(
const std::string& path);
40 MVVM_MODEL_EXPORT
void remove_all(
const std::string& path);
43 MVVM_MODEL_EXPORT std::string
base_name(
const std::string& path);
46 MVVM_MODEL_EXPORT std::vector<std::string>
FindFiles(
const std::string& dirname,
47 const std::string& ext);
50 MVVM_MODEL_EXPORT std::string
parent_path(
const std::string& path);
53 MVVM_MODEL_EXPORT
bool is_empty(
const std::string& path);
MVVM_MODEL_EXPORT std::string base_name(const std::string &path)
Provide the filename of a file path.
MVVM_MODEL_EXPORT std::vector< std::string > FindFiles(const std::string &dirname, const std::string &ext)
Returns list of files with given extention found in given directory.
MVVM_MODEL_EXPORT bool is_empty(const std::string &path)
Returns true if the file indicated by 'path' refers to empty file or directory.
MVVM_MODEL_EXPORT bool remove(const std::string &path)
Removes file or empty directory.
MVVM_MODEL_EXPORT void remove_all(const std::string &path)
Removes directory with all its content.
MVVM_MODEL_EXPORT std::string parent_path(const std::string &path)
Returns the path to the parent directory.
MVVM_MODEL_EXPORT std::string join(const std::string &part1, const std::string &part2)
Joins two path elements into the path.
MVVM_MODEL_EXPORT bool exists(const std::string &fileName)
Returns true if file exists.
MVVM_MODEL_EXPORT bool create_directory(const std::string &path)
Create directory, parent directory must exist.
materialitems.h Collection of materials to populate MaterialModel.