Go to the documentation of this file.
21 #ifndef __fileSystem_hpp__
22 #define __fileSystem_hpp__
42 std::ostream&
operator <<
51 const fileSystem& fs1,
57 const fileSystem& fs1,
63 const fileSystem& fs1,
103 return fileSystem(std::filesystem::current_path().c_str());
124 fileSystem(
const char* dir,
const char* file=
"");
fileSystem canonical() const
Canonical path of this (it should exist)
friend fileSystem operator/(const fileSystem &fs1, const fileSystem &fs2)
Create a dir path from dir path of fs1 and fas2 in the form of fs1/fs2
word fileName() const
File name part of the path (if any)
bool dirExist() const
Only operate on dir path Check if the dir path exists.
static fileSystem CWD()
return current working directory
bool exist() const
Check if the path exists.
void operator/=(const fileSystem &fs)
It operates on dir path only Add the dir path of fs to this
void operator+=(const word &fileName)
If this is dir path, add the filename to dir path if it is file path, replace the file name
fileSystem operator()(bool retDir=true) const
Return the dir path of this.
fileSystemList containingFiles(const fileSystem &path)
A list of file paths that exist in the path.
bool isDir_
Is this a directory path?
fileSystem & operator=(const fileSystem &)=default
Copy assignment.
bool isDir() const
Is directory?
bool isRegularFile(const fileSystem &path)
free function to check if the path is regular file
Manages file pathes, manupulate and combines them.
fileSystemList subDirectories(const fileSystem &path)
A list of sub-directories that exist in path.
static word notPermittedCharsFile
Not premitted chars in file name
const pathType & path() const
Const access to path.
fileSystem dirPath() const
Dir part of the path.
friend iOstream & operator<<(iOstream &os, const fileSystem &fs)
bool isDirectory(const fileSystem &path)
Free function to check if the path is dir path.
fileSystem absolute() const
Absolute path of this.
static bool validFileName(const word &name)
Is name is valid for a file?
static bool checkFileName(const word &name)
Is a valid file name?
List< fileSystem > fileSystemList
fileSystem CWD()
Free function to reture current working directory.
~fileSystem()=default
Destructor.
fileSystem relative(const fileSystem &base) const
relative path of this this with respect to base
word wordPath() const
Path in word type.
std::filesystem::path pathType
fileSystem createDirs() const
Operate on dir path only Create dir based on the path and returns the canonical path.
Interface class for any output stream.