#include <LocalResource.hpp>
◆ SeekType
Position to seek relative to.
Enumerator |
---|
SEEKTYPE_CUR | Current position.
|
SEEKTYPE_END | End of file.
|
SEEKTYPE_SET | Begining of file.
|
◆ LocalResource() [1/2]
dart::common::LocalResource::LocalResource |
( |
const std::string & |
_path | ) |
|
|
explicit |
◆ ~LocalResource()
dart::common::LocalResource::~LocalResource |
( |
| ) |
|
|
virtual |
◆ LocalResource() [2/2]
dart::common::LocalResource::LocalResource |
( |
const LocalResource & |
_other | ) |
|
|
delete |
◆ getSize()
std::size_t dart::common::LocalResource::getSize |
( |
| ) |
|
|
overridevirtual |
◆ isGood()
bool dart::common::LocalResource::isGood |
( |
| ) |
const |
Returns true if the resource is open and in a valid state.
◆ operator=()
◆ read()
std::size_t dart::common::LocalResource::read |
( |
void * |
_buffer, |
|
|
std::size_t |
_size, |
|
|
std::size_t |
_count |
|
) |
| |
|
overridevirtual |
Read _count element, each of size _size, into _buffer.
- Parameters
-
[out] | _buffer | Pointer to a block of memory with a size of at least (_size * _count) bytes. |
[in] | _size | Size, in bytes, of each element. |
[in] | _count | Number of elements, each of _size bytes. |
- Note
- This method has the same API as the standard fread function.
Implements dart::common::Resource.
◆ readAll()
std::string dart::common::Resource::readAll |
( |
| ) |
|
|
virtualinherited |
Reads all data from this resource, and returns it as a string.
- Returns
- The string retrieved from the resource.
- Exceptions
-
std::runtime_error | when failed to read sucessfully. |
◆ seek()
bool dart::common::LocalResource::seek |
( |
ptrdiff_t |
_offset, |
|
|
SeekType |
_origin |
|
) |
| |
|
overridevirtual |
Set the position indicator to a new position.
- Parameters
-
[in] | _offset | Offset, in bytes, relative to _origin. |
[in] | _origin | Position used as the reference of _offset. |
- Note
- This method has the same API as the standard fseek function.
Implements dart::common::Resource.
◆ tell()
std::size_t dart::common::LocalResource::tell |
( |
| ) |
|
|
overridevirtual |
Return the current value of the position indicator.
- Note
- This method has the same API as the standard ftell function.
Implements dart::common::Resource.
◆ mFile
std::FILE* dart::common::LocalResource::mFile |
|
private |