Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::container::BasicStaticString< StrCapacity, CharT, Traits > Class Template Reference

A fixed-capacity string class that owns its storage. More...

#include <static_string.hpp>

Public Types

using traits_type = Traits
using value_type = CharT
using pointer = CharT*
using const_pointer = const CharT*
using reference = CharT&
using const_reference = const CharT&
using iterator = CharT*
using const_iterator = const CharT*
using reverse_iterator = std::reverse_iterator<iterator>
using const_reverse_iterator = std::reverse_iterator<const_iterator>
using size_type = size_t
using difference_type = ptrdiff_t

Public Member Functions

constexpr BasicStaticString () noexcept
 Default constructor. Creates an empty string.
constexpr BasicStaticString (std::basic_string_view< CharT, Traits > sv) noexcept
 Constructs from a string_view.
constexpr BasicStaticString (std::basic_string_view< CharT, Traits > sv, size_type pos, size_type count=npos) noexcept
 Constructs a substring from a string_view with position and count.
constexpr BasicStaticString (const CharT *str) noexcept
 Constructs from a null-terminated C string.
template<size_t N>
requires (N <= StrCapacity + 1)
constexpr explicit (false) BasicStaticString(const CharT(&str)[N]) noexcept
 Constructs from a character array of known size.
constexpr BasicStaticString (size_type count, CharT ch) noexcept
 Constructs from count copies of character ch.
constexpr BasicStaticString (const CharT *str, size_type len) noexcept
 Constructs from a pointer and length.
template<std::input_iterator InputIt>
requires (StrCapacity > 0)
constexpr BasicStaticString (InputIt first, InputIt last) noexcept
 Constructs from an iterator range.
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
constexpr BasicStaticString (std::from_range_t tag, Range &&range) noexcept
 Constructs from a range using std::from_range_t.
constexpr BasicStaticString (std::initializer_list< CharT > ilist) noexcept
 Constructs from an initializer list.
 BasicStaticString (std::nullptr_t)=delete
constexpr BasicStaticString (const BasicStaticString &) noexcept=default
constexpr BasicStaticString (BasicStaticString &&) noexcept=default
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
constexpr BasicStaticString (const BasicStaticString< OtherCapacity, CharT, Traits > &other) noexcept
 Copy constructor from smaller capacity string.
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
constexpr BasicStaticString (BasicStaticString< OtherCapacity, CharT, Traits > &&other) noexcept
 Move constructor from smaller capacity string.
constexpr BasicStaticString (const BasicStaticString &other, size_type pos, size_type count=npos) noexcept
 Substring copy constructor from same capacity string.
constexpr BasicStaticString (BasicStaticString &&other, size_type pos, size_type count=npos) noexcept
 Substring move constructor from same capacity string (C++23).
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
constexpr BasicStaticString (const BasicStaticString< OtherCapacity, CharT, Traits > &other, size_type pos, size_type count=npos) noexcept
 Substring copy constructor from smaller capacity string.
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
constexpr BasicStaticString (BasicStaticString< OtherCapacity, CharT, Traits > &&other, size_type pos, size_type count=npos) noexcept
 Substring move constructor from smaller capacity string (C++23).
constexpr ~BasicStaticString () noexcept=default
constexpr BasicStaticStringoperator= (const BasicStaticString &) noexcept=default
constexpr BasicStaticStringoperator= (BasicStaticString &&) noexcept=default
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
constexpr BasicStaticStringoperator= (const BasicStaticString< OtherCapacity, CharT, Traits > &other) noexcept
 Copy assignment from smaller capacity string.
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
constexpr BasicStaticStringoperator= (BasicStaticString< OtherCapacity, CharT, Traits > &&other) noexcept
 Move assignment from smaller capacity string.
constexpr BasicStaticStringoperator= (std::basic_string_view< CharT, Traits > sv) noexcept
 Assigns from a std::basic_string_view.
constexpr BasicStaticStringoperator= (const CharT *str) noexcept
 Assigns from a null-terminated C string.
constexpr void Clear () noexcept
 Clears the string content.
constexpr BasicStaticStringInsert (size_type pos, std::basic_string_view< CharT, Traits > sv) noexcept
 Inserts a std::basic_string_view at position.
constexpr BasicStaticStringInsert (size_type pos, size_type count, CharT ch) noexcept
 Inserts count copies of character at position..
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
constexpr BasicStaticStringInsertRange (size_type pos, Range &&range) noexcept
 Inserts characters from a range at position.
constexpr BasicStaticStringErase (size_type pos=0, size_type count=npos) noexcept
 Erases characters from pos to pos + count.
constexpr void PushBack (CharT ch) noexcept
 Appends a character.
constexpr void PopBack () noexcept
 Removes the last character.
constexpr BasicStaticStringAppend (std::basic_string_view< CharT, Traits > sv) noexcept
 Appends a std::basic_string_view.
constexpr BasicStaticStringAppend (size_type count, CharT ch) noexcept
 Appends count copies of character ch.
constexpr BasicStaticStringAppend (const CharT *str) noexcept
 Appends a null-terminated C string.
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
constexpr BasicStaticStringAppendRange (Range &&range) noexcept
 Appends characters from a range.
constexpr BasicStaticStringReplace (size_type pos, size_type count, std::basic_string_view< CharT, Traits > sv) noexcept
 Replaces characters in range [pos, pos + count) with std::basic_string_view.
constexpr BasicStaticStringReplace (size_type pos, size_type count, size_type count2, CharT ch) noexcept
 Replaces characters in range [pos, pos + count) with count2 copies of ch.
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
constexpr BasicStaticStringReplaceWithRange (size_type pos, size_type count, Range &&range) noexcept
 Replaces characters in range [pos, pos + count) with characters from a range.
