#include <SkStream.h>
Inherits SkStream.
Public Member Functions | |
SkFDStream (int fileDesc, bool closeWhenDone) | |
virtual | ~SkFDStream () |
bool | isValid () const |
virtual bool | rewind () |
virtual size_t | read (void *buffer, size_t size) |
virtual const char * | getFileName () |
A stream that reads from a file descriptor
Definition at line 140 of file SkStream.h.
SkFDStream::SkFDStream | ( | int | fileDesc, | |
bool | closeWhenDone | |||
) |
Initialize the stream with a dup() of the specified file descriptor. If closeWhenDone is true, then the descriptor will be closed in the destructor.
virtual SkFDStream::~SkFDStream | ( | ) | [virtual] |
virtual const char* SkFDStream::getFileName | ( | ) | [inline, 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.
Definition at line 155 of file SkStream.h.
bool SkFDStream::isValid | ( | ) | const [inline] |
Returns true if the current path could be opened.
Definition at line 151 of file SkStream.h.
virtual size_t SkFDStream::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 SkFDStream::rewind | ( | ) | [virtual] |
Called to rewind to the beginning of the stream. If this cannot be done, return false.
Implements SkStream.