Gnash
0.8.10
|
The SWFParser parses tags from a SWFStream. More...
#include <SWFParser.h>
Public Member Functions | |
SWFParser (SWFStream &in, movie_definition *md, const RunResources &runResources) | |
size_t | bytesRead () const |
The number of bytes processed by this SWFParser. | |
bool | read (std::streamsize bytes) |
Parse a specified number of bytes from the stream. |
The SWFParser parses tags from a SWFStream.
The definitions created from the tags are added to one of the higher-level definition types: either a sprite_definition or a SWFMovieDefinition. SWFParser's interface deals only with the size of data it has to read, or the number of bytes read. It does not expose the absolute stream position. This is intended to make internal refactoring simpler. Users must tell the SWFParser how many bytes it should read from the stream. The SWFParser will only deal with ParserExceptions in an open tag. Exceptions thrown when opening and closing tags signal a fatal error, and will be left to the callers to deal with.
gnash::SWFParser::SWFParser | ( | SWFStream & | in, |
movie_definition * | md, | ||
const RunResources & | runResources | ||
) | [inline] |
size_t gnash::SWFParser::bytesRead | ( | ) | const [inline] |
The number of bytes processed by this SWFParser.
bool gnash::SWFParser::read | ( | std::streamsize | bytes | ) |
Parse a specified number of bytes from the stream.
This function will read as many complete tags as are in the specified number of bytes. Any incomplete tags will be left open and unparsed until the next call to read().
bytes | The number of bytes to read. Callers must ensure this is not past the end of the stream, or this function may never return. |
References gnash::key::SWF, gnash::RunResources::tagLoaders(), startPos, gnash::SWFStream::tell(), gnash::SWF::END, gnash::SWF::SHOWFRAME, IF_VERBOSE_PARSE, _, gnash::movie_definition::incrementLoadedFrames(), gnash::SWF::TagLoadersTable::get(), and gnash::key::e.