.TH "ost::String" 3 "Sun Dec 27 2020" "GNU CommonC++" \" -*- nroff -*- .ad l .nh .SH NAME ost::String \- This is a generic and portable string class\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherited by \fBost::SString\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef size_t \fBsize_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBString\fP ()" .br .RI "Construct an empty string\&. " .ti -1c .RI "\fBString\fP (const \fBString\fP &original)" .br .RI "Copy constructor\&. " .ti -1c .RI "\fBString\fP (const char *str)" .br .RI "Create a string from a cstring\&. " .ti -1c .RI "\fBString\fP (std::string string)" .br .RI "Create a \fBString\fP from std::string\&. " .ti -1c .RI "\fBString\fP (const \fBString\fP &str, size_t offset, size_t len=\fBnpos\fP)" .br .RI "Create a new string from a subset of another string\&. " .ti -1c .RI "\fBString\fP (size_t \fBsize\fP, const char *format,\&.\&.\&.)" .br .RI "Create a string from formatted text input\&. " .ti -1c .RI "\fBString\fP (size_t \fBcount\fP, const char fill=' ')" .br .RI "Fill a new string with character data\&. " .ti -1c .RI "virtual \fB~String\fP ()" .br .RI "Destroy the string\&.\&.\&. " .ti -1c .RI "const char * \fBgetIndex\fP (size_t \fBindex\fP) const" .br .RI "Get a string pointer to string content based on an indexed offset\&. " .ti -1c .RI "char * \fBgetText\fP (void) const" .br .RI "Get the text of a string\&. " .ti -1c .RI "long \fBgetValue\fP (long defvalue=0l) const" .br .RI "Get the value of a string\&. " .ti -1c .RI "bool \fBgetBool\fP (bool defbool=false) const" .br .RI "Get the bool flag of a string\&. " .ti -1c .RI "const size_t \fBgetLength\fP (void) const" .br .RI "Get the assigned length of string\&. " .ti -1c .RI "const size_t \fBgetSize\fP (void) const" .br .RI "Get the allocation size of the string variable\&. " .ti -1c .RI "bool \fBisEmpty\fP (void) const" .br .RI "Return true if string is empty\&. " .ti -1c .RI "void \fBresize\fP (size_t \fBsize\fP)" .br .RI "Re-allocate buffer space for string\&. " .ti -1c .RI "void \fBclear\fP (void)" .br .RI "Clear the contents of the entire string\&. " .ti -1c .RI "char \fBat\fP (ssize_t offset) const" .br .RI "Return a character at a known offset\&. " .ti -1c .RI "unsigned \fBcount\fP (const \fBString\fP &s, size_t offset=0) const" .br .RI "Count the number of occurences of a specific string within our string\&. " .ti -1c .RI "unsigned \fBcount\fP (const char *s, size_t offset=0, size_t len=0) const" .br .RI "Count the number of occurrences of a specific text pattern within our string\&. " .ti -1c .RI "\fBString\fP \fBtoken\fP (const char *delim=' \\t\\n\\r', size_t offset=0)" .br .RI "Extract a new string as a token from the current string\&. " .ti -1c .RI "size_t \fBfind\fP (const \fBString\fP &s, size_t offset=0, unsigned instance=1) const" .br .RI "Find the index to the nth instance of a substring in our string\&. " .ti -1c .RI "size_t \fBrfind\fP (const \fBString\fP &s, size_t offset=0) const" .br .RI "Find last occurence of a substring in our string\&. " .ti -1c .RI "size_t \fBfind\fP (const char *s, size_t offset=0, size_t len=0, unsigned \fBcount\fP=1) const" .br .RI "Find the index to the nth instance of text in our string\&. " .ti -1c .RI "size_t \fBrfind\fP (const char *s, size_t offset=0, size_t len=0) const" .br .RI "Find last occurence of a text in our string\&. " .ti -1c .RI "void \fBtrim\fP (const char *cs)" .br .RI "Trim trailing characters from a string\&. " .ti -1c .RI "void \fBchop\fP (const char *cs)" .br .RI "Chop leading characters from a string\&. " .ti -1c .RI "void \fBstrip\fP (const char *cs)" .br .RI "Strip lead and trailing characters from a string\&. " .ti -1c .RI "void \fBchop\fP (size_t chars)" .br .RI "Chop n leading characters from a string\&. " .ti -1c .RI "void \fBtrim\fP (size_t \fBcount\fP)" .br .RI "Trim n trailing characters from a string\&. " .ti -1c .RI "void \fBerase\fP (size_t start, size_t len=\fBnpos\fP)" .br .RI "Erase a portion of string\&. " .ti -1c .RI "void \fBinsert\fP (size_t start, const char *\fBtext\fP, size_t len=0)" .br .RI "Insert text into a string\&. " .ti -1c .RI "void \fBinsert\fP (size_t start, const \fBString\fP &str)" .br .RI "Insert other string into our string\&. " .ti -1c .RI "void \fBreplace\fP (size_t start, size_t len, const char *\fBtext\fP, size_t \fBcount\fP=0)" .br .RI "Replace text at a specific position in the string with new text\&. " .ti -1c .RI "void \fBreplace\fP (size_t start, size_t len, const \fBString\fP &string)" .br .RI "Replace text at a specific position in the string with new string,\&. " .ti -1c .RI "size_t \fBfind\fP (unsigned instance, const char *\fBtext\fP, size_t offset=0, size_t len=0) const" .br .RI "A more convenient version of find for nth occurences, by putting the instance first\&. " .ti -1c .RI "size_t \fBfind\fP (unsigned instance, const \fBString\fP &string, size_t offset=0) const" .br .RI "A more convenient version of find for nth occurences, by putting the instance first\&. " .ti -1c .RI "\fBString\fP \fBsubstr\fP (size_t start, size_t len) const" .br .RI "Return a new string that contains a specific substring of the current string\&. " .ti -1c .RI "const char *() \fBindex\fP (size_t ind) const" .br .RI "Return an indexed string based on the index, such as from a find\&. " .ti -1c .RI "void \fBcompact\fP (void)" .br .RI "Reduce the size of the string allocation to the minimum needed based on the current effective length\&. " .ti -1c .RI "char * \fBc_str\fP (void) const" .br .RI "Old ANSI C++ compatible string pointer extraction\&. " .ti -1c .RI "\fBoperator char *\fP () const" .br .RI "Get our string data through dereference operator\&. " .ti -1c .RI "bool \fBoperator!\fP (void) const" .br .RI "Logical test for string empty\&. " .ti -1c .RI "char * \fBtext\fP (void) const" .br .RI "Alternate get text method\&. " .ti -1c .RI "char * \fBdata\fP (void) const" .br .RI "Alternate get text method\&. " .ti -1c .RI "size_t \fBlength\fP (void) const" .br .RI "Get length as if null terminated string\&. " .ti -1c .RI "size_t \fBsize\fP (void) const" .br .RI "Get actual length of string data\&. " .ti -1c .RI "size_t \fBcapacity\fP (void) const" .br .RI "Get space allocated to hold current string\&. " .ti -1c .RI "bool \fBempty\fP (void) const" .br .RI "Return true if string is empty\&. " .ti -1c .RI "void \fBappend\fP (const char *str, size_t \fBcount\fP=0)" .br .RI "Append text to the end of the current string\&. " .ti -1c .RI "void \fBappend\fP (size_t \fBsize\fP, const char *format,\&.\&.\&.)" .br .RI "Append formatted text to the end of the current string\&. " .ti -1c .RI "void \fBappend\fP (const char *str, size_t offset, size_t \fBcount\fP)" .br .RI "Append text into the current string\&. " .ti -1c .RI "void \fBadd\fP (char c)" .br .RI "Add a character to the end of a string\&. " .ti -1c .RI "void \fBappend\fP (const \fBString\fP &str)" .br .RI "Append string to the end of the current string\&. " .ti -1c .RI "const char \fBoperator[]\fP (unsigned ind) const" .br .RI "Extract a character by array indexing\&. " .ti -1c .RI "const char * \fBoperator=\fP (const char *str)" .br .RI "Assign our string for c string\&. " .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (const \fBString\fP &str)" .br .RI "Append operator\&. " .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (char c)" .br .RI "Append operator\&. " .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (const char *str)" .br .RI "Append operator\&. " .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (const std::string &str)" .br .RI "Append operator\&. " .ti -1c .RI "bool \fBoperator<\fP (const \fBString\fP &str) const" .br .ti -1c .RI "bool \fBoperator<\fP (const char *str) const" .br .ti -1c .RI "bool \fBoperator>\fP (const \fBString\fP &str) const" .br .ti -1c .RI "bool \fBoperator>\fP (const char *str) const" .br .ti -1c .RI "bool \fBoperator<=\fP (const \fBString\fP &str) const" .br .ti -1c .RI "bool \fBoperator<=\fP (const char *str) const" .br .ti -1c .RI "bool \fBoperator>=\fP (const \fBString\fP &str) const" .br .ti -1c .RI "bool \fBoperator>=\fP (const char *str) const" .br .ti -1c .RI "bool \fBoperator==\fP (const \fBString\fP &str) const" .br .ti -1c .RI "bool \fBoperator==\fP (const char *str) const" .br .ti -1c .RI "bool \fBoperator!=\fP (const \fBString\fP &str) const" .br .ti -1c .RI "bool \fBoperator!=\fP (const char *str) const" .br .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (int i)" .br .RI "Append operator\&. " .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (unsigned int i)" .br .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (long l)" .br .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (unsigned long l)" .br .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (float f)" .br .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (double d)" .br .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (short s)" .br .ti -1c .RI "\fBString\fP & \fBoperator+=\fP (unsigned short s)" .br .ti -1c .RI "\fBString\fP & \fBoperator=\fP (int i)" .br .RI "Assignment operator\&. " .ti -1c .RI "\fBString\fP & \fBoperator=\fP (unsigned int i)" .br .ti -1c .RI "\fBString\fP & \fBoperator=\fP (long l)" .br .ti -1c .RI "\fBString\fP & \fBoperator=\fP (unsigned long l)" .br .ti -1c .RI "\fBString\fP & \fBoperator=\fP (float f)" .br .ti -1c .RI "\fBString\fP & \fBoperator=\fP (double d)" .br .ti -1c .RI "\fBString\fP & \fBoperator=\fP (short s)" .br .ti -1c .RI "\fBString\fP & \fBoperator=\fP (unsigned short s)" .br .ti -1c .RI "\fBString\fP & \fBoperator=\fP (const \fBString\fP &original)" .br .ti -1c .RI "bool \fBoperator*=\fP (const \fBString\fP &str) const" .br .RI "Test if string is contained in our string\&. " .ti -1c .RI "bool \fBoperator*=\fP (const char *str) const" .br .RI "Test if text is contained in our string\&. " .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static const size_t \fBnpos\fP" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "bool \fBisBig\fP (void) const" .br .RI "Determine if string is allocated in local variable or an external reference\&. " .ti -1c .RI "const char * \fBset\fP (const char *str, size_t len=0)" .br .RI "Set the content of the string variable to the specified string value, and use smart re-allocation strategies if appropriate to shrink the size of the variable\&. " .ti -1c .RI "void \fBset\fP (const \fBString\fP &str)" .br .RI "Set the content of the string variable to that of another variable\&. " .ti -1c .RI "const char * \fBset\fP (size_t \fBsize\fP, const char *format,\&.\&.\&.)" .br .RI "Set the content of the string variable to that of a formatted printf style string\&. " .ti -1c .RI "void \fBcopy\fP (const \fBString\fP &str)" .br .RI "Impliment the copy constructor, used internally\&. " .ti -1c .RI "void \fBinit\fP (void)" .br .RI "Used to initialize a string object\&. " .ti -1c .RI "size_t \fBsetSize\fP (size_t \fBsize\fP)" .br .RI "Set the size of allocated space in the string variable (capacity) to a known value\&. " .ti -1c .RI "void \fBsetLength\fP (size_t len)" .br .RI "Set the length value of the string content\&. " .ti -1c .RI "virtual int \fBcompare\fP (const char *\fBtext\fP, size_t len=0, size_t \fBindex\fP=0) const" .br .RI "A derivable low level comparison operator\&. " .ti -1c .RI "size_t \fBsearch\fP (const char *\fBtext\fP, size_t clen=0, size_t offset=0) const" .br .RI "An internal method used to search for a substring starting at a known offset\&. " .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static char * \fBgetSpace\fP (size_t \fBsize\fP)" .br .RI "Used to fetch memory, if needed, based on the size, from the pager, or the system heap\&. " .in -1c .SS "Static Protected Attributes" .in +1c .ti -1c .RI "static const unsigned \fBminsize\fP" .br .ti -1c .RI "static const unsigned \fBslotsize\fP" .br .ti -1c .RI "static const unsigned \fBpagesize\fP" .br .ti -1c .RI "static const unsigned \fBslotlimit\fP" .br .ti -1c .RI "static const unsigned \fBslotcount\fP" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "class \fBStringObject\fP" .br .ti -1c .RI "class \fBMemPager\fP" .br .ti -1c .RI "\fB__EXPORT\fP \fBString\fP \fBoperator+\fP (const \fBString\fP &s1, const \fBString\fP &s2)" .br .RI "Add two strings and return a temporary object\&. " .ti -1c .RI "\fB__EXPORT\fP \fBString\fP \fBoperator+\fP (const \fBString\fP &s1, const char *s2)" .br .ti -1c .RI "\fB__EXPORT\fP \fBString\fP \fBoperator+\fP (const char *s1, const \fBString\fP &s2)" .br .ti -1c .RI "\fB__EXPORT\fP \fBString\fP \fBoperator+\fP (const \fBString\fP &s1, const char c2)" .br .ti -1c .RI "\fB__EXPORT\fP \fBString\fP \fBoperator+\fP (const char c1, const \fBString\fP &s2)" .br .ti -1c .RI "std::istream & \fBgetline\fP (std::istream &is, \fBString\fP &str, char delim, size_t \fBsize\fP)" .br .RI "Fetch input from a std::istream into the current string variable until either the string variable is filled (based on current length) or the deliminator is read\&. " .ti -1c .RI "\fB__EXPORT\fP std::ostream & \fBoperator<<\fP (std::ostream &os, const \fBString\fP &str)" .br .RI "Stream the content of our string variable directly to a C++ streaming source\&. " .ti -1c .RI "std::istream & \fBoperator>>\fP (std::istream &is, \fBString\fP &str)" .br .RI "Stream input into our variable\&. " .ti -1c .RI "\fB__EXPORT\fP int \fBstrprintf\fP (\fBString\fP &str, size_t \fBsize\fP, const char *format,\&.\&.\&.)" .br .RI "Print values directly into a string variable\&. " .in -1c .SH "Detailed Description" .PP This is a generic and portable string class\&. It uses optimized memory allocation strategies to efficiently handle smaller string content by grouping strings into 32 byte aligned slots that can be re-allocated from a free list directly\&. .PP While meant to cover the basic functionality of the ANSI C++ string class in form and function, this class offers some important enhancements, including the ability to derive class type specific versions of itself\&. The latter might be used to derive a unicode string, a string for data and time data types, or to add case insensitive comparisons, for example\&. .PP \fBAuthor\fP .RS 4 David Sugar dyfet@ostel.com .RE .PP Generic string class\&. .SH "Member Typedef Documentation" .PP .SS "typedef size_t \fBost::String::size_type\fP" .SH "Constructor & Destructor Documentation" .PP .SS "ost::String::String ()" .PP Construct an empty string\&. .SS "ost::String::String (const \fBString\fP & original)" .PP Copy constructor\&. .PP \fBParameters\fP .RS 4 \fIoriginal\fP string to copy from\&. .RE .PP .SS "ost::String::String (const char * str)" .PP Create a string from a cstring\&. .PP \fBParameters\fP .RS 4 \fIstr\fP text to set with\&. .RE .PP .SS "ost::String::String (std::string string)" .PP Create a \fBString\fP from std::string\&. .PP \fBParameters\fP .RS 4 \fIstring\fP from std::string to copy from\&. .RE .PP .SS "ost::String::String (const \fBString\fP & str, size_t offset, size_t len = \fC\fBnpos\fP\fP)" .PP Create a new string from a subset of another string\&. .PP \fBParameters\fP .RS 4 \fIstr\fP reference of source string\&. .br \fIoffset\fP offset to start of data in prior string\&. .br \fIlen\fP length of our substring\&. .RE .PP .SS "ost::String::String (size_t size, const char * format, \&.\&.\&.)" .PP Create a string from formatted text input\&. .PP \fBParameters\fP .RS 4 \fIsize\fP to allocate for our new string\&. .br \fIformat\fP of data to input\&. .RE .PP .SS "ost::String::String (size_t count, const char fill = \fC' '\fP)" .PP Fill a new string with character data\&. .PP \fBParameters\fP .RS 4 \fIcount\fP size of new string\&. .br \fIfill\fP char to fill string with\&. .RE .PP .SS "virtual ost::String::~String ()\fC [virtual]\fP" .PP Destroy the string\&.\&.\&. .SH "Member Function Documentation" .PP .SS "void ost::String::add (char c)" .PP Add a character to the end of a string\&. .PP \fBParameters\fP .RS 4 \fIc\fP char to add\&. .RE .PP .SS "void ost::String::append (const char * str, size_t count = \fC0\fP)" .PP Append text to the end of the current string\&. .PP \fBParameters\fP .RS 4 \fIstr\fP text to append\&. .br \fIcount\fP size of text to append\&. .RE .PP .SS "void ost::String::append (const char * str, size_t offset, size_t count)" .PP Append text into the current string\&. .PP \fBParameters\fP .RS 4 \fIstr\fP text to append\&. .br \fIoffset\fP offset to overlay\&. .br \fIcount\fP size of text to append\&. .RE .PP .SS "void ost::String::append (const \fBString\fP & str)" .PP Append string to the end of the current string\&. .PP \fBParameters\fP .RS 4 \fIstr\fP string to append\&. .RE .PP .SS "void ost::String::append (size_t size, const char * format, \&.\&.\&.)" .PP Append formatted text to the end of the current string\&. .PP \fBParameters\fP .RS 4 \fIsize\fP size of text to append\&. .br \fIformat\fP of data to append\&. .RE .PP .SS "char ost::String::at (ssize_t offset) const" .PP Return a character at a known offset\&. .PP \fBReturns\fP .RS 4 character at offset\&. .RE .PP .SS "char* ost::String::c_str (void) const\fC [inline]\fP" .PP Old ANSI C++ compatible string pointer extraction\&. .PP \fBReturns\fP .RS 4 string data\&. .RE .PP .SS "size_t ost::String::capacity (void) const\fC [inline]\fP" .PP Get space allocated to hold current string\&. .PP \fBReturns\fP .RS 4 space of memory buffer from heap or local\&. .RE .PP .SS "void ost::String::chop (const char * cs)\fC [inline]\fP" .PP Chop leading characters from a string\&. .PP \fBParameters\fP .RS 4 \fIcs\fP list of chars to chop\&. .RE .PP .PP References ost::strchop()\&. .SS "void ost::String::chop (size_t chars)\fC [inline]\fP" .PP Chop n leading characters from a string\&. .PP \fBParameters\fP .RS 4 \fIchars\fP count to chop\&. .RE .PP .SS "void ost::String::clear (void)" .PP Clear the contents of the entire string\&. .SS "void ost::String::compact (void)\fC [inline]\fP" .PP Reduce the size of the string allocation to the minimum needed based on the current effective length\&. .SS "virtual int ost::String::compare (const char * text, size_t len = \fC0\fP, size_t index = \fC0\fP) const\fC [protected]\fP, \fC [virtual]\fP" .PP A derivable low level comparison operator\&. This can be used to create custom comparison data types in derived string classes\&. .PP \fBReturns\fP .RS 4 0 if match, or value for ordering\&. .RE .PP \fBParameters\fP .RS 4 \fItext\fP text to compare\&. .br \fIlen\fP length of text to compare\&. .br \fIindex\fP offset from start of string, used in searchs\&. .RE .PP .SS "void ost::String::copy (const \fBString\fP & str)\fC [protected]\fP" .PP Impliment the copy constructor, used internally\&. Will always create a minimum sized string allocation\&. .PP \fBParameters\fP .RS 4 \fIstr\fP string to copy from\&. .RE .PP .SS "unsigned ost::String::count (const char * s, size_t offset = \fC0\fP, size_t len = \fC0\fP) const" .PP Count the number of occurrences of a specific text pattern within our string\&. .PP \fBReturns\fP .RS 4 count of instances\&. .RE .PP \fBParameters\fP .RS 4 \fIs\fP text pattern to find .br \fIoffset\fP offset to start from\&. .br \fIlen\fP length of text pattern if specified\&. .RE .PP .SS "unsigned ost::String::count (const \fBString\fP & s, size_t offset = \fC0\fP) const" .PP Count the number of occurences of a specific string within our string\&. .PP \fBReturns\fP .RS 4 count of instances\&. .RE .PP \fBParameters\fP .RS 4 \fIs\fP string to test\&. .br \fIoffset\fP offset to start from\&. .RE .PP .SS "char* ost::String::data (void) const\fC [inline]\fP" .PP Alternate get text method\&. .PP \fBReturns\fP .RS 4 string data\&. .RE .PP .SS "bool ost::String::empty (void) const\fC [inline]\fP" .PP Return true if string is empty\&. .SS "void ost::String::erase (size_t start, size_t len = \fC\fBnpos\fP\fP)" .PP Erase a portion of string\&. .PP \fBParameters\fP .RS 4 \fIstart\fP starting index to erase from\&. .br \fIlen\fP number of characters to erase\&. .RE .PP .SS "size_t ost::String::find (const char * s, size_t offset = \fC0\fP, size_t len = \fC0\fP, unsigned count = \fC1\fP) const" .PP Find the index to the nth instance of text in our string\&. .PP \fBReturns\fP .RS 4 index of found substring\&. .RE .PP \fBParameters\fP .RS 4 \fIs\fP string to search for\&. .br \fIoffset\fP offset to start at\&. .br \fIlen\fP size of string text\&. .br \fIcount\fP instance to look for\&. .RE .PP .SS "size_t ost::String::find (const \fBString\fP & s, size_t offset = \fC0\fP, unsigned instance = \fC1\fP) const" .PP Find the index to the nth instance of a substring in our string\&. .PP \fBReturns\fP .RS 4 index of found substring\&. .RE .PP \fBParameters\fP .RS 4 \fIs\fP string to search for\&. .br \fIoffset\fP offset to start at\&. .br \fIinstance\fP instance to look for\&. .RE .PP .SS "size_t ost::String::find (unsigned instance, const char * text, size_t offset = \fC0\fP, size_t len = \fC0\fP) const\fC [inline]\fP" .PP A more convenient version of find for nth occurences, by putting the instance first\&. .PP \fBParameters\fP .RS 4 \fIinstance\fP nth instance to look for\&. .br \fItext\fP text to look for\&. .br \fIoffset\fP offset to start at\&. .br \fIlen\fP length of text\&. .RE .PP .PP References ost::find()\&. .SS "size_t ost::String::find (unsigned instance, const \fBString\fP & string, size_t offset = \fC0\fP) const\fC [inline]\fP" .PP A more convenient version of find for nth occurences, by putting the instance first\&. .PP \fBParameters\fP .RS 4 \fIinstance\fP nth instance to look for\&. .br \fIstring\fP reference to look for\&. .br \fIoffset\fP offset to start at\&. .RE .PP .PP References ost::find()\&. .SS "bool ost::String::getBool (bool defbool = \fCfalse\fP) const" .PP Get the bool flag of a string\&. .PP \fBReturns\fP .RS 4 boolean value\&. .RE .PP .SS "const char* ost::String::getIndex (size_t index) const" .PP Get a string pointer to string content based on an indexed offset\&. A NULL is returned if the index is outsize of range\&. .PP \fBReturns\fP .RS 4 string content or NULL if invalid index\&. .RE .PP \fBParameters\fP .RS 4 \fIindex\fP .RE .PP .SS "const size_t ost::String::getLength (void) const" .PP Get the assigned length of string\&. .PP \fBReturns\fP .RS 4 string length\&. .RE .PP .SS "const size_t ost::String::getSize (void) const" .PP Get the allocation size of the string variable\&. .PP \fBReturns\fP .RS 4 allocation size\&. .RE .PP .SS "static char* ost::String::getSpace (size_t size)\fC [static]\fP, \fC [protected]\fP" .PP Used to fetch memory, if needed, based on the size, from the pager, or the system heap\&. .PP \fBReturns\fP .RS 4 string pointer to space\&. .RE .PP \fBParameters\fP .RS 4 \fIsize\fP of space needed\&. .RE .PP .SS "char* ost::String::getText (void) const" .PP Get the text of a string\&. .PP \fBReturns\fP .RS 4 string content\&. .RE .PP .SS "long ost::String::getValue (long defvalue = \fC0l\fP) const" .PP Get the value of a string\&. .PP \fBReturns\fP .RS 4 string value as number\&. .RE .PP .SS "const char*() ost::String::index (size_t ind) const\fC [inline]\fP" .PP Return an indexed string based on the index, such as from a find\&. If out of range, a NULL string is returned\&. .PP \fBReturns\fP .RS 4 pointer to string data from our string, .RE .PP \fBParameters\fP .RS 4 \fIind\fP index or offset to use\&. .RE .PP .SS "void ost::String::init (void)\fC [protected]\fP" .PP Used to initialize a string object\&. .SS "void ost::String::insert (size_t start, const char * text, size_t len = \fC0\fP)" .PP Insert text into a string\&. .PP \fBParameters\fP .RS 4 \fIstart\fP starting offset to insert at\&. .br \fItext\fP text to insert\&. .br \fIlen\fP size of text to insert\&. .RE .PP .SS "void ost::String::insert (size_t start, const \fBString\fP & str)" .PP Insert other string into our string\&. .PP \fBParameters\fP .RS 4 \fIstart\fP string offset to insert at\&. .br \fIstr\fP string to insert\&. .RE .PP .SS "bool ost::String::isBig (void) const\fC [inline]\fP, \fC [protected]\fP" .PP Determine if string is allocated in local variable or an external reference\&. .PP \fBReturns\fP .RS 4 true if external heap is used\&. .RE .PP .SS "bool ost::String::isEmpty (void) const" .PP Return true if string is empty\&. .PP \fBReturns\fP .RS 4 true if string is empty string\&. .RE .PP .SS "size_t ost::String::length (void) const\fC [inline]\fP" .PP Get length as if null terminated string\&. .PP \fBReturns\fP .RS 4 cstring length\&. .RE .PP .SS "ost::String::operator char * () const\fC [inline]\fP" .PP Get our string data through dereference operator\&. .PP \fBReturns\fP .RS 4 string data\&. .RE .PP .SS "bool ost::String::operator! (void) const\fC [inline]\fP" .PP Logical test for string empty\&. .PP \fBReturns\fP .RS 4 true if is empty\&. .RE .PP .SS "bool \fBost::String::operator!\fP= (const char * str) const" .SS "bool \fBost::String::operator!\fP= (const \fBString\fP & str) const" .SS "bool ost::String::operator*= (const char * str) const" .PP Test if text is contained in our string\&. .SS "bool ost::String::operator*= (const \fBString\fP & str) const" .PP Test if string is contained in our string\&. .SS "\fBString\fP& ost::String::operator+= (char c)\fC [inline]\fP" .PP Append operator\&. .SS "\fBString\fP& ost::String::operator+= (const char * str)\fC [inline]\fP" .PP Append operator\&. .SS "\fBString\fP& ost::String::operator+= (const std::string & str)\fC [inline]\fP" .PP Append operator\&. .SS "\fBString\fP& ost::String::operator+= (const \fBString\fP & str)\fC [inline]\fP" .PP Append operator\&. .SS "\fBString\fP& ost::String::operator+= (double d)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator+= (float f)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator+= (int i)\fC [inline]\fP" .PP Append operator\&. .SS "\fBString\fP& ost::String::operator+= (long l)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator+= (short s)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator+= (unsigned int i)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator+= (unsigned long l)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator+= (unsigned short s)\fC [inline]\fP" .SS "bool ost::String::operator< (const char * str) const" .SS "bool ost::String::operator< (const \fBString\fP & str) const" .SS "bool ost::String::operator<= (const char * str) const" .SS "bool ost::String::operator<= (const \fBString\fP & str) const" .SS "const char* ost::String::operator= (const char * str)\fC [inline]\fP" .PP Assign our string for c string\&. .SS "\fBString\fP& ost::String::operator= (const \fBString\fP & original)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator= (double d)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator= (float f)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator= (int i)\fC [inline]\fP" .PP Assignment operator\&. .SS "\fBString\fP& ost::String::operator= (long l)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator= (short s)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator= (unsigned int i)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator= (unsigned long l)\fC [inline]\fP" .SS "\fBString\fP& ost::String::operator= (unsigned short s)\fC [inline]\fP" .SS "bool ost::String::operator== (const char * str) const" .SS "bool ost::String::operator== (const \fBString\fP & str) const" .SS "bool ost::String::operator> (const char * str) const" .SS "bool ost::String::operator> (const \fBString\fP & str) const" .SS "bool ost::String::operator>= (const char * str) const" .SS "bool ost::String::operator>= (const \fBString\fP & str) const" .SS "const char ost::String::operator[] (unsigned ind) const\fC [inline]\fP" .PP Extract a character by array indexing\&. .PP \fBReturns\fP .RS 4 character code\&. .RE .PP .SS "void ost::String::replace (size_t start, size_t len, const char * text, size_t count = \fC0\fP)" .PP Replace text at a specific position in the string with new text\&. .PP \fBParameters\fP .RS 4 \fIstart\fP starting offset to replace at\&. .br \fIlen\fP length of text to remove\&. .br \fItext\fP text to replace with\&. .br \fIcount\fP size of replacement text\&. .RE .PP .SS "void ost::String::replace (size_t start, size_t len, const \fBString\fP & string)" .PP Replace text at a specific position in the string with new string,\&. .PP \fBParameters\fP .RS 4 \fIstart\fP starting offset to replace at\&. .br \fIlen\fP length of text to remove\&. .br \fIstring\fP reference to replace with\&. .RE .PP .SS "void ost::String::resize (size_t size)" .PP Re-allocate buffer space for string\&. .PP \fBParameters\fP .RS 4 \fIsize\fP new size to use\&. .RE .PP .SS "size_t ost::String::rfind (const char * s, size_t offset = \fC0\fP, size_t len = \fC0\fP) const" .PP Find last occurence of a text in our string\&. .PP \fBReturns\fP .RS 4 index of last instance found, .RE .PP \fBParameters\fP .RS 4 \fIs\fP string to search for\&. .br \fIoffset\fP offset to start from\&. .br \fIlen\fP size of string to look for\&. .RE .PP .SS "size_t ost::String::rfind (const \fBString\fP & s, size_t offset = \fC0\fP) const" .PP Find last occurence of a substring in our string\&. .PP \fBReturns\fP .RS 4 index of last instance found, .RE .PP \fBParameters\fP .RS 4 \fIs\fP string to search for\&. .br \fIoffset\fP offset to start from\&. .RE .PP .SS "size_t ost::String::search (const char * text, size_t clen = \fC0\fP, size_t offset = \fC0\fP) const\fC [protected]\fP" .PP An internal method used to search for a substring starting at a known offset\&. Used by find and count methods\&. .PP \fBReturns\fP .RS 4 npos if fails, or offset to text found\&. .RE .PP \fBParameters\fP .RS 4 \fItext\fP text to search for\&. .br \fIclen\fP length of search text\&. .br \fIoffset\fP offset to start from\&. .RE .PP .SS "const char* ost::String::set (const char * str, size_t len = \fC0\fP)\fC [protected]\fP" .PP Set the content of the string variable to the specified string value, and use smart re-allocation strategies if appropriate to shrink the size of the variable\&. .PP \fBParameters\fP .RS 4 \fIstr\fP string to set\&. .br \fIlen\fP length of string if passed\&. .RE .PP .SS "void ost::String::set (const \fBString\fP & str)\fC [protected]\fP" .PP Set the content of the string variable to that of another variable\&. Uses the string set method\&. .PP \fBParameters\fP .RS 4 \fIstr\fP string to copy from\&. .RE .PP .SS "const char* ost::String::set (size_t size, const char * format, \&.\&.\&.)\fC [protected]\fP" .PP Set the content of the string variable to that of a formatted printf style string\&. .PP \fBParameters\fP .RS 4 \fIsize\fP of string data to set\&. .br \fIformat\fP of string to write into object\&. .RE .PP .SS "void ost::String::setLength (size_t len)\fC [protected]\fP" .PP Set the length value of the string content\&. .PP \fBParameters\fP .RS 4 \fIlen\fP size in bytes\&. .RE .PP .SS "size_t ost::String::setSize (size_t size)\fC [protected]\fP" .PP Set the size of allocated space in the string variable (capacity) to a known value\&. The value is recomputed and adjusted based on allocation method\&. .PP \fBParameters\fP .RS 4 \fIsize\fP in bytes\&. .RE .PP .SS "size_t ost::String::size (void) const\fC [inline]\fP" .PP Get actual length of string data\&. .PP \fBReturns\fP .RS 4 actual size of string\&. .RE .PP .SS "void ost::String::strip (const char * cs)" .PP Strip lead and trailing characters from a string\&. .PP \fBParameters\fP .RS 4 \fIcs\fP list of chars to strip\&. .RE .PP .SS "\fBString\fP ost::String::substr (size_t start, size_t len) const\fC [inline]\fP" .PP Return a new string that contains a specific substring of the current string\&. .PP \fBReturns\fP .RS 4 new string\&. .RE .PP \fBParameters\fP .RS 4 \fIstart\fP starting offset for extracted substring\&. .br \fIlen\fP length of substring\&. .RE .PP .SS "char* ost::String::text (void) const\fC [inline]\fP" .PP Alternate get text method\&. .PP \fBReturns\fP .RS 4 string data\&. .RE .PP .SS "\fBString\fP ost::String::token (const char * delim = \fC' \\t\\n\\r'\fP, size_t offset = \fC0\fP)" .PP Extract a new string as a token from the current string\&. .PP \fBReturns\fP .RS 4 string containing token\&. .RE .PP \fBParameters\fP .RS 4 \fIdelim\fP deliminator characters\&. .br \fIoffset\fP offset to start from\&. .RE .PP .SS "void ost::String::trim (const char * cs)\fC [inline]\fP" .PP Trim trailing characters from a string\&. .PP \fBParameters\fP .RS 4 \fIcs\fP list of chars to trim\&. .RE .PP .PP References ost::strtrim()\&. .SS "void ost::String::trim (size_t count)" .PP Trim n trailing characters from a string\&. .PP \fBParameters\fP .RS 4 \fIcount\fP number of bytes to trim\&. .RE .PP .SH "Friends And Related Function Documentation" .PP .SS "std::istream& getline (std::istream & is, \fBString\fP & str, char delim, size_t size)\fC [friend]\fP" .PP Fetch input from a std::istream into the current string variable until either the string variable is filled (based on current length) or the deliminator is read\&. .PP \fBParameters\fP .RS 4 \fIis\fP stream to read\&. .br \fIstr\fP string to save into\&. .br \fIdelim\fP deliminator to use\&. .br \fIsize\fP optional size limitor\&. .RE .PP .SS "friend class \fBMemPager\fP\fC [friend]\fP" .SS "\fB__EXPORT\fP \fBString\fP operator+ (const char * s1, const \fBString\fP & s2)\fC [friend]\fP" .SS "\fB__EXPORT\fP \fBString\fP operator+ (const char c1, const \fBString\fP & s2)\fC [friend]\fP" .SS "\fB__EXPORT\fP \fBString\fP operator+ (const \fBString\fP & s1, const char * s2)\fC [friend]\fP" .SS "\fB__EXPORT\fP \fBString\fP operator+ (const \fBString\fP & s1, const char c2)\fC [friend]\fP" .SS "\fB__EXPORT\fP \fBString\fP operator+ (const \fBString\fP & s1, const \fBString\fP & s2)\fC [friend]\fP" .PP Add two strings and return a temporary object\&. .SS "\fB__EXPORT\fP std::ostream& operator<< (std::ostream & os, const \fBString\fP & str)\fC [friend]\fP" .PP Stream the content of our string variable directly to a C++ streaming source\&. .SS "std::istream& operator>> (std::istream & is, \fBString\fP & str)\fC [friend]\fP" .PP Stream input into our variable\&. .SS "friend class \fBStringObject\fP\fC [friend]\fP" .SS "\fB__EXPORT\fP int strprintf (\fBString\fP & str, size_t size, const char * format, \&.\&.\&.)\fC [friend]\fP" .PP Print values directly into a string variable\&. .PP \fBReturns\fP .RS 4 character count\&. .RE .PP \fBParameters\fP .RS 4 \fIstr\fP object reference to use\&. .br \fIsize\fP of string required\&. .br \fIformat\fP of data\&. .RE .PP .SH "Member Data Documentation" .PP .SS "bool ost::String::big" .SS "struct { \&.\&.\&. } ost::String::bigstring" .SS "size_t ost::String::length" .SS "char ost::String::length" .SS "struct { \&.\&.\&. } ost::String::ministring" .SS "const unsigned ost::String::minsize\fC [static]\fP, \fC [protected]\fP" .SS "const size_t ost::String::npos\fC [static]\fP" .SS "const unsigned ost::String::pagesize\fC [static]\fP, \fC [protected]\fP" .SS "size_t ost::String::size" .SS "const unsigned ost::String::slotcount\fC [static]\fP, \fC [protected]\fP" .SS "const unsigned ost::String::slotlimit\fC [static]\fP, \fC [protected]\fP" .SS "const unsigned ost::String::slotsize\fC [static]\fP, \fC [protected]\fP" .SS "char* ost::String::text" .SS "char ost::String::text[(sizeof(char *)+(sizeof(size_t) *2)+1)]" .SH "Author" .PP Generated automatically by Doxygen for GNU CommonC++ from the source code\&.