RESTinio
Loading...
Searching...
No Matches
restinio::easy_parser::digits_to_consume_t Class Reference

Limits for number of digits to be extracted during parsing of decimal numbers. More...

#include <easy_parser.hpp>

Public Types

using underlying_int_t = std::int_fast8_t

Public Member Functions

constexpr digits_to_consume_t (underlying_int_t total) noexcept
constexpr digits_to_consume_t (underlying_int_t min, underlying_int_t max) noexcept
constexpr auto min () const noexcept
 Get the minimal value.
constexpr auto max () const noexcept
 Get the maximum value.

Static Public Member Functions

static constexpr auto unlimited_max () noexcept
 Get the value that means that maximum is not limited.
static constexpr auto from_one_to_max () noexcept

Public Attributes

underlying_int_t m_min
 Minimal number of digits to consume.
underlying_int_t m_max
 Maximal number of digits to consume.

Detailed Description

Limits for number of digits to be extracted during parsing of decimal numbers.

Since
v.0.6.6

Definition at line 467 of file easy_parser.hpp.

Member Typedef Documentation

◆ underlying_int_t

Definition at line 470 of file easy_parser.hpp.

Constructor & Destructor Documentation

◆ digits_to_consume_t() [1/2]

restinio::easy_parser::digits_to_consume_t::digits_to_consume_t ( underlying_int_t total)
inlineconstexprnoexcept

A constructor for the case when min = max and both are equal to total.

Definition at line 488 of file easy_parser.hpp.

◆ digits_to_consume_t() [2/2]

restinio::easy_parser::digits_to_consume_t::digits_to_consume_t ( underlying_int_t min,
underlying_int_t max )
inlineconstexprnoexcept

A constructor for the case when min and max are specified separately.

Definition at line 498 of file easy_parser.hpp.

Member Function Documentation

◆ from_one_to_max()

constexpr auto restinio::easy_parser::digits_to_consume_t::from_one_to_max ( )
inlinestaticnodiscardconstexprnoexcept

Returns digits_to_consume_t{1, unlimited_max()}.

Definition at line 528 of file easy_parser.hpp.

◆ max()

auto restinio::easy_parser::digits_to_consume_t::max ( ) const
inlinenodiscardconstexprnoexcept

Get the maximum value.

Definition at line 513 of file easy_parser.hpp.

◆ min()

auto restinio::easy_parser::digits_to_consume_t::min ( ) const
inlinenodiscardconstexprnoexcept

Get the minimal value.

Definition at line 508 of file easy_parser.hpp.

◆ unlimited_max()

constexpr auto restinio::easy_parser::digits_to_consume_t::unlimited_max ( )
inlinestaticnodiscardconstexprnoexcept

Get the value that means that maximum is not limited.

Definition at line 518 of file easy_parser.hpp.

Member Data Documentation

◆ m_max

underlying_int_t restinio::easy_parser::digits_to_consume_t::m_max

Maximal number of digits to consume.

Definition at line 480 of file easy_parser.hpp.

◆ m_min

underlying_int_t restinio::easy_parser::digits_to_consume_t::m_min

Minimal number of digits to consume.

Note
Can't be 0, but this value is not checked for performance reasons.

Definition at line 478 of file easy_parser.hpp.


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