Om
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Om::Source::CodePointStringFrontSource< ThisStringIterator > Class Template Reference

A Source of CodePoint strings from the front of a string. More...

#include "code_point_string_front_source.hpp"

+ Inheritance diagram for Om::Source::CodePointStringFrontSource< ThisStringIterator >:
+ Collaboration diagram for Om::Source::CodePointStringFrontSource< ThisStringIterator >:

Public Member Functions

 CodePointStringFrontSource (ThisStringIterator theStringStart, ThisStringIterator const theStringEnd)
 
CodePointStringFrontSourceoperator= (CodePointStringFrontSource)
 
virtual bool operator! () const
 
virtual std::string & operator* () const
 
bool Equals (CodePointStringFrontSource const &) const
 
virtual void Pop ()
 Pops the current item. More...
 
void Swap (CodePointStringFrontSource &)
 
- Public Member Functions inherited from Om::Source::DefaultSource< std::string, CodePointStringFrontSource< ThisStringIterator > >
virtual ~DefaultSource ()=0
 
CodePointStringFrontSource< ThisStringIterator > & operator++ ()
 Pulls the next item from the Source. More...
 
CodePointStringFrontSource< ThisStringIterator > operator++ (int)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual bool Equals (Source< std::string > const &) const
 
bool Equals (CodePointStringFrontSource< ThisStringIterator > const &) const
 
- Public Member Functions inherited from Om::Source::Source< ThisItem >
virtual ~Source ()=0
 
ThisItem * operator-> () const
 
 operator Boolean () const
 Implements the Safe Boolean idiom. More...
 
virtual bool Equals (Source const &) const =0
 

Private Member Functions

void Update ()
 Populates the CodePoint string with each code unit of the next CodePoint. More...
 

Private Attributes

ThisStringIterator thisStringIterator
 
ThisStringIterator thisStringEnd
 
std::string thisCodePoint
 

Additional Inherited Members

- Public Types inherited from Om::Source::Source< ThisItem >
typedef void(Source::* Boolean) () const
 The implementation of the Safe Boolean idiom. More...
 

Detailed Description

template<typename ThisStringIterator>
class Om::Source::CodePointStringFrontSource< ThisStringIterator >

Note
Const methods are not thread-safe due to a non-mutexed mutable member.
Dereferencing exposes a non-const reference to the member string cache of the current segment, allowing swap as an optimization. Modifying the string will not modify the source data.

Definition at line 43 of file code_point_string_front_source.hpp.

Constructor & Destructor Documentation

◆ CodePointStringFrontSource()

template<typename ThisStringIterator >
Om::Source::CodePointStringFrontSource< ThisStringIterator >::CodePointStringFrontSource ( ThisStringIterator  theStringStart,
ThisStringIterator const  theStringEnd 
)
Parameters
theStringStartThe string start.
theStringEndThe string end.

Member Function Documentation

◆ operator=()

template<typename ThisStringIterator >
CodePointStringFrontSource& Om::Source::CodePointStringFrontSource< ThisStringIterator >::operator= ( CodePointStringFrontSource< ThisStringIterator >  )

◆ operator!()

template<typename ThisStringIterator >
virtual bool Om::Source::CodePointStringFrontSource< ThisStringIterator >::operator! ( ) const
virtual
Returns
True if empty.

Implements Om::Source::Source< ThisItem >.

◆ operator*()

template<typename ThisStringIterator >
virtual std::string& Om::Source::CodePointStringFrontSource< ThisStringIterator >::operator* ( ) const
virtual

◆ Equals()

template<typename ThisStringIterator >
bool Om::Source::CodePointStringFrontSource< ThisStringIterator >::Equals ( CodePointStringFrontSource< ThisStringIterator > const &  ) const

◆ Pop()

template<typename ThisStringIterator >
virtual void Om::Source::CodePointStringFrontSource< ThisStringIterator >::Pop ( )
virtual
Precondition
Not empty.

Implements Om::Source::Source< ThisItem >.

◆ Swap()

template<typename ThisStringIterator >
void Om::Source::CodePointStringFrontSource< ThisStringIterator >::Swap ( CodePointStringFrontSource< ThisStringIterator > &  )

◆ Update()

template<typename ThisStringIterator >
void Om::Source::CodePointStringFrontSource< ThisStringIterator >::Update ( )
private

Member Data Documentation

◆ thisStringIterator

template<typename ThisStringIterator >
ThisStringIterator Om::Source::CodePointStringFrontSource< ThisStringIterator >::thisStringIterator
private

Definition at line 87 of file code_point_string_front_source.hpp.

◆ thisStringEnd

template<typename ThisStringIterator >
ThisStringIterator Om::Source::CodePointStringFrontSource< ThisStringIterator >::thisStringEnd
private

Definition at line 89 of file code_point_string_front_source.hpp.

◆ thisCodePoint

template<typename ThisStringIterator >
std::string Om::Source::CodePointStringFrontSource< ThisStringIterator >::thisCodePoint
mutableprivate

The current CodePoint string; empty if invalid.

Definition at line 94 of file code_point_string_front_source.hpp.


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