GNU CommonC++
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Friends | List of all members
ost::String Class Reference

This is a generic and portable string class. More...

#include <string.h>

Inheritance diagram for ost::String:
ost::SString

Public Types

typedef size_t size_type
 

Public Member Functions

 String ()
 Construct an empty string.
 
 String (const String &original)
 Copy constructor.
 
 String (const char *str)
 Create a string from a cstring.
 
 String (std::string string)
 Create a String from std::string.
 
 String (const String &str, size_t offset, size_t len=npos)
 Create a new string from a subset of another string.
 
 String (size_t size, const char *format,...)
 Create a string from formatted text input.
 
 String (size_t count, const char fill=' ')
 Fill a new string with character data.
 
virtual ~String ()
 Destroy the string...
 
const char * getIndex (size_t index) const
 Get a string pointer to string content based on an indexed offset.
 
char * getText (void) const
 Get the text of a string.
 
long getValue (long defvalue=0l) const
 Get the value of a string.
 
bool getBool (bool defbool=false) const
 Get the bool flag of a string.
 
const size_t getLength (void) const
 Get the assigned length of string.
 
const size_t getSize (void) const
 Get the allocation size of the string variable.
 
bool isEmpty (void) const
 Return true if string is empty.
 
void resize (size_t size)
 Re-allocate buffer space for string.
 
void clear (void)
 Clear the contents of the entire string.
 
char at (ssize_t offset) const
 Return a character at a known offset.
 
unsigned count (const String &s, size_t offset=0) const
 Count the number of occurences of a specific string within our string.
 
unsigned count (const char *s, size_t offset=0, size_t len=0) const
 Count the number of occurrences of a specific text pattern within our string.
 
String token (const char *delim=" \t\n\r", size_t offset=0)
 Extract a new string as a token from the current string.
 
size_t find (const String &s, size_t offset=0, unsigned instance=1) const
 Find the index to the nth instance of a substring in our string.
 
size_t rfind (const String &s, size_t offset=0) const
 Find last occurence of a substring in our string.
 
size_t find (const char *s, size_t offset=0, size_t len=0, unsigned count=1) const
 Find the index to the nth instance of text in our string.
 
size_t rfind (const char *s, size_t offset=0, size_t len=0) const
 Find last occurence of a text in our string.
 
void trim (const char *cs)
 Trim trailing characters from a string.
 
void chop (const char *cs)
 Chop leading characters from a string.
 
void strip (const char *cs)
 Strip lead and trailing characters from a string.
 
void chop (size_t chars)
 Chop n leading characters from a string.
 
void trim (size_t count)
 Trim n trailing characters from a string.
 
void erase (size_t start, size_t len=npos)
 Erase a portion of string.
 
void insert (size_t start, const char *text, size_t len=0)
 Insert text into a string.
 
void insert (size_t start, const String &str)
 Insert other string into our string.
 
void replace (size_t start, size_t len, const char *text, size_t count=0)
 Replace text at a specific position in the string with new text.
 
void replace (size_t start, size_t len, const String &string)
 Replace text at a specific position in the string with new string,.
 
size_t find (unsigned instance, const char *text, size_t offset=0, size_t len=0) const
 A more convenient version of find for nth occurences, by putting the instance first.
 
size_t find (unsigned instance, const String &string, size_t offset=0) const
 A more convenient version of find for nth occurences, by putting the instance first.
 
String substr (size_t start, size_t len) const
 Return a new string that contains a specific substring of the current string.
 
const char *() index (size_t ind) const
 Return an indexed string based on the index, such as from a find.
 
void compact (void)
 Reduce the size of the string allocation to the minimum needed based on the current effective length.
 
char * c_str (void) const
 Old ANSI C++ compatible string pointer extraction.
 
 operator char * () const
 Get our string data through dereference operator.
 
bool operator! (void) const
 Logical test for string empty.
 
char * text (void) const
 Alternate get text method.
 
char * data (void) const
 Alternate get text method.
 
size_t length (void) const
 Get length as if null terminated string.
 
size_t size (void) const
 Get actual length of string data.
 
size_t capacity (void) const
 Get space allocated to hold current string.
 
bool empty (void) const
 Return true if string is empty.
 
void append (const char *str, size_t count=0)
 Append text to the end of the current string.
 
void append (size_t size, const char *format,...)
 Append formatted text to the end of the current string.
 
