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 29 of file files.hpp.
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 104 of file files.cc.
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 111 of file files.cc.
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 85 of file files.cc.
const std::string & File::getFileName |
( |
| ) |
const |
Get the current file path
- Returns
- File path
Definition at line 94 of file files.cc.
unsigned long File::getId |
( |
| ) |
const |
Get the ID of the file
- Returns
- ID of the file
Definition at line 119 of file files.cc.
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 128 of file files.cc.
The documentation for this class was generated from the following files: