diff options
author | Mike Buland <eichlan@xagasoft.com> | 2008-10-01 21:48:33 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2008-10-01 21:48:33 +0000 |
commit | b6f57560fb7fae00f0854ca19158bd5512e5405b (patch) | |
tree | aa3c7012ee2b1ee9b97b1ba136217cbf6a84d587 /src/tests | |
parent | d872f7e07c5367f251cf5ebb70a03916251f5306 (diff) | |
download | libbu++-b6f57560fb7fae00f0854ca19158bd5512e5405b.tar.gz libbu++-b6f57560fb7fae00f0854ca19158bd5512e5405b.tar.bz2 libbu++-b6f57560fb7fae00f0854ca19158bd5512e5405b.tar.xz libbu++-b6f57560fb7fae00f0854ca19158bd5512e5405b.zip |
This commit is sure to break things. This should be a very, very minor change.
What changed API-Wise:
- I deleted a constructor in Bu::File that shouldn't have been used anyway.
- I changed it from using fopen style mode strings to using libbu++ style
mode flags. Check the docs for the complete list, but basically instead of
"wb" you do Bu::File::Write, and so on, you can or any of the libbu++ flags
together. There is no binary/text mode, it just writes whatever you tell it
to verbatim (binary mode). Lots of extras are supported. Nothing else
should have changed (except now the file stream is unbuffered, like all the
other streams).
Sorry if this breaks anything, if it's too annoying, use the last revision for
a while longer.
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/archive.cpp | 2 | ||||
-rw-r--r-- | src/tests/archive2.cpp | 2 | ||||
-rw-r--r-- | src/tests/bzip2.cpp | 4 | ||||
-rw-r--r-- | src/tests/nids.cpp | 11 | ||||
-rw-r--r-- | src/tests/taf.cpp | 8 |
5 files changed, 13 insertions, 14 deletions
diff --git a/src/tests/archive.cpp b/src/tests/archive.cpp index 698d37c..131d4de 100644 --- a/src/tests/archive.cpp +++ b/src/tests/archive.cpp | |||
@@ -12,7 +12,7 @@ using namespace Bu; | |||
12 | 12 | ||
13 | int main() | 13 | int main() |
14 | { | 14 | { |
15 | File f("test.dat", "wb"); | 15 | File f("test.dat", File::Write ); |
16 | Archive ar( f, Archive::save ); | 16 | Archive ar( f, Archive::save ); |
17 | 17 | ||
18 | std::string s("Hello there"); | 18 | std::string s("Hello there"); |
diff --git a/src/tests/archive2.cpp b/src/tests/archive2.cpp index 6d3c2c1..ab02d04 100644 --- a/src/tests/archive2.cpp +++ b/src/tests/archive2.cpp | |||
@@ -82,7 +82,7 @@ void write() | |||
82 | { | 82 | { |
83 | C *c = new C; | 83 | C *c = new C; |
84 | 84 | ||
85 | Bu::File f( "test.archive", "wb"); | 85 | Bu::File f( "test.archive", Bu::File::Write ); |
86 | Bu::Archive ar( f, Bu::Archive::save ); | 86 | Bu::Archive ar( f, Bu::Archive::save ); |
87 | ar << c; | 87 | ar << c; |
88 | } | 88 | } |
diff --git a/src/tests/bzip2.cpp b/src/tests/bzip2.cpp index de7c034..77dc064 100644 --- a/src/tests/bzip2.cpp +++ b/src/tests/bzip2.cpp | |||
@@ -19,10 +19,10 @@ int main( int argc, char *argv[] ) | |||
19 | char buf[1024]; | 19 | char buf[1024]; |
20 | size_t nRead; | 20 | size_t nRead; |
21 | 21 | ||
22 | Bu::File f( argv[0], "wb" ); | 22 | Bu::File f( argv[0], Bu::File::Write ); |
23 | Bu::BZip2 bz2( f ); | 23 | Bu::BZip2 bz2( f ); |
24 | 24 | ||
25 | Bu::File fin( argv[1], "rb"); | 25 | Bu::File fin( argv[1], Bu::File::Read ); |
26 | 26 | ||
27 | for(;;) | 27 | for(;;) |
28 | { | 28 | { |
diff --git a/src/tests/nids.cpp b/src/tests/nids.cpp index 4856883..f50fde5 100644 --- a/src/tests/nids.cpp +++ b/src/tests/nids.cpp | |||
@@ -10,17 +10,16 @@ int main( int argc, char *argv[] ) | |||
10 | return 1; | 10 | return 1; |
11 | } | 11 | } |
12 | 12 | ||
13 | Bu::File fOut( argv[1], "wb+"); | 13 | Bu::File fOut( argv[1], Bu::File::ReadWrite ); |
14 | Bu::Nids n( fOut ); | 14 | Bu::Nids n( fOut ); |
15 | 15 | ||
16 | // n.initialize( 120, 5 ); | 16 | // n.initialize( 120, 5 ); |
17 | 17 | ||
18 | Bu::NidsStream s = n.openStream( n.createStream() ); | 18 | Bu::NidsStream s = n.openStream( n.createStream() ); |
19 | /* | 19 | |
20 | Bu::FString sBuf( 350 ); | 20 | // Bu::FString sBuf( 350 ); |
21 | memset( sBuf.getStr(), 'a', 350 ); | 21 | // memset( sBuf.getStr(), 'a', 350 ); |
22 | s.write( sBuf ); | 22 | // s.write( sBuf ); |
23 | */ | ||
24 | 23 | ||
25 | return 0; | 24 | return 0; |
26 | } | 25 | } |
diff --git a/src/tests/taf.cpp b/src/tests/taf.cpp index 281b9c4..859ecfc 100644 --- a/src/tests/taf.cpp +++ b/src/tests/taf.cpp | |||
@@ -13,13 +13,13 @@ int main( int argc, char *argv[] ) | |||
13 | { | 13 | { |
14 | if( argc == 1 ) | 14 | if( argc == 1 ) |
15 | { | 15 | { |
16 | Bu::File f("test.taf", "rb"); | 16 | Bu::File f("test.taf", Bu::File::Read ); |
17 | Bu::TafReader tr( f ); | 17 | Bu::TafReader tr( f ); |
18 | 18 | ||
19 | Bu::TafGroup *pGroup = tr.readGroup(); | 19 | Bu::TafGroup *pGroup = tr.readGroup(); |
20 | 20 | ||
21 | { | 21 | { |
22 | Bu::File fo("out.taf", "wb"); | 22 | Bu::File fo("out.taf", Bu::File::Write ); |
23 | Bu::TafWriter tw( fo ); | 23 | Bu::TafWriter tw( fo ); |
24 | tw.writeGroup( pGroup ); | 24 | tw.writeGroup( pGroup ); |
25 | } | 25 | } |
@@ -28,13 +28,13 @@ int main( int argc, char *argv[] ) | |||
28 | } | 28 | } |
29 | else if( argc == 3 ) | 29 | else if( argc == 3 ) |
30 | { | 30 | { |
31 | Bu::File f( argv[1], "rb"); | 31 | Bu::File f( argv[1], Bu::File::Read ); |
32 | Bu::TafReader tr( f ); | 32 | Bu::TafReader tr( f ); |
33 | 33 | ||
34 | Bu::TafGroup *pGroup = tr.readGroup(); | 34 | Bu::TafGroup *pGroup = tr.readGroup(); |
35 | 35 | ||
36 | { | 36 | { |
37 | Bu::File fo( argv[2], "wb"); | 37 | Bu::File fo( argv[2], Bu::File::Write ); |
38 | Bu::TafWriter tw( fo ); | 38 | Bu::TafWriter tw( fo ); |
39 | tw.writeGroup( pGroup ); | 39 | tw.writeGroup( pGroup ); |
40 | } | 40 | } |