Class to handle file related operations.
More...
#include <files.hpp>
|
unsigned long | id |
| ID of the file.
|
|
std::string | fileName |
| Path of the file.
|
|
Class to handle file related operations.
Definition at line 25 of file files.hpp.
◆ File() [1/2]
File::File |
( |
unsigned long |
_id, |
|
|
const char * |
_fileName |
|
) |
| |
Constructor for File class
- Parameters
-
_id | ID of the file |
_fileName | Path of the file |
Definition at line 100 of file files.cc.
◆ File() [2/2]
File::File |
( |
unsigned long |
id, |
|
|
std::string const & |
fileName |
|
) |
| |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 107 of file files.cc.
◆ getContent()
std::string File::getContent |
( |
const unsigned long int |
maximumBytes = 1 << 20 | ) |
const |
Get the content of the file limited by maximumBytes.
- Parameters
-
maximumBytes | Limit of file content to read (set -1 to read full content). |
- Returns
- Content of the file as a string.
- See also
- fo::getStringFromFile()
Definition at line 81 of file files.cc.
◆ getFileName()
const std::string & File::getFileName |
( |
| ) |
const |
Get the current file path
- Returns
- File path
Definition at line 90 of file files.cc.
◆ getId()
unsigned long File::getId |
( |
| ) |
const |
Get the ID of the file
- Returns
- ID of the file
Definition at line 115 of file files.cc.
◆ isReadable()
bool File::isReadable |
( |
| ) |
const |
Check if the file is accessible and readable
- Returns
- True if the the file is readable, false otherwise
Definition at line 124 of file files.cc.
The documentation for this class was generated from the following files: