ZFFramework
 
Loading...
Searching...
No Matches
zft_zfstring< T_Char > Class Template Reference

low level string container More...

#include <zfstring.h>

Public Member Functions

 zft_zfstring (void)
 construct an empty string
 
 zft_zfstring (const zft_zfstring< T_Char > &s)
 copy content from another string
 
 zft_zfstring (const zft_zfstring< T_Char > &s, zfindex len)
 copy content from another string
 
 zft_zfstring (const zft_zfstring< T_Char > &s, zfindex pos, zfindex len)
 copy content from another string
 
 zft_zfstring (const T_Char *s)
 copy content from another string
 
 zft_zfstring (const T_Char *s, zfindex len)
 copy content from another string
 
 zft_zfstring (const T_Char *s, zfindex pos, zfindex len)
 copy content from another string
 
 zft_zfstring (const zft_zfnullT &dummy)
 construct empty string
 
void set (zfindex pos, T_Char c)
 change char at index
 
T_Char get (zfindex pos) const
 get char at index
 
void swap (zft_zfstring< T_Char > &ref)
 swap internal data without deep copy, designed for performance
 
zft_zfstring< T_Char > & append (T_Char c)
 append string
 
zft_zfstring< T_Char > & append (const zft_zfstring< T_Char > &s)
 append string
 
zft_zfstring< T_Char > & append (const zft_zfstring< T_Char > &s, zfindex len)
 append string
 
zft_zfstring< T_Char > & append (const zft_zfstring< T_Char > &s, zfindex offset, zfindex len)
 append string
 
zft_zfstring< T_Char > & append (const void *s, zfindex len=((zfindex) -1))
 append string
 
zft_zfstring< T_Char > & assign (const zft_zfstring< T_Char > &s)
 replace all content of the string
 
zft_zfstring< T_Char > & assign (const zft_zfstring< T_Char > &s, zfindex len)
 replace all content of the string
 
zft_zfstring< T_Char > & assign (const zft_zfstring< T_Char > &s, zfindex offset, zfindex len)
 replace all content of the string
 
zft_zfstring< T_Char > & assign (const void *s, zfindex len=((zfindex) -1))
 replace all content of the string
 
zft_zfstring< T_Char > & assign (const zft_zfnullT &dummy)
 replace all content of the string
 
zft_zfstring< T_Char > & insert (zfindex insertAt, const zft_zfstring< T_Char > &s)
 insert string
 
zft_zfstring< T_Char > & insert (zfindex insertAt, const void *s, zfindex len=((zfindex) -1))
 insert string
 
zft_zfstring< T_Char > & replace (zfindex replacePos, zfindex replaceLen, const zft_zfstring< T_Char > &s)
 replace string in range
 
zft_zfstring< T_Char > & replace (zfindex replacePos, zfindex replaceLen, const void *s, zfindex len=((zfindex) -1))
 replace string in range
 
const T_Char * cString (void) const
 access string value
 
zfindex length (void) const
 length of the string
 
zfbool isEmpty (void) const
 true if empty
 
void capacity (zfindex capacity)
 ensure the string's capacity (including tail '\0'), note the result capacity is not ensured same as requested one
 
zfindex capacity (void) const
 get current capacity (including tail '\0')
 
void capacityTrim (void)
 trim to a proper capacity to save memory
 
void remove (zfindex pos, zfindex len=((zfindex) -1))
 remove part of the string
 
void removeAll (void)
 remove all content of the string
 
zfint compare (const zft_zfstring< T_Char > &s) const
 compare with another string
 
zfint compare (const T_Char *s, zfindex len=((zfindex) -1)) const
 compare with another string
 
const void * buffer (void) const
 return internal buffer
 
void * zfunsafe_bufferGiveUp (void)
 give up the buffer's ownership and return the buffer, you must free it manually by zfunsafe_bufferFree
 
T_Char * zfunsafe_buffer (void)
 directly access internal writable buffer
 
void zfunsafe_length (zfindex length)
 directly modify the string's length
 

Static Public Member Functions

static void zfunsafe_bufferFree (void *buf)
 free buffer returned by zfunsafe_bufferGiveUp
 
static const zft_zfstring< T_Char > & Empty (void)
 global null string ref for impl
 
static zft_zfstring< T_Char > shared (const void *sLiteral, zfindex length=((zfindex) -1))
 explicitly create from literal string, you must ensure the literal's life exceeds the returned string
 

Detailed Description

template<typename T_Char>
class zft_zfstring< T_Char >

low level string container


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