#include <bn_string.h>
template<int MaxSize>
string class
String implementation that uses a fixed size buffer.
| Template parameters | |
|---|---|
| MaxSize | Maximum number of characters that can be stored. |
Contents
Base classes
- class istring
- Base class of string.
Constructors, destructors, conversion operators
- string() constexpr
- Default constructor.
- string(const string& other) constexpr
- Copy constructor.
-
string(const istring_
base& other) constexpr - Copy constructor.
-
string(const_
pointer char_array_ptr) constexpr - Copy constructor.
-
string(const_
pointer char_array_ptr, size_ type char_array_size) constexpr - Copy constructor.
-
string(size_
type count, value_ type value) constexpr - Constructs a string with count copies of character value.
-
string(const_
iterator first, const_ iterator last) constexpr - Constructs a string with the characters in the range [first, last).
Public functions
- auto operator=(const string& other) -> string& constexpr
- Copy assignment operator.
-
auto operator=(const istring_
base& other) -> string& constexpr - Copy assignment operator.
-
auto operator=(const_
pointer char_array_ptr) -> string& constexpr - Copy assignment operator.
Friends
-
auto operator+(const string& a,
const istring_
base& b) -> friend string constexpr - Concatenates a string and a istring_
base. -
auto operator+(const string& a,
value_
type b) -> friend string constexpr - Concatenates a string and a character.
-
auto operator+(const string& a,
const string_
view& b) -> friend string constexpr - Concatenates two strings.
-
auto operator+(const string& a,
const_
pointer b) -> friend string constexpr - Concatenates two strings.
Function documentation
template<int MaxSize>
bn:: string<MaxSize>:: string(const istring_ base& other) constexpr
Copy constructor.
| Parameters | |
|---|---|
| other | istring_ |
template<int MaxSize>
bn:: string<MaxSize>:: string(const_ pointer char_array_ptr) constexpr
Copy constructor.
| Parameters | |
|---|---|
| char_array_ptr | Pointer to null-terminated characters array. |
template<int MaxSize>
bn:: string<MaxSize>:: string(const_ pointer char_array_ptr,
size_ type char_array_size) constexpr
Copy constructor.
| Parameters | |
|---|---|
| char_array_ptr | Pointer to characters array. |
| char_array_size | Characters count of the characters array. |
template<int MaxSize>
bn:: string<MaxSize>:: string(size_ type count,
value_ type value) constexpr
Constructs a string with count copies of character value.
| Parameters | |
|---|---|
| count | Number of characters to append. |
| value | Character to append. |
template<int MaxSize>
bn:: string<MaxSize>:: string(const_ iterator first,
const_ iterator last) constexpr
Constructs a string with the characters in the range [first, last).
| Parameters | |
|---|---|
| first | First element of the range. |
| last | Last element of the range. |
template<int MaxSize>
string& bn:: string<MaxSize>:: operator=(const istring_ base& other) constexpr
Copy assignment operator.
| Parameters | |
|---|---|
| other | istring_ |
| Returns | Reference to this. |
template<int MaxSize>
string& bn:: string<MaxSize>:: operator=(const_ pointer char_array_ptr) constexpr
Copy assignment operator.
| Parameters | |
|---|---|
| char_array_ptr | Pointer to null-terminated characters array. |
| Returns | Reference to this. |
template<int MaxSize>
friend string operator+(const string& a,
const istring_ base& b) constexpr
Concatenates a string and a istring_
| Parameters | |
|---|---|
| a | First string to concatenate. |
| b | Second istring_ |
| Returns | string containing characters from a followed by the characters from b. |
template<int MaxSize>
friend string operator+(const string& a,
value_ type b) constexpr
Concatenates a string and a character.
| Parameters | |
|---|---|
| a | First string to concatenate. |
| b | Second character to concatenate. |
| Returns | string containing characters from a followed by b. |
template<int MaxSize>
friend string operator+(const string& a,
const string_ view& b) constexpr
Concatenates two strings.
| Parameters | |
|---|---|
| a | First string to concatenate. |
| b | Second string_ |
| Returns | string containing characters from a followed by the characters from b. |
template<int MaxSize>
friend string operator+(const string& a,
const_ pointer b) constexpr
Concatenates two strings.
| Parameters | |
|---|---|
| a | First string to concatenate. |
| b | Second pointer to null-terminated characters array to concatenate. |
| Returns | string containing characters from a followed by the characters from b. |