void append (const char *str, size_t offset, size_t count)
 Append text into the current string.
 
void add (char c)
 Add a character to the end of a string.
 
void append (const String &str)
 Append string to the end of the current string.
 
const char operator[] (unsigned ind) const
 Extract a character by array indexing.
 
const char * operator= (const char *str)
 Assign our string for c string.
 
Stringoperator+= (const String &str)
 Append operator.
 
Stringoperator+= (char c)
 Append operator.
 
Stringoperator+= (const char *str)
 Append operator.
 
Stringoperator+= (const std::string &str)
 Append operator.
 
bool operator< (const String &str) const
 
bool operator< (const char *str) const
 
bool operator> (const String &str) const
 
bool operator> (const char *str) const
 
bool operator<= (const String &str) const
 
bool operator<= (const char *str) const
 
bool operator>= (const String &str) const
 
bool operator>= (const char *str) const
 
bool operator== (const String &str) const
 
bool operator== (const char *str) const
 
bool operator!= (const String &str) const
 
bool operator!= (const char *str) const
 
Stringoperator+= (int i)
 Append operator.
 
Stringoperator+= (unsigned int i)
 
Stringoperator+= (long l)
 
Stringoperator+= (unsigned long l)
 
Stringoperator+= (float f)
 
Stringoperator+= (double d)
 
Stringoperator+= (short s)
 
Stringoperator+= (unsigned short s)
 
Stringoperator= (int i)
 Assignment operator.
 
Stringoperator= (unsigned int i)
 
Stringoperator= (long l)
 
Stringoperator= (unsigned long l)
 
Stringoperator= (float f)
 
Stringoperator= (double d)
 
Stringoperator= (short s)
 
Stringoperator= (unsigned short s)
 
Stringoperator= (const String &original)
 
bool operator*= (const String &str) const
 Test if string is contained in our string.
 
bool operator*= (const char *str) const
 Test if text is contained in our string.
 

Static Public Attributes

static const size_t npos
 

Protected Member Functions

bool isBig (void) const
 Determine if string is allocated in local variable or an external reference.
 
const char * set (const char *str, size_t len=0)
 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.
 
void set (const String &str)
 Set the content of the string variable to that of another variable.
 
const char * set (size_t size, const char *format,...)
 Set the content of the string variable to that of a formatted printf style string.
 
void copy (const String &str)
 Impliment the copy constructor, used internally.
 
void init (void)
 Used to initialize a string object.
 
size_t setSize (size_t size)
 Set the size of allocated space in the string variable (capacity) to a known value.
 
void setLength (size_t len)
 Set the length value of the string content.
 
virtual int compare (const char *text, size_t len=0, size_t index=0) const
 A derivable low level comparison operator.
 
size_t search (const char *text, size_t clen=0, size_t offset=0) const
 An internal method used to search for a substring starting at a known offset.
 

Static Protected Member Functions

static char * getSpace (size_t size)
 Used to fetch memory, if needed, based on the size, from the pager, or the system heap.
 

Static Protected Attributes

static const unsigned minsize
 
static const unsigned slotsize
 
static const unsigned pagesize
 
static const unsigned slotlimit
 
static const unsigned slotcount
 

Friends

class StringObject
 
class MemPager
 
__EXPORT String operator+ (const String &s1, const String &s2)
 Add two strings and return a temporary object.
 
__EXPORT String operator+ (const String &s1, const char *s2)
 
__EXPORT String operator+ (const char *s1, const String &s2)
 
__EXPORT String operator+ (const String &s1, const char c2)
 
__EXPORT String operator+ (const char c1, const String &s2)
 
std::istream & getline (std::istream &is, String &str, char delim, size_t size)
 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.
 
__EXPORT std::ostream & operator<< (std::ostream &os, const String &str)
 Stream the content of our string variable directly to a C++ streaming source.
 
std::istream & operator>> (std::istream &is, String &str)
 Stream input into our variable.
 
__EXPORT int strprintf (String &str, size_t size, const char *format,...)
 Print values directly into a string variable.
 

Detailed Description

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.

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.

Author
David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m

Generic string class.

Member Typedef Documentation

◆ size_type

typedef size_t ost::String::size_type

Constructor & Destructor Documentation

◆ String() [1/7]

ost::String::String ( )

Construct an empty string.

◆ String() [2/7]

ost::String::String ( const String original)

Copy constructor.

