|
Melon
A C++ library designed for RadishOS.
|
A null-terminated string. More...
#include <CString.hpp>
Public Member Functions | |
| CString (const char *s) | |
| Constructs the object from a given null-terminated string. | |
| ~CString () | |
| Free the internal buffer since it is allocated on the heap. | |
| CString & | copy (this const CString &self, CString &dest, Typing::USize chars) |
| Copies somes bytes from the internal buffer to another string's internal buffer. | |
| bool | has (this const CString &self, char ch) |
| Checks if this string contains a given character. | |
| Typing::USize | length (this const CString &self) |
| Computes the length of this string. | |
| const char * | begin (this const CString &self) |
| Gets a pointer to the base of the internal buffer. | |
| const char * | end (this const CString &self) |
| Gets a pointer to the end of the internal buffer. | |
| const char * | get (this const CString &self) |
| Gets the internal buffer. | |
| bool | operator== (this const CString &self, const CString &other) |
| Checks if a string is the same than this one. | |
| bool | operator!= (this const CString &self, const CString &other) |
| Checks if a string is different to this one. | |
| bool | operator< (this const CString &self, const CString &other) |
| Checks if this string is smaller than another. | |
| bool | operator> (this const CString &self, const CString &other) |
| Checks if this string is bigger than another. | |
| bool | operator<= (this const CString &self, const CString &other) |
| Checks if this string is smaller than or equals another. | |
| bool | operator>= (this const CString &self, const CString &other) |
| Checks if this string is bigger than or equals another. | |
| char & | operator[] (this CString &self, Typing::USize index) |
| Gets a character by its index in the string. | |
A null-terminated string.
This kind of string is not intended to be extended or shortened. Its size should be always the same.
| Melon::Memory::CString::CString | ( | const char * | s | ) |
Constructs the object from a given null-terminated string.
The internal buffer is allocated on the heap.
| s | null-terminated string |
| CString & Melon::Memory::CString::copy | ( | this const CString & | self, |
| CString & | dest, | ||
| Typing::USize | chars ) |
Copies somes bytes from the internal buffer to another string's internal buffer.
| other | destination string |
| chars | character count |
| const char * Melon::Memory::CString::get | ( | this const CString & | self | ) |
Gets the internal buffer.
| bool Melon::Memory::CString::has | ( | this const CString & | self, |
| char | ch ) |
Checks if this string contains a given character.
| ch | character to find |
| Typing::USize Melon::Memory::CString::length | ( | this const CString & | self | ) |
Computes the length of this string.
The null-terminating character is not treated as a part of the string.
Checks if a string is different to this one.
| other | string to compare |
Checks if this string is smaller than another.
| other | string to compare |
Checks if this string is smaller than or equals another.
| other | string to compare |
Checks if a string is the same than this one.
| other | string to compare |
Checks if this string is bigger than another.
| other | string to compare |
Checks if this string is bigger than or equals another.
| other | string to compare |
| char & Melon::Memory::CString::operator[] | ( | this CString & | self, |
| Typing::USize | index ) |
Gets a character by its index in the string.
| index | character position |