#include <SkStream.h>
Inherits SkStream.
Public Member Functions | |
SkFILEStream (const char path[]=NULL) | |
virtual | ~SkFILEStream () |
bool | isValid () const |
void | setPath (const char path[]) |
virtual bool | rewind () |
virtual size_t | read (void *buffer, size_t size) |
virtual const char * | getFileName () |
A stream that reads from a FILE*, which is opened in the constructor and closed in the destructor
Definition at line 113 of file SkStream.h.
SkFILEStream::SkFILEStream | ( | const char | path[] = NULL |
) | [explicit] |
Initialize the stream by calling fopen on the specified path. Will be closed in the destructor.
virtual SkFILEStream::~SkFILEStream | ( | ) | [virtual] |
virtual const char* SkFILEStream::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 from SkStream.
bool SkFILEStream::isValid | ( | ) | const [inline] |
Returns true if the current path could be opened.
Definition at line 123 of file SkStream.h.
virtual size_t SkFILEStream::read | ( | void * | buffer, | |
size_t | size | |||
) | [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 |
Implements SkStream.
virtual bool SkFILEStream::rewind | ( | ) | [virtual] |
Called to rewind to the beginning of the stream. If this cannot be done, return false.
Implements SkStream.
void SkFILEStream::setPath | ( | const char | path[] | ) |
Close the current file, and open a new file with the specified path. If path is NULL, just close the current file.