HDK
|
#include <filesystem.h>
Public Member Functions | |
IOFile (string_view filename, Mode mode) | |
IOFile (const std::wstring &filename, Mode mode) | |
IOFile (FILE *file, Mode mode) | |
~IOFile () override | |
const char * | proxytype () const override |
void | close () override |
bool | seek (int64_t offset) override |
size_t | read (void *buf, size_t size) override |
size_t | write (const void *buf, size_t size) override |
size_t | pread (void *buf, size_t size, int64_t offset) override |
size_t | pwrite (const void *buf, size_t size, int64_t offset) override |
size_t | size () const override |
void | flush () const override |
FILE * | handle () const |
![]() | |
IOProxy () | |
IOProxy (string_view filename, Mode mode) | |
IOProxy (const std::wstring &filename, Mode mode) | |
virtual | ~IOProxy () |
virtual bool | opened () const |
virtual int64_t | tell () |
Mode | mode () const |
const std::string & | filename () const |
template<class T > | |
size_t | read (span< T > buf) |
template<class T > | |
size_t | write (span< T > buf) |
size_t | write (string_view buf) |
bool | seek (int64_t offset, int origin) |
std::string | error () const |
void | error (string_view e) |
Protected Attributes | |
FILE * | m_file = nullptr |
size_t | m_size = 0 |
bool | m_auto_close = false |
std::mutex | m_mutex |
![]() | |
std::string | m_filename |
int64_t | m_pos = 0 |
Mode | m_mode = Closed |
std::string | m_error |
Additional Inherited Members | |
![]() | |
enum | Mode { Closed = 0, Read = 'r', Write = 'w' } |
IOProxy subclass for reading or writing (but not both) that wraps C stdio 'FILE'.
Definition at line 476 of file filesystem.h.
Filesystem::IOFile::IOFile | ( | string_view | filename, |
Mode | mode | ||
) |
|
inline |
Definition at line 480 of file filesystem.h.
Filesystem::IOFile::IOFile | ( | FILE * | file, |
Mode | mode | ||
) |
|
override |
|
overridevirtual |
Reimplemented from Filesystem::IOProxy.
|
overridevirtual |
Reimplemented from Filesystem::IOProxy.
|
inline |
Definition at line 497 of file filesystem.h.
|
overridevirtual |
Read size
bytes starting at the offset
position into buf[]
, returning the number of bytes successfully read. This function does not alter the current file position. This function is thread-safe against all other concurrent calls to pread() and pwrite(), but not against any other function of IOProxy.
Reimplemented from Filesystem::IOProxy.
|
inlineoverridevirtual |
Implements Filesystem::IOProxy.
Definition at line 486 of file filesystem.h.
|
overridevirtual |
Write size
bytes from buf[]
to file starting at the offset
position, returning the number of bytes successfully written. This function does not alter the current file position. This function is thread-safe against all other concurrent calls to pread() and pwrite(), but not against any other function of IOProxy.
Reimplemented from Filesystem::IOProxy.
|
overridevirtual |
Reimplemented from Filesystem::IOProxy.
|
overridevirtual |
Reimplemented from Filesystem::IOProxy.
|
overridevirtual |
Reimplemented from Filesystem::IOProxy.
|
overridevirtual |
Reimplemented from Filesystem::IOProxy.
|
protected |
Definition at line 502 of file filesystem.h.
|
protected |
Definition at line 500 of file filesystem.h.
|
protected |
Definition at line 503 of file filesystem.h.
|
protected |
Definition at line 501 of file filesystem.h.