FileSystem class.
More...
#include <radarlib/io.hpp>
|
static bool | fileExists (const std::string &path) |
| Check the existence of a file.
|
|
static bool | dirExists (const std::string &path) |
| Check the existence of a directory.
|
|
static void | changeDir (const std::string &path) |
| Change the current working directory.
|
|
static std::string | getCurrentDir () |
| Get the current working directory.
|
|
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.
|
|
static void | rmDirTree (const std::string &path) |
| Remove a directory and all its sub directories.
|
|
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.
|
|
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.
|
|
static void | createFile (const std::string &path) |
| Touch a file like unix system command 'touch'.
|
|
static void | createFile (const std::string &path, const std::string &msg) |
| Touch a file like unix system command 'touch'.
|
|
static size_t | getFileSize (const std::string &path) |
| Get the size in bytes of the given file.
|
|
FileSystem class.
This class provides functions to manipulate files and directories
◆ fileExists()
static bool Radar::FileSystem::fileExists |
( |
const std::string & | path | ) |
|
|
static |
Check the existence of a file.
- Parameters
-
◆ dirExists()
static bool Radar::FileSystem::dirExists |
( |
const std::string & | path | ) |
|
|
static |
Check the existence of a directory.
- Parameters
-
◆ changeDir()
static void Radar::FileSystem::changeDir |
( |
const std::string & | path | ) |
|
|
static |
Change the current working directory.
- Parameters
-
path | the new directory path |
◆ getCurrentDir()
static std::string Radar::FileSystem::getCurrentDir |
( |
| ) |
|
|
static |
Get the current working directory.
◆ mkDirTree()
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 |
◆ rmDirTree()
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 |
◆ listFiles()
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 |
◆ listDirs()
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 |
◆ createFile() [1/2]
void Radar::FileSystem::createFile |
( |
const std::string & | path | ) |
|
|
static |
Touch a file like unix system command 'touch'.
- Parameters
-
◆ createFile() [2/2]
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 |
◆ getFileSize()
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