ATLAS Offline Software
Loading...
Searching...
No Matches
CxxUtils::detail::FixedString< N > Struct Template Reference

Helper structure to allow string literals to be passed as non-type template parameters. More...

#include <HexString.h>

Collaboration diagram for CxxUtils::detail::FixedString< N >:

Public Member Functions

constexpr FixedString (const char(&str)[N])
 Constructs a FixedString from a string literal.
constexpr std::size_t length () const
 Gets the length of the string excluding the null terminator.

Public Attributes

char buf [N] {}
 The internal character buffer.

Detailed Description

template<std::size_t N>
struct CxxUtils::detail::FixedString< N >

Helper structure to allow string literals to be passed as non-type template parameters.

Not necessarily intended to be used directly.

  • Template Parameters
    NThe length of the string array, including the null terminator.

Definition at line 27 of file HexString.h.

Constructor & Destructor Documentation

◆ FixedString()

template<std::size_t N>
CxxUtils::detail::FixedString< N >::FixedString ( const char(&) str[N])
inlineconstexpr

Constructs a FixedString from a string literal.

Parameters
strA reference to a character array (string literal).

Definition at line 34 of file HexString.h.

34 {
35 for (std::size_t i = 0; i < N; ++i) buf[i] = str[i];
36 }
Helper structure to allow string literals to be passed as non-type template parameters.
Definition HexString.h:27
char buf[N]
The internal character buffer.
Definition HexString.h:29

Member Function Documentation

◆ length()

template<std::size_t N>
std::size_t CxxUtils::detail::FixedString< N >::length ( ) const
inlineconstexpr

Gets the length of the string excluding the null terminator.

Returns
The length of the string.

Definition at line 41 of file HexString.h.

41{ return N - 1; }

Member Data Documentation

◆ buf

template<std::size_t N>
char CxxUtils::detail::FixedString< N >::buf[N] {}

The internal character buffer.

Definition at line 29 of file HexString.h.

29{};

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