![]() |
Max OS 0.3
|
A wrapper for a File which exposes File operations as Resource operations. More...
#include <vfsresource.h>
Public Member Functions | |
| FileResource (const string &name, size_t flags, processes::resource_type_t type) | |
| Construct a new File Resource object. | |
| int | read (void *buffer, size_t size, size_t flags) final |
| read from a file resource | |
| int | write (const void *buffer, size_t size, size_t flags) final |
| write to a file resource | |
Public Member Functions inherited from MaxOS::processes::Resource | |
| Resource (const string &name, size_t flags, resource_type_t type) | |
| Constructs a new Resource object. | |
| string | name () |
| Gets the name of this resource. | |
| resource_type_t | type () |
| Gets the type of this resource. | |
| virtual void | open (size_t flags) |
| Opens the resource. | |
| virtual void | close (size_t flags) |
| Closes the resource. | |
Public Attributes | |
| File * | file |
| The file that this resource handles & exposes. | |
A wrapper for a File which exposes File operations as Resource operations.
Definition at line 32 of file vfsresource.h.
| FileResource::FileResource | ( | const string & | name, |
| size_t | flags, | ||
| processes::resource_type_t | type | ||
| ) |
Construct a new File Resource object.
| name | The name of the resource |
| flags | The flags for the resource when opened |
| type | The type of the resource |
Definition at line 24 of file vfsresource.cpp.
read from a file resource
| buffer | The buffer to read into |
| size | The number of bytes to read |
| flags | The flags to pass to the reading |
Reimplemented from MaxOS::processes::Resource.
Definition at line 41 of file vfsresource.cpp.
References file, MaxOS::filesystem::File::position(), MaxOS::filesystem::File::read(), and MaxOS::filesystem::File::size().
write to a file resource
| buffer | The buffer to write from |
| size | The number of bytes to write |
| flags | The flags to pass to the writing |
Reimplemented from MaxOS::processes::Resource.
Definition at line 80 of file vfsresource.cpp.
References file, MaxOS::processes::GlobalResourceRegistry::get_registry(), MaxOS::processes::Resource::name(), MaxOS::filesystem::Path::parent_directory(), MaxOS::filesystem::File::seek(), and MaxOS::filesystem::File::write().
| File* MaxOS::filesystem::FileResource::file |
The file that this resource handles & exposes.
Definition at line 38 of file vfsresource.h.