Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkSWriter32< SIZE > Class Template Reference

Helper class to allocated SIZE bytes as part of the writer, and to provide that storage to the constructor as its initial storage buffer. More...

#include <SkWriter32.h>

Inheritance diagram for SkSWriter32< SIZE >:
SkWriter32

Public Member Functions

void reset ()
 
- Public Member Functions inherited from SkWriter32
 SkWriter32 (void *external=NULL, size_t externalBytes=0)
 The caller can specify an initial block of storage, which the caller manages. More...
 
size_t bytesWritten () const
 
size_t size () const
 
void reset (void *external=NULL, size_t externalBytes=0)
 
uint32_t * reserve (size_t size)
 
template<typename T >
const T & readTAt (size_t offset) const
 Read a T record at offset, which must be a multiple of 4. More...
 
template<typename T >
void overwriteTAt (size_t offset, const T &value)
 Overwrite a T record at offset, which must be a multiple of 4. More...
 
bool writeBool (bool value)
 
void writeInt (int32_t value)
 
void write8 (int32_t value)
 
void write16 (int32_t value)
 
void write32 (int32_t value)
 
void writePtr (void *value)
 
void writeScalar (SkScalar value)
 
void writePoint (const SkPoint &pt)
 
void writePoint3 (const SkPoint3 &pt)
 
void writeRect (const SkRect &rect)
 
void writeIRect (const SkIRect &rect)
 
void writeRRect (const SkRRect &rrect)
 
void writePath (const SkPath &path)
 
void writeMatrix (const SkMatrix &matrix)
 
void writeRegion (const SkRegion &rgn)
 
void writeMul4 (const void *values, size_t size)
 
void write (const void *values, size_t size)
 Write size bytes from values. More...
 
uint32_t * reservePad (size_t size)
 Reserve size bytes. More...
 
void writePad (const void *src, size_t size)
 Write size bytes from src, and pad to 4 byte alignment with zeroes.
 
void writeString (const char *str, size_t len=(size_t)-1)
 Writes a string to the writer, which can be retrieved with SkReader32::readString(). More...
 
void writeData (const SkData *data)
 
void rewindToOffset (size_t offset)
 Move the cursor back to offset bytes from the beginning. More...
 
void flatten (void *dst) const
 
bool writeToStream (SkWStream *stream) const
 
size_t readFromStream (SkStream *stream, size_t length)
 
sk_sp< SkDatasnapshotAsData () const
 Captures a snapshot of the data as it is right now, and return it.
 

Private Types

typedef SkWriter32 INHERITED
 

Private Attributes

union {
   void *   fPtrAlignment
 
   double   fDoubleAlignment
 
   char   fStorage [SIZE]
 
fData
 

Additional Inherited Members

- Static Public Member Functions inherited from SkWriter32
static size_t WriteStringSize (const char *str, size_t len=(size_t)-1)
 Computes the size (aligned to multiple of 4) need to write the string in a call to writeString(). More...
 
static size_t WriteDataSize (const SkData *data)
 

Detailed Description

template<size_t SIZE>
class SkSWriter32< SIZE >

Helper class to allocated SIZE bytes as part of the writer, and to provide that storage to the constructor as its initial storage buffer.

This wrapper ensures proper alignment rules are met for the storage.


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