Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkString Class Reference

Light weight class for managing strings. More...

#include <SkString.h>

Classes

struct  Rec
 

Public Member Functions

 SkString (size_t len)
 
 SkString (const char text[])
 
 SkString (const char text[], size_t len)
 
 SkString (const SkString &)
 
 SkString (SkString &&)
 
bool isEmpty () const
 
size_t size () const
 
const char * c_str () const
 
char operator[] (size_t n) const
 
bool equals (const SkString &) const
 
bool equals (const char text[]) const
 
bool equals (const char text[], size_t len) const
 
bool startsWith (const char prefixStr[]) const
 
bool startsWith (const char prefixChar) const
 
bool endsWith (const char suffixStr[]) const
 
bool endsWith (const char suffixChar) const
 
bool contains (const char substring[]) const
 
bool contains (const char subchar) const
 
int find (const char substring[]) const
 
int findLastOf (const char subchar) const
 
SkStringoperator= (const SkString &)
 
SkStringoperator= (SkString &&)
 
SkStringoperator= (const char text[])
 
char * writable_str ()
 
char & operator[] (size_t n)
 
void reset ()
 
void resize (size_t len)
 Destructive resize, does not preserve contents. More...
 
void set (const SkString &src)
 
void set (const char text[])
 
void set (const char text[], size_t len)
 
void setUTF16 (const uint16_t[])
 
void setUTF16 (const uint16_t[], size_t len)
 
void insert (size_t offset, const SkString &src)
 
void insert (size_t offset, const char text[])
 
void insert (size_t offset, const char text[], size_t len)
 
void insertUnichar (size_t offset, SkUnichar)
 
void insertS32 (size_t offset, int32_t value)
 
void insertS64 (size_t offset, int64_t value, int minDigits=0)
 
void insertU32 (size_t offset, uint32_t value)
 
void insertU64 (size_t offset, uint64_t value, int minDigits=0)
 
void insertHex (size_t offset, uint32_t value, int minDigits=0)
 
void insertScalar (size_t offset, SkScalar)
 
void append (const SkString &str)
 
void append (const char text[])
 
void append (const char text[], size_t len)
 
void appendUnichar (SkUnichar uni)
 
void appendS32 (int32_t value)
 
void appendS64 (int64_t value, int minDigits=0)
 
void appendU32 (uint32_t value)
 
void appendU64 (uint64_t value, int minDigits=0)
 
void appendHex (uint32_t value, int minDigits=0)
 
void appendScalar (SkScalar value)
 
void prepend (const SkString &str)
 
void prepend (const char text[])
 
void prepend (const char text[], size_t len)
 
void prependUnichar (SkUnichar uni)
 
void prependS32 (int32_t value)
 
void prependS64 (int32_t value, int minDigits=0)
 
void prependHex (uint32_t value, int minDigits=0)
 
void prependScalar (SkScalar value)
 
void printf (const char format[],...) SK_PRINTF_LIKE(2
 
void void appendf (const char format[],...) SK_PRINTF_LIKE(2
 
void void void appendVAList (const char format[], va_list)
 
void prependf (const char format[],...) SK_PRINTF_LIKE(2
 
void void prependVAList (const char format[], va_list)
 
void remove (size_t offset, size_t length)
 
SkStringoperator+= (const SkString &s)
 
SkStringoperator+= (const char text[])
 
SkStringoperator+= (const char c)
 
void swap (SkString &other)
 Swap contents between this and other. More...
 

Private Member Functions

void validate () const
 

Static Private Member Functions

static RecAllocRec (const char text[], size_t len)
 
static RecRefRec (Rec *)
 

Private Attributes

RecfRec
 

Static Private Attributes

static const Rec gEmptyRec
 

Friends

bool operator== (const SkString &a, const SkString &b)
 
bool operator!= (const SkString &a, const SkString &b)
 

Detailed Description

Light weight class for managing strings.

Uses reference counting to make string assignments and copies very fast with no extra RAM cost. Assumes UTF8 encoding.

Member Function Documentation

void SkString::resize ( size_t  len)
inline

Destructive resize, does not preserve contents.

void SkString::swap ( SkString other)

Swap contents between this and other.

This function is guaranteed to never fail or throw.


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