#include <SkStream.h>
Inherits SkRefCnt.
Inherited by SkBufferStream, SkFDStream, SkFILEStream, and SkMemoryStream.
Public Member Functions | |
virtual | ~SkStream () |
virtual bool | rewind ()=0 |
virtual const char * | getFileName () |
virtual size_t | read (void *buffer, size_t size)=0 |
size_t | getLength () |
size_t | skip (size_t bytes) |
virtual const void * | getMemoryBase () |
int8_t | readS8 () |
int16_t | readS16 () |
int32_t | readS32 () |
uint8_t | readU8 () |
uint16_t | readU16 () |
uint32_t | readU32 () |
bool | readBool () |
SkScalar | readScalar () |
size_t | readPackedUInt () |
Definition at line 23 of file SkStream.h.
virtual SkStream::~SkStream | ( | ) | [virtual] |
virtual const char* SkStream::getFileName | ( | ) | [virtual] |
If this stream represents a file, this method returns the file's name. If it does not, it returns NULL (the default behavior).
Reimplemented in SkFILEStream, SkFDStream, and SkBufferStream.
size_t SkStream::getLength | ( | ) | [inline] |
Return the total length of the stream.
Definition at line 46 of file SkStream.h.
virtual const void* SkStream::getMemoryBase | ( | ) | [virtual] |
If the stream is backed by RAM, this method returns the starting address for the data. If not (i.e. it is backed by a file or other structure), this method returns NULL. The default implementation returns NULL.
Reimplemented in SkMemoryStream, and SkBufferStream.
virtual size_t SkStream::read | ( | void * | buffer, | |
size_t | size | |||
) | [pure virtual] |
Called to read or skip size number of bytes. If buffer is NULL and size > 0, skip that many bytes, returning how many were skipped. If buffer is NULL and size == 0, return the total length of the stream. If buffer != NULL, copy the requested number of bytes into buffer, returning how many were copied.
buffer | If buffer is NULL, ignore and just skip size bytes, otherwise copy size bytes into buffer | |
size | The number of bytes to skip or copy |
Implemented in SkFILEStream, SkFDStream, SkMemoryStream, and SkBufferStream.
bool SkStream::readBool | ( | ) | [inline] |
Definition at line 68 of file SkStream.h.
size_t SkStream::readPackedUInt | ( | ) |
int16_t SkStream::readS16 | ( | ) |
int32_t SkStream::readS32 | ( | ) |
int8_t SkStream::readS8 | ( | ) |
SkScalar SkStream::readScalar | ( | ) |
uint16_t SkStream::readU16 | ( | ) | [inline] |
Definition at line 65 of file SkStream.h.
uint32_t SkStream::readU32 | ( | ) | [inline] |
Definition at line 66 of file SkStream.h.
uint8_t SkStream::readU8 | ( | ) | [inline] |
Definition at line 64 of file SkStream.h.
virtual bool SkStream::rewind | ( | ) | [pure virtual] |
Called to rewind to the beginning of the stream. If this cannot be done, return false.
Implemented in SkFILEStream, SkFDStream, SkMemoryStream, and SkBufferStream.
size_t SkStream::skip | ( | size_t | bytes | ) |
Skip the specified number of bytes, returning the actual number of bytes that could be skipped.