BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslfmt::MockParseContext< t_CHAR > Class Template Reference

#include <bslfmt_mockparsecontext.h>

Detailed Description

template<class t_CHAR>
class bslfmt::MockParseContext< t_CHAR >

This class template provides an access to the format specification current parsing state.

See bslfmt_mockparsecontext

Public Types

enum  IndexingMode { e_UNKNOWN , e_MANUAL , e_AUTOMATIC }
 
typedef bsl::basic_string_view< t_CHAR >::const_iterator const_iterator
 
typedef const_iterator iterator
 
typedef t_CHAR char_type
 

Public Member Functions

BSLS_KEYWORD_CONSTEXPR_CPP20 MockParseContext (bsl::basic_string_view< t_CHAR > fmt, size_t numArgs=0) BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP20 void advance_to (const_iterator it)
 
BSLS_KEYWORD_CONSTEXPR_CPP20 size_t next_arg_id ()
 
BSLS_KEYWORD_CONSTEXPR_CPP20 void check_arg_id (size_t id)
 
BSLS_KEYWORD_CONSTEXPR_CPP20 const_iterator begin () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP20 const_iterator end () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP20 IndexingMode indexingMode () const BSLS_KEYWORD_NOEXCEPT
 

Member Typedef Documentation

◆ char_type

template<class t_CHAR >
typedef t_CHAR bslfmt::MockParseContext< t_CHAR >::char_type

◆ const_iterator

template<class t_CHAR >
typedef bsl::basic_string_view<t_CHAR>::const_iterator bslfmt::MockParseContext< t_CHAR >::const_iterator

◆ iterator

template<class t_CHAR >
typedef const_iterator bslfmt::MockParseContext< t_CHAR >::iterator

Member Enumeration Documentation

◆ IndexingMode

template<class t_CHAR >
enum bslfmt::MockParseContext::IndexingMode

Argument indexing mode.

Enumerator
e_UNKNOWN 
e_MANUAL 
e_AUTOMATIC 

Constructor & Destructor Documentation

◆ MockParseContext()

template<class t_CHAR >
BSLS_KEYWORD_CONSTEXPR_CPP20 bslfmt::MockParseContext< t_CHAR >::MockParseContext ( bsl::basic_string_view< t_CHAR >  fmt,
size_t  numArgs = 0 
)
explicit

Create an object having the specified fmt as a format specification and the specified numArgs.

Member Function Documentation

◆ advance_to()

template<class t_CHAR >
BSLS_KEYWORD_CONSTEXPR_CPP20 void bslfmt::MockParseContext< t_CHAR >::advance_to ( const_iterator  it)

Update the held iterator to the unparsed portion of the format string to be the specified it. Subsequent calls to begin will return this value.

◆ begin()

template<class t_CHAR >
BSLS_KEYWORD_CONSTEXPR_CPP20 MockParseContext< t_CHAR >::const_iterator bslfmt::MockParseContext< t_CHAR >::begin ( ) const

Return an iterator to the beginning of the format specification.

◆ check_arg_id()

template<class t_CHAR >
BSLS_KEYWORD_CONSTEXPR_CPP20 void bslfmt::MockParseContext< t_CHAR >::check_arg_id ( size_t  id)

Check whether the specified id is in range of number of arguments and enter manual indexing mode. Throw bslfmt::format_error if this object has already entered automatic indexing mode.

◆ end()

template<class t_CHAR >
BSLS_KEYWORD_CONSTEXPR_CPP20 MockParseContext< t_CHAR >::const_iterator bslfmt::MockParseContext< t_CHAR >::end ( ) const

Return an iterator to the end of the format specification.

◆ indexingMode()

template<class t_CHAR >
BSLS_KEYWORD_CONSTEXPR_CPP20 MockParseContext< t_CHAR >::IndexingMode bslfmt::MockParseContext< t_CHAR >::indexingMode ( ) const

Return the current indexing mode.

◆ next_arg_id()

template<class t_CHAR >
BSLS_KEYWORD_CONSTEXPR_CPP20 size_t bslfmt::MockParseContext< t_CHAR >::next_arg_id ( )

Enter automatic indexing mode and return the next argument index. Throw bslfmt::format_error if this object has already entered manual indexing mode.


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