Minimal file-backed asIBinaryStream for bytecode I/O.
More...
#include <kscriptmanager.h>
|
| | kFileByteStream (const kString &path, bool writing) |
| | Opens path for bytecode reading or writing.
|
| | ~kFileByteStream () override |
| | Closes the underlying file if it is open.
|
| bool | isOpen () const |
| | Returns true if the underlying file opened successfully.
|
| int | Read (void *ptr, asUINT size) override |
| | Reads size bytes from the file into ptr.
|
| int | Write (const void *ptr, asUINT size) override |
| | Writes size bytes from ptr to the file.
|
Minimal file-backed asIBinaryStream for bytecode I/O.
Used by kScriptManager to write (SaveByteCode) and read (LoadByteCode) AngelScript bytecode to and from disk.
◆ kFileByteStream()
| kemena::kFileByteStream::kFileByteStream |
( |
const kString & | path, |
|
|
bool | writing ) |
Opens path for bytecode reading or writing.
- Parameters
-
| path | File path to open. |
| writing | true to open for writing, false for reading. |
◆ ~kFileByteStream()
| kemena::kFileByteStream::~kFileByteStream |
( |
| ) |
|
|
override |
Closes the underlying file if it is open.
◆ isOpen()
| bool kemena::kFileByteStream::isOpen |
( |
| ) |
const |
|
inline |
Returns true if the underlying file opened successfully.
◆ Read()
| int kemena::kFileByteStream::Read |
( |
void * | ptr, |
|
|
asUINT | size ) |
|
override |
Reads size bytes from the file into ptr.
- Parameters
-
| ptr | Destination buffer. |
| size | Number of bytes to read. |
- Returns
- 0 on success, negative on error (asIBinaryStream convention).
◆ Write()
| int kemena::kFileByteStream::Write |
( |
const void * | ptr, |
|
|
asUINT | size ) |
|
override |
Writes size bytes from ptr to the file.
- Parameters
-
| ptr | Source buffer. |
| size | Number of bytes to write. |
- Returns
- 0 on success, negative on error (asIBinaryStream convention).
The documentation for this class was generated from the following file: