Go to the documentation of this file.
22 #define ASSERT_FILE_EXISTS_(FIL) \
24 mrpt::system::fileExists(FIL), \
25 std::string("Assert file existence failed: ") + ::std::string(FIL))
27 #define ASSERT_DIRECTORY_EXISTS_(DIR) \
29 mrpt::system::directoryExists(DIR), \
30 std::string("Assert directory existence failed: ") + \
80 const std::string&
s,
bool deleteDirectoryAsWell =
false);
97 const std::string& filePath,
bool ignore_gz =
false);
122 const std::string& filename,
const char replacement_to_invalid_chars =
'_');
159 std::string* outErrStr =
nullptr,
bool copyAttribs =
true);
bool renameFile(const std::string &oldFileName, const std::string &newFileName, std::string *error_msg=nullptr)
Renames a file - If the target path is different and the filesystem allows it, it will be moved to th...
std::string extractFileDirectory(const std::string &filePath)
Extract the whole path (the directory) of a filename from a complete path plus name plus extension.
bool copyFile(const std::string &sourceFile, const std::string &targetFile, std::string *outErrStr=nullptr, bool copyAttribs=true)
Copies file sourceFile to targetFile.
time_t getFileModificationTime(const std::string &filename)
Return the time of the file last modification, or "0" if the file doesn't exist.
std::string getShareMRPTDir()
Attempts to find the directory [PREFIX/]share/mrpt/ and returns its absolute path,...
bool directoryExists(const std::string &fileName)
Test if a given directory exists (it fails if the given path refers to an existing file).
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::string getTempFileName()
Returns the name of a proposed temporary file name.
bool fileExists(const std::string &fileName)
Test if a given file (or directory) exists.
std::string fileNameStripInvalidChars(const std::string &filename, const char replacement_to_invalid_chars='_')
Replace invalid filename chars by underscores ('_') or any other user-given char.
std::string fileNameChangeExtension(const std::string &filename, const std::string &newExtension)
Replace the filename extension by another one.
std::string getcwd()
Returns the current working directory
std::string filePathSeparatorsToNative(const std::string &filePath)
Windows: replace all '/'->'\' , in Linux/MacOS: replace all '\'->'/'.
unsigned __int64 uint64_t
bool deleteFile(const std::string &fileName)
Deletes a single file.
void deleteFiles(const std::string &s)
Delete one or more files, especified by the (optional) path and the file name (including '?...
std::string extractFileExtension(const std::string &filePath, bool ignore_gz=false)
Extract the extension of a filename.
bool deleteFilesInDirectory(const std::string &s, bool deleteDirectoryAsWell=false)
Delete all the files in a given directory (nothing done if directory does not exists,...
std::string extractFileName(const std::string &filePath)
Extract just the name (without extension) of a filename from a complete path plus name plus extension...
GLsizei const GLchar ** string
bool createDirectory(const std::string &dirName)
Creates a directory.
uint64_t getFileSize(const std::string &fileName)
Return the size of the given file, or size_t(-1) if some error is found accessing that file.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |