PARTONS/ElementaryUtils  
Basic utility softwares (Logger, threads, etc)
Static Public Member Functions | List of all members
ElemUtils::FileUtils Class Reference

Handle file system. More...

Static Public Member Functions

static bool isReadable (const std::string &filePath)
 
static bool open (std::ofstream &fileOutputStream, const std::string &filePath, const std::ios_base::openmode &openMode=std::ios_base::out|std::ios_base::trunc)
 By default open a file in write mode. More...
 
static void writeAndFlush (std::ofstream &fileOutputStream, const std::string &str)
 
static void write (std::ofstream &fileOutputStream, const std::string &str)
 
static void flush (std::ofstream &fileOutputStream)
 
static void close (std::ofstream &fileOutputStream)
 
static std::string read (const std::string &filePath)
 
static std::vector< std::string > readByLine (const std::string &filePath)
 
static std::ifstream::pos_type getFileSize (const std::string &filetPath)
 
static bool remove (const std::string &filePath)
 

Detailed Description

Handle file system.

Member Function Documentation

◆ close()

void ElemUtils::FileUtils::close ( std::ofstream &  fileOutputStream)
static

◆ flush()

void ElemUtils::FileUtils::flush ( std::ofstream &  fileOutputStream)
static

◆ getFileSize()

std::ifstream::pos_type ElemUtils::FileUtils::getFileSize ( const std::string &  filetPath)
static

◆ isReadable()

bool ElemUtils::FileUtils::isReadable ( const std::string &  filePath)
static

◆ open()

bool ElemUtils::FileUtils::open ( std::ofstream &  fileOutputStream,
const std::string &  filePath,
const std::ios_base::openmode &  openMode = std::ios_base::out | std::ios_base::trunc 
)
static

By default open a file in write mode.

If the file exists, its content is deleted.

Parameters
fileOutputStream
filePath
openMode: by default open in write mode and content is deleted.z
Returns

◆ read()

std::string ElemUtils::FileUtils::read ( const std::string &  filePath)
static

◆ readByLine()

std::vector< std::string > ElemUtils::FileUtils::readByLine ( const std::string &  filePath)
static

◆ remove()

bool ElemUtils::FileUtils::remove ( const std::string &  filePath)
static

◆ write()

void ElemUtils::FileUtils::write ( std::ofstream &  fileOutputStream,
const std::string &  str 
)
static

◆ writeAndFlush()

void ElemUtils::FileUtils::writeAndFlush ( std::ofstream &  fileOutputStream,
const std::string &  str 
)
static

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