Parameters
originalstring to copy from.

◆ String() [3/7]

ost::String::String ( const char *  str)

Create a string from a cstring.

Parameters
strtext to set with.

◆ String() [4/7]

ost::String::String ( std::string  string)

Create a String from std::string.

Parameters
stringfrom std::string to copy from.

◆ String() [5/7]

ost::String::String ( const String str,
size_t  offset,
size_t  len = npos 
)

Create a new string from a subset of another string.

Parameters
strreference of source string.
offsetoffset to start of data in prior string.
lenlength of our substring.

◆ String() [6/7]

ost::String::String ( size_t  size,
const char *  format,
  ... 
)

Create a string from formatted text input.

Parameters
sizeto allocate for our new string.
formatof data to input.

◆ String() [7/7]

ost::String::String ( size_t  count,
const char  fill = ' ' 
)

Fill a new string with character data.

Parameters
countsize of new string.
fillchar to fill string with.

◆ ~String()

virtual ost::String::~String ( )
virtual

Destroy the string...

Member Function Documentation

◆ add()

void ost::String::add ( char  c)

Add a character to the end of a string.

Parameters
cchar to add.

◆ append() [1/4]

void ost::String::append ( const char *  str,
size_t  count = 0 
)

Append text to the end of the current string.

Parameters
strtext to append.
countsize of text to append.

◆ append() [2/4]

void ost::String::append ( const char *  str,
size_t  offset,
size_t  count 
)

Append text into the current string.

Parameters
strtext to append.
offsetoffset to overlay.
countsize of text to append.

◆ append() [3/4]

void ost::String::append ( const String str)

Append string to the end of the current string.

Parameters
strstring to append.

◆ append() [4/4]

void ost::String::append ( size_t  size,
const char *  format,
  ... 
)

Append formatted text to the end of the current string.

Parameters
sizesize of text to append.
formatof data to append.

◆ at()

char ost::String::at ( ssize_t  offset) const

Return a character at a known offset.

Returns
character at offset.

◆ c_str()

char * ost::String::c_str ( void  ) const
inline

Old ANSI C++ compatible string pointer extraction.

Returns
string data.

◆ capacity()

size_t ost::String::capacity ( void  ) const
inline

Get space allocated to hold current string.

Returns
space of memory buffer from heap or local.

◆ chop() [1/2]

void ost::String::chop ( const char *  cs)
inline

Chop leading characters from a string.

Parameters
cslist of chars to chop.

References ost::strchop().

◆ chop() [2/2]

void ost::String::chop ( size_t  chars)
inline

Chop n leading characters from a string.

Parameters
charscount to chop.

◆ clear()

void ost::String::clear ( void  )

Clear the contents of the entire string.

◆ compact()

void ost::String::compact ( void  )
inline

Reduce the size of the string allocation to the minimum needed based on the current effective length.

◆ compare()

virtual int ost::String::compare ( const char *  text,
size_t  len = 0,
size_t  index = 0 
) const
protectedvirtual

A derivable low level comparison operator.

This can be used to create custom comparison data types in derived string classes.

Returns
0 if match, or value for ordering.
Parameters
texttext to compare.
lenlength of text to compare.
indexoffset from start of string, used in searchs.

◆ copy()

void ost::String::copy ( const String str)
protected

Impliment the copy constructor, used internally.

Will always create a minimum sized string allocation.

Parameters
strstring to copy from.

◆ count() [1/2]

unsigned ost::String::count ( const char *  s,
size_t  offset = 0,
size_t  len = 0 
) const

Count the number of occurrences of a specific text pattern within our string.

Returns
count of instances.
Parameters
stext pattern to find
offsetoffset to start from.
lenlength of text pattern if specified.

◆ count() [2/2]

unsigned ost::String::count ( const String s,
size_t  offset = 0 
) const

Count the number of occurences of a specific string within our string.

Returns
count of instances.
Parameters
sstring to test.
offsetoffset to start from.

◆ data()

char * ost::String::data ( void  ) const
inline

Alternate get text method.

Returns
string data.

◆ empty()

bool ost::String::empty ( void  ) const
inline

Return true if string is empty.

◆ erase()

void ost::String::erase ( size_t  start,
size_t  len = npos 
)

Erase a portion of string.

Parameters
startstarting index to erase from.
lennumber of characters to erase.

◆ find() [1/4]

size_t ost::String::find ( const char *  s,
size_t  offset = 0,
size_t  len = 0,
unsigned  count = 1 
) const

Find the index to the nth instance of text in our string.

Returns
index of found substring.
Parameters
sstring to search for.
offsetoffset to start at.
lensize of string text.
countinstance to look for.

◆ find() [2/4]

size_t ost::String::find ( const String s,
size_t  offset = 0,
unsigned  instance = 1 
) const

Find the index to the nth instance of a substring in our string.

Returns
index of found substring.
Parameters
sstring to search for.
offsetoffset to start at.
instanceinstance to look for.

◆ find() [3/4]

size_t ost::String::find ( unsigned  instance,
const char *  text,
size_t  offset = 0,
size_t  len = 0 
) const
inline

A more convenient version of find for nth occurences, by putting the instance first.

Parameters
instancenth instance to look for.
texttext to look for.
offsetoffset to start at.
lenlength of text.

References ost::find().

◆ find() [4/4]

size_t ost::String::find ( unsigned  instance,
const String string,
size_t  offset = 0 
) const
inline

A more convenient version of find for nth occurences, by putting the instance first.

Parameters
instancenth instance to look for.
stringreference to look for.
offsetoffset to start at.

References ost::find().

◆ getBool()

bool ost::String::getBool ( bool  defbool = false) const

Get the bool flag of a string.

Returns
boolean value.

◆ getIndex()

const char * ost::String::getIndex ( size_t  index) const

Get a string pointer to string content based on an indexed offset.

A NULL is returned if the index is outsize of range.

Returns
string content or NULL if invalid index.
Parameters
index

◆ getLength()

const size_t ost::String::getLength ( void  ) const

Get the assigned length of string.

Returns
string length.

◆ getSize()

const size_t ost::String::getSize ( void  ) const

Get the allocation size of the string variable.

Returns
allocation size.

◆ getSpace()

static char * ost::String::getSpace ( size_t  size)
staticprotected

Used to fetch memory, if needed, based on the size, from the pager, or the system heap.

Returns
string pointer to space.
Parameters
sizeof space needed.

◆ getText()

char * ost::String::getText ( void  ) const

Get the text of a string.

Returns
string content.

◆ getValue()

long ost::String::getValue ( long  defvalue = 0l) const

Get the value of a string.

Returns
string value as number.

◆ index()

const char *() ost::String::index ( size_t  ind) const
inline

Return an indexed string based on the index, such as from a find.

If out of range, a NULL string is returned.

Returns
pointer to string data from our string,
Parameters
indindex or offset to use.

◆ init()

void ost::String::init ( void  )
protected

Used to initialize a string object.

◆ insert() [1/2]

void ost::String::insert ( size_t  start,
const char *  text,
size_t  len = 0 
)

Insert text into a string.

Parameters
startstarting offset to insert at.
texttext to insert.
lensize of text to insert.

◆ insert() [2/2]

void ost::String::insert ( size_t  start,
const String str 
)

Insert other string into our string.

Parameters
startstring offset to insert at.
strstring to insert.

◆ isBig()

bool ost::String::isBig ( void  ) const
inlineprotected

Determine if string is allocated in local variable or an external reference.

Returns
true if external heap is used.

◆ isEmpty()

bool ost::String::isEmpty ( void  ) const

Return true if string is empty.

Returns
true if string is empty string.

◆ length()

size_t ost::String::length ( void  ) const
inline

Get length as if null terminated string.

Returns
cstring length.

◆ operator char *()

ost::String::operator char * ( ) const
inline

Get our string data through dereference operator.

Returns
string data.

◆ operator!()

bool ost::String::operator! ( void  ) const
inline

Logical test for string empty.

Returns
true if is empty.

◆ operator!=() [1/2]

bool ost::String::operator!= ( const char *  str) const

◆ operator!=() [2/2]

bool ost::String::operator!= ( const String str) const

◆ operator*=() [1/2]

bool ost::String::operator*= ( const char *  str) const

Test if text is contained in our string.

◆ operator*=() [2/2]

bool ost::String::operator*= ( const String str) const

Test if string is contained in our string.

◆ operator+=() [1/12]

String & ost::String::operator+= ( char  c)
inline

Append operator.

◆ operator+=() [2/12]

String & ost::String::operator+= ( const char *  str)
inline

Append operator.

◆ operator+=() [3/12]

String & ost::String::operator+= ( const std::string &  str)
inline

Append operator.

◆ operator+=() [4/12]

String & ost::String::operator+= ( const String str)
inline

Append operator.

◆ operator+=() [5/12]

String & ost::String::operator+= ( double  d)
inline

◆ operator+=() [6/12]

String & ost::String::operator+= ( float  f)
inline

◆ operator+=() [7/12]

String & ost::String::operator+= ( int  i)
inline

Append operator.

◆ operator+=() [8/12]

String & ost::String::operator+= ( long  l)
inline

◆ operator+=() [9/12]

String & ost::String::operator+= ( short  s)
inline

◆ operator+=() [10/12]

String & ost::String::operator+= ( unsigned int  i)
inline

◆ operator+=() [11/12]

String & ost::String::operator+= ( unsigned long  l)
inline

◆ operator+=() [12/12]

String & ost::String::operator+= ( unsigned short  s)
inline

◆ operator<() [1/2]

bool ost::String::operator< ( const char *  str) const

◆ operator<() [2/2]

bool ost::String::operator< ( const String str) const

◆ operator<=() [1/2]

bool ost::String::operator<= ( const char *  str) const

◆ operator<=() [2/2]

bool ost::String::operator<= ( const String str) const

◆ operator=() [1/10]

const char * ost::String::operator= ( const char *  str)
inline

Assign our string for c string.

◆ operator=() [2/10]

String & ost::String::operator= ( const String original)
inline

◆ operator=() [3/10]

String & ost::String::operator= ( double  d)
inline

◆ operator=() [4/10]

String & ost::String::operator= ( float  f)
inline

◆ operator=() [5/10]

String & ost::String::operator= ( int  i)
inline

Assignment operator.

◆ operator=() [6/10]

String & ost::String::operator= ( long  l)
inline

◆ operator=() [7/10]

String & ost::String::operator= ( short  s)
inline

◆ operator=() [8/10]

String & ost::String::operator= ( unsigned int  i)
inline

◆ operator=() [9/10]

String & ost::String::operator= ( unsigned long  l)
inline

◆ operator=() [10/10]

String & ost::String::operator= ( unsigned short  s)
inline

◆ operator==() [1/2]

bool ost::String::operator== ( const char *  str) const

◆ operator==() [2/2]

bool ost::String::operator== ( const String str) const

◆ operator>() [1/2]

bool ost::String::operator> ( const char *  str) const

◆ operator>() [2/2]

bool ost::String::operator> ( const String str) const

◆ operator>=() [1/2]

bool ost::String::operator>= ( const char *  str) const

◆ operator>=() [2/2]

bool ost::String::operator>= ( const String str) const

◆ operator[]()

const char ost::String::operator[] ( unsigned  ind) const
inline

Extract a character by array indexing.

Returns
character code.

◆ replace() [1/2]

void ost::String::replace ( size_t  start,
size_t  len,
const char *  text,
size_t  count = 0 
)

Replace text at a specific position in the string with new text.

Parameters
startstarting offset to replace at.
lenlength of text to remove.
texttext to replace with.
countsize of replacement text.

◆ replace() [2/2]

void ost::String::replace ( size_t  start,
size_t  len,
const String string 
)

Replace text at a specific position in the string with new string,.

Parameters
startstarting offset to replace at.
lenlength of text to remove.
stringreference to replace with.

◆ resize()

void ost::String::resize ( size_t  size)

Re-allocate buffer space for string.

Parameters
sizenew size to use.

◆ rfind() [1/2]

size_t ost::String::rfind ( const char *  s,
size_t  offset = 0,
size_t  len = 0 
) const

Find last occurence of a text in our string.

Returns
index of last instance found,
Parameters
sstring to search for.
offsetoffset to start from.
lensize of string to look for.

◆ rfind() [2/2]

size_t ost::String::rfind ( const String s,
size_t  offset = 0 
) const

Find last occurence of a substring in our string.

Returns
index of last instance found,
Parameters
sstring to search for.
offsetoffset to start from.

◆ search()

size_t ost::String::search ( const char *  text,
size_t  clen = 0,
size_t  offset = 0 
) const
protected

An internal method used to search for a substring starting at a known offset.

Used by find and count methods.

Returns
npos if fails, or offset to text found.
Parameters
texttext to search for.
clenlength of search text.
offsetoffset to start from.

◆ set() [1/3]

