Lightweight 0.20260303.0
Loading...
Searching...
No Matches
Lightweight::SqlRealName< N > Struct Template Reference

Helper class, used to represent a real SQL column names as template arguments. More...

#include <SqlRealName.hpp>

Public Member Functions

constexpr size_t size () const noexcept
 Returns the length of the name string.
 
constexpr SqlRealName (SqlRealName const &) noexcept=default
 Default copy constructor.
 
constexpr SqlRealName (SqlRealName &&) noexcept=default
 Default move constructor.
 
constexpr SqlRealNameoperator= (SqlRealName const &) noexcept=default
 Default copy assignment operator.
 
constexpr SqlRealNameoperator= (SqlRealName &&) noexcept=default
 Default move assignment operator.
 
constexpr SqlRealName (char const (&str)[N]) noexcept
 Constructs a SqlRealName from a character array literal.
 
constexpr bool empty () const noexcept
 Returns true if the name is empty.
 
constexpr char const * begin () const noexcept
 Returns a pointer to the beginning of the name string.
 
constexpr char const * end () const noexcept
 Returns a pointer past the end of the name string.
 
constexpr auto operator<=> (SqlRealName const &) const =default
 Three-way comparison operator.
 
constexpr std::string_view sv () const noexcept
 Returns the name as a string_view.
 

Public Attributes

char value [N] {}
 The underlying character buffer storing the name.
 

Static Public Attributes

static constexpr size_t length = (N > 0) ? (N - 1) : 0
 The length of the name string (excluding null terminator).
 

Detailed Description

template<size_t N>
struct Lightweight::SqlRealName< N >

Helper class, used to represent a real SQL column names as template arguments.

See also
Field, BelongsTo

Definition at line 14 of file SqlRealName.hpp.

Constructor & Destructor Documentation

◆ SqlRealName()

template<size_t N>
constexpr Lightweight::SqlRealName< N >::SqlRealName ( char const (&)  str[N])
inlineconstexprnoexcept

Constructs a SqlRealName from a character array literal.

Definition at line 37 of file SqlRealName.hpp.

References Lightweight::SqlRealName< N >::value.

Member Function Documentation

◆ size()

template<size_t N>
constexpr size_t Lightweight::SqlRealName< N >::size ( ) const
inlineconstexprnoexcept

Returns the length of the name string.

Definition at line 20 of file SqlRealName.hpp.

References Lightweight::SqlRealName< N >::length.

◆ empty()

template<size_t N>
constexpr bool Lightweight::SqlRealName< N >::empty ( ) const
inlineconstexprnoexcept

Returns true if the name is empty.

Definition at line 46 of file SqlRealName.hpp.

References Lightweight::SqlRealName< N >::length.

◆ begin()

template<size_t N>
constexpr char const * Lightweight::SqlRealName< N >::begin ( ) const
inlineconstexprnoexcept

Returns a pointer to the beginning of the name string.

Definition at line 52 of file SqlRealName.hpp.

References Lightweight::SqlRealName< N >::value.

◆ end()

template<size_t N>
constexpr char const * Lightweight::SqlRealName< N >::end ( ) const
inlineconstexprnoexcept

Returns a pointer past the end of the name string.

Definition at line 58 of file SqlRealName.hpp.

References Lightweight::SqlRealName< N >::length, and Lightweight::SqlRealName< N >::value.

◆ sv()

template<size_t N>
constexpr std::string_view Lightweight::SqlRealName< N >::sv ( ) const
inlineconstexprnoexcept

Returns the name as a string_view.

Definition at line 68 of file SqlRealName.hpp.

References Lightweight::SqlRealName< N >::length, and Lightweight::SqlRealName< N >::value.

Member Data Documentation

◆ length

template<size_t N>
constexpr size_t Lightweight::SqlRealName< N >::length = (N > 0) ? (N - 1) : 0
staticconstexpr

The length of the name string (excluding null terminator).

Definition at line 17 of file SqlRealName.hpp.

Referenced by Lightweight::SqlRealName< N >::empty(), Lightweight::SqlRealName< N >::end(), Lightweight::SqlRealName< N >::size(), and Lightweight::SqlRealName< N >::sv().

◆ value

template<size_t N>
char Lightweight::SqlRealName< N >::value[N] {}

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