Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
StringDecoder Class Reference

The base class to a family of classes that decode various kinds of encoded byte streams. More...

#include "stringDecoder.h"

Inheritance diagram for StringDecoder:
StringUnicodeDecoder StringUtf8Decoder

List of all members.

Public Member Functions

 StringDecoder (const string &input)
virtual int get_next_character ()
 Returns the next character in sequence.
bool is_eof ()
 Returns true if the decoder has returned the last character in the string, false if there are more to go.

Static Public Member Functions

static ostream * get_notify_ptr ()
 Returns the ostream that is used to write error messages to.
static void set_notify_ptr (ostream *ptr)
 Sets the ostream that is used to write error messages to.

Protected Member Functions

bool test_eof ()
 If the pointer is past the last character of the string, set the eof flag and return true.

Protected Attributes

bool _eof
string _input
size_t _p

Static Protected Attributes

static ostream * _notify_ptr = &cerr

Detailed Description

The base class to a family of classes that decode various kinds of encoded byte streams.

Give it a string, then ask it to pull the characters out one at a time. This also serves as the plain old byte-at-a-time decoder.

Definition at line 28 of file stringDecoder.h.


Member Function Documentation

Returns the next character in sequence.

Reimplemented in StringUnicodeDecoder, and StringUtf8Decoder.

Definition at line 35 of file stringDecoder.cxx.

References test_eof().

ostream * StringDecoder::get_notify_ptr ( ) [static]

Returns the ostream that is used to write error messages to.

See set_notify_ptr().

Definition at line 63 of file stringDecoder.cxx.

bool StringDecoder::is_eof ( ) [inline]

Returns true if the decoder has returned the last character in the string, false if there are more to go.

Definition at line 35 of file stringDecoder.I.

void StringDecoder::set_notify_ptr ( ostream *  notify_ptr) [static]

Sets the ostream that is used to write error messages to.

This is necessary because of the low-level placement of this class, before the definition of the NotifyCategory class, so it cannot specify its own notify.

Definition at line 52 of file stringDecoder.cxx.

bool StringDecoder::test_eof ( ) [inline, protected]

If the pointer is past the last character of the string, set the eof flag and return true.

Definition at line 46 of file stringDecoder.I.

Referenced by get_next_character(), StringUtf8Decoder::get_next_character(), and StringUnicodeDecoder::get_next_character().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations