Snap! Websites
An Open Source CMS System in C++
#include <stream.h>
DecodingFilter::pointer_t(new DecodingFilterDetect)
)
protected
This function initializes the input object making it ready to be used to read data from a file, a string, or a TTY.
The filter
should generally not be specified, although if you know the format of an input file, it can be useful to force the filter to the exact format. We only support Unicode formats, though.
Definition at line 517 of file stream.cpp.
This function reads the next character from the input. In most cases this reads one or more bytes from the input file, and then it converts those bytes in a character using a filter.
This function does not return Input::INPUT_NAC. Instead it reads as much data as it can and returns the next character, no matter what. However, it may return EOF if the end of the file is reached, or ERR if a character in the stream is not valid. There are two types of invalid characters: (1) numbers that are outside of the Unicode range (0 .. 0x010FFFF) or a UTF-16 surrogate in a format that does not support such surrogate (UTF-8, UTF-32), and (2) byte sequences that end before a valid character can be formed (missing surrogate, invalid UTF-8).
Reimplemented in as2js::StringInput.
Definition at line 609 of file stream.cpp.
References f_filter, get_byte(), INPUT_EOF, INPUT_ERR, and INPUT_NAC.
Referenced by getc().
This virtual function is used by the filter_getc() function to retrieve the next character of data from the input stream. The default implementation of the function throws because it should never get called.
Note that it is possible to bypass this function by implementing instead the filter_getc() in your own class.
Reimplemented in as2js::FileInput, and as2js::StandardInput.
Definition at line 652 of file stream.cpp.
Referenced by filter_getc().
The stream manages a position object. The call can use this function to retrieve a read/write version of the current position.
Definition at line 532 of file stream.cpp.
References f_position.
Referenced by as2js::StandardOutput::internal_write(), as2js::FileOutput::internal_write(), as2js::FileInput::open(), as2js::FileOutput::open(), as2js::StandardInput::StandardInput(), as2js::StandardOutput::StandardOutput(), and as2js::StringInput::StringInput().
The stream manages a position object. The call can use this function to retrieve a read-only version of the current position.
Definition at line 545 of file stream.cpp.
References f_position.
This function retrieves the next character from the input object.
If the caller used the ungetc() function, then the characters that were ungotten are returned first in the opposite order (FILO).
Definition at line 560 of file stream.cpp.
References f_unget, and filter_getc().
This function saves the specified character c
in a buffer of the Input object. The next getc() call will first return that last character the caller unget.
Definition at line 580 of file stream.cpp.
References f_unget.
Definition at line 173 of file stream.h.
Referenced by filter_getc().
Definition at line 174 of file stream.h.
Referenced by get_position(), and as2js::Output::get_position().
Definition at line 155 of file stream.h.
Referenced by filter_getc(), as2js::StringInput::filter_getc(), as2js::StandardInput::get_byte(), as2js::FileInput::get_byte(), as2js::DecodingFilterDetect::get_char(), and as2js::DecodingFilter::getc().
Definition at line 157 of file stream.h.
Referenced by filter_getc(), as2js::DecodingFilterUTF8::get_char(), as2js::DecodingFilterUTF16LE::get_char(), as2js::DecodingFilterUTF16BE::get_char(), as2js::DecodingFilterUTF32LE::get_char(), as2js::DecodingFilterUTF32BE::get_char(), and as2js::DecodingFilterUTF16::next_char().
Definition at line 156 of file stream.h.
Referenced by filter_getc(), as2js::DecodingFilterUTF8::get_char(), as2js::DecodingFilterUTF16LE::get_char(), as2js::DecodingFilterUTF16BE::get_char(), as2js::DecodingFilterUTF32LE::get_char(), as2js::DecodingFilterUTF32BE::get_char(), as2js::DecodingFilterDetect::get_char(), and as2js::DecodingFilterUTF16::next_char().
This document is part of the Snap! Websites Project.
Copyright by Made to Order Software Corp.
Snap! Websites
An Open Source CMS System in C++