Lightweight 0.20250904.0
Loading...
Searching...
No Matches
Lightweight::SqlDate Struct Reference

#include <SqlDate.hpp>

Public Member Functions

constexpr SqlDate (SqlDate &&) noexcept=default
 
constexpr SqlDateoperator= (SqlDate &&) noexcept=default
 
constexpr SqlDate (SqlDate const &) noexcept=default
 
constexpr SqlDateoperator= (SqlDate const &) noexcept=default
 
LIGHTWEIGHT_FORCE_INLINE constexpr std::chrono::year_month_day value () const noexcept
 Returns the current date.
 
LIGHTWEIGHT_FORCE_INLINE constexpr bool operator== (SqlDate const &other) const noexcept
 
LIGHTWEIGHT_FORCE_INLINE constexpr bool operator!= (SqlDate const &other) const noexcept
 
constexpr SqlDate (std::chrono::year_month_day value) noexcept
 Constructs a date from individual std::chrono::year_month_day.
 
constexpr SqlDate (std::chrono::year year, std::chrono::month month, std::chrono::day day) noexcept
 Constructs a date from individual components.
 

Static Public Member Functions

static LIGHTWEIGHT_FORCE_INLINE SqlDate Today () noexcept
 Returns the current date.
 
static LIGHTWEIGHT_FORCE_INLINE constexpr SQL_DATE_STRUCT ConvertToSqlValue (std::chrono::year_month_day value) noexcept
 
static LIGHTWEIGHT_FORCE_INLINE constexpr std::chrono::year_month_day ConvertToNative (SQL_DATE_STRUCT const &value) noexcept
 

Public Attributes

SQL_DATE_STRUCT sqlValue {}
 

Detailed Description

Represents a date to efficiently write to or read from a database.

Definition at line 17 of file SqlDate.hpp.

Constructor & Destructor Documentation

◆ SqlDate() [1/2]

constexpr Lightweight::SqlDate::SqlDate ( std::chrono::year_month_day  value)
inlineconstexprnoexcept

Constructs a date from individual std::chrono::year_month_day.

Definition at line 46 of file SqlDate.hpp.

References value().

◆ SqlDate() [2/2]

constexpr Lightweight::SqlDate::SqlDate ( std::chrono::year  year,
std::chrono::month  month,
std::chrono::day  day 
)
inlineconstexprnoexcept

Constructs a date from individual components.

Definition at line 52 of file SqlDate.hpp.

Member Function Documentation

◆ value()

LIGHTWEIGHT_FORCE_INLINE constexpr std::chrono::year_month_day Lightweight::SqlDate::value ( ) const
inlineconstexprnoexcept

Returns the current date.

Definition at line 29 of file SqlDate.hpp.

Referenced by SqlDate().

◆ operator==()

LIGHTWEIGHT_FORCE_INLINE constexpr bool Lightweight::SqlDate::operator== ( SqlDate const &  other) const
inlineconstexprnoexcept

Definition at line 34 of file SqlDate.hpp.

◆ operator!=()

LIGHTWEIGHT_FORCE_INLINE constexpr bool Lightweight::SqlDate::operator!= ( SqlDate const &  other) const
inlineconstexprnoexcept

Definition at line 40 of file SqlDate.hpp.

◆ Today()

static LIGHTWEIGHT_FORCE_INLINE SqlDate Lightweight::SqlDate::Today ( )
inlinestaticnoexcept

Returns the current date.

Definition at line 58 of file SqlDate.hpp.

◆ ConvertToSqlValue()

static LIGHTWEIGHT_FORCE_INLINE constexpr SQL_DATE_STRUCT Lightweight::SqlDate::ConvertToSqlValue ( std::chrono::year_month_day  value)
inlinestaticconstexprnoexcept

Definition at line 65 of file SqlDate.hpp.

◆ ConvertToNative()

static LIGHTWEIGHT_FORCE_INLINE constexpr std::chrono::year_month_day Lightweight::SqlDate::ConvertToNative ( SQL_DATE_STRUCT const &  value)
inlinestaticconstexprnoexcept

Definition at line 74 of file SqlDate.hpp.

Member Data Documentation

◆ sqlValue

SQL_DATE_STRUCT Lightweight::SqlDate::sqlValue {}

Definition at line 19 of file SqlDate.hpp.


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