Om
1.0.0
A universal framework for multimedia simulation
|
A class that abstracts a source for a stream of character information. More...
#include <omStringInputStream.h>
Public Member Functions | |
StringInputStream () | |
Create a StringInputStream with the native endianness. More... | |
StringInputStream (data::Endianness newEndianness) | |
Create a StringInputStream with the specified input endianness. More... | |
virtual | ~StringInputStream () |
Destroy an input stream and free all of it's resources (close it). More... | |
virtual LargeSize | getCharactersRemaining () const =0 |
Return the number of ASCII characters remaining in the stream. More... | |
Bool | hasCharactersRemaining () const |
Return whether or not there are bytes remaining in the stream. More... | |
Bool | readASCII (Char &value) |
Read a single ASCII character and place it in the input parameter. More... | |
Bool | readUTF32 (UTF32Char &value) |
Read a single UTF32 character and place it in the input parameter. More... | |
Size | readASCII (Char *buffer, Size numBytes) |
Read the specified number of ASCII characters and place them in the output buffer. More... | |
Size | readUTF8 (UTF8Char *buffer, Size numChars, Size capacity) |
Read the specified number of UTF-8 characters and place them in the output buffer. More... | |
Size | readUTF16 (UTF16Char *buffer, Size numChars, Size capacity) |
Read the specified number of UTF-16 characters and place them in the output buffer. More... | |
Size | readUTF32 (UTF32Char *buffer, Size numChars) |
Read the specified number of UTF-16 characters and place them in the output buffer. More... | |
Size | readASCII (data::StringBuffer &buffer, Size numChars) |
Read the specified number of characters from the stream and place them in the specified string buffer. More... | |
Size | readUTF8 (data::UTF8StringBuffer &buffer, Size numChars) |
Read the specified number of characters from the stream and place them in the specified UTF-8 string buffer. More... | |
Size | readUTF16 (data::UTF16StringBuffer &buffer, Size numChars) |
Read the specified number of characters from the stream and place them in the specified UTF-16 string buffer. More... | |
Size | readUTF32 (data::UTF32StringBuffer &buffer, Size numChars) |
Read the specified number of characters from the stream and place them in the specified UTF-32 string buffer. More... | |
data::String | readAllASCII () |
data::UTF8String | readAllUTF8 () |
data::UTF16String | readAllUTF16 () |
data::UTF32String | readAllUTF32 () |
data::Endianness | getEndianness () const |
Get the endianness to assume when reading from the stream. More... | |
void | setEndianness (data::Endianness newEndianness) |
Set the endianness to assume when reading from the stream. More... | |
Protected Member Functions | |
virtual Size | readChars (Char *buffer, Size number)=0 |
Read the specified number of characters from the stream and place them in the specified output buffer. More... | |
virtual Size | readUTF8Chars (UTF8Char *buffer, Size numChars, Size capacity)=0 |
Read the specified number of UTF-8 characters from the stream and place them in the specified output buffer. More... | |
virtual Size | readUTF16Chars (UTF16Char *buffer, Size numChars, Size capacity)=0 |
Read the specified number of UTF-16 characters from the stream and place them in the specified output buffer. More... | |
virtual Size | readUTF32Chars (UTF32Char *buffer, Size numChars)=0 |
Read the specified number of UTF-32 characters from the stream and place them in the specified output buffer. More... | |
A class that abstracts a source for a stream of character information.
|
inline |
Create a StringInputStream with the native endianness.
|
inline |
Create a StringInputStream with the specified input endianness.
|
inlinevirtual |
Destroy an input stream and free all of it's resources (close it).
|
pure virtual |
Return the number of ASCII characters remaining in the stream.
The value returned must only be a lower bound on the number of characters remaining in the stream. If there are characters remaining, it must return at least 1.
Implemented in om::io::FileReader.
|
inline |
Return whether or not there are bytes remaining in the stream.
Read a single ASCII character and place it in the input parameter.
If the read operation was successful, return TRUE, otherwise return FALSE.
Read a single UTF32 character and place it in the input parameter.
If the read operation was successful, return TRUE, otherwise return FALSE.
Read the specified number of ASCII characters and place them in the output buffer.
The number of characters successfully read is returned.
Read the specified number of UTF-8 characters and place them in the output buffer.
The number of unicode code points successfully read is returned. The number of code points read is limited to the specified buffer capacity. The number of full unicode characters actually read is placed in the input/output paramter numChars.
|
inline |
Read the specified number of UTF-16 characters and place them in the output buffer.
The number of unicode code points successfully read is returned. The number of code points read is limited to the specified buffer capacity. The number of full unicode characters actually read is placed in the input/output paramter numChars.
Read the specified number of UTF-16 characters and place them in the output buffer.
The number of characters successfully read is returned.
Size om::io::StringInputStream::readASCII | ( | data::StringBuffer & | buffer, |
Size | numChars | ||
) |
Read the specified number of characters from the stream and place them in the specified string buffer.
Size om::io::StringInputStream::readUTF8 | ( | data::UTF8StringBuffer & | buffer, |
Size | numChars | ||
) |
Read the specified number of characters from the stream and place them in the specified UTF-8 string buffer.
The number of unicode code points read is returned and the number of characters actually read is placed in the input/output paramter numChars.
Size om::io::StringInputStream::readUTF16 | ( | data::UTF16StringBuffer & | buffer, |
Size | numChars | ||
) |
Read the specified number of characters from the stream and place them in the specified UTF-16 string buffer.
The number of unicode code points read is returned and the number of characters actually read is placed in the input/output paramter numChars.
Size om::io::StringInputStream::readUTF32 | ( | data::UTF32StringBuffer & | buffer, |
Size | numChars | ||
) |
Read the specified number of characters from the stream and place them in the specified UTF-32 string buffer.
The number of characters read is returned.
data::String om::io::StringInputStream::readAllASCII | ( | ) |
data::UTF8String om::io::StringInputStream::readAllUTF8 | ( | ) |
|
inline |
|
inline |
|
inline |
Get the endianness to assume when reading from the stream.
|
inline |
Set the endianness to assume when reading from the stream.
|
protectedpure virtual |
Read the specified number of characters from the stream and place them in the specified output buffer.
Implemented in om::io::FileReader.
|
protectedpure virtual |
Read the specified number of UTF-8 characters from the stream and place them in the specified output buffer.
If the number of unicode code points exceeds the capacity of the buffer, as many characters are read as possible. The number of code points read is returned.
Implemented in om::io::FileReader.
|
protectedpure virtual |
Read the specified number of UTF-16 characters from the stream and place them in the specified output buffer.
If the number of unicode code points exceeds the capacity of the buffer, as many characters are read as possible. The number of code points read is returned.
Implemented in om::io::FileReader.
|
protectedpure virtual |
Read the specified number of UTF-32 characters from the stream and place them in the specified output buffer.
If the number of unicode code points exceeds the capacity of the buffer, as many characters are read as possible. The number of code points read is returned.
Implemented in om::io::FileReader.