summaryrefslogtreecommitdiff
path: root/src/tests/cache.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-20 02:14:08 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-20 02:14:08 +0000
commitf5aca1a1b402bd7ebc944dc6e6fe65828d863365 (patch)
tree4a0fdd8e166d5c4b03543279d332b9a858ef62df /src/tests/cache.cpp
parent10c557562e1d67c55314c212371ea9cb7f802863 (diff)
downloadlibbu++-f5aca1a1b402bd7ebc944dc6e6fe65828d863365.tar.gz
libbu++-f5aca1a1b402bd7ebc944dc6e6fe65828d863365.tar.bz2
libbu++-f5aca1a1b402bd7ebc944dc6e6fe65828d863365.tar.xz
libbu++-f5aca1a1b402bd7ebc944dc6e6fe65828d863365.zip
Bu::FString is now String, and there's a shell script to fix any other programs
that were using fstring, I hope.
Diffstat (limited to 'src/tests/cache.cpp')
-rw-r--r--src/tests/cache.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tests/cache.cpp b/src/tests/cache.cpp
index 7fe660a..38a5591 100644
--- a/src/tests/cache.cpp
+++ b/src/tests/cache.cpp
@@ -14,7 +14,7 @@
14 14
15#include "bu/cache.h" 15#include "bu/cache.h"
16#include "bu/file.h" 16#include "bu/file.h"
17#include "bu/fstring.h" 17#include "bu/string.h"
18#include "bu/cachecalc.h" 18#include "bu/cachecalc.h"
19 19
20class Bob 20class Bob
@@ -90,7 +90,7 @@ public:
90 writeNum("bobcache/last", cLastId ); 90 writeNum("bobcache/last", cLastId );
91 } 91 }
92 92
93 long readNum( const Bu::FString &sFile ) 93 long readNum( const Bu::String &sFile )
94 { 94 {
95 TRACE( sFile ); 95 TRACE( sFile );
96 Bu::File f( sFile, Bu::File::Read ); 96 Bu::File f( sFile, Bu::File::Read );
@@ -99,13 +99,13 @@ public:
99 return strtol( buf, NULL, 0 ); 99 return strtol( buf, NULL, 0 );
100 } 100 }
101 101
102 void writeNum( const Bu::FString &sFile, long num ) 102 void writeNum( const Bu::String &sFile, long num )
103 { 103 {
104 TRACE( sFile, num ); 104 TRACE( sFile, num );
105 Bu::File f( sFile, 105 Bu::File f( sFile,
106 Bu::File::Write|Bu::File::Create|Bu::File::Truncate 106 Bu::File::Write|Bu::File::Create|Bu::File::Truncate
107 ); 107 );
108 Bu::FString s; 108 Bu::String s;
109 s.format("%d", num ); 109 s.format("%d", num );
110 f.write( s ); 110 f.write( s );
111 } 111 }
@@ -126,7 +126,7 @@ public:
126 virtual Bob *load( const long &key ) 126 virtual Bob *load( const long &key )
127 { 127 {
128 TRACE( key ); 128 TRACE( key );
129 Bu::FString sDest; 129 Bu::String sDest;
130 sDest.format("bobcache/%d", key ); 130 sDest.format("bobcache/%d", key );
131 return new Bob( readNum( sDest ) ); 131 return new Bob( readNum( sDest ) );
132 } 132 }
@@ -134,7 +134,7 @@ public:
134 virtual void unload( Bob *pObj, const long &key ) 134 virtual void unload( Bob *pObj, const long &key )
135 { 135 {
136 TRACE( pObj, key ); 136 TRACE( pObj, key );
137 Bu::FString sDest; 137 Bu::String sDest;
138 sDest.format("bobcache/%d", key ); 138 sDest.format("bobcache/%d", key );
139 writeNum( sDest, pObj->getInt() ); 139 writeNum( sDest, pObj->getInt() );
140 delete pObj; 140 delete pObj;
@@ -144,7 +144,7 @@ public:
144 { 144 {
145 TRACE( rSrc ); 145 TRACE( rSrc );
146 long id = ++cLastId; 146 long id = ++cLastId;
147 Bu::FString sDest; 147 Bu::String sDest;
148 sDest.format("bobcache/%d", id ); 148 sDest.format("bobcache/%d", id );
149 writeNum( sDest, rSrc->getInt() ); 149 writeNum( sDest, rSrc->getInt() );
150 return id; 150 return id;
@@ -153,7 +153,7 @@ public:
153 virtual void destroy( Bob *pObj, const long &key ) 153 virtual void destroy( Bob *pObj, const long &key )
154 { 154 {
155 TRACE( pObj, key ); 155 TRACE( pObj, key );
156 Bu::FString sDest; 156 Bu::String sDest;
157 sDest.format("bobcache/%d", key ); 157 sDest.format("bobcache/%d", key );
158 if( !access( sDest.getStr(), F_OK ) ) 158 if( !access( sDest.getStr(), F_OK ) )
159 unlink( sDest.getStr() ); 159 unlink( sDest.getStr() );
@@ -163,7 +163,7 @@ public:
163 virtual void destroy( const long &key ) 163 virtual void destroy( const long &key )
164 { 164 {
165 TRACE( pObj, key ); 165 TRACE( pObj, key );
166 Bu::FString sDest; 166 Bu::String sDest;
167 sDest.format("bobcache/%d", key ); 167 sDest.format("bobcache/%d", key );
168 if( !access( sDest.getStr(), F_OK ) ) 168 if( !access( sDest.getStr(), F_OK ) )
169 unlink( sDest.getStr() ); 169 unlink( sDest.getStr() );