Kemena3D
Loading...
Searching...
No Matches
kemena::kFileByteStream Class Reference
module nullptr

Minimal file-backed asIBinaryStream for bytecode I/O. More...

#include <kscriptmanager.h>

Inheritance diagram for kemena::kFileByteStream:
Collaboration diagram for kemena::kFileByteStream:

Public Member Functions

 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.

Detailed Description

Minimal file-backed asIBinaryStream for bytecode I/O.

Used by kScriptManager to write (SaveByteCode) and read (LoadByteCode) AngelScript bytecode to and from disk.

Constructor & Destructor Documentation

◆ kFileByteStream()

kemena::kFileByteStream::kFileByteStream ( const kString & path,
bool writing )

Opens path for bytecode reading or writing.

Parameters
pathFile path to open.
writingtrue to open for writing, false for reading.

◆ ~kFileByteStream()

kemena::kFileByteStream::~kFileByteStream ( )
override

Closes the underlying file if it is open.

Member Function Documentation

◆ 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
ptrDestination buffer.
sizeNumber 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
ptrSource buffer.
sizeNumber of bytes to write.
Returns
0 on success, negative on error (asIBinaryStream convention).

The documentation for this class was generated from the following file: