ucommon  7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
  Fossies Dox: ucommon-7.0.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Loading...
Searching...
No Matches
ucommon::String::cstring Class Reference

#include <string.h>

Inheritance diagram for ucommon::String::cstring:
[legend]
Collaboration diagram for ucommon::String::cstring:
[legend]

Public Member Functions

 cstring (size_t size)
 Create a cstring node allocated for specified string size. More...
 
void clear (size_t offset)
 Used to clear a string at specified offset. More...
 
void set (size_t offset, const char *text, size_t size)
 Set part or all of a string with new text. More...
 
void set (const char *text)
 Set our string from null terminated text up to our allocated size. More...
 
void add (const char *text)
 Append null terminated text to our string buffer. More...
 
void add (char character)
 Append a single character to our string buffer. More...
 
void fix (void)
 Fill our string buffer to end if fill mode. More...
 
void inc (size_t number)
 Adjust size of our string buffer by deleting characters from start of buffer. More...
 
void dec (size_t number)
 Adjust size of our string buffer by deleting characters from end of buffer. More...
 
- Public Member Functions inherited from ucommon::CountedObject
bool is_copied (void) const
 Test if the object has copied references. More...
 
bool is_retained (void) const
 Test if the object has been referenced (retained) by anyone yet. More...
 
unsigned copied (void) const
 Return the number of active references (retentions) to our object. More...
 
void retain (void) __OVERRIDE
 Increase reference count when retained. More...
 
void release (void) __OVERRIDE
 Decrease reference count when released. More...
 

Public Attributes

size_t max
 Allocated size of cstring text. More...
 
size_t len
 Current length of cstring text. More...
 
char text [1]
 Null terminated text, in overdraft space. More...
 

Protected Member Functions

virtual void dealloc (void) __OVERRIDE
 Dealloc object no longer referenced. More...
 
- Protected Member Functions inherited from ucommon::CountedObject
 CountedObject ()
 Construct a counted object, mark initially as unreferenced. More...
 
 CountedObject (const ObjectProtocol &ref)
 Construct a copy of a counted object. More...
 
virtual void dealloc (void)
 Dealloc object no longer referenced. More...
 
void reset (void)
 Force reset of count. More...
 

Private Member Functions

 __DELETE_COPY (cstring)
 

Detailed Description

Definition at line 134 of file string.h.

Constructor & Destructor Documentation

◆ cstring()

ucommon::String::cstring::cstring ( size_t  size)

Create a cstring node allocated for specified string size.

The new operator would also need the size as an overdraft value.

Parameters
sizeof string.

Definition at line 32 of file string.cpp.

References len, max, ucommon::String::size(), and text.

Here is the call graph for this function:

Member Function Documentation

◆ __DELETE_COPY()

ucommon::String::cstring::__DELETE_COPY ( cstring  )
private

◆ add() [1/2]

void ucommon::String::cstring::add ( char  character)

Append a single character to our string buffer.

Parameters
characterto append.

Definition at line 104 of file string.cpp.

References ch, ucommon::String::fix(), ucommon::String::len(), and ucommon::max().

Here is the call graph for this function:

◆ add() [2/2]

void ucommon::String::cstring::add ( const char *  text)

Append null terminated text to our string buffer.

Parameters
textto append.

Definition at line 86 of file string.cpp.

References ucommon::String::fix(), ucommon::String::len(), ucommon::max(), ucommon::String::size(), and ucommon::String::str.

Referenced by ucommon::String::add(), and ucommon::String::operator|().

Here is the call graph for this function:

◆ clear()

void ucommon::String::cstring::clear ( size_t  offset)

Used to clear a string at specified offset.

Parameters
offsetto clear from.

Definition at line 45 of file string.cpp.

References ucommon::String::len(), and ucommon::String::offset().

Referenced by ucommon::String::clear().

Here is the call graph for this function:

◆ dealloc()

void ucommon::String::cstring::dealloc ( void  )
protectedvirtual

Dealloc object no longer referenced.

The dealloc routine would commonly be used for a self delete to return the object back to a heap when it is no longer referenced.

Reimplemented from ucommon::CountedObject.

Definition at line 262 of file string.cpp.

◆ dec()

void ucommon::String::cstring::dec ( size_t  number)

