Support Class Library
A set of tools providing classes and utility
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
scl::http::Version Class Reference

A pseudo enum class that describes the version of the HTTP Protocol. More...

#include "Version.h"

Collaboration diagram for scl::http::Version:
Collaboration graph
[legend]

Public Types

using version_type = const char *
 The string representation type. More...
 
using integral_type = unsigned char
 The integer representation type. More...
 

Public Member Functions

constexpr operator version_type () const
 Implicit conversion to string. More...
 
constexpr operator integral_type () const
 Implicit conversion to integer. More...
 
constexpr bool operator== (const Version &other) const
 
constexpr bool operator< (const Version &other) const
 
constexpr bool operator<= (const Version &other) const
 
constexpr bool operator> (const Version &other) const
 
constexpr bool operator>= (const Version &other) const
 
constexpr bool operator!= (const Version &other) const
 

Static Public Attributes

static const Version V1_0 { "1.0" , 10 }
 
static const Version V1_1 { "1.1" , 11 }
 
static const Version V2_0 { "2.0" , 20 }
 
static const Version V3_0 { "3.0" , 30 }
 

Protected Member Functions

constexpr Version (const version_type &v, integral_type i)
 Constrct a version from its string and integer representation. More...
 

Protected Attributes

const version_type str
 The string representation of the version. More...
 
const integral_type nb
 The integer representation of the version. More...
 

Friends

class scl::utils::ToString< Version >
 

Detailed Description

A pseudo enum class that describes the version of the HTTP Protocol.

Definition at line 10 of file Version.h.

Member Typedef Documentation

◆ integral_type

The integer representation type.

Definition at line 22 of file Version.h.

◆ version_type

The string representation type.

Definition at line 16 of file Version.h.

Constructor & Destructor Documentation

◆ Version()

constexpr scl::http::Version::Version ( const version_type v,
integral_type  i 
)
inlineexplicitprotected

Constrct a version from its string and integer representation.

Parameters
vbeing the string representation
ibeing the integer representation

Definition at line 42 of file Version.h.

Member Function Documentation

◆ operator integral_type()

constexpr scl::http::Version::operator integral_type ( ) const
inlineexplicit

Implicit conversion to integer.

Returns
the integer representation of this version

Definition at line 58 of file Version.h.

◆ operator version_type()

constexpr scl::http::Version::operator version_type ( ) const
inlineexplicit

Implicit conversion to string.

Returns
the string representation of this version

Definition at line 50 of file Version.h.

◆ operator!=()

constexpr bool scl::http::Version::operator!= ( const Version other) const
inline

Definition at line 82 of file Version.h.

◆ operator<()

constexpr bool scl::http::Version::operator< ( const Version other) const
inline

Definition at line 66 of file Version.h.

◆ operator<=()

constexpr bool scl::http::Version::operator<= ( const Version other) const
inline

Definition at line 70 of file Version.h.

◆ operator==()

constexpr bool scl::http::Version::operator== ( const Version other) const
inline

Definition at line 62 of file Version.h.

◆ operator>()

constexpr bool scl::http::Version::operator> ( const Version other) const
inline

Definition at line 74 of file Version.h.

◆ operator>=()

constexpr bool scl::http::Version::operator>= ( const Version other) const
inline

Definition at line 78 of file Version.h.

Friends And Related Function Documentation

◆ scl::utils::ToString< Version >

friend class scl::utils::ToString< Version >
friend

Definition at line 87 of file Version.h.

Member Data Documentation

◆ nb

scl::http::Version::nb
protected

The integer representation of the version.

Definition at line 35 of file Version.h.

◆ str

scl::http::Version::str
protected

The string representation of the version.

Definition at line 29 of file Version.h.

◆ V1_0

const Version scl::http::Version::V1_0 { "1.0" , 10 }
static

Definition at line 90 of file Version.h.

◆ V1_1

const Version scl::http::Version::V1_1 { "1.1" , 11 }
static

Definition at line 91 of file Version.h.

◆ V2_0

const Version scl::http::Version::V2_0 { "2.0" , 20 }
static

Definition at line 92 of file Version.h.

◆ V3_0

const Version scl::http::Version::V3_0 { "3.0" , 30 }
static

Definition at line 93 of file Version.h.


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