SkStreamSeekable is a SkStreamRewindable for which position, seek, move, and fork are required.
More...
#include <SkStream.h>
SkStreamSeekable is a SkStreamRewindable for which position, seek, move, and fork are required.
◆ duplicate()
◆ fork()
◆ getLength()
virtual size_t SkStream::getLength |
( |
| ) |
const |
|
inlinevirtualinherited |
◆ getMemoryBase()
virtual const void* SkStream::getMemoryBase |
( |
| ) |
|
|
inlinevirtualinherited |
◆ getPosition()
size_t SkStreamSeekable::getPosition |
( |
| ) |
const |
|
overridepure virtual |
◆ hasLength()
virtual bool SkStream::hasLength |
( |
| ) |
const |
|
inlinevirtualinherited |
Returns true if this stream can report its total length.
Reimplemented in SkStreamAsset.
◆ hasPosition()
bool SkStreamSeekable::hasPosition |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns true if this stream can report its current position.
Reimplemented from SkStream.
◆ isAtEnd()
virtual bool SkStream::isAtEnd |
( |
| ) |
const |
|
pure virtualinherited |
Returns true when all the bytes in the stream have been read.
As SkStream represents synchronous I/O, isAtEnd returns false when the final stream length isn't known yet, even when all the bytes available so far have been read. This may return true early (when there are no more bytes to be read) or late (after the first unsuccessful read).
Implemented in SkMemoryStream, and SkFILEStream.
◆ MakeFromFile()
static std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile |
( |
const char |
path[] | ) |
|
|
staticinherited |
Attempts to open the specified file as a stream, returns nullptr on failure.
◆ move()
bool SkStreamSeekable::move |
( |
long |
| ) |
|
|
overridepure virtual |
Seeks to an relative offset in the stream.
If this cannot be done, returns false. If an attempt is made to move to a position outside the stream, the position will be set to the closest point within the stream (beginning or end).
Reimplemented from SkStream.
Implemented in SkMemoryStream, and SkFILEStream.
◆ peek()
virtual size_t SkStream::peek |
( |
void * |
, |
|
|
size_t |
|
|
) |
| const |
|
inlinevirtualinherited |
Attempt to peek at size bytes.
If this stream supports peeking, copy min(size, peekable bytes) into buffer, and return the number of bytes copied. If the stream does not support peeking, or cannot peek any bytes, return 0 and leave buffer unchanged. The stream is guaranteed to be in the same visible state after this call, regardless of success or failure.
- Parameters
-
buffer | Must not be NULL, and must be at least size bytes. Destination to copy bytes. |
size | Number of bytes to copy. |
- Returns
- The number of bytes peeked/copied.
Reimplemented in SkMemoryStream.
◆ read()
virtual size_t SkStream::read |
( |
void * |
buffer, |
|
|
size_t |
size |
|
) |
| |
|
pure virtualinherited |
Reads or skips size number of bytes.
If buffer == NULL, skip size bytes, return how many were skipped. If buffer != NULL, copy size bytes into buffer, return how many were copied.
- Parameters
-
buffer | when NULL skip size bytes, otherwise copy size bytes into buffer |
size | the number of bytes to skip or copy |
- Returns
- the number of bytes actually read.
Implemented in SkMemoryStream, and SkFILEStream.
◆ readBool()
bool SkStream::readBool |
( |
bool * |
b | ) |
|
|
inlineinherited |
◆ readPackedUInt()
bool SkStream::readPackedUInt |
( |
size_t * |
| ) |
|
|
inherited |
◆ readS16()
bool SkStream::readS16 |
( |
int16_t * |
| ) |
|
|
inherited |
◆ readS32()
bool SkStream::readS32 |
( |
int32_t * |
| ) |
|
|
inherited |
◆ readS8()
bool SkStream::readS8 |
( |
int8_t * |
| ) |
|
|
inherited |
◆ readScalar()
bool SkStream::readScalar |
( |
SkScalar * |
| ) |
|
|
inherited |
◆ readU16()
bool SkStream::readU16 |
( |
uint16_t * |
i | ) |
|
|
inlineinherited |
◆ readU32()
bool SkStream::readU32 |
( |
uint32_t * |
i | ) |
|
|
inlineinherited |
◆ readU8()
bool SkStream::readU8 |
( |
uint8_t * |
i | ) |
|
|
inlineinherited |
◆ rewind()
bool SkStreamRewindable::rewind |
( |
| ) |
|
|
overridepure virtualinherited |
Rewinds to the beginning of the stream.
Returns true if the stream is known to be at the beginning after this call returns.
Reimplemented from SkStream.
Implemented in SkMemoryStream, and SkFILEStream.
◆ seek()
bool SkStreamSeekable::seek |
( |
size_t |
| ) |
|
|
overridepure virtual |
Seeks to an absolute position in the stream.
If this cannot be done, returns false. If an attempt is made to seek past the end of the stream, the position will be set to the end of the stream.
Reimplemented from SkStream.
Implemented in SkMemoryStream, and SkFILEStream.
◆ skip()
size_t SkStream::skip |
( |
size_t |
size | ) |
|
|
inlineinherited |
Skip size number of bytes.
- Returns
- the actual number bytes that could be skipped.
The documentation for this class was generated from the following file: