36#include "../mxlib.hpp"
52bool exists(
const std::string &path );
66std::string
pathStem(
const std::string &fname );
78std::string
parentPath(
const std::string &fname );
93template<
class verboseT=verbose::vvv>
95 const std::string &directory,
97 const std::string &prefix,
100 const std::string &substr,
103 const std::string &extension
109error_t getFileNames<verbose::o>( std::vector<std::string> &fileNames,
110 const std::string &directory,
111 const std::string &prefix,
112 const std::string &substr,
113 const std::string &extension
117error_t getFileNames<verbose::v>( std::vector<std::string> &fileNames,
118 const std::string &directory,
119 const std::string &prefix,
120 const std::string &substr,
121 const std::string &extension
125error_t getFileNames<verbose::vv>( std::vector<std::string> &fileNames,
126 const std::string &directory,
127 const std::string &prefix,
128 const std::string &substr,
129 const std::string &extension
133error_t getFileNames<verbose::vvv>( std::vector<std::string> &fileNames,
134 const std::string &directory,
135 const std::string &prefix,
136 const std::string &substr,
137 const std::string &extension
145 const std::string &prepend,
147 const std::string &append
157 const std::string &append
167 const std::string &prepend
185 const std::string &extension =
"",
187 const int startat = 0,
error_t
The mxlib error codes.
error_t getFileNames(std::vector< std::string > &fileNames, const std::string &directory, const std::string &prefix, const std::string &substr, const std::string &extension)
Get a list of file names from the specified directory, specifying a prefix, a substring to match,...
std::string fileNamePrepend(const std::string &fname, const std::string &prepend)
Prepend strings to a file name, leaving the directory and extension unaltered.
std::string getSequentialFilename(const std::string &basename, const std::string &extension="", const int startat=0, int ndigit=4)
Get the next file in a numbered sequence.
std::string fileNamePrependAppend(const std::string &fname, const std::string &prepend, const std::string &append)
Prepend and/or append strings to a file name, leaving the directory and extension unaltered.
std::string fileNameAppend(const std::string &fname, const std::string &append)
Append a string to a file name, leaving the directory and extension unaltered.
int createDirectories(const std::string &path)
Create a directory or directories.
std::string parentPath(const std::string &fname)
Get the parent path from a filename.
std::string pathStem(const std::string &fname)
Get the stem of the filename.
bool exists(const std::string &path)
Check if a path exists.
off_t fileSize(int fd)
Get the size in bytes of a file.
std::string pathFilename(const std::string &fname)
Get the base filename.