curl-cpp
static c++17 wrapper for curl with -fno-exceptions support
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
curl::curl_t::Version Struct Reference
Collaboration diagram for curl::curl_t::Version:
Collaboration graph

Public Member Functions

constexpr std::uint8_t get_major () const noexcept
 
constexpr std::uint8_t get_minor () const noexcept
 
constexpr std::uint8_t get_patch () const noexcept
 
std::size_t to_string (char buffer[12]) const noexcept
 

Static Public Member Functions

static constexpr Version from (std::uint8_t major, std::uint8_t minor, std::uint8_t patch) noexcept
 

Public Attributes

std::uint32_t num
 

Friends

constexpr friend bool operator< (const Version &x, const Version &y) noexcept
 
constexpr friend bool operator<= (const Version &x, const Version &y) noexcept
 
constexpr friend bool operator> (const Version &x, const Version &y) noexcept
 
constexpr friend bool operator>= (const Version &x, const Version &y) noexcept
 
constexpr friend bool operator== (const Version &x, const Version &y) noexcept
 
constexpr friend bool operator!= (const Version &x, const Version &y) noexcept
 

Detailed Description

Examples
curl_version.cc.

Definition at line 69 of file curl.hpp.

Member Function Documentation

◆ to_string()

std::size_t curl::curl_t::Version::to_string ( char  buffer[12]) const
noexcept
Parameters
bufferis required to be at least 12 bytes long. Will be write in format "uint8_t.uint8_t.uint8_t" (with trailing '\0').
Returns
If success, the number of characters writen to buffer (excluding trailing '\0'); If failed, return negative value.

Definition at line 57 of file curl.cc.

58 {
59  return std::snprintf(buffer, 12, "%" PRIu8 ".%" PRIu8 ".%" PRIu8, get_major(), get_minor(), get_patch());
60 }

Friends And Related Function Documentation

◆ operator<

constexpr friend bool operator< ( const Version x,
const Version y 
)
friend

Check whether version x is older than version y.

Definition at line 32 of file curl.cc.

33 {
34  return x.num < y.num;
35 }

◆ operator<=

constexpr friend bool operator<= ( const Version x,
const Version y 
)
friend

Check whether version x is older than or the same as version y.

Definition at line 36 of file curl.cc.

37 {
38  return x.num <= y.num;
39 }

◆ operator>

constexpr friend bool operator> ( const Version x,
const Version y 
)
friend

Check whether version x is newer than version y.

Definition at line 40 of file curl.cc.

41 {
42  return x.num > y.num;
43 }

◆ operator>=

constexpr friend bool operator>= ( const Version x,
const Version y 
)
friend

Check whether version x is newer than or the same as version y.

Definition at line 44 of file curl.cc.

45 {
46  return x.num >= y.num;
47 }

◆ operator==

constexpr friend bool operator== ( const Version x,
const Version y 
)
friend

Check whether version x is the same as version y.

Definition at line 48 of file curl.cc.

49 {
50  return x.num == y.num;
51 }

◆ operator!=

constexpr friend bool operator!= ( const Version x,
const Version y 
)
friend

Check whether version x is not the same as version y.

Definition at line 52 of file curl.cc.

53 {
54  return x.num != y.num;
55 }

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