|
Melon
A C++ library designed for RadishOS.
|
A dynamic string. More...
#include <String.hpp>
Public Member Functions | |
| String (const char *s) | |
| Constructs the string from a raw char pointer. | |
| String (const String &other) | |
| Copy constructor. | |
| String (String &&other) | |
| Move constructor. | |
| String | substract (this String &self, Typing::USize chars) |
| Returns a substring from this string. | |
| const char * | raw (this const String &self) |
| Gets a raw buffer which contains the string characters. | |
| Typing::USize | length (this const String &self) |
| Gets the length of the string. | |
| const char * | begin (this const String &self) |
| Gets the base of the string vector. | |
| const char * | end (this const String &self) |
| Gets the end of the string vector. | |
| void | appendChar (this String &self, char ch) |
| Appends a character to the string. | |
| String | reverse (this String &self) |
| Reverse the string. | |
| String | ltrim (this String &self, char ch=' ') |
| Removes all occurences of ch at the left of the string. | |
| String | rtrim (this String &self, char ch=' ') |
| Removes all occurences of ch at the right of the string. | |
| String | trim (this String &self, char ch=' ') |
| Removes all occurences of ch at the left and the right of the string. | |
| char & | operator[] (this String &self, Typing::USize index) |
| Gets a character from its index. | |
| const char & | operator[] (this const String &self, Typing::USize index) |
| Gets a character from its index. | |
| bool | operator== (this const String &self, const String &other) |
| Checks if both strings are the same. | |
| bool | operator!= (this const String &self, const String &other) |
| Checks if both strings are different. | |
| bool | operator< (this const String &self, const String &other) |
| Checks if this string is smaller than another. | |
| bool | operator> (this const String &self, const String &other) |
| Checks if this string is bigger than another. | |
| bool | operator<= (this const String &self, const String &other) |
| Checks if this string is smaller than another or if both have the same size. | |
| bool | operator>= (this const String &self, const String &other) |
| Checks if this string is bigger than another or if both have the same size. | |
| String | operator+ (this const String &self, const String &other) |
| Creates a new string by concatenating this string and another. | |
| String & | operator= (this String &self, const String &other) |
| Copy assignment operator. | |
| String & | operator= (this String &self, String &&other) |
| Move assignment operator. | |
| String & | operator+= (this String &self, const String &other) |
| Concatenate two strings. | |
A dynamic string.
| Melon::String::String::String | ( | const char * | s | ) |
Constructs the string from a raw char pointer.
| s | raw char pointer |
| Melon::String::String::String | ( | const String & | other | ) |
Copy constructor.
| other | string to copy |
| Melon::String::String::String | ( | String && | other | ) |
Move constructor.
| other | string to move |
| void Melon::String::String::appendChar | ( | this String & | self, |
| char | ch ) |
Appends a character to the string.
| ch | character to append |
| const char * Melon::String::String::begin | ( | this const String & | self | ) |
Gets the base of the string vector.
| const char * Melon::String::String::end | ( | this const String & | self | ) |
Gets the end of the string vector.
| Typing::USize Melon::String::String::length | ( | this const String & | self | ) |
Gets the length of the string.
| String Melon::String::String::ltrim | ( | this String & | self, |
| char | ch = ' ' ) |
Removes all occurences of ch at the left of the string.
| ch | character to remove, =' ' by default |
| bool Melon::String::String::operator!= | ( | this const String & | self, |
| const String & | other ) |
Checks if both strings are different.
| other | string to compare |
| String Melon::String::String::operator+ | ( | this const String & | self, |
| const String & | other ) |
Creates a new string by concatenating this string and another.
| other | string to concatenate with |
| String & Melon::String::String::operator+= | ( | this String & | self, |
| const String & | other ) |
Concatenate two strings.
| other | string to add |
| bool Melon::String::String::operator< | ( | this const String & | self, |
| const String & | other ) |
Checks if this string is smaller than another.
| other | string to compare |
| bool Melon::String::String::operator<= | ( | this const String & | self, |
| const String & | other ) |
Checks if this string is smaller than another or if both have the same size.
| other | string to compare |
| String & Melon::String::String::operator= | ( | this String & | self, |
| const String & | other ) |
Copy assignment operator.
| other | string to copy |
| String & Melon::String::String::operator= | ( | this String & | self, |
| String && | other ) |
Move assignment operator.
| other | string to move |
| bool Melon::String::String::operator== | ( | this const String & | self, |
| const String & | other ) |
Checks if both strings are the same.
| other | string to compare |
| bool Melon::String::String::operator> | ( | this const String & | self, |
| const String & | other ) |
Checks if this string is bigger than another.
| other | string to compare |
| bool Melon::String::String::operator>= | ( | this const String & | self, |
| const String & | other ) |
Checks if this string is bigger than another or if both have the same size.
| other | string to compare |
| const char & Melon::String::String::operator[] | ( | this const String & | self, |
| Typing::USize | index ) |
Gets a character from its index.
| index | position of the character |
| char & Melon::String::String::operator[] | ( | this String & | self, |
| Typing::USize | index ) |
Gets a character from its index.
| index | position of the character |
| const char * Melon::String::String::raw | ( | this const String & | self | ) |
Gets a raw buffer which contains the string characters.
| String Melon::String::String::reverse | ( | this String & | self | ) |
Reverse the string.
| String Melon::String::String::rtrim | ( | this String & | self, |
| char | ch = ' ' ) |
Removes all occurences of ch at the right of the string.
| ch | character to remove, =' ' by default |
| String Melon::String::String::substract | ( | this String & | self, |
| Typing::USize | chars ) |
Returns a substring from this string.
| chars | number of characters to substract |
| String Melon::String::String::trim | ( | this String & | self, |
| char | ch = ' ' ) |
Removes all occurences of ch at the left and the right of the string.
| ch | character to remove, =' ' by default |