ost::String(3)
π ost::String(3) π
Library Functions Manual β and bestie, this is part 1 of 3, so buckle up π«Ά
β¨ NAME β¨
ost::String β this is a generic and portable string class. periodt. π
πΈ SYNOPSIS πΈ
#include <string.h>
Inherited by ost::SString. (iconic family tree moment π)
π· Public Types π·
typedef size_t size_typeβ yeah she's justsize_twearing a little name tag π
π¦ Public Member Functions π¦
π Constructors, destructor & friends π
String ()β Construct an empty string. a blank canvas, the moment before the glow-up β¨String (const String &original)β Copy constructor. she's literally her twin fr fr π―String (const char *str)β Create a string from a cstring.String (std::string string)β Create aStringfromstd::string. crossover episode π₯String (const String &str, size_t offset, size_t len=npos)β Create a new string from a subset of another string. it's giving snippet.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... (she said "I'm leaving" π)
π Getter era π
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β Returntrueif string is empty.void resize (size_t size)β Re-allocate buffer space for string. glow-up, but for memory πvoid clear (void)β Clear the contents of the entire string. clean slate energy π§Όchar at (ssize_t offset) constβ Return a character at a known offset.
π Counting, tokenizing & finding π
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=' 0r', 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. (reverse find, she's looking back π)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.
βοΈ Trim / chop / strip β the makeover section βοΈ
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,.
π More find (nth-instance convenience edition) π
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.
π«§ Housekeeping & raw access π«§
void compact (void)β Reduce the size of the string allocation to the minimum needed based on the current effective length. declutter queen π§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β Returntrueif string is empty.
π Append / add / assign π
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.String & operator+= (const String &str)β Append operator.String & operator+= (char c)β Append operator.String & operator+= (const char *str)β Append operator.String & operator+= (const std::string &str)β Append operator.
π Comparison operators (no blurb given, she's mysterious) π
bool operator< (const String &str) constbool operator< (const char *str) constbool operator> (const String &str) constbool operator> (const char *str) constbool operator<= (const String &str) constbool operator<= (const char *str) constbool operator>= (const String &str) constbool operator>= (const char *str) constbool operator== (const String &str) constbool operator== (const char *str) constbool operator!= (const String &str) constbool operator!= (const char *str) const
π’ Numeric append operators π’
String & operator+= (int i)β Append operator.String & operator+= (unsigned int i)String & operator+= (long l)String & operator+= (unsigned long l)String & operator+= (float f)String & operator+= (double d)String & operator+= (short s)String & operator+= (unsigned short s)
π Numeric assignment operators π
String & operator= (int i)β Assignment operator.String & operator= (unsigned int i)String & operator= (long l)String & operator= (unsigned long l)String & operator= (float f)String & operator= (double d)String & operator= (short s)String & operator= (unsigned short s)String & operator= (const String &original)
π Containment tests π
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β the classic "no position" sentinel π«
πΈ 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 formattedprintfstyle 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 minsizestatic const unsigned slotsizestatic const unsigned pagesizestatic const unsigned slotlimitstatic const unsigned slotcount
π¦ Friends π¦
class StringObjectclass 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 astd::istreaminto 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. no cap, that's the whole trick and it eats π₯
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. main character energy, honestly π
π Author π
David Sugar dyfet@ostel.com
Generic string class. (that's the whole vibe, short and slay β¨)
π« Member Typedef Documentation π«
typedef size_t ost::String::size_type
π Constructor & Destructor Documentation π
ok so this is the part where we β¨makeβ¨ strings. every single one of these is a different lil way to summon an ost::String into existence, and the last one yeets it back out. let's go bestie π«Ά
πΈ ost::String::String ()
Construct an empty string. literally just an empty lil guy, zero thoughts, head empty, iconic π
πΈ ost::String::String (const String & original)
Copy constructor β it's giving "twin where have you been" β¨
- Parameters:
- original β string to copy from.
πΈ ost::String::String (const char * str)
Create a string from a cstring. glow-up from C to C++, no cap.
- Parameters:
- str β text to set with.
πΈ ost::String::String (std::string string)
Create a String from std::string. crossover episode π¦
- Parameters:
- string β from
std::stringto copy from.
- string β from
πΈ ost::String::String (const String & str, size_t offset, size_t len = npos)
Create a new string from a subset of another string β like, you're taking a slice of the original's whole personality π
- Parameters:
- str β reference of source string.
- offset β offset to start of data in prior string.
- len β length of our substring.
πΈ ost::String::String (size_t size, const char * format, ...)
Create a string from formatted text input. it's giving printf but make it a whole object π
- Parameters:
- size β to allocate for our new string.
- format β of data to input.
πΈ ost::String::String (size_t count, const char fill = ' ')
Fill a new string with character data. repetitive? yes. iconic? also yes. main character energy for real.
- Parameters:
- count β size of new string.
- fill β char to fill string with.
πΈ virtual ost::String::~String () [virtual]
Destroy the string... πβ¨ (yes it literally says "Destroy the string..." with the trailing dots, the drama of it all)
β¨ Member Function Documentation β¨
okay bestie this is the big one, hydrate before you read this. every function, every flag, every parameter, exactly as written, no notes π
πΈ void ost::String::add (char c)
Add a character to the end of a string. one (1) char, at the very end, no drama π
- Parameters:
- c β char to add.
πΈ void ost::String::append (const char * str, size_t count = 0)
Append text to the end of the current string. "and another one" π
- Parameters:
- str β text to append.
- count β size of text to append.
πΈ void ost::String::append (const char * str, size_t offset, size_t count)
Append text into the current string. same energy, but now with an offset so it knows exactly where it's landing π
- Parameters:
- str β text to append.
- offset β offset to overlay.
- count β size of text to append.
πΈ void ost::String::append (const String & str)
Append string to the end of the current string. string on string, bestie behaviour π«Ά
- Parameters:
- str β string to append.
πΈ void ost::String::append (size_t size, const char * format, ...)
Append formatted text to the end of the current string. fancy formatting, added to the back, slay π₯
- Parameters:
- size β size of text to append.
- format β of data to append.
πΈ char ost::String::at (ssize_t offset) const
Return a character at a known offset. you know exactly where it lives and you're going to get it π
- Returns: character at offset.
πΈ char* ost::String::c_str (void) const [inline]
Old ANSI C++ compatible string pointer extraction. vintage. retro. still valid. the thrifted jacket of string methods π§₯β¨
- Returns: string data.
πΈ size_t ost::String::capacity (void) const [inline]
Get space allocated to hold current string. it's giving "how much room does she have" π
- Returns: space of memory buffer from heap or local.
πΈ void ost::String::chop (const char * cs) [inline]
Chop leading characters from a string. bye bestie βοΈ
- Parameters:
- cs β list of chars to chop.
- References:
ost::strchop().
πΈ void ost::String::chop (size_t chars) [inline]
Chop n leading characters from a string. same scissors, but now you're counting βοΈβοΈ
- Parameters:
- chars β count to chop.
πΈ void ost::String::clear (void)
Clear the contents of the entire string. memory wiped, factory reset, fresh start π
πΈ void ost::String::compact (void) [inline]
Reduce the size of the string allocation to the minimum needed based on the current effective length. it's decluttering. it's the "getting rid of everything that doesn't spark joy" of memory π
πΈ virtual int ost::String::compare (const char * text, size_t len = 0, size_t index = 0) const [protected], [virtual]
A derivable low level comparison operator. This can be used to create custom comparison data types in derived string classes. it's protected and virtual so you can build your own comparison lore on top of it π§
- Returns:
0if match, or value for ordering. - Parameters:
- text β text to compare.
- len β length of text to compare.
- index β offset from start of string, used in searchs.
πΈ void ost::String::copy (const String & str) [protected]
Impliment the copy constructor, used internally. Will always create a minimum sized string allocation. (yes, "Impliment" β we keep the spelling exactly as it is, character for character, no corrections here π)
- Parameters:
- str β string to copy from.
πΈ 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. it's counting. it's the "how many times did you say that" of functions π’
- Returns: count of instances.
- Parameters:
- s β text pattern to find
- offset β offset to start from.
- len β length of text pattern if specified.
πΈ unsigned ost::String::count (const String & s, size_t offset = 0) const
Count the number of occurences of a specific string within our string. (again, "occurences" β verbatim, we don't touch it πΈ)
- Returns: count of instances.
- Parameters:
- s β string to test.
- offset β offset to start from.
πΈ char* ost::String::data (void) const [inline]
Alternate get text method. a second way to get the same thing, because options are self-care β¨
- Returns: string data.
πΈ bool ost::String::empty (void) const [inline]
Return true if string is empty. is she empty? is the vibe void? let's find out π³οΈ
πΈ void ost::String::erase (size_t start, size_t len = npos)
Erase a portion of string. not the whole thing, just a portion. surgical. precise. π
- Parameters:
- start β starting index to erase from.
- len β number of characters to erase.
πΈ 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. detective mode, but for the *n*th one specifically π
- Returns: index of found substring.
- Parameters:
- s β string to search for.
- offset β offset to start at.
- len β size of string text.
- count β instance to look for.
πΈ 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. same hunt, but the target is a whole String π¦
- Returns: index of found substring.
- Parameters:
- s β string to search for.
- offset β offset to start at.
- instance β instance to look for.
πΈ 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. quality of life upgrade, we love to see it π
- Parameters:
- instance β nth instance to look for.
- text β text to look for.
- offset β offset to start at.
- len β length of text.
- References:
ost::find().
πΈ 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. same trick, but the thing you're hunting is a String reference π
- Parameters:
- instance β nth instance to look for.
- string β reference to look for.
- offset β offset to start at.
- References:
ost::find().
πΈ bool ost::String::getBool (bool defbool = false) const
Get the bool flag of a string. true or false, no in-between, no "it's complicated" π«Ά
- Returns: boolean value.
πΈ 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. (yep, "outsize" β verbatim, bestie, we don't fix it π)
- Returns: string content or
NULLif invalid index. - Parameters:
- index
πΈ const size_t ost::String::getLength (void) const
Get the assigned length of string. the length she was assigned. it's on her file. π
- Returns: string length.
πΈ const size_t ost::String::getSize (void) const
Get the allocation size of the string variable. different from the length, bestie, don't get it twisted π
- Returns: allocation size.
πΈ static char* ost::String::getSpace (size_t size) [static], [protected]
Used to fetch memory, if needed, based on the size, from the pager, or the system heap. it goes and gets the space, from wherever the space lives π β¨
- Returns: string pointer to space.
- Parameters:
- size β of space needed.
πΈ char* ost::String::getText (void) const
Get the text of a string. the actual contents. the lore. π
- Returns: string content.
πΈ long ost::String::getValue (long defvalue = 0l) const
Get the value of a string. it's giving number, but the number is wearing a string costume π
- Returns: string value as number.
πΈ 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. (yes the signature really is written const char*() β keeping it exactly as-is, no cap β)
- Returns: pointer to string data from our string,
- Parameters:
- ind β index or offset to use.
πΈ void ost::String::init (void) [protected]
Used to initialize a string object. the setup era, the getting-ready montage π§
πΈ void ost::String::insert (size_t start, const char * text, size_t len = 0)
Insert text into a string. not at the end, at the start position you choose. rude? no, requested π
- Parameters:
- start β starting offset to insert at.
- text β text to insert.
- len β size of text to insert.
πΈ void ost::String::insert (size_t start, const String & str)
Insert other string into our string. bestie moving into your string, rent free π‘
- Parameters:
- start β string offset to insert at.
- str β string to insert.
πΈ bool ost::String::isBig (void) const [inline], [protected]
Determine if string is allocated in local variable or an external reference. is she big? is she local? is she external? π
- Returns:
trueif external heap is used.
πΈ bool ost::String::isEmpty (void) const
Return true if string is empty. note: this is the other empty check, don't come for me πΈ
- Returns:
trueif string is empty string.
πΈ size_t ost::String::length (void) const [inline]
Get length as if null terminated string. cstring-coded length, for the cstring girlies π
- Returns: cstring length.
πΈ ost::String::operator char * () const [inline]
Get our string data through dereference operator. just... * her. she'll hand over the data. β¨
- Returns: string data.
πΈ bool ost::String::operator! (void) const [inline]
Logical test for string empty. the ! of it all π
- Returns:
trueif is empty.
πΈ bool ost::String::operator!= (const char * str) const
πΈ bool ost::String::operator!= (const String & str) const
these two are not-equal checks β no description given in the original, so I'm not about to invent one, that's the rules bestie π€
πΈ bool ost::String::operator*= (const char * str) const
Test if text is contained in our string. *= but make it a contains check. yes it's weird. yes it's iconic. π
πΈ bool ost::String::operator*= (const String & str) const
Test if string is contained in our string. same weird-but-iconic energy, with a String π¦
πΈ String& ost::String::operator+= (char c) [inline]
Append operator. char goes in, string grows, everybody cheers π
πΈ String& ost::String::operator+= (const char * str) [inline]
Append operator. cstring edition β¨
πΈ String& ost::String::operator+= (const std::string & str) [inline]
Append operator. std::string edition πΈ
πΈ String& ost::String::operator+= (const String & str) [inline]
Append operator. String edition π«Ά
πΈ String& ost::String::operator+= (double d) [inline]
πΈ String& ost::String::operator+= (float f) [inline]
πΈ String& ost::String::operator+= (int i) [inline]
Append operator. (these three share the one description in the original β number-coded appending, so many types, so little time π’)
πΈ String& ost::String::operator+= (long l) [inline]
πΈ String& ost::String::operator+= (short s) [inline]
πΈ String& ost::String::operator+= (unsigned int i) [inline]
πΈ String& ost::String::operator+= (unsigned long l) [inline]
πΈ String& ost::String::operator+= (unsigned short s) [inline]
these five came with no description attached in the original β just a whole family of append operators, listed, unbothered, thriving π
πΈ bool ost::String::operator< (const char * str) const
πΈ bool ost::String::operator< (const String & str) const
πΈ bool ost::String::operator<= (const char * str) const
πΈ bool ost::String::operator<= (const String & str) const
four comparison operators, zero descriptions in the source. they're just there, being less-than, being less-than-or-equal, holding it down β
πΈ const char* ost::String::operator= (const char * str) [inline]
Assign our string for c string. (that's how the original words it β "Assign our string for c string" π)
πΈ String& ost::String::operator= (const String & original) [inline]
πΈ String& ost::String::operator= (float f) [inline]
πΈ String& ost::String::operator= (int i) [inline]
Assignment operator. (the description in the original sits under the group, and honestly same β assigning is assigning π₯)
πΈ String& ost::String::operator= (double d) [inline]
one more assignment operator, sitting there being all assigny, no separate description given π
ok that was a lot and we're literally not even done yet, more coming in the next part, don't go anywhere π
String& ost::String::operator= (long l) [inline]β assignment operator, inline, returnsString&.String& ost::String::operator= (short s) [inline]β same assignment energy,shortflavor, inline, returnsString&.String& ost::String::operator= (unsigned int i) [inline]β assignment operator,unsigned intedition, inline, returnsString&.String& ost::String::operator= (unsigned long l) [inline]β assignment operator,unsigned longedition, inline, returnsString&.String& ost::String::operator= (unsigned short s) [inline]β assignment operator,unsigned shortedition, inline, returnsString&.bool ost::String::operator== (const char * str) constβ equality check against a C string, const, returnsbool.bool ost::String::operator== (const String & str) constβ equality check against anotherString, const, returnsbool.bool ost::String::operator> (const char * str) constβ greater-than check against a C string, const, returnsbool.bool ost::String::operator> (const String & str) constβ greater-than check against anotherString, const, returnsbool.bool ost::String::operator>= (const char * str) constβ greater-than-or-equal check against a C string, const, returnsbool.bool ost::String::operator>= (const String & str) constβ greater-than-or-equal check against anotherString, const, returnsbool.const char ost::String::operator[] (unsigned ind) const [inline]β Extract a character by array indexing. Returns character code.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.startβ starting offset to replace at.lenβ length of text to remove.textβ text to replace with.countβ size of replacement text.
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,.startβ starting offset to replace at.lenβ length of text to remove.stringβ reference to replace with.
void ost::String::resize (size_t size)β Re-allocate buffer space for string.sizeβ new size to use.
size_t ost::String::rfind (const char * s, size_t offset = 0, size_t len = 0) constβ Find last occurrence of a text in our string.- Returns: index of last instance found,
sβ string to search for.offsetβ offset to start from.lenβ size of string to look for.
size_t ost::String::rfind (const String & s, size_t offset = 0) constβ Find last occurrence of a substring in our string.- Returns: index of last instance found,
sβ string to search for.offsetβ offset to start from.
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:
nposif fails, or offset to text found. textβ text to search for.clenβ length of search text.offsetβ offset to start from.
- Returns:
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.strβ string to set.lenβ length of string if passed.
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.strβ string to copy from.
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.- size of string data to set.
- format of string to write into object.
void ost::String::setLength (size_t len) [protected]β Set the length value of the string content.lenβ size in bytes.
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.sizeβ in bytes.
size_t ost::String::size (void) const [inline]β Get actual length of string data.- Returns: actual size of string.
void ost::String::strip (const char * cs)β Strip lead and trailing characters from a string.csβ list of chars to strip.
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.
startβ starting offset for extracted substring.lenβ length of substring.
char* ost::String::text (void) const [inline]β Alternate get text method.- Returns: string data.
String ost::String::token (const char * delim = ' 0r', size_t offset = 0)β Extract a new string as a token from the current string.- Returns: string containing token.
delimβ deliminator characters.offsetβ offset to start from.
void ost::String::trim (const char * cs) [inline]β Trim trailing characters from a string.csβ list of chars to trim.- References
ost::strtrim().
void ost::String::trim (size_t count)β Trim n trailing characters from a string.countβ number of bytes to trim.
π― Friends And Related Function Documentation π―
std::istream& getline (std::istream & is, String & str, char delim, size_t size) [friend]β Fetch input from astd::istreaminto the current string variable until either the string variable is filled (based on current length) or the deliminator is read.isβ stream to read.strβ string to save into.delimβ deliminator to use.sizeβ optional size limitor.
friend class MemPager [friend]β it's a friend class, periodt.__EXPORT String operator+ (const char * s1, const String & s2) [friend]__EXPORT String operator+ (const char c1, const String & s2) [friend]__EXPORT String operator+ (const String & s1, const char * s2) [friend]__EXPORT String operator+ (const String & s1, const char c2) [friend]__EXPORT String operator+ (const String & s1, const String & s2) [friend]β Add two strings and return a temporary object.__EXPORT std::ostream& operator<< (std::ostream & os, const String & str) [friend]β Stream the content of our string variable directly to a C++ streaming source.std::istream& operator>> (std::istream & is, String & str) [friend]β Stream input into our variable.friend class StringObject [friend]β friend class vibes.__EXPORT int strprintf (String & str, size_t size, const char * format, ...) [friend]β Print values directly into a string variable.- Returns: character count.
strβ object reference to use.- size of string required.
- format of data.
π§Έ Member Data Documentation π§Έ
bool ost::String::bigstruct { ... } ost::String::bigstringsize_t ost::String::lengthchar ost::String::lengthstruct { ... } ost::String::ministringconst unsigned ost::String::minsize [static], [protected]const size_t ost::String::npos [static]const unsigned ost::String::pagesize [static], [protected]size_t ost::String::sizeconst unsigned ost::String::slotcount [static], [protected]const unsigned ost::String::slotlimit [static], [protected]const unsigned ost::String::slotsize [static], [protected]char* ost::String::textchar ost::String::text[(sizeof(char *)+(sizeof(size_t) *2)+1)]
βοΈ Author βοΈ
Generated automatically by Doxygen for GNU CommonC++ from the source code.
that's the whole page, bestie π this one came from GNU CommonC++ and is stamped Sun Dec 27 2020 β go off, king π
π¦ where this page comes from
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms