class
#include <bn_string.h>
istring Base class of bn::
Can be used as a reference type for all bn::
Base classes
- class istring_base
- Base class of bn::
istring.
Derived classes
-
template<int MaxSize>class string
std::string
like container with a fixed size buffer.
Public types
- using reverse_iterator = bn::reverse_iterator<iterator>
- Reverse iterator alias.
-
using const_reverse_iterator = bn::reverse_iterator<const_
iterator> - Const reverse iterator alias.
Public static variables
Public functions
-
auto operator=(const istring_
base& other) -> istring& constexpr - Copy assignment operator.
-
auto operator=(const string_
view& view) -> istring& constexpr - Copy assignment operator.
-
auto operator=(const_
pointer char_array_ptr) -> istring& constexpr - Copy assignment operator.
-
auto rbegin() const -> const_
reverse_ iterator constexpr - Returns a const reverse iterator to the end of the characters data.
-
auto rbegin() -> reverse_
iterator constexpr - Returns a reverse iterator to the end of the characters data.
-
auto rend() const -> const_
reverse_ iterator constexpr - Returns a const reverse iterator to the beginning of the characters data.
-
auto rend() -> reverse_
iterator constexpr - Returns a reverse iterator to the beginning of the characters data.
-
auto crbegin() const -> const_
reverse_ iterator constexpr - Returns a const reverse iterator to the end of the characters data.
-
auto crend() const -> const_
reverse_ iterator constexpr - Returns a const reverse iterator to the beginning of the characters data.
-
auto operator[](size_
type index) const -> const_ reference constexpr - Returns a const reference to the character stored at the specified index.
-
auto operator[](size_
type index) -> reference constexpr - Returns a reference to the character stored at the specified index.
-
auto at(size_
type index) const -> const_ reference constexpr - Returns a const reference to the character stored at the specified index.
-
auto at(size_
type index) -> reference constexpr - Returns a reference to the character stored at the specified index.
-
auto front() const -> const_
reference constexpr - Returns a const reference to the first character.
- auto front() -> reference constexpr
- Returns a reference to the first character.
-
auto back() const -> const_
reference constexpr - Returns a const reference to the last character.
- auto back() -> reference constexpr
- Returns a reference to the last character.
-
auto starts_with(value_
type value) const -> bool constexpr - Checks if the referenced string begins with the given prefix.
-
auto starts_with(const string_
view& view) const -> bool constexpr - Checks if the referenced string begins with the given prefix.
-
auto starts_with(const_
pointer char_array_ptr) const -> bool constexpr - Checks if the referenced string begins with the given prefix.
-
auto ends_with(value_
type value) const -> bool constexpr - Checks if the referenced string ends with the given prefix.
-
auto ends_with(const string_
view& view) const -> bool constexpr - Checks if the referenced string ends with the given prefix.
-
auto ends_with(const_
pointer char_array_ptr) const -> bool constexpr - Checks if the referenced string ends with the given prefix.
-
auto contains(value_
type value) const -> bool constexpr - Checks if the referenced string contains the given character.
-
auto contains(const string_
view& view) const -> bool constexpr - Checks if the referenced string contains the given substring.
-
auto contains(const_
pointer char_array_ptr) const -> bool constexpr - Checks if the referenced string contains the given substring.
-
auto find(value_
type value) const -> size_ type constexpr - Finds the first substring equal to the given character.
-
auto find(const string_
view& view) const -> size_ type constexpr - Finds the first substring equal to the given character sequence.
-
auto find(const_
pointer char_array_ptr) const -> size_ type constexpr - Finds the first substring equal to the given character sequence.
-
auto assign(const istring_
base& other) -> istring& constexpr - Replaces the contents of the istring.
-
auto assign(const istring_
base& other, size_ type position) -> istring& constexpr - Replaces the contents of the istring.
-
auto assign(const istring_
base& other, size_ type position, size_ type count) -> istring& constexpr - Replaces the contents of the istring.
-
auto assign(value_
type value) -> istring& constexpr - Replaces the contents of the istring.
-
auto assign(const string_
view& view) -> istring& constexpr - Replaces the contents of the istring.
-
auto assign(const string_
view& view, size_ type position) -> istring& constexpr - Replaces the contents of the istring.
-
auto assign(const string_
view& view, size_ type position, size_ type count) -> istring& constexpr - Replaces the contents of the istring.
-
auto assign(const_
pointer char_array_ptr) -> istring& constexpr - Replaces the contents of the istring.
-
auto assign(const_
pointer char_array_ptr, size_ type char_array_size) -> istring& constexpr - Replaces the contents of the istring.
-
auto assign(size_
type count, value_ type value) -> istring& constexpr - Replaces the contents of the istring with count copies of character value.
-
auto assign(const_
iterator first, const_ iterator last) -> istring& constexpr - Replaces the contents of the istring with the characters in the range [first, last).
-
void push_back(value_
type value) constexpr - Inserts a character at the end of the istring.
- void pop_back() constexpr
- Removes the last character of the istring.
-
auto append(const istring_
base& other) -> istring& constexpr - Appends additional characters to the istring.
-
auto append(const istring_
base& other, size_ type position) -> istring& constexpr - Appends additional characters to the istring.
-
auto append(const istring_
base& other, size_ type position, size_ type count) -> istring& constexpr - Appends additional characters to the istring.
-
auto append(value_
type value) -> istring& constexpr - Appends an additional character to the istring.
-
auto append(const string_
view& view) -> istring& constexpr - Appends additional characters to the istring.
-
auto append(const string_
view& view, size_ type position) -> istring& constexpr - Appends additional characters to the istring.
-
auto append(const string_
view& view, size_ type position, size_ type count) -> istring& constexpr - Appends additional characters to the istring.
-
auto append(const_
pointer char_array_ptr) -> istring& constexpr - Appends additional characters to the istring.
-
auto append(const_
pointer char_array_ptr, size_ type char_array_size) -> istring& constexpr - Appends additional characters to the istring.
-
auto append(size_
type count, value_ type value) -> istring& constexpr - Appends additional characters to the istring.
-
auto append(const_
iterator first, const_ iterator last) -> istring& constexpr - Appends additional characters to the istring.
-
auto erase(const_
iterator position) -> iterator constexpr - Erases a character.
-
auto erase(const_
iterator first, const_ iterator last) -> iterator constexpr - Erases a range of characters.
-
void resize(size_
type count) constexpr - Resizes the istring.
-
void resize(size_
type count, value_ type value) constexpr - Resizes the istring.
-
void shrink(size_
type count) constexpr - Resizes the istring to a size less or equal than the previous one.
- void swap(istring& other) constexpr
- Exchanges the contents of this istring with those of the other one.
-
auto operator+=(const istring_
base& other) -> istring& constexpr - Appends additional characters to the istring.
-
auto operator+=(value_
type value) -> istring& constexpr - Appends an additional character to the istring.
-
auto operator+=(const string_
view& view) -> istring& constexpr - Appends additional characters to the istring.
-
auto operator+=(const_
pointer char_array_ptr) -> istring& constexpr - Appends additional characters to the istring.
Friends
Function documentation
istring& bn:: istring:: operator=(const istring_ base& other) constexpr
Copy assignment operator.
Parameters | |
---|---|
other | istring_ |
Returns | Reference to this. |
istring& bn:: istring:: operator=(const string_ view& view) constexpr
Copy assignment operator.
Parameters | |
---|---|
view | string_ |
Returns | Reference to this. |
istring& bn:: istring:: operator=(const_ pointer char_array_ptr) constexpr
Copy assignment operator.
Parameters | |
---|---|
char_array_ptr | Pointer to null-terminated characters array. |
Returns | Reference to this. |
bool bn:: istring:: starts_with(value_ type value) const constexpr
Checks if the referenced string begins with the given prefix.
Parameters | |
---|---|
value | Single character. |
Returns | true if the referenced string begins with the given prefix; false otherwise. |
bool bn:: istring:: starts_with(const string_ view& view) const constexpr
Checks if the referenced string begins with the given prefix.
Parameters | |
---|---|
view | string_ |
Returns | true if the referenced string begins with the given prefix; false otherwise. |
bool bn:: istring:: starts_with(const_ pointer char_array_ptr) const constexpr
Checks if the referenced string begins with the given prefix.
Parameters | |
---|---|
char_array_ptr | Pointer to null-terminated characters array. |
Returns | true if the referenced string begins with the given prefix; false otherwise. |
bool bn:: istring:: ends_with(value_ type value) const constexpr
Checks if the referenced string ends with the given prefix.
Parameters | |
---|---|
value | Single character. |
Returns | true if the referenced string ends with the given prefix; false otherwise. |
bool bn:: istring:: ends_with(const string_ view& view) const constexpr
Checks if the referenced string ends with the given prefix.
Parameters | |
---|---|
view | string_ |
Returns | true if the referenced string ends with the given prefix; false otherwise. |
bool bn:: istring:: ends_with(const_ pointer char_array_ptr) const constexpr
Checks if the referenced string ends with the given prefix.
Parameters | |
---|---|
char_array_ptr | Pointer to null-terminated characters array. |
Returns | true if the referenced string ends with the given prefix; false otherwise. |
bool bn:: istring:: contains(value_ type value) const constexpr
Checks if the referenced string contains the given character.
Parameters | |
---|---|
value | Single character. |
Returns | true if the referenced string contains the given character; false otherwise. |
bool bn:: istring:: contains(const string_ view& view) const constexpr
Checks if the referenced string contains the given substring.
Parameters | |
---|---|
view | string_ |
Returns | true if the referenced string contains the given substring; false otherwise. |
bool bn:: istring:: contains(const_ pointer char_array_ptr) const constexpr
Checks if the referenced string contains the given substring.
Parameters | |
---|---|
char_array_ptr | Pointer to null-terminated characters array. |
Returns | true if the referenced string contains the given substring; false otherwise. |
size_ type bn:: istring:: find(value_ type value) const constexpr
Finds the first substring equal to the given character.
Parameters | |
---|---|
value | Single character. |
Returns | Position of the first character of the found substring, or npos if no such substring is found. |
size_ type bn:: istring:: find(const string_ view& view) const constexpr
Finds the first substring equal to the given character sequence.
Parameters | |
---|---|
view | string_ |
Returns | Position of the first character of the found substring, or npos if no such substring is found. |
size_ type bn:: istring:: find(const_ pointer char_array_ptr) const constexpr
Finds the first substring equal to the given character sequence.
Parameters | |
---|---|
char_array_ptr | Pointer to null-terminated characters array. |
Returns | Position of the first character of the found substring, or npos if no such substring is found. |
istring& bn:: istring:: assign(const istring_ base& other) constexpr
Replaces the contents of the istring.
Parameters | |
---|---|
other | istring_ |
Returns | Reference to this. |
istring& bn:: istring:: assign(const istring_ base& other,
size_ type position) constexpr
Replaces the contents of the istring.
Parameters | |
---|---|
other | istring_ |
position | Starting character index. |
Returns | Reference to this. |
istring& bn:: istring:: assign(const istring_ base& other,
size_ type position,
size_ type count) constexpr
Replaces the contents of the istring.
Parameters | |
---|---|
other | istring_ |
position | Starting character index. |
count | Number of characters to assign. |
Returns | Reference to this. |
istring& bn:: istring:: assign(value_ type value) constexpr
Replaces the contents of the istring.
Parameters | |
---|---|
value | Character replacement. |
Returns | Reference to this. |
istring& bn:: istring:: assign(const string_ view& view) constexpr
Replaces the contents of the istring.
Parameters | |
---|---|
view | string_ |
Returns | Reference to this. |
istring& bn:: istring:: assign(const string_ view& view,
size_ type position) constexpr
Replaces the contents of the istring.
Parameters | |
---|---|
view | string_ |
position | Starting character index. |
Returns | Reference to this. |
istring& bn:: istring:: assign(const string_ view& view,
size_ type position,
size_ type count) constexpr
Replaces the contents of the istring.
Parameters | |
---|---|
view | string_ |
position | Starting character index. |
count | Number of characters to assign. |
Returns | Reference to this. |
istring& bn:: istring:: assign(const_ pointer char_array_ptr) constexpr
Replaces the contents of the istring.
Parameters | |
---|---|
char_array_ptr | Pointer to null-terminated characters array replacement. |
Returns | Reference to this. |
istring& bn:: istring:: assign(const_ pointer char_array_ptr,
size_ type char_array_size) constexpr
Replaces the contents of the istring.
Parameters | |
---|---|
char_array_ptr | Pointer to null-terminated characters array replacement. |
char_array_size | Characters count of the characters array. |
Returns | Reference to this. |
istring& bn:: istring:: assign(size_ type count,
value_ type value) constexpr
Replaces the contents of the istring with count copies of character value.
Parameters | |
---|---|
count | New size. |
value | Character replacement. |
Returns | Reference to this. |
istring& bn:: istring:: assign(const_ iterator first,
const_ iterator last) constexpr
Replaces the contents of the istring with the characters in the range [first, last).
Parameters | |
---|---|
first | First element of the range. |
last | Last element of the range. |
Returns | Reference to this. |
void bn:: istring:: push_back(value_ type value) constexpr
Inserts a character at the end of the istring.
Parameters | |
---|---|
value | Character to insert. |
istring& bn:: istring:: append(const istring_ base& other) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
other | istring_ |
Returns | Reference to this. |
istring& bn:: istring:: append(const istring_ base& other,
size_ type position) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
other | istring_ |
position | Starting character index. |
Returns | Reference to this. |
istring& bn:: istring:: append(const istring_ base& other,
size_ type position,
size_ type count) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
other | istring_ |
position | Starting character index. |
count | Number of characters to append. |
Returns | Reference to this. |
istring& bn:: istring:: append(value_ type value) constexpr
Appends an additional character to the istring.
Parameters | |
---|---|
value | Character to append. |
Returns | Reference to this. |
istring& bn:: istring:: append(const string_ view& view) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
view | string_ |
Returns | Reference to this. |
istring& bn:: istring:: append(const string_ view& view,
size_ type position) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
view | string_ |
position | Starting character index. |
Returns | Reference to this. |
istring& bn:: istring:: append(const string_ view& view,
size_ type position,
size_ type count) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
view | string_ |
position | Starting character index. |
count | Number of characters to append. |
Returns | Reference to this. |
istring& bn:: istring:: append(const_ pointer char_array_ptr) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
char_array_ptr | Pointer to null-terminated characters array. |
Returns | Reference to this. |
istring& bn:: istring:: append(const_ pointer char_array_ptr,
size_ type char_array_size) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
char_array_ptr | Pointer to characters array. |
char_array_size | Characters count of the characters array. |
Returns | Reference to this. |
istring& bn:: istring:: append(size_ type count,
value_ type value) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
count | Number of characters to append. |
value | Character to append. |
Returns | Reference to this. |
istring& bn:: istring:: append(const_ iterator first,
const_ iterator last) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
first | First element of the range to append. |
last | Last element of the range to append. |
Returns | Reference to this. |
iterator bn:: istring:: erase(const_ iterator position) constexpr
Erases a character.
Parameters | |
---|---|
position | Iterator to the character to erase. |
Returns | Iterator following the erased character. |
iterator bn:: istring:: erase(const_ iterator first,
const_ iterator last) constexpr
Erases a range of characters.
Parameters | |
---|---|
first | Iterator to the first character to erase. |
last | Iterator to the last character to erase. |
Returns | Iterator following the last erased character. |
The range includes all the characters between first and last, including the character pointed by first, but not the one pointed by last.
void bn:: istring:: resize(size_ type count,
value_ type value) constexpr
Resizes the istring.
Parameters | |
---|---|
count | New size. |
value | Character to fill new elements with. |
istring& bn:: istring:: operator+=(const istring_ base& other) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
other | istring_ |
Returns | Reference to this. |
istring& bn:: istring:: operator+=(value_ type value) constexpr
Appends an additional character to the istring.
Parameters | |
---|---|
value | Character to append. |
Returns | Reference to this. |
istring& bn:: istring:: operator+=(const string_ view& view) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
view | string_ |
Returns | Reference to this. |
istring& bn:: istring:: operator+=(const_ pointer char_array_ptr) constexpr
Appends additional characters to the istring.
Parameters | |
---|---|
char_array_ptr | Pointer to null-terminated characters array. |
Returns | Reference to this. |