constexpr size_type Copy (CharT *dest, size_type count, size_type pos=0) const noexcept
 Copies characters to a buffer.
constexpr void Resize (size_type count, CharT ch=CharT{}) noexcept
 Resizes the string.
constexpr void Swap (BasicStaticString &other) noexcept
 Swaps contents with another BasicStaticString.
constexpr BasicStaticStringAssign (std::basic_string_view< CharT, Traits > sv) noexcept
 Assigns a std::basic_string_view.
constexpr BasicStaticStringAssign (const CharT *str) noexcept
 Assigns a null-terminated C string.
constexpr BasicStaticStringAssign (size_type count, CharT ch) noexcept
 Assigns count copies of character ch.
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
constexpr BasicStaticStringAssignRange (Range &&range) noexcept
 Assigns characters from a range.
constexpr BasicStaticString Substr (size_type pos=0, size_type count=npos) const noexcept
 Returns a substring.
constexpr int Compare (std::basic_string_view< CharT, Traits > other) const noexcept
 Compares with another string.
template<size_t OtherCapacity>
constexpr int Compare (const BasicStaticString< OtherCapacity, CharT, Traits > &other) const noexcept
 Compares with another BasicStaticString.
constexpr size_type Find (std::basic_string_view< CharT, Traits > sv, size_type pos=0) const noexcept
 Finds first occurrence of substring.
constexpr size_type Find (CharT ch, size_type pos=0) const noexcept
 Finds first occurrence of character.
constexpr size_type RFind (std::basic_string_view< CharT, Traits > sv, size_type pos=npos) const noexcept
 Finds last occurrence of substring.
constexpr size_type RFind (CharT ch, size_type pos=npos) const noexcept
 Finds last occurrence of character.
constexpr size_type FindFirstOf (std::basic_string_view< CharT, Traits > sv, size_type pos=0) const noexcept
 Finds first occurrence of any character in sv.
constexpr size_type FindLastOf (std::basic_string_view< CharT, Traits > sv, size_type pos=npos) const noexcept
 Finds last occurrence of any character in sv.
constexpr size_type FindFirstNotOf (std::basic_string_view< CharT, Traits > sv, size_type pos=0) const noexcept
 Finds first character not in sv.
constexpr size_type FindLastNotOf (std::basic_string_view< CharT, Traits > sv, size_type pos=npos) const noexcept
 Finds last character not in sv.
constexpr BasicStaticStringoperator+= (std::basic_string_view< CharT, Traits > sv) noexcept
 Appends a std::basic_string_view.
constexpr BasicStaticStringoperator+= (CharT ch) noexcept
 Appends a character.
constexpr BasicStaticStringoperator+= (const CharT *str) noexcept
 Appends a null-terminated C string.
constexpr reference operator[] (size_type pos) noexcept
 Accesses character at specified position.
constexpr const_reference operator[] (size_type pos) const noexcept
 Accesses character at specified position (const).
constexpr operator std::basic_string_view< CharT, Traits > () const noexcept
 Converts to std::basic_string_view.
template<size_t OtherCapacity>
constexpr bool operator== (const BasicStaticString< OtherCapacity, CharT, Traits > &other) const noexcept
constexpr bool operator== (std::basic_string_view< CharT, Traits > other) const noexcept
constexpr bool operator== (const CharT *other) const noexcept
template<size_t OtherCapacity>
requires (StrCapacity > 0)
constexpr auto operator<=> (const BasicStaticString< OtherCapacity, CharT, Traits > &other) const noexcept -> std::strong_ordering
constexpr auto operator<=> (std::basic_string_view< CharT, Traits > other) const noexcept -> std::strong_ordering
constexpr auto operator<=> (const CharT *other) const noexcept -> std::strong_ordering
constexpr bool Empty () const noexcept
 Checks if the string is empty.
constexpr bool StartsWith (std::basic_string_view< CharT, Traits > sv) const noexcept
 Checks if string starts with prefix.
constexpr bool StartsWith (CharT ch) const noexcept
 Checks if string starts with character.
constexpr bool EndsWith (std::basic_string_view< CharT, Traits > sv) const noexcept
 Checks if string ends with suffix.
constexpr bool EndsWith (CharT ch) const noexcept
 Checks if string ends with character.
constexpr bool Contains (std::basic_string_view< CharT, Traits > sv) const noexcept
 Checks if string contains substring.
constexpr bool Contains (CharT ch) const noexcept
 Checks if string contains character.
constexpr size_type Size () const noexcept
 Returns the number of characters.
constexpr size_type Length () const noexcept
 Returns the number of characters.
constexpr size_type RemainingCapacity () const noexcept
 Returns the remaining capacity.
constexpr reference At (size_type pos) noexcept
 Accesses character at specified position with bounds checking.
constexpr const_reference At (size_type pos) const noexcept
 Accesses character at specified position with bounds checking (const).
constexpr reference Front () noexcept
 Accesses the first character.
constexpr const_reference Front () const noexcept
 Accesses the first character (const).
constexpr reference Back () noexcept
 Accesses the last character.
constexpr const_reference Back () const noexcept
 Accesses the last character (const).
constexpr pointer Data () noexcept
 Returns pointer to the underlying character array.
constexpr const_pointer Data () const noexcept
 Returns pointer to the underlying character array (const).
constexpr const_pointer CStr () const noexcept
 Returns null-terminated C string.
constexpr std::basic_string_view< CharT, Traits > View () const noexcept
 Returns a std::basic_string_view of the content.
