NeBuild dev
Loading...
Searching...
No Matches
time_offset Struct Reference

A timezone offset. More...

#include <date_time.hpp>

Public Member Functions

TOML_NODISCARD_CTOR time_offset () noexcept=default
 Default constructor. Does not initialize the members.
 
TOML_NODISCARD_CTOR constexpr time_offset (H h, M m) noexcept
 Constructs a timezone offset from individual hour and minute totals.
 

Public Attributes

int16_t minutes
 Offset from UTC+0, in minutes.
 

Friends

TOML_PURE_INLINE_GETTER friend constexpr bool operator== (time_offset lhs, time_offset rhs) noexcept
 Equality operator.
 
TOML_PURE_INLINE_GETTER friend constexpr bool operator!= (time_offset lhs, time_offset rhs) noexcept
 Inequality operator.
 
TOML_PURE_INLINE_GETTER friend constexpr bool operator< (time_offset lhs, time_offset rhs) noexcept
 Less-than operator.
 
TOML_PURE_INLINE_GETTER friend constexpr bool operator<= (time_offset lhs, time_offset rhs) noexcept
 Less-than-or-equal-to operator.
 
TOML_PURE_INLINE_GETTER friend constexpr bool operator> (time_offset lhs, time_offset rhs) noexcept
 Greater-than operator.
 
TOML_PURE_INLINE_GETTER friend constexpr bool operator>= (time_offset lhs, time_offset rhs) noexcept
 Greater-than-or-equal-to operator.
 
std::ostream & operator<< (std::ostream &lhs, const time_offset &rhs)
 Prints a time_offset out to a stream as +-HH:MM or Z (per RFC 3339). \detail \cpp std::cout << toml::time_offset{ 2, 30 } << "\n"; std::cout << toml::time_offset{ 2, -30 } << "\n"; std::cout << toml::time_offset{} << "\n"; std::cout << toml::time_offset{ -2, 30 } << "\n"; std::cout << toml::time_offset{ -2, -30 } << "\n"; \ecpp.
 

Detailed Description

A timezone offset.

Constructor & Destructor Documentation

◆ time_offset() [1/2]

TOML_NODISCARD_CTOR time_offset::time_offset ( )
defaultnoexcept

Default constructor. Does not initialize the members.

◆ time_offset() [2/2]

TOML_NODISCARD_CTOR constexpr time_offset::time_offset ( h,
m 
)
inlineconstexprnoexcept

Constructs a timezone offset from individual hour and minute totals.

\detail \cpp std::cout << toml::time_offset{ 2, 30 } << "\n"; std::cout << toml::time_offset{ -2, 30 } << "\n"; std::cout << toml::time_offset{ -2, -30 } << "\n"; std::cout << toml::time_offset{ 0, 0 } << "\n"; \ecpp

\out +02:30 -01:30 -02:30 Z \eout

Template Parameters
HAn integral type.
MAn integral type.
Parameters
hThe total hours.
mThe total minutes.

Friends And Related Symbol Documentation

◆ operator!=

TOML_PURE_INLINE_GETTER friend constexpr bool operator!= ( time_offset  lhs,
time_offset  rhs 
)
friend

Inequality operator.

◆ operator<

TOML_PURE_INLINE_GETTER friend constexpr bool operator< ( time_offset  lhs,
time_offset  rhs 
)
friend

Less-than operator.

◆ operator<<

std::ostream & operator<< ( std::ostream &  lhs,
const time_offset rhs 
)
friend

Prints a time_offset out to a stream as +-HH:MM or Z (per RFC 3339). \detail \cpp std::cout << toml::time_offset{ 2, 30 } << "\n"; std::cout << toml::time_offset{ 2, -30 } << "\n"; std::cout << toml::time_offset{} << "\n"; std::cout << toml::time_offset{ -2, 30 } << "\n"; std::cout << toml::time_offset{ -2, -30 } << "\n"; \ecpp.

\out +02:30 +01:30 Z -01:30 -02:30 \eout

◆ operator<=

TOML_PURE_INLINE_GETTER friend constexpr bool operator<= ( time_offset  lhs,
time_offset  rhs 
)
friend

Less-than-or-equal-to operator.

◆ operator==

TOML_PURE_INLINE_GETTER friend constexpr bool operator== ( time_offset  lhs,
time_offset  rhs 
)
friend

Equality operator.

◆ operator>

TOML_PURE_INLINE_GETTER friend constexpr bool operator> ( time_offset  lhs,
time_offset  rhs 
)
friend

Greater-than operator.

◆ operator>=

TOML_PURE_INLINE_GETTER friend constexpr bool operator>= ( time_offset  lhs,
time_offset  rhs 
)
friend

Greater-than-or-equal-to operator.

Member Data Documentation

◆ minutes

int16_t time_offset::minutes

Offset from UTC+0, in minutes.


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