ost::String(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– 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 just size_t wearing 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 a String from std::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 β€” Return true if 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 β€” Return true if 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) 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

πŸ”’ 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 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. 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::string to copy 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: 0 if 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 NULL if 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: true if 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: true if 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: true if 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, returns String&.
  • String& ost::String::operator= (short s) [inline] β€” same assignment energy, short flavor, inline, returns String&.
  • String& ost::String::operator= (unsigned int i) [inline] β€” assignment operator, unsigned int edition, inline, returns String&.
  • String& ost::String::operator= (unsigned long l) [inline] β€” assignment operator, unsigned long edition, inline, returns String&.
  • String& ost::String::operator= (unsigned short s) [inline] β€” assignment operator, unsigned short edition, inline, returns String&.
  • bool ost::String::operator== (const char * str) const β€” equality check against a C string, const, returns bool.
  • bool ost::String::operator== (const String & str) const β€” equality check against another String, const, returns bool.
  • bool ost::String::operator> (const char * str) const β€” greater-than check against a C string, const, returns bool.
  • bool ost::String::operator> (const String & str) const β€” greater-than check against another String, const, returns bool.
  • bool ost::String::operator>= (const char * str) const β€” greater-than-or-equal check against a C string, const, returns bool.
  • bool ost::String::operator>= (const String & str) const β€” greater-than-or-equal check against another String, const, returns bool.
  • 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: npos if fails, or offset to text found.
    • text β€” text to search for.
    • clen β€” length of search text.
    • offset β€” offset to start from.
  • 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.
  • 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.
    • 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::big
  • struct { ... } ost::String::bigstring
  • size_t ost::String::length
  • char ost::String::length
  • struct { ... } ost::String::ministring
  • const unsigned ost::String::minsize [static], [protected]
  • const size_t ost::String::npos [static]
  • const unsigned ost::String::pagesize [static], [protected]
  • size_t ost::String::size
  • const unsigned ost::String::slotcount [static], [protected]
  • const unsigned ost::String::slotlimit [static], [protected]
  • const unsigned ost::String::slotsize [static], [protected]
  • char* ost::String::text
  • char 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