FlatImage
A configurable Linux containerization system
Loading...
Searching...
No Matches
ns_string::static_string< N > Struct Template Reference

Compile-time string container with fixed size. More...

#include <string.hpp>

Public Member Functions

constexpr static_string (const char(&str)[N])
 Constructs a static string from a string literal.
 
constexpr static_string ()=default
 Default constructor.
 
constexpr operator const char * () const
 Implicit conversion to C-style string.
 
constexpr operator std::string_view () const
 Implicit conversion to string_view.
 
constexpr size_t size () const
 Returns the size of the string (excluding null terminator)
 
template<auto... Strs>
constexpr auto join () const noexcept
 Concatenates this string with other static strings.
 

Public Attributes

char data [N]
 

Detailed Description

template<size_t N>
struct ns_string::static_string< N >

Compile-time string container with fixed size.

Template Parameters
NSize of the string including null terminator
Examples
/flatimage/src/std/expected.hpp.

Definition at line 34 of file string.hpp.

Constructor & Destructor Documentation

◆ static_string()

template<size_t N>
ns_string::static_string< N >::static_string ( const char(&) str[N])
inlineconstexpr

Constructs a static string from a string literal.

Parameters
strString literal to copy

Definition at line 42 of file string.hpp.

Here is the caller graph for this function:

Member Function Documentation

◆ join()

template<size_t N>
template<auto... Strs>
auto ns_string::static_string< N >::join ( ) const
inlineconstexprnoexcept

Concatenates this string with other static strings.

Template Parameters
StrsStatic strings to concatenate
Returns
New static_string containing the concatenated result

Definition at line 68 of file string.hpp.

Here is the call graph for this function:

◆ operator const char *()

template<size_t N>
ns_string::static_string< N >::operator const char * ( ) const
inlineconstexpr

Implicit conversion to C-style string.

Definition at line 51 of file string.hpp.

◆ operator std::string_view()

template<size_t N>
ns_string::static_string< N >::operator std::string_view ( ) const
inlineconstexpr

Implicit conversion to string_view.

Definition at line 54 of file string.hpp.

◆ size()

template<size_t N>
size_t ns_string::static_string< N >::size ( ) const
inlineconstexpr

Returns the size of the string (excluding null terminator)

Returns
Size of the string

Definition at line 60 of file string.hpp.

Member Data Documentation

◆ data

template<size_t N>
char ns_string::static_string< N >::data[N]
Examples
/flatimage/src/std/expected.hpp.

Definition at line 36 of file string.hpp.


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