A logical representation of a file.
More...
#include <File.h>
|
| File (std::string name, uint8_t type=DT_UNKNOWN) |
| Construct a file. More...
|
|
std::string | getContent (bool base64Encode=false) |
| Retrieve the content of the file. More...
|
|
std::string | getContent (uint32_t offset, uint32_t size) |
| Retrieve the content of the file. More...
|
|
std::string | getName () |
| Get the name of the file. More...
|
|
std::string | getPath () |
|
uint8_t | getType () |
| Get the type of the file. The type of a file can be DT_REGULAR, DT_DIRECTORY or DT_UNKNOWN. More...
|
|
bool | isDirectory () |
| Determine if the type of the file is a directory. More...
|
|
uint32_t | length () |
| Get the length of the file in bytes. More...
|
|
A logical representation of a file.
File::File |
( |
std::string |
path, |
|
|
uint8_t |
type = DT_UNKNOWN |
|
) |
| |
Construct a file.
- Parameters
-
[in] | name | The name of the file. |
[in] | type | The type of the file (DT_REGULAR, DT_DIRECTORY or DT_UNKNOWN). |
std::string File::getContent |
( |
bool |
base64Encode = false | ) |
|
Retrieve the content of the file.
- Parameters
-
[in] | base64Encode | Should we base64 encode the content? |
- Returns
- The content of the file.
std::string File::getContent |
( |
uint32_t |
offset, |
|
|
uint32_t |
readSize |
|
) |
| |
Retrieve the content of the file.
- Parameters
-
[in] | offset | The file offset to read from. |
[in] | readSize | The number of bytes to read. |
- Returns
- The content of the file.
std::string File::getName |
( |
| ) |
|
Get the name of the file.
- Returns
- The name of the file.
uint8_t File::getType |
( |
| ) |
|
Get the type of the file. The type of a file can be DT_REGULAR, DT_DIRECTORY or DT_UNKNOWN.
- Returns
- The type of the file.
bool File::isDirectory |
( |
| ) |
|
Determine if the type of the file is a directory.
- Returns
- True if the file is a directory.
uint32_t File::length |
( |
| ) |
|
Get the length of the file in bytes.
- Returns
- The length of the file in bytes.
The documentation for this class was generated from the following files: