Lightweight 0.1.0
Loading...
Searching...
No Matches
SqlDynamicBinary< N > Class Template Referencefinal

#include <SqlDynamicBinary.hpp>

Public Types

using value_type = uint8_t
 

Public Member Functions

LIGHTWEIGHT_FORCE_INLINE constexpr SqlDynamicBinary (SqlDynamicBinary const &) noexcept=default
 
LIGHTWEIGHT_FORCE_INLINE constexpr SqlDynamicBinaryoperator= (SqlDynamicBinary const &) noexcept=default
 
LIGHTWEIGHT_FORCE_INLINE constexpr SqlDynamicBinary (SqlDynamicBinary &&) noexcept=default
 
LIGHTWEIGHT_FORCE_INLINE constexpr SqlDynamicBinaryoperator= (SqlDynamicBinary &&) noexcept=default
 
template<std::size_t SourceSize>
constexpr LIGHTWEIGHT_FORCE_INLINE SqlDynamicBinary (value_type const (&text)[SourceSize])
 Constructs a fixed-size string from a string literal.
 
template<std::size_t SourceSize>
constexpr LIGHTWEIGHT_FORCE_INLINE SqlDynamicBinary (std::initializer_list< value_type > data)
 Constructs the object from an initializer list of bytes.
 
LIGHTWEIGHT_FORCE_INLINE constexpr SqlDynamicBinary (value_type const *s, value_type const *e) noexcept
 Constructs a fixed-size string from a string pointer and end pointer.
 
LIGHTWEIGHT_FORCE_INLINE constexpr SqlDynamicBinary (std::basic_string_view< value_type > s) noexcept
 Constructs a fixed-size string from a string view.
 
LIGHTWEIGHT_FORCE_INLINE constexpr std::basic_string_view< value_type > ToStringView () const noexcept
 Retrieves a string view of the string.
 
constexpr auto operator<=> (SqlDynamicBinary< N > const &) const noexcept=default
 
LIGHTWEIGHT_FORCE_INLINE constexpr std::size_t size () const noexcept
 Retrieves the size of the string.
 
void LIGHTWEIGHT_FORCE_INLINE resize (std::size_t newSize)
 Resizes the underlying data storage to the given size.
 
LIGHTWEIGHT_FORCE_INLINE constexpr bool empty () const noexcept
 Tests if the stored data is empty.
 
LIGHTWEIGHT_FORCE_INLINE constexpr decltype(auto) data (this auto &&self) noexcept
 Retrieves the pointer to the string data.
 
LIGHTWEIGHT_FORCE_INLINE void clear () noexcept
 Clears the storad data.
 

Static Public Attributes

static constexpr auto ColumnType = SqlColumnTypeDefinitions::VarBinary { N }
 
static constexpr std::size_t DynamicCapacity = N
 The maximum size of the underlying data storage.
 

Detailed Description

template<std::size_t N>
class SqlDynamicBinary< N >

SQL dynamic-capacity string that mimicks standard library string.

The underlying memory is allocated dynamically and the string can grow up to the maximum size of a SQL column.

Definition at line 19 of file SqlDynamicBinary.hpp.

Member Typedef Documentation

◆ value_type

template<std::size_t N>
using SqlDynamicBinary< N >::value_type = uint8_t

Definition at line 25 of file SqlDynamicBinary.hpp.

Constructor & Destructor Documentation

◆ SqlDynamicBinary() [1/4]

template<std::size_t N>
template<std::size_t SourceSize>
constexpr LIGHTWEIGHT_FORCE_INLINE SqlDynamicBinary< N >::SqlDynamicBinary ( value_type const (&)  text[SourceSize])
inlineconstexpr

Constructs a fixed-size string from a string literal.

Definition at line 40 of file SqlDynamicBinary.hpp.

◆ SqlDynamicBinary() [2/4]

template<std::size_t N>
template<std::size_t SourceSize>
constexpr LIGHTWEIGHT_FORCE_INLINE SqlDynamicBinary< N >::SqlDynamicBinary ( std::initializer_list< value_type >  data)
inlineconstexpr

Constructs the object from an initializer list of bytes.

Definition at line 48 of file SqlDynamicBinary.hpp.

◆ SqlDynamicBinary() [3/4]

template<std::size_t N>
LIGHTWEIGHT_FORCE_INLINE constexpr SqlDynamicBinary< N >::SqlDynamicBinary ( value_type const *  s,
value_type const *  e 
)
inlineconstexprnoexcept

Constructs a fixed-size string from a string pointer and end pointer.

Definition at line 55 of file SqlDynamicBinary.hpp.

◆ SqlDynamicBinary() [4/4]

template<std::size_t N>
LIGHTWEIGHT_FORCE_INLINE constexpr SqlDynamicBinary< N >::SqlDynamicBinary ( std::basic_string_view< value_type >  s)
inlineconstexprnoexcept

Constructs a fixed-size string from a string view.

Definition at line 61 of file SqlDynamicBinary.hpp.

Member Function Documentation

◆ ToStringView()

template<std::size_t N>
LIGHTWEIGHT_FORCE_INLINE constexpr std::basic_string_view< value_type > SqlDynamicBinary< N >::ToStringView ( ) const
inlineconstexprnoexcept

Retrieves a string view of the string.

Definition at line 67 of file SqlDynamicBinary.hpp.

◆ size()

template<std::size_t N>
LIGHTWEIGHT_FORCE_INLINE constexpr std::size_t SqlDynamicBinary< N >::size ( ) const
inlineconstexprnoexcept

Retrieves the size of the string.

Definition at line 76 of file SqlDynamicBinary.hpp.

◆ resize()

template<std::size_t N>
void LIGHTWEIGHT_FORCE_INLINE SqlDynamicBinary< N >::resize ( std::size_t  newSize)
inline

Resizes the underlying data storage to the given size.

Definition at line 82 of file SqlDynamicBinary.hpp.

◆ empty()

template<std::size_t N>
LIGHTWEIGHT_FORCE_INLINE constexpr bool SqlDynamicBinary< N >::empty ( ) const
inlineconstexprnoexcept

Tests if the stored data is empty.

Definition at line 88 of file SqlDynamicBinary.hpp.

◆ data()

template<std::size_t N>
LIGHTWEIGHT_FORCE_INLINE constexpr decltype(auto) SqlDynamicBinary< N >::data ( this auto &&  self)
inlineconstexprnoexcept

Retrieves the pointer to the string data.

Definition at line 95 of file SqlDynamicBinary.hpp.

◆ clear()

template<std::size_t N>
LIGHTWEIGHT_FORCE_INLINE void SqlDynamicBinary< N >::clear ( )
inlinenoexcept

Clears the storad data.

Definition at line 101 of file SqlDynamicBinary.hpp.

Member Data Documentation

◆ ColumnType

template<std::size_t N>
constexpr auto SqlDynamicBinary< N >::ColumnType = SqlColumnTypeDefinitions::VarBinary { N }
staticconstexpr

Definition at line 26 of file SqlDynamicBinary.hpp.

◆ DynamicCapacity

template<std::size_t N>
constexpr std::size_t SqlDynamicBinary< N >::DynamicCapacity = N
staticconstexpr

The maximum size of the underlying data storage.

Definition at line 29 of file SqlDynamicBinary.hpp.


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