PicoScenes API Docs
 
Loading...
Searching...
No Matches
SystemTools::File Namespace Reference

Functions

std::string getHomeDirectory ()
 
bool checkCommandExists (const std::string &command)
 
std::vector< struct timespec > getAccessChangeModifyTimeOfFile (const std::string &file)
 
bool touchFile (const std::string &file, std::optional< struct timespec > targetTimeOrNow)
 
std::string getFileOwner (const std::string &filePath)
 
std::vector< uint8_t > readContentFromFile (const std::string &file)
 
std::string readContentFromFileAsString (const std::string &file)
 
std::vector< std::string > readContentFromFileLineByLine (const std::string &filePath)
 
void writeContent2File (const std::string &file, const uint8_t *buffer, size_t bufferLength)
 
void writeContent2File (const std::string &file, const std::string &content)
 
bool removeFile (const std::string &filePath)
 
std::vector< fs::path > listFilesWithExtension (fs::path folderPath, std::string prefix="", std::string surfix="")
 
std::vector< fs::path > listFilesRecursivelyWithExtension (fs::path folderPath, std::string prefix="", std::string surfix="")
 
template<typename ParseType >
ParseType readValueFromFilePath (const std::string &path)
 
template<typename ParseType >
int writeValue2FilePath (const std::string &path, const ParseType &value, const std::string &formatStr="{}")
 

Function Documentation

◆ checkCommandExists()

bool SystemTools::File::checkCommandExists ( const std::string &  command)

◆ getAccessChangeModifyTimeOfFile()

std::vector< struct timespec > SystemTools::File::getAccessChangeModifyTimeOfFile ( const std::string &  file)

◆ getFileOwner()

std::string SystemTools::File::getFileOwner ( const std::string &  filePath)

◆ getHomeDirectory()

std::string SystemTools::File::getHomeDirectory ( )

◆ listFilesRecursivelyWithExtension()

std::vector< fs::path > SystemTools::File::listFilesRecursivelyWithExtension ( fs::path  folderPath,
std::string  prefix = "",
std::string  surfix = "" 
)

◆ listFilesWithExtension()

std::vector< fs::path > SystemTools::File::listFilesWithExtension ( fs::path  folderPath,
std::string  prefix = "",
std::string  surfix = "" 
)

◆ readContentFromFile()

std::vector< uint8_t > SystemTools::File::readContentFromFile ( const std::string &  file)

◆ readContentFromFileAsString()

std::string SystemTools::File::readContentFromFileAsString ( const std::string &  file)

◆ readContentFromFileLineByLine()

std::vector< std::string > SystemTools::File::readContentFromFileLineByLine ( const std::string &  filePath)

◆ readValueFromFilePath()

template<typename ParseType >
ParseType SystemTools::File::readValueFromFilePath ( const std::string &  path)

Definition at line 84 of file SystemTools.hxx.

◆ removeFile()

bool SystemTools::File::removeFile ( const std::string &  filePath)

◆ touchFile()

bool SystemTools::File::touchFile ( const std::string &  file,
std::optional< struct timespec >  targetTimeOrNow 
)

◆ writeContent2File() [1/2]

void SystemTools::File::writeContent2File ( const std::string &  file,
const std::string &  content 
)

◆ writeContent2File() [2/2]

void SystemTools::File::writeContent2File ( const std::string &  file,
const uint8_t *  buffer,
size_t  bufferLength 
)

◆ writeValue2FilePath()

template<typename ParseType >
int SystemTools::File::writeValue2FilePath ( const std::string &  path,
const ParseType &  value,
const std::string &  formatStr = "{}" 
)

Definition at line 102 of file SystemTools.hxx.