27#ifndef __RADAR_IO_HPP__
28#define __RADAR_IO_HPP__
92 static void listFiles(std::vector<std::string>& result,
const std::string& path,
bool completePath =
false);
100 static void listDirs(std::vector<std::string>& result,
const std::string& path,
bool completePath =
false);
106 static void createFile(
const std::string& path);
113 static void createFile(
const std::string& path,
const std::string& msg);
133 static std::string
getBasePath(
const std::string& path);
139 static std::string
getFileName(
const std::string& path);
145 static std::string
getFileExt(
const std::string& path);
152 static std::string
changeExt(
const std::string& path,
const std::string& newext);
158 static std::string
removeExt(
const std::string& path);
FileSystem class.
Definition io.hpp:47
static bool fileExists(const std::string &path)
Check the existence of a file.
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 bool dirExists(const std::string &path)
Check the existence of 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'.
Definition io.cpp:499
static void changeDir(const std::string &path)
Change the current working directory.
static void rmDirTree(const std::string &path)
Remove a directory and all its sub directories.
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...
static std::string getCurrentDir()
Get the current working directory.
static size_t getFileSize(const std::string &path)
Get the size in bytes of the given file.
File path manipulation routines.
Definition io.hpp:126
static std::string changeExt(const std::string &path, const std::string &newext)
Returns the path indicated after changing che extension.
Definition io.cpp:560
static std::string getBasePath(const std::string &path)
Extract the parent directory path of a file or directory indicated.
Definition io.cpp:532
static std::string getFileName(const std::string &path)
Extract the file or directory name from a generic path.
Definition io.cpp:540
static std::string getFileExt(const std::string &path)
Extract the directory or file exstension without the dot.
Definition io.cpp:552
static std::string removeExt(const std::string &path)
Remove the extension from a file or directory path.
Definition io.cpp:568