aboutsummaryrefslogtreecommitdiff
path: root/src/tests/utf.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-11-05 22:41:51 +0000
committerMike Buland <eichlan@xagasoft.com>2012-11-05 22:41:51 +0000
commitec05778d5718a7912e506764d443a78d6a6179e3 (patch)
tree78a9a01532180030c095acefc45763f07c14edb8 /src/tests/utf.cpp
parentb20414ac1fe80a71a90601f4cd1767fa7014a9ba (diff)
downloadlibbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.gz
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.bz2
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.xz
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.zip
Converted tabs to spaces with tabconv.
Diffstat (limited to '')
-rw-r--r--src/tests/utf.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/src/tests/utf.cpp b/src/tests/utf.cpp
index 923b611..40d4194 100644
--- a/src/tests/utf.cpp
+++ b/src/tests/utf.cpp
@@ -7,65 +7,65 @@ using namespace Bu;
7 7
8int main() 8int main()
9{ 9{
10 sio << "Code: " << Bu::__calcHashCode( Bu::UtfString("Hello there") ) 10 sio << "Code: " << Bu::__calcHashCode( Bu::UtfString("Hello there") )
11 << sio.nl; 11 << sio.nl;
12 12
13 Bu::File fIn("utf8.in", Bu::File::Read ); 13 Bu::File fIn("utf8.in", Bu::File::Read );
14 Bu::String sUtf8; 14 Bu::String sUtf8;
15 char buf[4096]; 15 char buf[4096];
16 while( !fIn.isEos() ) 16 while( !fIn.isEos() )
17 { 17 {
18 int iAmnt = fIn.read( buf, 4096 ); 18 int iAmnt = fIn.read( buf, 4096 );
19 sUtf8.append( buf, iAmnt ); 19 sUtf8.append( buf, iAmnt );
20 } 20 }
21 Bu::UtfString us( sUtf8, Bu::UtfString::Utf8 ); 21 Bu::UtfString us( sUtf8, Bu::UtfString::Utf8 );
22 us.debug(); 22 us.debug();
23 { 23 {
24 Bu::File fOut("utf8.out", Bu::File::WriteNew ); 24 Bu::File fOut("utf8.out", Bu::File::WriteNew );
25 us.write( fOut, Bu::UtfString::Utf8 ); 25 us.write( fOut, Bu::UtfString::Utf8 );
26 } 26 }
27 { 27 {
28 Bu::File fOut("utf16.out", Bu::File::WriteNew ); 28 Bu::File fOut("utf16.out", Bu::File::WriteNew );
29 us.write( fOut, Bu::UtfString::Utf16 ); 29 us.write( fOut, Bu::UtfString::Utf16 );
30 } 30 }
31 { 31 {
32 Bu::File fOut("utf16le.out", Bu::File::WriteNew ); 32 Bu::File fOut("utf16le.out", Bu::File::WriteNew );
33 us.write( fOut, Bu::UtfString::Utf16le ); 33 us.write( fOut, Bu::UtfString::Utf16le );
34 } 34 }
35 { 35 {
36 Bu::File fOut("utf16be.out", Bu::File::WriteNew ); 36 Bu::File fOut("utf16be.out", Bu::File::WriteNew );
37 us.write( fOut, Bu::UtfString::Utf16be ); 37 us.write( fOut, Bu::UtfString::Utf16be );
38 } 38 }
39 { 39 {
40 Bu::File fOut("utf32.out", Bu::File::WriteNew ); 40 Bu::File fOut("utf32.out", Bu::File::WriteNew );
41 us.write( fOut, Bu::UtfString::Utf32 ); 41 us.write( fOut, Bu::UtfString::Utf32 );
42 } 42 }
43 { 43 {
44 Bu::File fOut("utf32le.out", Bu::File::WriteNew ); 44 Bu::File fOut("utf32le.out", Bu::File::WriteNew );
45 us.write( fOut, Bu::UtfString::Utf32le ); 45 us.write( fOut, Bu::UtfString::Utf32le );
46 } 46 }
47 { 47 {
48 Bu::File fOut("utf32be.out", Bu::File::WriteNew ); 48 Bu::File fOut("utf32be.out", Bu::File::WriteNew );
49 us.write( fOut, Bu::UtfString::Utf32be ); 49 us.write( fOut, Bu::UtfString::Utf32be );
50 } 50 }
51 51
52 /* 52 /*
53 argc--, argv++; 53 argc--, argv++;
54 54
55 for( char **sFile = argv; *sFile; sFile++ ) 55 for( char **sFile = argv; *sFile; sFile++ )
56 { 56 {
57 Bu::File fIn( *sFile, Bu::File::Read ); 57 Bu::File fIn( *sFile, Bu::File::Read );
58 Bu::String sUtf8; 58 Bu::String sUtf8;
59 char buf[4096]; 59 char buf[4096];
60 while( !fIn.isEos() ) 60 while( !fIn.isEos() )
61 { 61 {
62 int iAmnt = fIn.read( buf, 4096 ); 62 int iAmnt = fIn.read( buf, 4096 );
63 sUtf8.append( buf, iAmnt ); 63 sUtf8.append( buf, iAmnt );
64 } 64 }
65 Bu::UtfString us( sUtf8, Bu::UtfString::Utf16 ); 65 Bu::UtfString us( sUtf8, Bu::UtfString::Utf16 );
66 66
67 us.debug(); 67 us.debug();
68 } 68 }
69 */ 69 */
70} 70}
71 71