ZFFramework
Loading...
Searching...
No Matches
Public Member Functions | List of all members
zft_zfstring< T_Char > Class Template Reference

low level string container More...

#include <ZFCoreString.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 pos)
 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
 
void set (zfindex pos, T_Char c)
 change char at index
 
T_Char const & 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 (const zft_zfstring< T_Char > &s)
 append string
 
zft_zfstring< T_Char > & append (const T_Char *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 T_Char *s, zfindex len=((zfindex) -1))
 replace all content of the string
 
void zfunsafe_assign (T_Char *s, zfindex capacity, zfindex length)
 transfer ownership and assign, the source memory would be free-ed by this string object
 
T_Char * zfunsafe_buffer (void)
 directly access internal writable buffer
 
void zfunsafe_length (zfindex length)
 directly modify the string's length
 
zft_zfstring< T_Char > & insert (zfindex insertAt, const zft_zfstring< T_Char > &s)
 insert string
 
zft_zfstring< T_Char > & insert (zfindex insertAt, const T_Char *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 T_Char *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, note the result capacity is not ensured same as requested one
 
zfindex capacity (void)
 capacity of the string
 
void capacityTrim (void)
 trim current capacity
 
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
 

Detailed Description

template<typename T_Char>
class zft_zfstring< T_Char >

low level string container

Member Function Documentation

◆ zfunsafe_assign()

template<typename T_Char >
void zft_zfstring< T_Char >::zfunsafe_assign ( T_Char * s,
zfindex capacity,
zfindex length )
inline

transfer ownership and assign, the source memory would be free-ed by this string object

note the capacity should not contain the tail '\0'

◆ capacityTrim()

template<typename T_Char >
void zft_zfstring< T_Char >::capacityTrim ( void )
inline

trim current capacity

do nothing if not necessary to trim


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