Main MRPT website > C++ reference
MRPT logo
Namespaces

filesystem.h File Reference

#include <mrpt/utils/utils_defs.h>
Include dependency graph for filesystem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  mrpt
 

This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.


namespace  mrpt::system
 

This namespace provides a OS-independent interface to many useful functions: filenames manipulation, time and date, string parsing, file I/O, threading, memory allocation, etc.


Functions

Directories, files, and file names
std::string BASE_IMPEXP mrpt::system::getTempFileName ()
 Returns the name of a proposed temporary file name.
std::string BASE_IMPEXP mrpt::system::getcwd ()
 Returns the current working directory.
bool BASE_IMPEXP mrpt::system::createDirectory (const std::string &dirName)
 Creates a directory.
bool BASE_IMPEXP mrpt::system::deleteFile (const std::string &fileName)
 Deletes a single file.
void BASE_IMPEXP mrpt::system::deleteFiles (const std::string &s)
 Delete one or more files, especified by the (optional) path and the file name (including '?' or '*') - Use forward slash ('/') for directories for compatibility between Windows and Linux, since they will be internally traslated into backward slashes ('\') if MRPT is compiled under Windows.
bool BASE_IMPEXP mrpt::system::renameFile (const std::string &oldFileName, const std::string &newFileName, std::string *error_msg=NULL)
 Renames a file - If the target path is different and the filesystem allows it, it will be moved to the new location.
bool BASE_IMPEXP mrpt::system::deleteFilesInDirectory (const std::string &s, bool deleteDirectoryAsWell=false)
 Delete all the files in a given directory (nothing done if directory does not exists, or path is a file).
std::string BASE_IMPEXP mrpt::system::extractFileName (const std::string &filePath)
 Extract just the name (without extension) of a filename from a complete path plus name plus extension.
std::string BASE_IMPEXP mrpt::system::extractFileExtension (const std::string &filePath, bool ignore_gz=false)
 Extract the extension of a filename.
std::string BASE_IMPEXP mrpt::system::extractFileDirectory (const std::string &filePath)
 Extract the whole path (the directory) of a filename from a complete path plus name plus extension.
bool BASE_IMPEXP mrpt::system::fileExists (const std::string &fileName)
 Test if a given file (or directory) exists.
bool BASE_IMPEXP mrpt::system::directoryExists (const std::string &fileName)
 Test if a given directory exists (it fails if the given path refers to an existing file).
std::string BASE_IMPEXP mrpt::system::fileNameStripInvalidChars (const std::string &filename)
 Replace invalid filename chars by underscores ('_').
std::string BASE_IMPEXP mrpt::system::fileNameChangeExtension (const std::string &filename, const std::string &newExtension)
 Replace the filename extension by another one.
uint64_t BASE_IMPEXP mrpt::system::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.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011