constexpr iterator begin () noexcept
constexpr const_iterator begin () const noexcept
constexpr const_iterator cbegin () const noexcept
constexpr iterator end () noexcept
constexpr const_iterator end () const noexcept
constexpr const_iterator cend () const noexcept
constexpr reverse_iterator rbegin () noexcept
constexpr const_reverse_iterator rbegin () const noexcept
constexpr const_reverse_iterator crbegin () const noexcept
constexpr reverse_iterator rend () noexcept
constexpr const_reverse_iterator rend () const noexcept
constexpr const_reverse_iterator crend () const noexcept
template<size_t N>
requires (N <= StrCapacity + 1)
constexpr BasicStaticString (const CharT(&str)[N]) noexcept
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
constexpr auto InsertRange (size_type pos, Range &&range) noexcept -> BasicStaticString &
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
constexpr auto AppendRange (Range &&range) noexcept -> BasicStaticString &
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
constexpr auto ReplaceWithRange (size_type pos, size_type count, Range &&range) noexcept -> BasicStaticString &
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
constexpr auto AssignRange (Range &&range) noexcept -> BasicStaticString &
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
constexpr auto operator= (const BasicStaticString< OtherCapacity, CharT, Traits > &other) noexcept -> BasicStaticString &
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
constexpr auto operator= (BasicStaticString< OtherCapacity, CharT, Traits > &&other) noexcept -> BasicStaticString &

Static Public Member Functions

static constexpr size_type MaxSize () noexcept
 Returns the maximum possible number of characters.
static constexpr size_type Capacity () noexcept
 Returns the capacity.

Static Public Attributes

static constexpr size_type npos = static_cast<size_type>(-1)

Detailed Description

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
requires (StrCapacity > 0)
class helios::container::BasicStaticString< StrCapacity, CharT, Traits >

A fixed-capacity string class that owns its storage.

Does not allocate heap memory.

Template Parameters
StrCapacityMaximum number of characters (excluding null terminator)
CharTCharacter type
TraitsCharacter traits type

Definition at line 32 of file static_string.hpp.

Member Typedef Documentation

◆ const_iterator

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::const_iterator = const CharT*

Definition at line 41 of file static_string.hpp.

◆ const_pointer

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::const_pointer = const CharT*

Definition at line 37 of file static_string.hpp.

◆ const_reference

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::const_reference = const CharT&

Definition at line 39 of file static_string.hpp.

◆ const_reverse_iterator

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 43 of file static_string.hpp.

◆ difference_type

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::difference_type = ptrdiff_t

Definition at line 45 of file static_string.hpp.

◆ iterator

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::iterator = CharT*

Definition at line 40 of file static_string.hpp.

◆ pointer

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::pointer = CharT*

Definition at line 36 of file static_string.hpp.

◆ reference

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::reference = CharT&

Definition at line 38 of file static_string.hpp.

◆ reverse_iterator

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 42 of file static_string.hpp.

◆ size_type

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::size_type = size_t

Definition at line 44 of file static_string.hpp.

◆ traits_type

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::traits_type = Traits

Definition at line 34 of file static_string.hpp.

◆ value_type

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
using helios::container::BasicStaticString< StrCapacity, CharT, Traits >::value_type = CharT

Definition at line 35 of file static_string.hpp.

Constructor & Destructor Documentation

◆ BasicStaticString() [1/19]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( )
inlineconstexprnoexcept

Default constructor. Creates an empty string.

Definition at line 50 of file static_string.hpp.

