Om
om.cpp
Go to the documentation of this file.
1 
15 #ifndef Om_
16 
17  #include "om.hpp"
18 
19  #ifdef Om_Macro_Test_
20 
21  #include "boost/test/included/unit_test.hpp"
22 
23 bool init_unit_test() {
24  boost::debug::detect_memory_leaks(false);
25  Om::Language::System::Get().Initialize("en_US.UTF-8");
26  return true;
27 }
28 
29  #else
30 
39 int main(
40  int const theArgumentCount,
41  char const * const theArgumentArray[]
42 ) {
43  assert(0 < theArgumentCount);
44  assert(theArgumentArray);
45 
47  1 < theArgumentCount ?
48  theArgumentArray[1] :
49  "en_US.UTF-8"
50  );
51 
52  typedef Om::Source::StreamSource<> CodeUnitSource;
53  CodeUnitSource theCodeUnitSource(std::cin);
55  theCodeUnitSource,
56  CodeUnitSource()
57  );
58 
59  typedef Om::Sink::StreamSink<> CodeUnitSink;
60  CodeUnitSink theCodeUnitSink(std::cout);
61  Om::Sink::CodePointSink<CodeUnitSink> theCodePointSink(theCodeUnitSink);
62 
64  theCodePointSource,
65  theCodePointSink
66  );
67 
68  return EXIT_SUCCESS;
69 }
70 
71  #endif
72 
73 #endif
void Initialize(char const theLocaleCodeUnitIterator[])
Initializes the System.
static System & Get()
void Evaluate(Om::Source::Source< CodePoint const > &, Om::Sink::Sink< CodePoint const > &) const
Evaluates input from the CodePoint Source and pushes it to the CodePoint Sink.
A CodePoint Sink that pushes each code unit to the iterator.
A Sink adapter for an output stream.
Definition: stream_sink.hpp:37
A CodePoint Source that reads each code unit from the iterator.
A Source adapter for an input stream.
int main(int const theArgumentCount, char const *const theArgumentArray[])
Definition: om.cpp:39
Om umbrella header file.