#include <OgreDataStream.h>
Public Member Functions | |
| DataStream () | |
| Constructor for creating unnamed streams. | |
| DataStream (const String &name) | |
| Constructor for creating named streams. | |
| const String & | getName (void) |
| Returns the name of the stream, if it has one. | |
| virtual | ~DataStream () |
| template<typename T> | |
| DataStream & | operator>> (T &val) |
| virtual size_t | read (void *buf, size_t count)=0 |
| Read the requisite number of bytes from the stream, stopping at the end of the file. | |
| virtual size_t | readLine (char *buf, size_t maxCount, const String &delim="\n") |
| Get a single line from the stream. | |
| virtual String | getLine (bool trimAfter=true) |
| Returns a String containing the next line of data, optionally trimmed for whitespace. | |
| virtual String | getAsString (void) |
| Returns a String containing the entire stream. | |
| virtual size_t | skipLine (const String &delim="\n") |
| Skip a single line from the stream. | |
| virtual void | skip (long count)=0 |
| Skip a defined number of bytes. | |
| virtual void | seek (size_t pos)=0 |
| Repositions the read point to a specified byte. | |
| virtual size_t | tell (void) const =0 |
| Returns the current byte offset from beginning. | |
| virtual bool | eof (void) const =0 |
| Returns true if the stream has reached the end. | |
| size_t | size (void) const |
| Returns the total size of the data to be read from the stream, or 0 if this is indeterminate for this stream. | |
| virtual void | close (void)=0 |
| Close the stream; this makes further operations invalid. | |
Protected Attributes | |
| String | mName |
| The name (e.g. resource name) that can be used to identify the source fot his data (optional). | |
| size_t | mSize |
| Size of the data in the stream (may be 0 if size cannot be determined). | |
Definition at line 58 of file OgreDataStream.h.
| Ogre::DataStream::DataStream | ( | ) |
| Ogre::DataStream::DataStream | ( | const String & | name | ) |
| virtual Ogre::DataStream::~DataStream | ( | ) | [virtual] |
Definition at line 73 of file OgreDataStream.h.
| const String& Ogre::DataStream::getName | ( | void | ) |
| DataStream& Ogre::DataStream::operator>> | ( | T & | val | ) |
| virtual size_t Ogre::DataStream::read | ( | void * | buf, | |
| size_t | count | |||
| ) | [pure virtual] |
Read the requisite number of bytes from the stream, stopping at the end of the file.
| buf | Reference to a buffer pointer | |
| count | Number of bytes to read |
Implemented in Ogre::MemoryDataStream, Ogre::FileStreamDataStream, Ogre::FileHandleDataStream, and Ogre::ZipDataStream.
| virtual size_t Ogre::DataStream::readLine | ( | char * | buf, | |
| size_t | maxCount, | |||
| const String & | delim = "\n" | |||
| ) | [virtual] |
Get a single line from the stream.
| buf | Reference to a buffer pointer | |
| maxCount | The maximum length of data to be read, excluding the terminating character | |
| delim | The delimiter to stop at |
Reimplemented in Ogre::MemoryDataStream, and Ogre::FileStreamDataStream.
| virtual String Ogre::DataStream::getLine | ( | bool | trimAfter = true |
) | [virtual] |
Returns a String containing the next line of data, optionally trimmed for whitespace.
| trimAfter | If true, the line is trimmed for whitespace (as in String.trim(true,true)) |
| virtual String Ogre::DataStream::getAsString | ( | void | ) | [virtual] |
Returns a String containing the entire stream.
| virtual size_t Ogre::DataStream::skipLine | ( | const String & | delim = "\n" |
) | [virtual] |
Skip a single line from the stream.
| delim | The delimiter(s) to stop at |
Reimplemented in Ogre::MemoryDataStream.
| virtual void Ogre::DataStream::skip | ( | long | count | ) | [pure virtual] |
Skip a defined number of bytes.
This can also be a negative value, in which case the file pointer rewinds a defined number of bytes.
Implemented in Ogre::MemoryDataStream, Ogre::FileStreamDataStream, Ogre::FileHandleDataStream, and Ogre::ZipDataStream.
| virtual void Ogre::DataStream::seek | ( | size_t | pos | ) | [pure virtual] |
Repositions the read point to a specified byte.
Implemented in Ogre::MemoryDataStream, Ogre::FileStreamDataStream, Ogre::FileHandleDataStream, and Ogre::ZipDataStream.
| virtual size_t Ogre::DataStream::tell | ( | void | ) | const [pure virtual] |
Returns the current byte offset from beginning.
Implemented in Ogre::MemoryDataStream, Ogre::FileStreamDataStream, Ogre::FileHandleDataStream, and Ogre::ZipDataStream.
| virtual bool Ogre::DataStream::eof | ( | void | ) | const [pure virtual] |
Returns true if the stream has reached the end.
Implemented in Ogre::MemoryDataStream, Ogre::FileStreamDataStream, Ogre::FileHandleDataStream, and Ogre::ZipDataStream.
| size_t Ogre::DataStream::size | ( | void | ) | const |
Returns the total size of the data to be read from the stream, or 0 if this is indeterminate for this stream.
Definition at line 149 of file OgreDataStream.h.
| virtual void Ogre::DataStream::close | ( | void | ) | [pure virtual] |
Close the stream; this makes further operations invalid.
Implemented in Ogre::MemoryDataStream, Ogre::FileStreamDataStream, Ogre::FileHandleDataStream, and Ogre::ZipDataStream.
String Ogre::DataStream::mName [protected] |
The name (e.g. resource name) that can be used to identify the source fot his data (optional).
Definition at line 62 of file OgreDataStream.h.
size_t Ogre::DataStream::mSize [protected] |
Size of the data in the stream (may be 0 if size cannot be determined).
Definition at line 64 of file OgreDataStream.h.
Copyright © 2000-2005 by The OGRE Team

This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Mon Jun 16 12:49:29 2008