Flutter Engine
The Flutter Engine
Public Member Functions | Private Member Functions | List of all members
SkStreamSeekable Class Referenceabstract

#include <SkStream.h>

Inheritance diagram for SkStreamSeekable:
SkStreamRewindable SkStream SkStreamAsset SkBlockMemoryStream SkFILEStream SkStreamMemory SkDWriteFontFileStream SkMemoryStream

Public Member Functions

std::unique_ptr< SkStreamSeekableduplicate () const
 
bool hasPosition () const override
 
size_t getPosition () const override=0
 
bool seek (size_t position) override=0
 
bool move (long offset) override=0
 
std::unique_ptr< SkStreamSeekablefork () const
 
- Public Member Functions inherited from SkStreamRewindable
bool rewind () override=0
 
std::unique_ptr< SkStreamRewindableduplicate () const
 
- Public Member Functions inherited from SkStream
virtual ~SkStream ()
 
 SkStream ()
 
virtual size_t read (void *buffer, size_t size)=0
 
size_t skip (size_t size)
 
virtual size_t peek (void *, size_t) const
 
virtual bool isAtEnd () const =0
 
bool readS8 (int8_t *)
 
bool readS16 (int16_t *)
 
bool readS32 (int32_t *)
 
bool readU8 (uint8_t *i)
 
bool readU16 (uint16_t *i)
 
bool readU32 (uint32_t *i)
 
bool readBool (bool *b)
 
bool readScalar (SkScalar *)
 
bool readPackedUInt (size_t *)
 
virtual bool rewind ()
 
std::unique_ptr< SkStreamduplicate () const
 
std::unique_ptr< SkStreamfork () const
 
virtual bool hasPosition () const
 
virtual size_t getPosition () const
 
virtual bool seek (size_t)
 
virtual bool move (long)
 
virtual bool hasLength () const
 
virtual size_t getLength () const
 
virtual const void * getMemoryBase ()
 
virtual sk_sp< SkDatagetData () const
 

Private Member Functions

SkStreamSeekableonDuplicate () const override=0
 
SkStreamSeekableonFork () const override=0
 

Additional Inherited Members

- Static Public Member Functions inherited from SkStream
static std::unique_ptr< SkStreamAssetMakeFromFile (const char path[])
 

Detailed Description

SkStreamSeekable is a SkStreamRewindable for which position, seek, move, and fork are required.

Definition at line 166 of file SkStream.h.

Member Function Documentation

◆ duplicate()

std::unique_ptr< SkStreamSeekable > SkStreamSeekable::duplicate ( ) const
inline

Definition at line 168 of file SkStream.h.

168 {
169 return std::unique_ptr<SkStreamSeekable>(this->onDuplicate());
170 }
SkStreamSeekable * onDuplicate() const override=0

◆ fork()

std::unique_ptr< SkStreamSeekable > SkStreamSeekable::fork ( ) const
inline

Definition at line 177 of file SkStream.h.

177 {
178 return std::unique_ptr<SkStreamSeekable>(this->onFork());
179 }
SkStreamSeekable * onFork() const override=0

◆ getPosition()

size_t SkStreamSeekable::getPosition ( ) const
overridepure virtual

Returns the current position in the stream. If this cannot be done, returns 0.

Reimplemented from SkStream.

Implemented in SkFILEStream, SkMemoryStream, SkBlockMemoryStream, and SkDWriteFontFileStream.

◆ hasPosition()

bool SkStreamSeekable::hasPosition ( ) const
inlineoverridevirtual

Returns true if this stream can report its current position.

Reimplemented from SkStream.

Definition at line 172 of file SkStream.h.

172{ return true; }

◆ 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 SkFILEStream, SkMemoryStream, SkBlockMemoryStream, and SkDWriteFontFileStream.

◆ onDuplicate()

SkStreamSeekable * SkStreamSeekable::onDuplicate ( ) const
overrideprivatepure virtual

◆ onFork()

SkStreamSeekable * SkStreamSeekable::onFork ( ) const
overrideprivatepure virtual

Reimplemented from SkStream.

Implemented in SkBlockMemoryStream, SkStreamAsset, and SkStreamMemory.

◆ 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 SkFILEStream, SkMemoryStream, SkBlockMemoryStream, and SkDWriteFontFileStream.


The documentation for this class was generated from the following file: