Panda3D
Public Types | Public Member Functions

ISubStream Class Reference

An istream object that presents a subwindow into another istream. More...

Inheritance diagram for ISubStream:
istream ios ios_base

List of all members.

Public Types

enum  openmode
enum  seekdir { beg = 0, cur = 1, end = 2 }

Public Member Functions

 ISubStream ()
 ISubStream (IStreamWrapper source, unsigned long int start, unsigned long int end)
bool bad ()
 clear ()
ISubStream close ()
 Resets the SubStream to empty, but does not actually close the source istream.
bool eof ()
bool fail ()
int get ()
bool good ()
ISubStream open (IStreamWrapper source, unsigned long int start, unsigned long int end)
 Starts the SubStream reading from the indicated source, with the first character being the character at position "start" within the source, for end - start total characters.
 seekg (long int off, seekdir dir)
 seekg (unsigned long int pos)
unsigned long int tellg ()

Detailed Description

An istream object that presents a subwindow into another istream.

The first character read from this stream will be the "start" character from the source istream; just before the file pointer reaches the "end" character, eof is returned.

The source stream must be one that we can randomly seek within. The resulting ISubStream will also support arbitrary seeks.


Member Enumeration Documentation

enum openmode [inherited]
enum seekdir [inherited]
Enumerator:
beg 
cur 
end 

Constructor & Destructor Documentation

ISubStream ( IStreamWrapper  source,
unsigned long int  start,
unsigned long int  end 
)

Member Function Documentation

bool bad ( ) [inherited]
clear ( ) [inherited]
ISubStream close ( )

Resets the SubStream to empty, but does not actually close the source istream.

bool eof ( ) [inherited]
bool fail ( ) [inherited]
int get ( ) [inherited]
bool good ( ) [inherited]
ISubStream open ( IStreamWrapper  source,
unsigned long int  start,
unsigned long int  end 
)

Starts the SubStream reading from the indicated source, with the first character being the character at position "start" within the source, for end - start total characters.

The character at "end" within the source will never be read; this will appear to be EOF.

If end is zero, it indicates that the ISubStream will continue until the end of the source stream.

seekg ( long int  off,
seekdir  dir 
) [inherited]
seekg ( unsigned long int  pos) [inherited]
unsigned long int tellg ( ) [inherited]
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties