36 #include "../mxlib.hpp"
59 std::string
pathStem(
const std::string & fname);
71 std::string
parentPath(
const std::string & fname);
77 std::vector<std::string>
getFileNames(
const std::string & directory,
78 const std::string & prefix,
79 const std::string & substr,
80 const std::string & extension
88 std::vector<std::string>
getFileNames(
const std::string & directory,
89 const std::string & extension
97 std::vector<std::string>
getFileNames(
const std::string & directory );
105 const std::string & prepend,
106 const std::string & append
114 const std::string & append
122 const std::string & prepend
138 const std::string & extension =
"",
139 const int startat = 0,
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.
off_t fileSize(FILE *f)
Get the size in bytes of a file pointed to by a FILE pointer.
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.
std::vector< std::string > getFileNames(const std::string &directory)
Get a list of file names from the specified directory.
std::string pathFilename(const std::string &fname)
Get the base filename.