◆ BasicStaticString() [2/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( std::basic_string_view< CharT, Traits > sv)
explicitconstexprnoexcept

Constructs from a string_view.

Warning
Triggers assertion if sv.size() > StrCapacity.
Parameters
svSource string view

Definition at line 913 of file static_string.hpp.

◆ BasicStaticString() [3/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( std::basic_string_view< CharT, Traits > sv,
size_type pos,
size_type count = npos )
constexprnoexcept

Constructs a substring from a string_view with position and count.

Warning
Triggers assertion if (pos + count) > sv.size() or count > StrCapacity.
Parameters
svSource string view
posStarting position in the view
countNumber of characters to copy (default: all remaining)

Definition at line 924 of file static_string.hpp.

◆ BasicStaticString() [4/19]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( const CharT * str)
inlineexplicitconstexprnoexcept

Constructs from a null-terminated C string.

Warning
Triggers assertion if string length > StrCapacity.
Parameters
strSource C string

Definition at line 76 of file static_string.hpp.

◆ BasicStaticString() [5/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( size_type count,
CharT ch )
constexprnoexcept

Constructs from count copies of character ch.

Warning
Triggers assertion if count > StrCapacity.
Parameters
countNumber of characters
chCharacter to repeat

Definition at line 952 of file static_string.hpp.

◆ BasicStaticString() [6/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( const CharT * str,
size_type len )
constexprnoexcept

Constructs from a pointer and length.

Warning
Triggers assertion if len > StrCapacity.
Parameters
strSource string pointer
lenLength of the string

Definition at line 962 of file static_string.hpp.

◆ BasicStaticString() [7/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
template<std::input_iterator InputIt>
requires (StrCapacity > 0)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( InputIt first,
InputIt last )
constexprnoexcept

Constructs from an iterator range.

Warning
Triggers assertion if std::distance(first, last) > StrCapacity.
Template Parameters
InputItInput iterator type
Parameters
firstBeginning of range
lastEnd of range

Definition at line 973 of file static_string.hpp.

◆ BasicStaticString() [8/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( std::from_range_t tag,
Range && range )
constexprnoexcept

Constructs from a range using std::from_range_t.

Warning
Triggers assertion if range size > StrCapacity.
Template Parameters
RangeRange type
Parameters
tagstd::from_range tag to disambiguate from iterator constructor
rangeRange to construct from

Definition at line 987 of file static_string.hpp.

◆ BasicStaticString() [9/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( std::initializer_list< CharT > ilist)
constexprnoexcept

Constructs from an initializer list.

Warning
Triggers assertion if ilist.size() > StrCapacity.
Parameters
ilistInitializer list

Definition at line 1002 of file static_string.hpp.

◆ BasicStaticString() [10/19]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( std::nullptr_t )
delete

◆ BasicStaticString() [11/19]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( const BasicStaticString< StrCapacity, CharT, Traits > & )
constexprdefaultnoexcept

◆ BasicStaticString() [12/19]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( BasicStaticString< StrCapacity, CharT, Traits > && )
constexprdefaultnoexcept

◆ BasicStaticString() [13/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (OtherCapacity < StrCapacity)
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( const BasicStaticString< OtherCapacity, CharT, Traits > & other)
explicitconstexprnoexcept

Copy constructor from smaller capacity string.

Warning
Triggers assertion if other.Size() > StrCapacity.
Template Parameters
OtherCapacityStrCapacity of source string (must be less than StrCapacity)
Parameters
otherSource string with smaller capacity

Definition at line 1480 of file static_string.hpp.

◆ BasicStaticString() [14/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (OtherCapacity < StrCapacity)
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( BasicStaticString< OtherCapacity, CharT, Traits > && other)
explicitconstexprnoexcept

Move constructor from smaller capacity string.

Warning
Triggers assertion if other.Size() > StrCapacity.
Template Parameters
OtherCapacityStrCapacity of source string (must be less than StrCapacity)
Parameters
otherSource string with smaller capacity

Definition at line 1493 of file static_string.hpp.

◆ BasicStaticString() [15/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( const BasicStaticString< StrCapacity, CharT, Traits > & other,
size_type pos,
size_type count = npos )
constexprnoexcept

Substring copy constructor from same capacity string.

Warning
Triggers assertion if (pos + count) > other.Size() or count > StrCapacity.
Parameters
otherSource string
posStarting position (default: 0)
countNumber of characters to copy (default: all remaining)

Definition at line 1454 of file static_string.hpp.

◆ BasicStaticString() [16/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( BasicStaticString< StrCapacity, CharT, Traits > && other,
size_type pos,
size_type count = npos )
constexprnoexcept

Substring move constructor from same capacity string (C++23).

Warning
Triggers assertion if (pos + count) > other.Size() or count > StrCapacity.
Parameters
otherSource string
posStarting position (default: 0)
countNumber of characters to copy (default: all remaining)

Definition at line 1466 of file static_string.hpp.

◆ BasicStaticString() [17/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (OtherCapacity < StrCapacity)
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( const BasicStaticString< OtherCapacity, CharT, Traits > & other,
size_type pos,
size_type count = npos )
constexprnoexcept

Substring copy constructor from smaller capacity string.

Warning
Triggers assertion if (pos + count) > other.Size() or count > StrCapacity.
Template Parameters
OtherCapacityStrCapacity of source string (must be less than StrCapacity)
Parameters
otherSource string with smaller capacity
posStarting position (default: 0)
countNumber of characters to copy (default: all remaining)

Definition at line 1506 of file static_string.hpp.

◆ BasicStaticString() [18/19]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (OtherCapacity < StrCapacity)
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( BasicStaticString< OtherCapacity, CharT, Traits > && other,
size_type pos,
size_type count = npos )
constexprnoexcept

Substring move constructor from smaller capacity string (C++23).

Warning
Triggers assertion if (pos + count) > other.Size() or count > StrCapacity.
Template Parameters
OtherCapacityStrCapacity of source string (must be less than StrCapacity)
Parameters
otherSource string with smaller capacity
posStarting position (default: 0)
countNumber of characters to copy (default: all remaining)

Definition at line 1521 of file static_string.hpp.

◆ ~BasicStaticString()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::~BasicStaticString ( )
constexprdefaultnoexcept

◆ BasicStaticString() [19/19]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<size_t N>
requires (N <= StrCapacity + 1)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::BasicStaticString ( const CharT(&) str[N])
constexprnoexcept

Definition at line 939 of file static_string.hpp.

Member Function Documentation

◆ Append() [1/3]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Append ( const CharT * str)
inlineconstexprnoexcept

Appends a null-terminated C string.

Warning
Triggers assertion if resulting size > Capacity().
Parameters
strC string to append
Returns
Reference to this

Definition at line 356 of file static_string.hpp.

◆ Append() [2/3]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Append ( size_type count,
CharT ch )
constexprnoexcept

Appends count copies of character ch.

Warning
Triggers assertion if resulting size > Capacity().
Parameters
countNumber of characters
chCharacter to append
Returns
Reference to this

Definition at line 1165 of file static_string.hpp.

◆ Append() [3/3]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Append ( std::basic_string_view< CharT, Traits > sv)
constexprnoexcept

Appends a std::basic_string_view.

Warning
Triggers assertion if resulting size > Capacity().
Parameters
svString view to append
Returns
Reference to this

Definition at line 1153 of file static_string.hpp.

◆ AppendRange() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::AppendRange ( Range && range)
constexprnoexcept

Appends characters from a range.

Warning
Triggers assertion if resulting size > Capacity().
Template Parameters
RangeRange type
Parameters
rangeRange to append
Returns
Reference to this

◆ AppendRange() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::AppendRange ( Range && range) -> BasicStaticString &
constexprnoexcept

Definition at line 1178 of file static_string.hpp.

◆ Assign() [1/3]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Assign ( const CharT * str)
inlineconstexprnoexcept

Assigns a null-terminated C string.

Warning
Triggers assertion if string length > Capacity().
Parameters
strC string to assign
Returns
Reference to this

Definition at line 455 of file static_string.hpp.

◆ Assign() [2/3]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Assign ( size_type count,
CharT ch )
constexprnoexcept

Assigns count copies of character ch.

Warning
Triggers assertion if count > Capacity().
Parameters
countNumber of characters
chCharacter to assign
Returns
Reference to this

Definition at line 1321 of file static_string.hpp.

◆ Assign() [3/3]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Assign ( std::basic_string_view< CharT, Traits > sv)
constexprnoexcept

Assigns a std::basic_string_view.

Warning
Triggers assertion if sv.size() > Capacity().
Parameters
svString view to assign
Returns
Reference to this

Definition at line 1310 of file static_string.hpp.

◆ AssignRange() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::AssignRange ( Range && range)
constexprnoexcept

Assigns characters from a range.

Warning
Triggers assertion if range size > Capacity().
Template Parameters
RangeRange type
Parameters
rangeRange to assign from
Returns
Reference to this

◆ AssignRange() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::AssignRange ( Range && range) -> BasicStaticString &
constexprnoexcept

Definition at line 1334 of file static_string.hpp.

◆ At() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::At ( size_type pos) const
nodiscardconstexprnoexcept

Accesses character at specified position with bounds checking (const).

Warning
Triggers assertion if pos >= Size().
Parameters
posPosition of the character
Returns
Const reference to the character

Definition at line 1374 of file static_string.hpp.

◆ At() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::At ( size_type pos)
nodiscardconstexprnoexcept

Accesses character at specified position with bounds checking.

Warning
Triggers assertion if pos >= size().
Parameters
posPosition of the character
Returns
Reference to the character

Definition at line 1366 of file static_string.hpp.

◆ Back() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Back ( ) const
nodiscardconstexprnoexcept

Accesses the last character (const).

Warning
Triggers assertion if string is empty.
Returns
Const reference to the last character

Definition at line 1406 of file static_string.hpp.

◆ Back() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Back ( )
nodiscardconstexprnoexcept

Accesses the last character.

Warning
Triggers assertion if string is empty.
Returns
Reference to the last character

Definition at line 1398 of file static_string.hpp.

◆ begin() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
const_iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::begin ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 868 of file static_string.hpp.

◆ begin() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::begin ( )
inlinenodiscardconstexprnoexcept

Definition at line 867 of file static_string.hpp.

◆ Capacity()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
constexpr size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Capacity ( )
inlinestaticnodiscardconstexprnoexcept

Returns the capacity.

Returns
StrCapacity

Definition at line 778 of file static_string.hpp.

◆ cbegin()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
const_iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::cbegin ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 871 of file static_string.hpp.

◆ cend()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
const_iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::cend ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 881 of file static_string.hpp.

◆ Clear()

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
void helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Clear ( )
constexprnoexcept

Clears the string content.

Definition at line 1029 of file static_string.hpp.

◆ Compare() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<size_t OtherCapacity>
int helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Compare ( const BasicStaticString< OtherCapacity, CharT, Traits > & other) const
inlinenodiscardconstexprnoexcept

Compares with another BasicStaticString.

Template Parameters
OtherCapacityStrCapacity of the other string
Parameters
otherString to compare with
Returns
Negative if less, zero if equal, positive if greater

Definition at line 506 of file static_string.hpp.

◆ Compare() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
int helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Compare ( std::basic_string_view< CharT, Traits > other) const
inlinenodiscardconstexprnoexcept

Compares with another string.

Parameters
otherString to compare with
Returns
Negative if less, zero if equal, positive if greater

Definition at line 494 of file static_string.hpp.

◆ Contains() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
bool helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Contains ( CharT ch) const
inlinenodiscardconstexprnoexcept

Checks if string contains character.

Parameters
chCharacter to search for
Returns
True if string contains ch

Definition at line 750 of file static_string.hpp.

◆ Contains() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
bool helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Contains ( std::basic_string_view< CharT, Traits > sv) const
inlinenodiscardconstexprnoexcept

Checks if string contains substring.

Parameters
svSubstring to search for
Returns
True if string contains sv

Definition at line 740 of file static_string.hpp.

◆ Copy()

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Copy ( CharT * dest,
size_type count,
size_type pos = 0 ) const
constexprnoexcept

Copies characters to a buffer.

Warning
Triggers assertion if pos > Size().
Parameters
destDestination buffer
countMaximum number of characters to copy
posStarting position
Returns
Number of characters copied

Definition at line 1279 of file static_string.hpp.

◆ crbegin()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
const_reverse_iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::crbegin ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 891 of file static_string.hpp.

◆ crend()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
const_reverse_iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::crend ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 901 of file static_string.hpp.

◆ CStr()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
const_pointer helios::container::BasicStaticString< StrCapacity, CharT, Traits >::CStr ( ) const
inlinenodiscardconstexprnoexcept

Returns null-terminated C string.

Returns
Null-terminated character array

Definition at line 854 of file static_string.hpp.

◆ Data() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
const_pointer helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Data ( ) const
inlinenodiscardconstexprnoexcept

Returns pointer to the underlying character array (const).

Returns
Const pointer to the character array

Definition at line 846 of file static_string.hpp.

◆ Data() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
pointer helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Data ( )
inlinenodiscardconstexprnoexcept

Returns pointer to the underlying character array.

Returns
Pointer to the character array

Definition at line 840 of file static_string.hpp.

◆ Empty()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
bool helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Empty ( ) const
inlinenodiscardconstexprnoexcept

Checks if the string is empty.

Returns
True if Size() == 0

Definition at line 695 of file static_string.hpp.

◆ end() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
const_iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::end ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 878 of file static_string.hpp.

◆ end() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::end ( )
inlinenodiscardconstexprnoexcept

Definition at line 875 of file static_string.hpp.

◆ EndsWith() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
bool helios::container::BasicStaticString< StrCapacity, CharT, Traits >::EndsWith ( CharT ch) const
inlinenodiscardconstexprnoexcept

Checks if string ends with character.

Parameters
chCharacter to check
Returns
True if string ends with ch

Definition at line 731 of file static_string.hpp.

◆ EndsWith() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
bool helios::container::BasicStaticString< StrCapacity, CharT, Traits >::EndsWith ( std::basic_string_view< CharT, Traits > sv) const
inlinenodiscardconstexprnoexcept

Checks if string ends with suffix.

Parameters
svSuffix to check
Returns
True if string ends with sv

Definition at line 721 of file static_string.hpp.

◆ Erase()

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Erase ( size_type pos = 0,
size_type count = npos )
constexprnoexcept

Erases characters from pos to pos + count.

Warning
Triggers assertion if pos > Size().
Parameters
posStarting position
countNumber of characters to erase (default: all remaining)
Returns
Reference to this

Definition at line 1120 of file static_string.hpp.

◆ explicit()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<size_t N>
requires (N <= StrCapacity + 1)
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::explicit ( false ) )[N] const &
constexprnoexcept

Constructs from a character array of known size.

Warning
Triggers assertion if N-1 > StrCapacity (excluding null terminator).
Template Parameters
NSize of the character array
Parameters
strSource character array

◆ Find() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Find ( CharT ch,
size_type pos = 0 ) const
inlinenodiscardconstexprnoexcept

Finds first occurrence of character.

Parameters
chCharacter to search for
posStarting position
Returns
Position of first occurrence, or npos if not found

Definition at line 530 of file static_string.hpp.

◆ Find() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Find ( std::basic_string_view< CharT, Traits > sv,
size_type pos = 0 ) const
inlinenodiscardconstexprnoexcept

Finds first occurrence of substring.

Parameters
svSubstring to search for
posStarting position
Returns
Position of first occurrence, or npos if not found

Definition at line 518 of file static_string.hpp.

◆ FindFirstNotOf()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::FindFirstNotOf ( std::basic_string_view< CharT, Traits > sv,
size_type pos = 0 ) const
inlinenodiscardconstexprnoexcept

Finds first character not in sv.

Parameters
svCharacters to exclude
posStarting position
Returns
Position of first non-matching character, or npos if not found

Definition at line 588 of file static_string.hpp.

◆ FindFirstOf()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::FindFirstOf ( std::basic_string_view< CharT, Traits > sv,
size_type pos = 0 ) const
inlinenodiscardconstexprnoexcept

Finds first occurrence of any character in sv.

Parameters
svCharacters to search for
posStarting position
Returns
Position of first occurrence, or npos if not found

Definition at line 564 of file static_string.hpp.

◆ FindLastNotOf()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::FindLastNotOf ( std::basic_string_view< CharT, Traits > sv,
size_type pos = npos ) const
inlinenodiscardconstexprnoexcept

Finds last character not in sv.

Parameters
svCharacters to exclude
posStarting position (searches backwards from here)
Returns
Position of last non-matching character, or npos if not found

Definition at line 600 of file static_string.hpp.

◆ FindLastOf()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::FindLastOf ( std::basic_string_view< CharT, Traits > sv,
size_type pos = npos ) const
inlinenodiscardconstexprnoexcept

Finds last occurrence of any character in sv.

Parameters
svCharacters to search for
posStarting position (searches backwards from here)
Returns
Position of last occurrence, or npos if not found

Definition at line 576 of file static_string.hpp.

◆ Front() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Front ( ) const
nodiscardconstexprnoexcept

Accesses the first character (const).

Warning
Triggers assertion if string is empty.
Returns
Const reference to the first character

Definition at line 1390 of file static_string.hpp.

◆ Front() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Front ( )
nodiscardconstexprnoexcept

Accesses the first character.

Warning
Triggers assertion if string is empty.
Returns
Reference to the first character

Definition at line 1382 of file static_string.hpp.

◆ Insert() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Insert ( size_type pos,
size_type count,
CharT ch )
constexprnoexcept

Inserts count copies of character at position..

Warning
Triggers assertion if pos > Size() or resulting size > Capacity()
Parameters
posPosition to insert at
countNumber of characters
chCharacter to insert
Returns
Reference to this

Definition at line 1058 of file static_string.hpp.

◆ Insert() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Insert ( size_type pos,
std::basic_string_view< CharT, Traits > sv )
constexprnoexcept

Inserts a std::basic_string_view at position.

Warning
Triggers assertion if pos > Size() or resulting size > Capacity().
Parameters
posPosition to insert at
svString view to insert
Returns
Reference to this

Definition at line 1036 of file static_string.hpp.

◆ InsertRange() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::InsertRange ( size_type pos,
Range && range )
constexprnoexcept

Inserts characters from a range at position.

Warning
Triggers assertion if pos > Size() or resulting size > Capacity().
Template Parameters
RangeRange type
Parameters
posPosition to insert at
rangeRange to insert
Returns
Reference to this

◆ InsertRange() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::InsertRange ( size_type pos,
Range && range ) -> BasicStaticString &
constexprnoexcept

Definition at line 1077 of file static_string.hpp.

◆ Length()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Length ( ) const
inlinenodiscardconstexprnoexcept

Returns the number of characters.

Returns
Number of characters (excluding null terminator)

Definition at line 764 of file static_string.hpp.

◆ MaxSize()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
constexpr size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::MaxSize ( )
inlinestaticnodiscardconstexprnoexcept

Returns the maximum possible number of characters.

Returns
StrCapacity

Definition at line 770 of file static_string.hpp.

◆ operator std::basic_string_view< CharT, Traits >()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator std::basic_string_view< CharT, Traits > ( ) const
inlinenodiscardconstexprnoexcept

Converts to std::basic_string_view.

Returns
String view of the content

Definition at line 656 of file static_string.hpp.

◆ operator+=() [1/3]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator+= ( CharT ch)
constexprnoexcept

Appends a character.

Warning
Triggers assertion if resulting size > Capacity().
Parameters
chCharacter to append
Returns
Reference to this

Definition at line 1342 of file static_string.hpp.

◆ operator+=() [2/3]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator+= ( const CharT * str)
inlineconstexprnoexcept

Appends a null-terminated C string.

Warning
Triggers assertion if resulting size > Capacity().
Parameters
strC string to append
Returns
Reference to this

Definition at line 631 of file static_string.hpp.

◆ operator+=() [3/3]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator+= ( std::basic_string_view< CharT, Traits > sv)
inlineconstexprnoexcept

Appends a std::basic_string_view.

Warning
Triggers assertion if resulting size > Capacity().
Parameters
svString view to append
Returns
Reference to this

Definition at line 612 of file static_string.hpp.

◆ operator<=>() [1/3]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
template<size_t OtherCapacity>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator<=> ( const BasicStaticString< OtherCapacity, CharT, Traits > & other) const -> std::strong_ordering
nodiscardconstexprnoexcept

Definition at line 1424 of file static_string.hpp.

◆ operator<=>() [2/3]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator<=> ( const CharT * other) const -> std::strong_ordering
inlinenodiscardconstexprnoexcept

Definition at line 686 of file static_string.hpp.

◆ operator<=>() [3/3]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator<=> ( std::basic_string_view< CharT, Traits > other) const -> std::strong_ordering
nodiscardconstexprnoexcept

Definition at line 1439 of file static_string.hpp.

◆ operator=() [1/8]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator= ( BasicStaticString< StrCapacity, CharT, Traits > && )
constexprdefaultnoexcept

◆ operator=() [2/8]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator= ( BasicStaticString< OtherCapacity, CharT, Traits > && other)
constexprnoexcept

Move assignment from smaller capacity string.

Warning
Triggers assertion if other.Size() > StrCapacity.
Template Parameters
OtherCapacityStrCapacity of source string (must be less than StrCapacity)
Parameters
otherSource string with smaller capacity
Returns
Reference to this

◆ operator=() [3/8]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator= ( BasicStaticString< OtherCapacity, CharT, Traits > && other) -> BasicStaticString &
constexprnoexcept

Definition at line 1551 of file static_string.hpp.

◆ operator=() [4/8]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator= ( const BasicStaticString< StrCapacity, CharT, Traits > & )
constexprdefaultnoexcept

◆ operator=() [5/8]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator= ( const BasicStaticString< OtherCapacity, CharT, Traits > & other)
constexprnoexcept

Copy assignment from smaller capacity string.

Warning
Triggers assertion if other.Size() > StrCapacity.
Template Parameters
OtherCapacityStrCapacity of source string (must be less than StrCapacity)
Parameters
otherSource string with smaller capacity
Returns
Reference to this

◆ operator=() [6/8]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<size_t OtherCapacity>
requires (OtherCapacity < StrCapacity)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator= ( const BasicStaticString< OtherCapacity, CharT, Traits > & other) -> BasicStaticString &
constexprnoexcept

Definition at line 1536 of file static_string.hpp.

◆ operator=() [7/8]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator= ( const CharT * str)
constexprnoexcept

Assigns from a null-terminated C string.

Warning
Triggers assertion if string length > StrCapacity.
Parameters
strSource C string
Returns
Reference to this

Definition at line 1021 of file static_string.hpp.

◆ operator=() [8/8]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator= ( std::basic_string_view< CharT, Traits > sv)
constexprnoexcept

Assigns from a std::basic_string_view.

Warning
Triggers assertion if sv.size() > StrCapacity.
Parameters
svSource string view
Returns
Reference to this

Definition at line 1013 of file static_string.hpp.

◆ operator==() [1/3]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<size_t OtherCapacity>
bool helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator== ( const BasicStaticString< OtherCapacity, CharT, Traits > & other) const
inlinenodiscardconstexprnoexcept

Definition at line 662 of file static_string.hpp.

◆ operator==() [2/3]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
bool helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator== ( const CharT * other) const
inlinenodiscardconstexprnoexcept

Definition at line 673 of file static_string.hpp.

◆ operator==() [3/3]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
bool helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator== ( std::basic_string_view< CharT, Traits > other) const
inlinenodiscardconstexprnoexcept

Definition at line 668 of file static_string.hpp.

◆ operator[]() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator[] ( size_type pos) const
nodiscardconstexprnoexcept

Accesses character at specified position (const).

Warning
Triggers assertion if pos >= Size().
Parameters
posPosition of the character
Returns
Const reference to the character

Definition at line 1358 of file static_string.hpp.

◆ operator[]() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::operator[] ( size_type pos)
nodiscardconstexprnoexcept

Accesses character at specified position.

Warning
Triggers assertion if pos >= Size().
Parameters
posPosition of the character
Returns
Reference to the character

Definition at line 1350 of file static_string.hpp.

◆ PopBack()

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
void helios::container::BasicStaticString< StrCapacity, CharT, Traits >::PopBack ( )
constexprnoexcept

Removes the last character.

Warning
Triggers assertion if string is empty.

Definition at line 1146 of file static_string.hpp.

◆ PushBack()

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
void helios::container::BasicStaticString< StrCapacity, CharT, Traits >::PushBack ( CharT ch)
constexprnoexcept

Appends a character.

Warning
Triggers assertion if Size() >= Capacity().
Parameters
chCharacter to append

Definition at line 1136 of file static_string.hpp.

◆ rbegin() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
const_reverse_iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::rbegin ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 888 of file static_string.hpp.

◆ rbegin() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
reverse_iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::rbegin ( )
inlinenodiscardconstexprnoexcept

Definition at line 885 of file static_string.hpp.

◆ RemainingCapacity()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::RemainingCapacity ( ) const
inlinenodiscardconstexprnoexcept

Returns the remaining capacity.

Returns
StrCapacity - Size()

Definition at line 786 of file static_string.hpp.

◆ rend() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
const_reverse_iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::rend ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 898 of file static_string.hpp.

◆ rend() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
reverse_iterator helios::container::BasicStaticString< StrCapacity, CharT, Traits >::rend ( )
inlinenodiscardconstexprnoexcept

Definition at line 895 of file static_string.hpp.

◆ Replace() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Replace ( size_type pos,
size_type count,
size_type count2,
CharT ch )
constexprnoexcept

Replaces characters in range [pos, pos + count) with count2 copies of ch.

Warning
Triggers assertion if pos > Size() or resulting size > Capacity().
Parameters
posStarting position
countNumber of characters to replace
count2Number of replacement characters
chReplacement character
Returns
Reference to this

Definition at line 1213 of file static_string.hpp.

◆ Replace() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Replace ( size_type pos,
size_type count,
std::basic_string_view< CharT, Traits > sv )
constexprnoexcept

Replaces characters in range [pos, pos + count) with std::basic_string_view.

Warning
Triggers assertion if pos > Size() or resulting size > Capacity().
Parameters
posStarting position
countNumber of characters to replace
svReplacement string view
Returns
Reference to this

Definition at line 1188 of file static_string.hpp.

◆ ReplaceWithRange() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
BasicStaticString & helios::container::BasicStaticString< StrCapacity, CharT, Traits >::ReplaceWithRange ( size_type pos,
size_type count,
Range && range )
constexprnoexcept

Replaces characters in range [pos, pos + count) with characters from a range.

Warning
Triggers assertion if pos > Size() or resulting size > Capacity().
Template Parameters
RangeRange type
Parameters
posStarting position
countNumber of characters to replace
rangeRange of replacement characters
Returns
Reference to this

◆ ReplaceWithRange() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
template<std::ranges::input_range Range>
requires std::convertible_to<std::ranges::range_value_t<Range>, CharT>
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::ReplaceWithRange ( size_type pos,
size_type count,
Range && range ) -> BasicStaticString &
constexprnoexcept

Definition at line 1238 of file static_string.hpp.

◆ Resize()

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
void helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Resize ( size_type count,
CharT ch = CharT{} )
constexprnoexcept

Resizes the string.

Warning
Triggers assertion if count > Capacity().
Parameters
countNew size
chCharacter to fill if expanding

Definition at line 1289 of file static_string.hpp.

◆ RFind() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::RFind ( CharT ch,
size_type pos = npos ) const
inlinenodiscardconstexprnoexcept

Finds last occurrence of character.

Parameters
chCharacter to search for
posStarting position (searches backwards from here)
Returns
Position of last occurrence, or npos if not found

Definition at line 553 of file static_string.hpp.

◆ RFind() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::RFind ( std::basic_string_view< CharT, Traits > sv,
size_type pos = npos ) const
inlinenodiscardconstexprnoexcept

Finds last occurrence of substring.

Parameters
svSubstring to search for
posStarting position (searches backwards from here)
Returns
Position of last occurrence, or npos if not found

Definition at line 541 of file static_string.hpp.

◆ Size()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Size ( ) const
inlinenodiscardconstexprnoexcept

Returns the number of characters.

Returns
Number of characters (excluding null terminator)

Definition at line 758 of file static_string.hpp.

◆ StartsWith() [1/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
bool helios::container::BasicStaticString< StrCapacity, CharT, Traits >::StartsWith ( CharT ch) const
inlinenodiscardconstexprnoexcept

Checks if string starts with character.

Parameters
chCharacter to check
Returns
True if string starts with ch

Definition at line 712 of file static_string.hpp.

◆ StartsWith() [2/2]

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
bool helios::container::BasicStaticString< StrCapacity, CharT, Traits >::StartsWith ( std::basic_string_view< CharT, Traits > sv) const
inlinenodiscardconstexprnoexcept

Checks if string starts with prefix.

Parameters
svPrefix to check
Returns
True if string starts with sv

Definition at line 702 of file static_string.hpp.

◆ Substr()

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
auto helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Substr ( size_type pos = 0,
size_type count = npos ) const
nodiscardconstexprnoexcept

Returns a substring.

Warning
Triggers assertion if pos > Size().
Parameters
posStarting position
countNumber of characters (default: all remaining)
Returns
Substring as StaticString with same capacity

Definition at line 1414 of file static_string.hpp.

◆ Swap()

template<size_t StrCapacity, typename CharT, typename Traits>
requires (StrCapacity > 0)
void helios::container::BasicStaticString< StrCapacity, CharT, Traits >::Swap ( BasicStaticString< StrCapacity, CharT, Traits > & other)
constexprnoexcept

Swaps contents with another BasicStaticString.

Parameters
otherString to swap with

Definition at line 1302 of file static_string.hpp.

◆ View()

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
std::basic_string_view< CharT, Traits > helios::container::BasicStaticString< StrCapacity, CharT, Traits >::View ( ) const
inlinenodiscardconstexprnoexcept

Returns a std::basic_string_view of the content.

Returns
String view of the content

Definition at line 862 of file static_string.hpp.

Member Data Documentation

◆ npos

template<size_t StrCapacity, typename CharT, typename Traits = std::char_traits<CharT>>
size_type helios::container::BasicStaticString< StrCapacity, CharT, Traits >::npos = static_cast<size_type>(-1)
staticconstexpr

Definition at line 47 of file static_string.hpp.