Adjust size of our string buffer by deleting characters from end of buffer.

Parameters
numberof characters to delete.

Definition at line 54 of file string.cpp.

References ucommon::String::fix(), ucommon::String::len(), and ucommon::String::offset().

Referenced by ucommon::String::operator--(), and ucommon::String::operator-=().

Here is the call graph for this function:

◆ fix()

void ucommon::String::cstring::fix ( void  )

Fill our string buffer to end if fill mode.

Definition at line 40 of file string.cpp.

References ucommon::String::len().

Referenced by ucommon::UString::add(), ucommon::String::chop(), ucommon::String::cut(), ucommon::String::erase(), ucommon::String::fill(), ucommon::String::fix(), ucommon::String::operator bool(), ucommon::String::operator!(), ucommon::String::paste(), ucommon::String::printf(), ucommon::UString::set(), ucommon::String::split(), ucommon::String::trim(), ucommon::String::unquote(), and ucommon::String::vprintf().

Here is the call graph for this function:

◆ inc()

void ucommon::String::cstring::inc ( size_t  number)

Adjust size of our string buffer by deleting characters from start of buffer.

Parameters
numberof characters to delete.

Definition at line 69 of file string.cpp.

References ucommon::String::fix(), ucommon::String::len(), and ucommon::String::offset().

Referenced by ucommon::String::operator++(), and ucommon::String::operator+=().

Here is the call graph for this function:

◆ set() [1/2]

void ucommon::String::cstring::set ( const char *  text)

Set our string from null terminated text up to our allocated size.

Parameters
textto set from.

Definition at line 153 of file string.cpp.

References ucommon::String::fix(), ucommon::String::len(), ucommon::max(), ucommon::String::size(), and ucommon::String::str.

Here is the call graph for this function:

◆ set() [2/2]

void ucommon::String::cstring::set ( size_t  offset,
const char *  text,
size_t  size 
)

Set part or all of a string with new text.

Parameters
offsetto set from.
textto insert from null terminated string.
sizeof field to modify. This is filled for fill mode.

Definition at line 116 of file string.cpp.

References ucommon::String::len(), ucommon::max(), ucommon::String::offset(), ucommon::String::size(), and ucommon::String::str.

Referenced by ucommon::memstring::c_copy(), ucommon::String::clear(), ucommon::memstring::memstring(), ucommon::String::rsplit(), ucommon::String::set(), and ucommon::String::String().

Here is the call graph for this function:

Member Data Documentation

◆ len

◆ max

◆ text

char ucommon::String::cstring::text[1]

Null terminated text, in overdraft space.

Definition at line 146 of file string.h.

Referenced by ucommon::UString::add(), ucommon::String::at(), ucommon::UString::at(), ucommon::String::begin(), ucommon::memstring::c_copy(), ucommon::String::c_str(), ucommon::String::ccount(), ucommon::UString::ccount(), ucommon::String::chop(), ucommon::String::chr(), ucommon::String::compare(), ucommon::String::cow(), cstring(), ucommon::String::cut(), ucommon::UString::cut(), ucommon::String::data(), ucommon::String::end(), ucommon::String::equal(), ucommon::String::erase(), ucommon::String::fill(), ucommon::String::find(), ucommon::UString::find(), ucommon::String::fix(), ucommon::String::get(), ucommon::UString::get(), ucommon::String::lower(), ucommon::String::offset(), ucommon::String::operator%(), ucommon::String::operator()(), ucommon::UString::operator()(), ucommon::String::operator+(), ucommon::String::operator[](), ucommon::String::paste(), ucommon::UString::paste(), ucommon::String::printf(), ucommon::String::rchr(), ucommon::String::replace(), ucommon::String::rfind(), ucommon::UString::rfind(), ucommon::String::rset(), ucommon::String::rskip(), ucommon::String::rsplit(), ucommon::String::scanf(), ucommon::String::search(), ucommon::String::set(), ucommon::UString::set(), ucommon::String::skip(), ucommon::String::split(), ucommon::String::String(), ucommon::String::trim(), ucommon::String::unquote(), ucommon::String::upper(), ucommon::UString::UString(), ucommon::String::vprintf(), and ucommon::String::vscanf().


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