File system interface.
More...
#include <IFileSystem.h>
|
typedef std::vector< uint8_t > | IOBuffer |
| Type for the buffer used for IO.
|
|
typedef std::function< void(const
std::string &)> | Callback |
| Default callback type for asynchronous filesystem calls. More...
|
|
typedef std::function< void(IOBuffer &&)> | ReadCallback |
| Callback type for the asynchronous Read call. More...
|
|
typedef std::function< void(const
StatResult &, const
std::string &)> | StatCallback |
| Callback type for the asynchronous Stat call. More...
|
|
|
virtual void | Read (const std::string &fileName, const ReadCallback &doneCallback, const Callback &errorCallback) const =0 |
| Reads from a file. More...
|
|
virtual void | Write (const std::string &fileName, const IOBuffer &data, const Callback &callback)=0 |
| Writes to a file. More...
|
|
virtual void | Move (const std::string &fromFileName, const std::string &toFileName, const Callback &callback)=0 |
| Moves a file (i.e. renames it). More...
|
|
virtual void | Remove (const std::string &fileName, const Callback &callback)=0 |
| Removes a file. More...
|
|
virtual void | Stat (const std::string &fileName, const StatCallback &callback) const =0 |
| Retrieves information about a file. More...
|
|
Default callback type for asynchronous filesystem calls.
- Parameters
-
An | error string. Empty is success. |
Callback type for the asynchronous Read call.
- Parameters
-
Output | char array with file content. |
Callback type for the asynchronous Stat call.
- Parameters
-
the | StatResult data. |
an | error string. Empty if no error. |
virtual void AdblockPlus::IFileSystem::Move |
( |
const std::string & |
fromFileName, |
|
|
const std::string & |
toFileName, |
|
|
const Callback & |
callback |
|
) |
| |
|
pure virtual |
Moves a file (i.e. renames it).
- Parameters
-
fromFileName | Current file name. |
toFileName | New file name. |
callback | The function called on completion. |
virtual void AdblockPlus::IFileSystem::Read |
( |
const std::string & |
fileName, |
|
|
const ReadCallback & |
doneCallback, |
|
|
const Callback & |
errorCallback |
|
) |
| const |
|
pure virtual |
Reads from a file.
- Parameters
-
fileName | File name. |
doneCallback | The function called on completion with the input data. If this function throws then the implementation should call errorCallback . |
errorCallback | The function called if an error occured. |
virtual void AdblockPlus::IFileSystem::Remove |
( |
const std::string & |
fileName, |
|
|
const Callback & |
callback |
|
) |
| |
|
pure virtual |
Removes a file.
- Parameters
-
fileName | File name. |
callback | The function called on completion. |
virtual void AdblockPlus::IFileSystem::Stat |
( |
const std::string & |
fileName, |
|
|
const StatCallback & |
callback |
|
) |
| const |
|
pure virtual |
Retrieves information about a file.
- Parameters
-
fileName | File name. |
callback | The function called on completion. |
virtual void AdblockPlus::IFileSystem::Write |
( |
const std::string & |
fileName, |
|
|
const IOBuffer & |
data, |
|
|
const Callback & |
callback |
|
) |
| |
|
pure virtual |
Writes to a file.
- Parameters
-
fileName | File name. |
data | The data to write. |
callback | The function called on completion. |
The documentation for this class was generated from the following file: