FileSystem class.
More...
#include <radarlib/io.hpp>
|
static bool | fileExists (const std::string &path) |
| Check the existence of a file. More...
|
|
static bool | dirExists (const std::string &path) |
| Check the existence of a directory. More...
|
|
static void | changeDir (const std::string &path) |
| Change the current working directory. More...
|
|
static std::string | getCurrentDir () |
| Get the current working directory. More...
|
|
static void | mkDirTree (const std::string &path) |
| Create a directory and all its parent directories if they don't exist If the directory already exists nothing is done. More...
|
|
static void | rmDirTree (const std::string &path) |
| Remove a directory and all its sub directories. More...
|
|
static void | listFiles (std::vector< std::string > &result, const std::string &path, bool completePath=false) |
| Get the list of all the files in a directory. More...
|
|
static void | listDirs (std::vector< std::string > &result, const std::string &path, bool completePath=false) |
| Get the list of all the direct sub directories of a specified directory. More...
|
|
static void | createFile (const std::string &path) |
| Touch a file like unix system command 'touch'. More...
|
|
static void | createFile (const std::string &path, const std::string &msg) |
| Touch a file like unix system command 'touch'. More...
|
|
static size_t | getFileSize (const std::string &path) |
| Get the size in bytes of the given file. More...
|
|
FileSystem class.
This class provides functions to manipulate files and directories
static bool Radar::FileSystem::fileExists |
( |
const std::string & |
path | ) |
|
|
static |
Check the existence of a file.
- Parameters
-
static bool Radar::FileSystem::dirExists |
( |
const std::string & |
path | ) |
|
|
static |
Check the existence of a directory.
- Parameters
-
static void Radar::FileSystem::changeDir |
( |
const std::string & |
path | ) |
|
|
static |
Change the current working directory.
- Parameters
-
path | the new directory path |
static std::string Radar::FileSystem::getCurrentDir |
( |
| ) |
|
|
static |
Get the current working directory.
static void Radar::FileSystem::mkDirTree |
( |
const std::string & |
path | ) |
|
|
static |
Create a directory and all its parent directories if they don't exist If the directory already exists nothing is done.
- Parameters
-
path | the new directory path |
static void Radar::FileSystem::rmDirTree |
( |
const std::string & |
path | ) |
|
|
static |
Remove a directory and all its sub directories.
- Parameters
-
path | the directory path to remove |
static void Radar::FileSystem::listFiles |
( |
std::vector< std::string > & |
result, |
|
|
const std::string & |
path, |
|
|
bool |
completePath = false |
|
) |
| |
|
static |
Get the list of all the files in a directory.
- Parameters
-
result | the std::vector the will store the result paths |
path | the parent directory to analize |
completePath | if true, the result paths will contain also the parent path specified |
static void Radar::FileSystem::listDirs |
( |
std::vector< std::string > & |
result, |
|
|
const std::string & |
path, |
|
|
bool |
completePath = false |
|
) |
| |
|
static |
Get the list of all the direct sub directories of a specified directory.
- Parameters
-
result | the std::vector the will store the result paths |
path | the parent directory to analize |
completePath | if true, the result paths will contain also the parent path specified |
void Radar::FileSystem::createFile |
( |
const std::string & |
path | ) |
|
|
static |
Touch a file like unix system command 'touch'.
- Parameters
-
void Radar::FileSystem::createFile |
( |
const std::string & |
path, |
|
|
const std::string & |
msg |
|
) |
| |
|
static |
Touch a file like unix system command 'touch'.
- Parameters
-
path | the path of the file |
msg | a text to write into nthe file |
static size_t Radar::FileSystem::getFileSize |
( |
const std::string & |
path | ) |
|
|
static |
Get the size in bytes of the given file.
*
- Parameters
-
The documentation for this class was generated from the following files:
- radarlib/io.hpp
- radarlib/io.cpp