Skia
2D Graphics Library
SkString Class Reference

#include <SkString.h>

Public Member Functions

 SkString ()
 
 SkString (size_t len)
 
 SkString (const char text[])
 
 SkString (const char text[], size_t len)
 
 SkString (const SkString &)
 
 SkString (SkString &&)
 
 SkString (const std::string &)
 
 ~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)
 String contents are preserved on resize. More...
 
void set (const SkString &src)
 
void set (const char text[])
 
void set (const char text[], 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 printVAList (const char format[], va_list)
 
void appendf (const char format[],...) SK_PRINTF_LIKE(2
 
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...
 

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.

Constructor & Destructor Documentation

◆ SkString() [1/7]

SkString::SkString ( )

◆ SkString() [2/7]

SkString::SkString ( size_t  len)
explicit

◆ SkString() [3/7]

SkString::SkString ( const char  text[])
explicit

◆ SkString() [4/7]

SkString::SkString ( const char  text[],
size_t  len 
)

◆ SkString() [5/7]

SkString::SkString ( const SkString )

◆ SkString() [6/7]

SkString::SkString ( SkString &&  )

◆ SkString() [7/7]

SkString::SkString ( const std::string &  )
explicit

◆ ~SkString()

SkString::~SkString ( )

Member Function Documentation

◆ append() [1/3]

void SkString::append ( const char  text[])
inline

◆ append() [2/3]

void SkString::append ( const char  text[],
size_t  len 
)
inline

◆ append() [3/3]

void SkString::append ( const SkString str)
inline

◆ appendf()

void SkString::appendf ( const char  format[],
  ... 
)

◆ appendHex()

void SkString::appendHex ( uint32_t  value,
int  minDigits = 0 
)
inline

◆ appendS32()

void SkString::appendS32 ( int32_t  value)
inline

◆ appendS64()

void SkString::appendS64 ( int64_t  value,
int  minDigits = 0 
)
inline

◆ appendScalar()

void SkString::appendScalar ( SkScalar  value)
inline

◆ appendU32()

void SkString::appendU32 ( uint32_t  value)
inline

◆ appendU64()

void SkString::appendU64 ( uint64_t  value,
int  minDigits = 0 
)
inline

◆ appendUnichar()

void SkString::appendUnichar ( SkUnichar  uni)
inline

◆ appendVAList()

void void SkString::appendVAList ( const char  format[],
va_list   
)

◆ c_str()

const char* SkString::c_str ( ) const
inline

◆ contains() [1/2]

bool SkString::contains ( const char  subchar) const
inline

◆ contains() [2/2]

bool SkString::contains ( const char  substring[]) const
inline

◆ endsWith() [1/2]

bool SkString::endsWith ( const char  suffixChar) const
inline

◆ endsWith() [2/2]

bool SkString::endsWith ( const char  suffixStr[]) const
inline

◆ equals() [1/3]

bool SkString::equals ( const char  text[]) const

◆ equals() [2/3]

bool SkString::equals ( const char  text[],
size_t  len 
) const

◆ equals() [3/3]

bool SkString::equals ( const SkString ) const

◆ find()

int SkString::find ( const char  substring[]) const
inline

◆ findLastOf()

int SkString::findLastOf ( const char  subchar) const
inline

◆ insert() [1/3]

void SkString::insert ( size_t  offset,
const char  text[] 
)

◆ insert() [2/3]

void SkString::insert ( size_t  offset,
const char  text[],
size_t  len 
)

◆ insert() [3/3]

void SkString::insert ( size_t  offset,
const SkString src 
)
inline

◆ insertHex()

void SkString::insertHex ( size_t  offset,
uint32_t  value,
int  minDigits = 0 
)

◆ insertS32()

void SkString::insertS32 ( size_t  offset,
int32_t  value 
)

◆ insertS64()

void SkString::insertS64 ( size_t  offset,
int64_t  value,
int  minDigits = 0 
)

◆ insertScalar()

void SkString::insertScalar ( size_t  offset,
SkScalar   
)

◆ insertU32()

void SkString::insertU32 ( size_t  offset,
uint32_t  value 
)

◆ insertU64()

void SkString::insertU64 ( size_t  offset,
uint64_t  value,
int  minDigits = 0 
)

◆ insertUnichar()

void SkString::insertUnichar ( size_t  offset,
SkUnichar   
)

◆ isEmpty()

bool SkString::isEmpty ( ) const
inline

◆ operator+=() [1/3]

SkString& SkString::operator+= ( const char  c)
inline

◆ operator+=() [2/3]

SkString& SkString::operator+= ( const char  text[])
inline

◆ operator+=() [3/3]

SkString& SkString::operator+= ( const SkString s)
inline

◆ operator=() [1/3]

SkString& SkString::operator= ( const char  text[])

◆ operator=() [2/3]

SkString& SkString::operator= ( const SkString )

◆ operator=() [3/3]

SkString& SkString::operator= ( SkString &&  )

◆ operator[]() [1/2]

char& SkString::operator[] ( size_t  n)
inline

◆ operator[]() [2/2]

char SkString::operator[] ( size_t  n) const
inline

◆ prepend() [1/3]

void SkString::prepend ( const char  text[])
inline

◆ prepend() [2/3]

void SkString::prepend ( const char  text[],
size_t  len 
)
inline

◆ prepend() [3/3]

void SkString::prepend ( const SkString str)
inline

◆ prependf()

void SkString::prependf ( const char  format[],
  ... 
)

◆ prependHex()

void SkString::prependHex ( uint32_t  value,
int  minDigits = 0 
)
inline

◆ prependS32()

void SkString::prependS32 ( int32_t  value)
inline

◆ prependS64()

void SkString::prependS64 ( int32_t  value,
int  minDigits = 0 
)
inline

◆ prependScalar()

void SkString::prependScalar ( SkScalar  value)
inline

◆ prependUnichar()

void SkString::prependUnichar ( SkUnichar  uni)
inline

◆ prependVAList()

void void SkString::prependVAList ( const char  format[],
va_list   
)

◆ printf()

void SkString::printf ( const char  format[],
  ... 
)

◆ printVAList()

void void SkString::printVAList ( const char  format[],
va_list   
)

◆ remove()

void SkString::remove ( size_t  offset,
size_t  length 
)

◆ reset()

void SkString::reset ( )

◆ resize()

void SkString::resize ( size_t  len)

String contents are preserved on resize.

(For destructive resize, set(nullptr, length).) resize automatically reserves an extra byte at the end of the buffer for a null terminator.

◆ set() [1/3]

void SkString::set ( const char  text[])

◆ set() [2/3]

void SkString::set ( const char  text[],
size_t  len 
)

◆ set() [3/3]

void SkString::set ( const SkString src)
inline

◆ size()

size_t SkString::size ( ) const
inline

◆ startsWith() [1/2]

bool SkString::startsWith ( const char  prefixChar) const
inline

◆ startsWith() [2/2]

bool SkString::startsWith ( const char  prefixStr[]) const
inline

◆ swap()

void SkString::swap ( SkString other)

Swap contents between this and other.

This function is guaranteed to never fail or throw.

◆ writable_str()

char* SkString::writable_str ( )

Friends And Related Function Documentation

◆ operator!=

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

◆ operator==

bool operator== ( const SkString a,
const SkString b 
)
friend

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