Om
code_point_source.hpp
Go to the documentation of this file.
1 
15 #ifndef Om_Source_CodePointSource_
16 
17  #define Om_Source_CodePointSource_ \
18  Om::Source::CodePointSource
19 
20  #include "om/code_point.hpp"
22 
23 namespace Om {
24 
25  namespace Source {
26 
27  // MARK: - Om::Source::CodePointSource
28 
33  template <typename ThisCodeUnitIterator = char const *>
35  public DefaultSource<
36  CodePoint const,
37  CodePointSource<ThisCodeUnitIterator>
38  > {
39 
40  public: // MARK: public (non-static)
41 
49  ThisCodeUnitIterator theInputStart,
50  ThisCodeUnitIterator const theInputEnd
51  );
52 
54 
55  virtual bool operator !() const;
56 
57  virtual CodePoint const & operator *() const;
58 
59  using DefaultSource<
60  CodePoint const,
62  >::Equals;
63 
64  bool Equals(CodePointSource const &) const;
65 
66  virtual void Pop();
67 
69 
70  private: // MARK: private (non-static)
71 
76  ThisCodeUnitIterator thisInputIterator;
77 
82  ThisCodeUnitIterator thisInputEnd;
83 
89 
90  };
91 
92  // MARK: - Om::Source::CodePointSource<char const *>
93 
98  template <>
99  class CodePointSource<char const *>:
100  public CodePointSource<
102  char const,
103  char const *
104  >
105  > {
106 
107  public: // MARK: public (non-static)
108 
113  explicit CodePointSource(
114  char const theCodeUnitIterator[]
115  );
116 
117  private: // MARK: private (static)
118 
123  typedef IteratorSource<
124  char const,
125  char const *
127 
128  };
129 
130  // MARK: - Om::Source::
131 
132  template <typename TheCodeUnitIterator>
136  );
137 
138  template <typename TheCodeUnitIterator>
142  );
143 
144  }
145 
146 }
147 
148 namespace boost {
149 
150  // MARK: - boost::
151 
152  template <typename TheCodeUnitIterator>
153  void swap(
156  );
157 
158 }
159 
161 
162 #endif
CodePointSource(char const theCodeUnitIterator[])
IteratorSource< char const, char const * > CodeUnitSource
A convenience typedef of the underlying IteratorSource.
A CodePoint Source that reads each code unit from the iterator.
CodePointSource(ThisCodeUnitIterator theInputStart, ThisCodeUnitIterator const theInputEnd)
virtual CodePoint const & operator*() const
void Swap(CodePointSource &)
bool Equals(CodePointSource const &) const
virtual void Pop()
Pops the current item.
ThisCodeUnitIterator thisInputEnd
The input code unit end iterator.
CodePointSource & operator=(CodePointSource)
virtual bool operator!() const
CodePoint thisCodePoint
The current Om::CodePoint.
ThisCodeUnitIterator thisInputIterator
The input code unit start iterator.
A partial implementation of Source.
A Source adapter for a sentinal-terminated input iterator.
Any object that items can be pulled from.
Definition: source.hpp:31
Om header file.
Om source file.
Om header file.
bool operator==(CodePointSource< TheCodeUnitIterator > const &, CodePointSource< TheCodeUnitIterator > const &)
bool operator!=(CodePointSource< TheCodeUnitIterator > const &, CodePointSource< TheCodeUnitIterator > const &)
The Om library.
Definition: code_point.hpp:26
boost::locale::utf::code_point CodePoint
A UTF-8 code point.
Definition: code_point.hpp:32
void swap(Om::Language::Expression &, Om::Language::Expression &)