Bash++
Bash++ compiler internal documentation
Public Member Functions | Public Attributes | List of all members
XGetOpt::Helpers::FixedString< N > Struct Template Reference

A fixed-size string class for compile-time string manipulation. More...

#include <xgetopt.h>

Public Member Functions

constexpr FixedString ()=default
 
constexpr FixedString (const char(&str)[N])
 
constexpr ~FixedString ()=default
 
constexpr const char * c_str () const
 
constexpr void append (const char *str)
 
constexpr void append (char c)
 
constexpr void append (char c, size_t count)
 
constexpr void append (std::string_view sv)
 
constexpr std::string_view view () const
 
constexpr operator std::string_view () const
 
constexpr size_t length () const
 
constexpr std::optional< size_t > find (char c, size_t start=0) const
 
constexpr std::optional< size_t > find_first_of (const char *chars, size_t start=0) const
 
constexpr std::string_view get_next_word (size_t pos) const
 Get the next word from the string starting at position pos.
 

Public Attributes

std::array< char, N > data {}
 
size_t size = 0
 

Detailed Description

template<size_t N>
struct XGetOpt::Helpers::FixedString< N >

A fixed-size string class for compile-time string manipulation.

Template Parameters
NThe maximum size of the string (including NUL terminator)

Constructor & Destructor Documentation

◆ FixedString() [1/2]

template<size_t N>
constexpr XGetOpt::Helpers::FixedString< N >::FixedString ( )
constexprdefault

◆ FixedString() [2/2]

template<size_t N>
constexpr XGetOpt::Helpers::FixedString< N >::FixedString ( const char(&)  str[N])
inlineconstexpr

◆ ~FixedString()

template<size_t N>
constexpr XGetOpt::Helpers::FixedString< N >::~FixedString ( )
constexprdefault

Member Function Documentation

◆ append() [1/4]

template<size_t N>
constexpr void XGetOpt::Helpers::FixedString< N >::append ( char  c)
inlineconstexpr

◆ append() [2/4]

template<size_t N>
constexpr void XGetOpt::Helpers::FixedString< N >::append ( char  c,
size_t  count 
)
inlineconstexpr

◆ append() [3/4]

template<size_t N>
constexpr void XGetOpt::Helpers::FixedString< N >::append ( const char *  str)
inlineconstexpr

◆ append() [4/4]

template<size_t N>
constexpr void XGetOpt::Helpers::FixedString< N >::append ( std::string_view  sv)
inlineconstexpr

◆ c_str()

template<size_t N>
constexpr const char * XGetOpt::Helpers::FixedString< N >::c_str ( ) const
inlineconstexpr

◆ find()

template<size_t N>
constexpr std::optional< size_t > XGetOpt::Helpers::FixedString< N >::find ( char  c,
size_t  start = 0 
) const
inlineconstexpr

◆ find_first_of()

template<size_t N>
constexpr std::optional< size_t > XGetOpt::Helpers::FixedString< N >::find_first_of ( const char *  chars,
size_t  start = 0 
) const
inlineconstexpr

◆ get_next_word()

template<size_t N>
constexpr std::string_view XGetOpt::Helpers::FixedString< N >::get_next_word ( size_t  pos) const
inlineconstexpr

Get the next word from the string starting at position pos.

A 'word' is considered to be a sequence of non-whitespace characters.

Parameters
posThe starting position to search from
Returns
constexpr std::string_view The next word found, or an empty string_view if none found

◆ length()

template<size_t N>
constexpr size_t XGetOpt::Helpers::FixedString< N >::length ( ) const
inlineconstexpr

◆ operator std::string_view()

template<size_t N>
constexpr XGetOpt::Helpers::FixedString< N >::operator std::string_view ( ) const
inlineconstexpr

◆ view()

template<size_t N>
constexpr std::string_view XGetOpt::Helpers::FixedString< N >::view ( ) const
inlineconstexpr

Member Data Documentation

◆ data

template<size_t N>
std::array<char, N> XGetOpt::Helpers::FixedString< N >::data {}

◆ size

template<size_t N>
size_t XGetOpt::Helpers::FixedString< N >::size = 0

The documentation for this struct was generated from the following file: