MySQL 9.6.0
Source Code Documentation
mysql::strconv::Repeat Class Reference

Represents a range of integers specifying the number of times a token or pattern should be repeated when parsing a string. More...

#include <repeat.h>

Inheritance diagram for mysql::strconv::Repeat:
[legend]

Public Member Functions

 Repeat ()
 Default-construct a Repeat object representing exactly 1 repetition. More...
 
 Repeat (std::integral auto count)
 Construct an object representing exactly the given number of repetitions. More...
 
template<std::integral Int_t>
 Repeat (Int_t min_arg, Int_t max_arg)
 Construct an object representing a range of at least min_arg and at most max_arg repetitions. More...
 
std::size_t min () const
 Return the mimimum number of repetitions, inclusive. More...
 
- Public Member Functions inherited from mysql::strconv::detail::Repeat_base< Repeat_optional >
 Repeat_base (std::integral auto max)
 Construct a new object with the given maximum. More...
 
std::size_t max () const
 Return the maximum number of repetitions, inclusive. More...
 

Static Public Member Functions

template<std::integral Int_t>
static Repeat at_least (Int_t min_arg)
 Return a Repeat object representing min_arg or more repetitions (bounded only by std::numeric_limits) More...
 
template<std::integral Int_t>
static Repeat range (Int_t min_arg, Int_t max_arg)
 Return a Repeat object representing a range of at least min_arg and at most max_arg repetitions. More...
 
static Repeat exact (std::integral auto count)
 Return a Repeat object representing exactly the given number of repetitions. More...
 
static Repeat one ()
 Return a Repeat object representing exactly one repetition. More...
 
- Static Public Member Functions inherited from mysql::strconv::detail::Repeat_base< Repeat_optional >
static Repeat_optional optional ()
 Return a Repeat_optional object representing zero or one instances. More...
 
static Repeat_optional at_most (std::integral auto max_arg)
 Return a Repeat object representing between 0 and min_arg repetitions. More...
 
static Repeat_optional any ()
 Return a Repeat_optional object representing any number of repetitions from 0 and up (bounded only by std::numeric_limits). More...
 

Private Attributes

std::size_t m_min
 The mimimum number of repetitions, inclusive. More...
 

Detailed Description

Represents a range of integers specifying the number of times a token or pattern should be repeated when parsing a string.

The range is defined by a minimum and maximum value, which can be used to constrain the number of repetitions.

Examples:

  • Repeat::one(): exactly 1 repetition
  • Repeat::exact(3): exactly 3 repetitions
  • Repeat::range(2, 5): between 2 and 5 repetitions
  • Repeat::at_least(1): 1 or more repetitions (analogous to regex syntax "+")

Constructor & Destructor Documentation

◆ Repeat() [1/3]

mysql::strconv::Repeat::Repeat ( )
inline

Default-construct a Repeat object representing exactly 1 repetition.

◆ Repeat() [2/3]

mysql::strconv::Repeat::Repeat ( std::integral auto  count)
inlineexplicit

Construct an object representing exactly the given number of repetitions.

◆ Repeat() [3/3]

template<std::integral Int_t>
mysql::strconv::Repeat::Repeat ( Int_t  min_arg,
Int_t  max_arg 
)
inlineexplicit

Construct an object representing a range of at least min_arg and at most max_arg repetitions.

Member Function Documentation

◆ at_least()

template<std::integral Int_t>
static Repeat mysql::strconv::Repeat::at_least ( Int_t  min_arg)
inlinestatic

Return a Repeat object representing min_arg or more repetitions (bounded only by std::numeric_limits)

◆ exact()

static Repeat mysql::strconv::Repeat::exact ( std::integral auto  count)
inlinestatic

Return a Repeat object representing exactly the given number of repetitions.

◆ min()

std::size_t mysql::strconv::Repeat::min ( ) const
inline

Return the mimimum number of repetitions, inclusive.

◆ one()

static Repeat mysql::strconv::Repeat::one ( )
inlinestatic

Return a Repeat object representing exactly one repetition.

◆ range()

template<std::integral Int_t>
static Repeat mysql::strconv::Repeat::range ( Int_t  min_arg,
Int_t  max_arg 
)
inlinestatic

Return a Repeat object representing a range of at least min_arg and at most max_arg repetitions.

Member Data Documentation

◆ m_min

std::size_t mysql::strconv::Repeat::m_min
private

The mimimum number of repetitions, inclusive.


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