11 #include <sys/types.h>
58 bool changeMode(mode_t __mode = S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)
const;
std::vector< PPath > PVecPath
PString phoenix_getFileContent(FILE *fp)
Get the content of a file.
Path of a directory or a file.
bool changeMode(mode_t __mode=S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) const
Change the mode of a file or directory.
bool checkFileBegning(const PString &expectedBegining) const
Check if the given file starts with the given begning.
PPath & eraseLongestExtension()
Erase the longest extension of the PPath.
std::vector< PPath > getAllDirectoryInDir() const
Get the list of files in a directory.
bool saveFileContent(const PString &content) const
Save a PString in a file.
PPath & eraseExtension()
Erase the extension of the PPath.
bool createDirectory(mode_t mode=0755) const
Create the current directory.
PPath getUnderPath(const PString &pathPart) const
Get path which is under the given pathPart ('some/dir/path' with 'dir' will return 'path')
static PPath getCurrentDirectory()
Returns the current directory.
static PString getCurrentNodeName()
Get the name of the current node on which the program is running.
PPath makeAbsolute() const
Make an absolute path of the given path.
PString getExtension() const
Get file extension.
friend PPath operator/(const PPath &other1, const PPath &other2)
Operator / for PPath to concatenate PPath.
PPath getParentDirectory() const
Get path of parent directory of current path.
PPath getDirectoryName() const
Get the name of the directory, from last char to / (if the last char is not a /, otherwise it takes t...
void copyPPath(const PPath &other)
Copy function of PPath.
static PPath getHomeDir()
Gets the $HOME directory.
size_t getFileSize() const
Get the size of the current file.
static PPath getProgramPrefix()
Get the program prefix (installation directory without /bin)
bool isDirectoryExist() const
Say if the current directory path does exist.
bool isAbsolutePath() const
Tel if a path is absolute or not.
time_t getFileModificationTime() const
Get the last modification time of the given file.
static PPath getProgramLocation()
Get the program location.
PPath simplify() const
Remove extra dots from the path.
bool isFileExist() const
Say if the current file path does exist.
PString loadFileContent() const
Get the file content in a PString.
std::vector< PPath > getAllFileInDir() const
Get the list of files in a directory.
PString getLongestExtension() const
Get the longest file extension.
virtual ~PPath()
Destructor of PPath.
bool isExist() const
Say if the current path does exist.
std::vector< PPath > getAllElementInDir() const
Get the list of all elements in a directory.
PPath & operator=(const PPath &other)
Definition of equal operator of PPath.
PPath getFileName() const
Get the name of the file, from last char to /.
static PPath getProgramDirectory()
Get the program directory.
void initialisationPPath()
Initialisation function of the class PPath.
PPath()
Default constructor of PPath.