Om
1.0.0
A universal framework for multimedia simulation
|
A class that handles encoding of resources to binary data. More...
#include <omResourceEncoder.h>
Public Member Functions | |
const ResourceID & | getFileID () const |
Return the resource ID of the resource set file that is being encoded. More... | |
void | setFileID (const ResourceID &newFileID) |
Set the resource ID of the resource set file that is being encoded. More... | |
const io::BinaryFormat & | getFormat () const |
Return a reference to the binary format this encoder is using. More... | |
void | setFormat (const io::BinaryFormat &newFormat) |
Set the binary format this encoder is using. More... | |
io::DataOutputStream * | getStream () const |
Return a pointer to a data stream that is the destination of this encoder. More... | |
void | setStream (io::DataOutputStream *newStream) |
Set a pointer to a data stream that is the destination of this encoder. More... | |
const UByte * | getBufferData () const |
Return a pointer to the start of the data encoding buffer. More... | |
Size | getBufferSize () const |
Return the number of bytes that have been written to the buffer. More... | |
Size | getBufferCapacity () const |
Return the total capacity of the internal buffer. More... | |
Bool | setBufferCapacity (Size newCapacity) |
Set the total capacity of the internal buffer. More... | |
void | pad () |
Pad the alignment of the write position to the next aligned object boundary. More... | |
template<typename T > | |
void | write (const T &value) |
Write a value of the templated type and advance the position. More... | |
template<typename T > | |
void | writeArray (const T *array, Size number) |
Write an array of values of the templated type and advance the data pointer. More... | |
template<typename T > | |
void | writeReference (const T *resource, const ResourceSet &resourceSet) |
Write a resource reference for the specified pointer to a concrete template resource type. More... | |
void | writeOpaqueReference (const OpaqueResource &resource, const ResourceSet &resourceSet) |
Write a resource reference for the specified opaque resource. More... | |
void | writeOpaqueReference (const ResourceType &type, const void *resource, const ResourceSet &resourceSet) |
Write a resource reference for the specified opaque resource. More... | |
void | writeASCIIString (const data::String &string) |
Write an ASCII encoded string starting at the specified data pointer and return it and advance the position. More... | |
void | writeUTF8String (const data::UTF8String &string) |
Write a UTF-8 encoded string starting at the specified data pointer and return it and advance the position. More... | |
void | writeUTF16String (const data::UTF16String &string) |
Write a UTF-16 encoded string starting at the specified data pointer and return it and advance the position. More... | |
void | writeUTF32String (const data::UTF32String &string) |
Write a UTF-32 encoded string starting at the specified data pointer and return it and advance the position. More... | |
Bool | write (const UByte *newData, Size number) |
Write the specified number of bytes of data from the buffer to the stream. More... | |
virtual Size | writeData (const UByte *newData, Size number) |
Write the specified number of bytes of data from the buffer to the stream. More... | |
virtual Bool | canSeek () const |
Return whether or not this type of stream allows seeking. More... | |
virtual Bool | canSeek (Int64 relativeOffset) const |
Return whether or not this stream can seek by the specified amount in bytes. More... | |
virtual Int64 | seek (Int64 relativeOffset) |
Move the current position in the stream by the specified relative signed offset in bytes. More... | |
virtual void | flush () |
Flush buffered output to the stream if the encoder has a valid stream. More... | |
virtual LargeIndex | getPosition () const |
Return the current write position of the encoder relative to the start of the output. More... | |
Public Member Functions inherited from om::io::DataOutputStream | |
virtual | ~DataOutputStream () |
Destroy an output stream and free all of its resources (close it). More... | |
Size | writeData (const data::Data &data) |
Write as much of the specified data array to the stream and return the number of bytes written. More... | |
Size | writeData (const data::DataBuffer &dataBuffer) |
Write as much of the specified data array to the stream and return the number of bytes written. More... | |
A class that handles encoding of resources to binary data.
|
inline |
Return the resource ID of the resource set file that is being encoded.
|
inline |
Set the resource ID of the resource set file that is being encoded.
|
inline |
Return a reference to the binary format this encoder is using.
|
inline |
Set the binary format this encoder is using.
|
inline |
Return a pointer to a data stream that is the destination of this encoder.
If the stream is NULL, the encoder keeps enlarging its internal buffer as necessary.
|
inline |
Set a pointer to a data stream that is the destination of this encoder.
If the stream is NULL, the encoder keeps enlarging its internal buffer as necessary.
|
inline |
Return a pointer to the start of the data encoding buffer.
|
inline |
Return the number of bytes that have been written to the buffer.
|
inline |
Return the total capacity of the internal buffer.
Set the total capacity of the internal buffer.
The method returns whether or not the capacity was successfully changed.
|
inline |
Pad the alignment of the write position to the next aligned object boundary.
|
inline |
Write a value of the templated type and advance the position.
|
inline |
Write an array of values of the templated type and advance the data pointer.
|
inline |
Write a resource reference for the specified pointer to a concrete template resource type.
|
inline |
Write a resource reference for the specified opaque resource.
|
inline |
Write a resource reference for the specified opaque resource.
|
inline |
Write an ASCII encoded string starting at the specified data pointer and return it and advance the position.
|
inline |
Write a UTF-8 encoded string starting at the specified data pointer and return it and advance the position.
|
inline |
Write a UTF-16 encoded string starting at the specified data pointer and return it and advance the position.
|
inline |
Write a UTF-32 encoded string starting at the specified data pointer and return it and advance the position.
Write the specified number of bytes of data from the buffer to the stream.
|
inlinevirtual |
Write the specified number of bytes of data from the buffer to the stream.
The method returns the number of bytes that were actually written.
Implements om::io::DataOutputStream.
|
inlinevirtual |
Return whether or not this type of stream allows seeking.
Implements om::io::DataOutputStream.
Return whether or not this stream can seek by the specified amount in bytes.
Implements om::io::DataOutputStream.
Move the current position in the stream by the specified relative signed offset in bytes.
Implements om::io::DataOutputStream.
|
inlinevirtual |
Flush buffered output to the stream if the encoder has a valid stream.
Implements om::io::DataOutputStream.
|
inlinevirtual |
Return the current write position of the encoder relative to the start of the output.
Implements om::io::DataOutputStream.