|
lintel 0.2.0
|
#include <FileService.h>
Classes | |
| class | Stream |
Public Member Functions | |
| FileService (std::filesystem::path path) | |
| bool | isFile () |
| bool | exists () |
| std::size_t | getSize () |
| void | deleteFile () |
| std::string | readFile () |
| std::string | getName () |
| std::filesystem::path | getPath () |
| void | writeToFile (const std::string &content, bool overwrite=false) |
| void | createFile (std::size_t sizeOfFile) |
| void | createSymlinkTo (const std::filesystem::path &to) |
| std::vector< std::string > | matches (const std::regex ®ex) |
| FileService::Stream | createStream () |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const FileService &file) |
class for wrapping general operations with a normal file
|
explicit |
constructor
| path | of file |
| void lintel::FileService::createFile | ( | std::size_t | sizeOfFile | ) |
Creates an empty file with the given size.
| sizeOfFile | the size to allocate for the new file |
| FileService::Stream lintel::FileService::createStream | ( | ) |
creates FileService::Stream for file
creates symlink of file to given path
| to | path where to create the sysmlink |
| void lintel::FileService::deleteFile | ( | ) |
delete file
| bool lintel::FileService::exists | ( | ) |
Checks if the given path exists and is a regular file.
| std::string lintel::FileService::getName | ( | ) |
returns name of file
| std::filesystem::path lintel::FileService::getPath | ( | ) |
returns given path of file
| std::size_t lintel::FileService::getSize | ( | ) |
Returns the size of the file in bytes.
| bool lintel::FileService::isFile | ( | ) |
Checks if the given path is a regular file.
| std::vector< std::string > lintel::FileService::matches | ( | const std::regex & | regex | ) |
searches matching string of file via FileService::Stream
| regex | for searching matching strings |
| std::string lintel::FileService::readFile | ( | ) |
reads whole file in total (not good for big files)
| content | to be written in file |
| overwrite | replace existing content instead of appending |
|
friend |
to string method