ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Represent/Represent.cpp
Revision: 373
Committed: 2004-12-22T17:27:28-08:00 (20 years, 6 months ago) by douglas
File size: 1425 byte(s)
Log Message:
Even better!

File Contents

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

Properties

Name Value
svn:eol-style native
svn:keywords Id