#include <bn_string.h>
template<int MaxSize>
bn::string class

String implementation that uses a fixed size buffer.

Template parameters
MaxSize Maximum number of characters that can be stored.

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 string& other) constexpr

Copy constructor.

Parameters
other string to copy.

template<int MaxSize>
bn::string<MaxSize>::string(const istring_base& other) constexpr

Copy constructor.

Parameters
other istring_base to copy.

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 string& other) constexpr

Copy assignment operator.

Parameters
other string to copy.
Returns Reference to this.

template<int MaxSize>
string& bn::string<MaxSize>::operator=(const istring_base& other) constexpr

Copy assignment operator.

Parameters
other istring_base to copy.
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_base.

Parameters
a First string to concatenate.
b Second istring_base to concatenate.
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_view to concatenate.
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.