13 #ifndef FFA_FILE_PATH_H
14 #define FFA_FILE_PATH_H
24 size_t checkName (
char* thePath,
size_t length);
25 std::string&
checkName (std::string& thePath);
26 std::string&
unixStyle (std::string& thePath);
27 std::string
unixStyle (
const std::string& thePath);
31 bool hasPath (
const std::string& fileName);
33 bool isExtension (
const std::string& fileName,
const std::string& ext);
37 std::string
getPath (
const std::string& fullPath,
bool keepSlash =
true);
38 std::string
getFileName (
const std::string& fullPath);
40 std::string
getBaseName (
const std::string& fileName,
bool removePath =
false);
43 std::string&
appendToPath (std::string& path,
const std::string& fName);
44 std::string&
makeItAbsolute (std::string& fName,
const std::string& path);
45 std::string&
makeItRelative (std::string& fName,
const std::string& path);
46 std::string&
setPath (std::string& fName,
const std::string& path);
50 std::string&
addExtension (std::string& fileName,
const std::string& ext);
51 std::string&
addExtension (std::string& fileName,
const std::vector<std::string>& exts);
55 const std::string& absoluteFilename);
58 std::string
distillName (
const std::string& filePath,
bool removePath =
false);
Utilities for file path handling.
Definition: FFaFilePath.H:21
std::string & setPath(std::string &fName, const std::string &path)
Replaces the current path in fileName with path.
Definition: FFaFilePath.C:331
std::string getBaseName(const std::string &fileName, bool removePath=false)
Returns the file name without extension.
Definition: FFaFilePath.C:178
std::string getFileName(const std::string &fullPath)
Returns the file name part of fullPath.
Definition: FFaFilePath.C:162
bool isExtension(const std::string &fileName, const std::string &ext)
Checks if ext is the extension of fName.
Definition: FFaFilePath.C:243
std::string getExtension(const std::string &fileName)
Returns the extension of fName.
Definition: FFaFilePath.C:221
std::string & appendToPath(std::string &path, const std::string &fName)
Appends fileName to path.
Definition: FFaFilePath.C:303
std::string & addExtension(std::string &fileName, const std::string &ext)
Adds ext to fileName, if not already present.
Definition: FFaFilePath.C:356
char getPathSeparator()
Returns the path separator for this system.
Definition: FFaFilePath.C:344
std::string & makeItRelative(std::string &fName, const std::string &path)
Makes fileName a relative pathname with respect to absPath.
Definition: FFaFilePath.C:523
std::string appendFileNameToPath(const std::string &path, const std::string &fName)
Appends fileName to path.
Definition: FFaFilePath.C:263
bool hasPath(const std::string &fileName)
Checks if the provided fileName has a path.
Definition: FFaFilePath.C:123
std::string & unixStyle(std::string &thePath)
Modify the given path to using UNIX-style path separators.
Definition: FFaFilePath.C:98
std::string getRelativeFilename(const std::string ¤tDirectory, const std::string &absoluteFilename)
Returns the relative path name with respect to an absolute path.
Definition: FFaFilePath.C:420
std::string distillName(const std::string &filePath, bool removePath=false)
Checks for illegal characters in file names.
Definition: FFaFilePath.C:539
std::string getPath(const std::string &fullPath, bool keepSlash=true)
Returns the path part of fullPath.
Definition: FFaFilePath.C:136
std::string & makeItAbsolute(std::string &fName, const std::string &path)
Makes fileName an absolute pathname by prefixing it with absPath.
Definition: FFaFilePath.C:317
bool isRelativePath(const std::string &pathName)
Determines if path is relative or absolute.
Definition: FFaFilePath.C:395
size_t checkName(char *thePath, size_t length)
Converts file pathnames from UNIX to Windows syntax and vice versa.
Definition: FFaFilePath.C:37