#include <SqlGuid.hpp>
|
|
constexpr std::weak_ordering | operator<=> (SqlGuid const &other) const noexcept=default |
| | Three-way comparison operator.
|
| |
| constexpr bool | operator== (SqlGuid const &other) const noexcept |
| | Equality comparison operator.
|
| |
| constexpr bool | operator!= (SqlGuid const &other) const noexcept |
| | Inequality comparison operator.
|
| |
| constexpr | operator bool () const noexcept |
| | Tests if the GUID is non-empty.
|
| |
| constexpr bool | operator! () const noexcept |
| | Tests if the GUID is empty.
|
| |
|
|
static SqlGuid | Create () noexcept |
| | Creates a new non-empty GUID.
|
| |
| static std::optional< SqlGuid > | TryParse (std::string_view const &text) noexcept |
| |
| static SqlGuid constexpr | UnsafeParse (std::string_view const &text) noexcept |
| |
|
| uint8_t | data [16] {} |
| | The raw GUID data bytes.
|
| |
Represents a GUID (Globally Unique Identifier).
Definition at line 24 of file SqlGuid.hpp.
◆ TryParse()
| static std::optional< SqlGuid > Lightweight::SqlGuid::TryParse |
( |
std::string_view const & |
text | ) |
|
|
staticnoexcept |
Parses a GUID from its 36-character xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx text form.
Any hex value is accepted, whatever its version and variant nibbles, as SQL Server's uniqueidentifier does. data[i] receives the i-th hex pair of the text, left to right.
- Parameters
-
| text | The GUID text, upper or lower case. |
- Returns
- The parsed GUID, or
std::nullopt if text is not a well-formed GUID.
◆ UnsafeParse()
| constexpr SqlGuid Lightweight::SqlGuid::UnsafeParse |
( |
std::string_view const & |
text | ) |
|
|
staticconstexprnoexcept |
Parses a GUID from a string. Use with caution and always prefer TryParse at all cost.
Accepts the same texts as TryParse(); for any other text it returns an unspecified sentinel.
- Parameters
-
- Returns
- The parsed GUID.
Definition at line 115 of file SqlGuid.hpp.
References data.
◆ operator==()
| constexpr bool Lightweight::SqlGuid::operator== |
( |
SqlGuid const & |
other | ) |
const |
|
inlineconstexprnoexcept |
Equality comparison operator.
Definition at line 52 of file SqlGuid.hpp.
◆ operator!=()
Inequality comparison operator.
Definition at line 58 of file SqlGuid.hpp.
◆ operator bool()
| constexpr Lightweight::SqlGuid::operator bool |
( |
| ) |
const |
|
inlineexplicitconstexprnoexcept |
Tests if the GUID is non-empty.
Definition at line 64 of file SqlGuid.hpp.
◆ operator!()
| constexpr bool Lightweight::SqlGuid::operator! |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Tests if the GUID is empty.
Definition at line 70 of file SqlGuid.hpp.
◆ data
| uint8_t Lightweight::SqlGuid::data[16] {} |
The documentation for this struct was generated from the following file: