Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::clara::detail::TokenStream Class Reference

#include <clara.hpp>

Public Member Functions

 TokenStream (Args const &args)
 
 TokenStream (Iterator it, Iterator itEnd)
 
 operator bool () const
 
auto count () const -> size_t
 
auto operator* () const -> Token
 
auto operator-> () const -> Token const *
 
auto operator++ () -> TokenStream &
 

Detailed Description

Definition at line 447 of file clara.hpp.

Constructor & Destructor Documentation

◆ TokenStream() [1/2]

Catch::clara::detail::TokenStream::TokenStream ( Args const & args)
inlineexplicit

Definition at line 485 of file clara.hpp.

485: TokenStream( args.m_args.begin(), args.m_args.end() ) {}
TokenStream(Args const &args)
Definition clara.hpp:485

◆ TokenStream() [2/2]

Catch::clara::detail::TokenStream::TokenStream ( Iterator it,
Iterator itEnd )
inline

Definition at line 487 of file clara.hpp.

487 : it( it ), itEnd( itEnd ) {
488 loadBuffer();
489 }

Member Function Documentation

◆ count()

auto Catch::clara::detail::TokenStream::count ( ) const -> size_t
inline

Definition at line 495 of file clara.hpp.

495{ return m_tokenBuffer.size() + (itEnd - it); }

◆ operator bool()

Catch::clara::detail::TokenStream::operator bool ( ) const
inlineexplicit

Definition at line 491 of file clara.hpp.

491 {
492 return !m_tokenBuffer.empty() || it != itEnd;
493 }

◆ operator*()

auto Catch::clara::detail::TokenStream::operator* ( ) const -> Token
inline

Definition at line 497 of file clara.hpp.

497 {
498 assert( !m_tokenBuffer.empty() );
499 return m_tokenBuffer.front();
500 }

◆ operator++()

auto Catch::clara::detail::TokenStream::operator++ ( ) -> TokenStream &
inline

Definition at line 507 of file clara.hpp.

507 {
508 if( m_tokenBuffer.size() >= 2 ) {
509 m_tokenBuffer.erase( m_tokenBuffer.begin() );
510 } else {
511 if( it != itEnd )
512 ++it;
513 loadBuffer();
514 }
515 return *this;
516 }

◆ operator->()

auto Catch::clara::detail::TokenStream::operator-> ( ) const -> Token const *
inline

Definition at line 502 of file clara.hpp.

502 {
503 assert( !m_tokenBuffer.empty() );
504 return &m_tokenBuffer.front();
505 }

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