1 |
// Represent |
2 |
// |
3 |
// Douglas Thrift |
4 |
// |
5 |
// $Id$ |
6 |
|
7 |
#include "Hexadecimal.hpp" |
8 |
|
9 |
#include <menes-app/simple.hpp> |
10 |
|
11 |
int Main(const app::Options& options) |
12 |
{ |
13 |
Represent represent; |
14 |
|
15 |
return 0; |
16 |
} |
17 |
|
18 |
Represent::Represent() |
19 |
{ |
20 |
std::string hello("Hello, World!"); |
21 |
|
22 |
api::Cerr << Binary(hello) << " = " << Hexadecimal(hello) << " = " << ext::String(hello) << ios::NewLine; |
23 |
|
24 |
_sforeach (std::string, atom, hello) api::Cerr << Binary(*atom) << " = " << Hexadecimal(*atom) << " = " << ext::String(atom, 1) << ios::NewLine; |
25 |
|
26 |
ext::String hello_(hello); |
27 |
|
28 |
api::Cerr << Binary(hello_) << " = " << Hexadecimal(hello_) << " = " << hello_ << ios::NewLine; |
29 |
|
30 |
_foreach (ext::String, atom, hello_) api::Cerr << Binary(*atom) << " = " << Hexadecimal(*atom) << " = " << ext::String(*atom) << ios::NewLine; |
31 |
|
32 |
_fori (index, -10, 11) api::Cerr << Binary(index) << " = " << Hexadecimal(index) << " = " << index << ios::NewLine; |
33 |
|
34 |
_foru (index, 0xFFFFFFF6, 11) api::Cerr << Binary(index) << " = " << Hexadecimal(index) << " = " << index << ios::NewLine; |
35 |
|
36 |
for (float index(-1); index < 1.1; index += float(0.1)) api::Cerr << Binary(index) << " = " << Hexadecimal(index) << " = " << index << ios::NewLine; |
37 |
|
38 |
for (double index(-1); index < 1.1; index += 0.1) api::Cerr << Binary(index) << " = " << Hexadecimal(index) << " = " << index << ios::NewLine; |
39 |
} |