This class implementes the read/write operations to work with text files stored in the file sytem.

#include <files>

Public Member Functions

bool readFile (boost::system::error_code &ec, const std::string &sPath, std::string &result, const bool binary=false)
 
void readContentandClose (std::ifstream &iFile, std::string &result)
 
bool writeFile (boost::system::error_code &ec, const std::string &sPath, const std::string &property_value)
 
bool createAndWrite (boost::system::error_code &ec, const std::string &sPath, const std::string &property_value, const bool atomic=false)
 
void writeContentandClose (std::ofstream &oFile, const std::string &value)
 
bool addContentToFile (boost::system::error_code &ec, const std::string &sPath, const std::string &content)
 
bool createAndAddContentToFile (boost::system::error_code &ec, const std::string &sPath, const std::string &content, const bool atomic=false)
 
bool readNumOfLines (boost::system::error_code &ec, const std::string &sPath, std::string &result, const int num, const bool binary=false)
 
void getLines (std::ifstream &iFile, const int num, std::string &result)
 
bool removeFile (const std::string &sPath)
 
bool isPath (boost::system::error_code &ec, const std::string &path)
 
bool isRegularFile (boost::system::error_code &ec, const std::string &path)
 
bool isDirectory (boost::system::error_code &ec, const std::string &path)
 
bool isFileOpened (std::ifstream &iFile)
 
bool isFileOpened (std::ofstream &oFile)
 
bool createDir (boost::system::error_code &ec, const std::string &path)
 
std::string getFilename (const std::string &path)
 
std::string getFoldername (const std::string &path)