const char * ost::String::set ( const char *  str,
size_t  len = 0 
)
protected

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.

Parameters
strstring to set.
lenlength of string if passed.

◆ set() [2/3]

void ost::String::set ( const String str)
protected

Set the content of the string variable to that of another variable.

Uses the string set method.

Parameters
strstring to copy from.

◆ set() [3/3]

const char * ost::String::set ( size_t  size,
const char *  format,
  ... 
)
protected

Set the content of the string variable to that of a formatted printf style string.

Parameters
sizeof string data to set.
formatof string to write into object.

◆ setLength()

void ost::String::setLength ( size_t  len)
protected

Set the length value of the string content.

Parameters
lensize in bytes.

◆ setSize()

size_t ost::String::setSize ( size_t  size)
protected

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.

Parameters
sizein bytes.

◆ size()

size_t ost::String::size ( void  ) const
inline

Get actual length of string data.

Returns
actual size of string.

◆ strip()

void ost::String::strip ( const char *  cs)

Strip lead and trailing characters from a string.

Parameters
cslist of chars to strip.

◆ substr()

String ost::String::substr ( size_t  start,
size_t  len 
) const
inline

Return a new string that contains a specific substring of the current string.

Returns
new string.
Parameters
startstarting offset for extracted substring.
lenlength of substring.

◆ text()

char * ost::String::text ( void  ) const
inline

Alternate get text method.

Returns
string data.

◆ token()

String ost::String::token ( const char *  delim = " \t\n\r",
size_t  offset = 0 
)

Extract a new string as a token from the current string.

Returns
string containing token.
Parameters
delimdeliminator characters.
offsetoffset to start from.

◆ trim() [1/2]

void ost::String::trim ( const char *  cs)
inline

Trim trailing characters from a string.

Parameters
cslist of chars to trim.

References ost::strtrim().

◆ trim() [2/2]

void ost::String::trim ( size_t  count)

Trim n trailing characters from a string.

Parameters
countnumber of bytes to trim.

Friends And Related Symbol Documentation

◆ getline

std::istream & getline ( std::istream &  is,
String str,
char  delim,
size_t  size 
)
friend

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.

Parameters
isstream to read.
strstring to save into.
delimdeliminator to use.
sizeoptional size limitor.

◆ MemPager

friend class MemPager
friend

◆ operator+ [1/5]

__EXPORT String operator+ ( const char *  s1,
const String s2 
)
friend

◆ operator+ [2/5]

__EXPORT String operator+ ( const char  c1,
const String s2 
)
friend

◆ operator+ [3/5]

__EXPORT String operator+ ( const String s1,
const char *  s2 
)
friend

◆ operator+ [4/5]

__EXPORT String operator+ ( const String s1,
const char  c2 
)
friend

◆ operator+ [5/5]

__EXPORT String operator+ ( const String s1,
const String s2 
)
friend

Add two strings and return a temporary object.

◆ operator<<

__EXPORT std::ostream & operator<< ( std::ostream &  os,
const String str 
)
friend

Stream the content of our string variable directly to a C++ streaming source.

◆ operator>>

std::istream & operator>> ( std::istream &  is,
String str 
)
friend

Stream input into our variable.

◆ StringObject

friend class StringObject
friend

◆ strprintf

__EXPORT int strprintf ( String str,
size_t  size,
const char *  format,
  ... 
)
friend

Print values directly into a string variable.

Returns
character count.
Parameters
strobject reference to use.
sizeof string required.
formatof data.

Member Data Documentation

◆ big

bool ost::String::big

◆ [struct]

struct { ... } ost::String::bigstring

◆ length [1/2]

size_t ost::String::length

◆ length [2/2]

char ost::String::length

◆ [struct]

struct { ... } ost::String::ministring

◆ minsize

const unsigned ost::String::minsize
staticprotected

◆ npos

const size_t ost::String::npos
static

◆ pagesize

const unsigned ost::String::pagesize
staticprotected

◆ size

size_t ost::String::size

◆ slotcount

const unsigned ost::String::slotcount
staticprotected

◆ slotlimit

const unsigned ost::String::slotlimit
staticprotected

◆ slotsize

const unsigned ost::String::slotsize
staticprotected

◆ text [1/2]

char* ost::String::text

◆ text [2/2]

char ost::String::text[(sizeof(char *)+(sizeof(size_t) *2)+1)]

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