radarlib  1.4.6
Radar::FileSystem Class Reference

FileSystem class. More...

#include <radarlib/io.hpp>

Static Public Member Functions

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...
 

Detailed Description

FileSystem class.

This class provides functions to manipulate files and directories

Member Function Documentation

static bool Radar::FileSystem::fileExists ( const std::string &  path)
static

Check the existence of a file.

Parameters
paththe file path
static bool Radar::FileSystem::dirExists ( const std::string &  path)
static

Check the existence of a directory.

Parameters
paththe directory path
static void Radar::FileSystem::changeDir ( const std::string &  path)
static

Change the current working directory.

Parameters
paththe 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
paththe new directory path
static void Radar::FileSystem::rmDirTree ( const std::string &  path)
static

Remove a directory and all its sub directories.

Parameters
paththe 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
resultthe std::vector the will store the result paths
paththe parent directory to analize
completePathif 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
resultthe std::vector the will store the result paths
paththe parent directory to analize
completePathif 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
paththe path of the file
void Radar::FileSystem::createFile ( const std::string &  path,
const std::string &  msg 
)
static

Touch a file like unix system command 'touch'.

Parameters
paththe path of the file
msga 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
paththe path of the file

The documentation for this class was generated from the following files: