From f5aca1a1b402bd7ebc944dc6e6fe65828d863365 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 20 Jan 2011 02:14:08 +0000 Subject: Bu::FString is now String, and there's a shell script to fix any other programs that were using fstring, I hope. --- src/tests/archive.cpp | 4 ++-- src/tests/cache.cpp | 18 +++++++++--------- src/tests/fastcgi.cpp | 8 ++++---- src/tests/fstratsptr.cpp | 8 ++++---- src/tests/fstrformat.cpp | 4 ++-- src/tests/fstring.cpp | 28 ++++++++++++++-------------- src/tests/fstrstd.cpp | 4 ++-- src/tests/hash2.cpp | 4 ++-- src/tests/heap.cpp | 14 +++++++------- src/tests/listsort.cpp | 6 +++--- src/tests/mmparse.cpp | 2 +- src/tests/optparser.cpp | 2 +- src/tests/sha1.cpp | 4 ++-- src/tests/signals.cpp | 24 ++++++++++++------------ src/tests/size.cpp | 6 +++--- src/tests/speed.cpp | 6 +++--- src/tests/streamstack.cpp | 4 ++-- src/tests/telnetsrv.cpp | 2 +- 18 files changed, 74 insertions(+), 74 deletions(-) (limited to 'src/tests') diff --git a/src/tests/archive.cpp b/src/tests/archive.cpp index 08e3b17..de227b0 100644 --- a/src/tests/archive.cpp +++ b/src/tests/archive.cpp @@ -7,7 +7,7 @@ #include "bu/archive.h" #include "bu/file.h" -#include "bu/fstring.h" +#include "bu/string.h" using namespace Bu; @@ -16,7 +16,7 @@ int main() File f("test.dat", File::WriteNew ); Archive ar( f, Archive::save ); - Bu::FString s("Hello there"); + Bu::String s("Hello there"); ar << s; ar.setProp("hi", 45 ); 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 @@ #include "bu/cache.h" #include "bu/file.h" -#include "bu/fstring.h" +#include "bu/string.h" #include "bu/cachecalc.h" class Bob @@ -90,7 +90,7 @@ public: writeNum("bobcache/last", cLastId ); } - long readNum( const Bu::FString &sFile ) + long readNum( const Bu::String &sFile ) { TRACE( sFile ); Bu::File f( sFile, Bu::File::Read ); @@ -99,13 +99,13 @@ public: return strtol( buf, NULL, 0 ); } - void writeNum( const Bu::FString &sFile, long num ) + void writeNum( const Bu::String &sFile, long num ) { TRACE( sFile, num ); Bu::File f( sFile, Bu::File::Write|Bu::File::Create|Bu::File::Truncate ); - Bu::FString s; + Bu::String s; s.format("%d", num ); f.write( s ); } @@ -126,7 +126,7 @@ public: virtual Bob *load( const long &key ) { TRACE( key ); - Bu::FString sDest; + Bu::String sDest; sDest.format("bobcache/%d", key ); return new Bob( readNum( sDest ) ); } @@ -134,7 +134,7 @@ public: virtual void unload( Bob *pObj, const long &key ) { TRACE( pObj, key ); - Bu::FString sDest; + Bu::String sDest; sDest.format("bobcache/%d", key ); writeNum( sDest, pObj->getInt() ); delete pObj; @@ -144,7 +144,7 @@ public: { TRACE( rSrc ); long id = ++cLastId; - Bu::FString sDest; + Bu::String sDest; sDest.format("bobcache/%d", id ); writeNum( sDest, rSrc->getInt() ); return id; @@ -153,7 +153,7 @@ public: virtual void destroy( Bob *pObj, const long &key ) { TRACE( pObj, key ); - Bu::FString sDest; + Bu::String sDest; sDest.format("bobcache/%d", key ); if( !access( sDest.getStr(), F_OK ) ) unlink( sDest.getStr() ); @@ -163,7 +163,7 @@ public: virtual void destroy( const long &key ) { TRACE( pObj, key ); - Bu::FString sDest; + Bu::String sDest; sDest.format("bobcache/%d", key ); if( !access( sDest.getStr(), F_OK ) ) unlink( sDest.getStr() ); diff --git a/src/tests/fastcgi.cpp b/src/tests/fastcgi.cpp index a3fa675..5f7758e 100644 --- a/src/tests/fastcgi.cpp +++ b/src/tests/fastcgi.cpp @@ -27,10 +27,10 @@ public: } virtual int onRequest( const StrHash &hParams, - const Bu::FString &sStdIn, Bu::Stream &sStdOut, + const Bu::String &sStdIn, Bu::Stream &sStdOut, Bu::Stream &/*sStdErr*/ ) { - Bu::FString sOut("Content-Type: text/html\r\n\r\n"); + Bu::String sOut("Content-Type: text/html\r\n\r\n"); sOut += "

Environment:

"; sOut += "

Stdin:

"; sOut.formatAppend("%d bytes
", sStdIn.getSize() );
-		Bu::FString sL, sR;
-		for( Bu::FString::const_iterator i = sStdIn.begin();
+		Bu::String sL, sR;
+		for( Bu::String::const_iterator i = sStdIn.begin();
 			i; i++ )
 		{
 			sL.formatAppend("%02X ",
diff --git a/src/tests/fstratsptr.cpp b/src/tests/fstratsptr.cpp
index 2303d6a..fa38459 100644
--- a/src/tests/fstratsptr.cpp
+++ b/src/tests/fstratsptr.cpp
@@ -5,7 +5,7 @@
  * terms of the license contained in the file LICENSE.
  */
 
-#include "bu/fstring.h"
+#include "bu/string.h"
 #include "bu/atom.h"
 #include "bu/sptr.h"
 
@@ -15,8 +15,8 @@ public:
 	Person(){};
 	virtual ~Person(){};
 
-	Bu::Atom sFirstName;
-	Bu::Atom sLastName;
+	Bu::Atom sFirstName;
+	Bu::Atom sLastName;
 };
 
 typedef Bu::SPtr PersonPtr;
@@ -45,7 +45,7 @@ int main()
 	Swap(one, two);
 */
 
-	Bu::Atom sOne, sTwo;
+	Bu::Atom sOne, sTwo;
 	sOne = "Hello";
 	sTwo = sOne;
 
diff --git a/src/tests/fstrformat.cpp b/src/tests/fstrformat.cpp
index a8e9def..2f04fe9 100644
--- a/src/tests/fstrformat.cpp
+++ b/src/tests/fstrformat.cpp
@@ -5,12 +5,12 @@
  * terms of the license contained in the file LICENSE.
  */
 
-#include "bu/fstring.h"
+#include "bu/string.h"
 #include 
 
 int main()
 {
-	Bu::FString s;
+	Bu::String s;
 
 	s.format("%d, %f, \'%s\'", 144, 12.5, "bob" );
 
diff --git a/src/tests/fstring.cpp b/src/tests/fstring.cpp
index c343172..acc3558 100644
--- a/src/tests/fstring.cpp
+++ b/src/tests/fstring.cpp
@@ -6,7 +6,7 @@
  */
 
 #include "bu/hash.h"
-#include "bu/fstring.h"
+#include "bu/string.h"
 #include 
 #include 
 
@@ -27,9 +27,9 @@ inline double getTime()
 }
 #endif
 
-Bu::FString genThing()
+Bu::String genThing()
 {
-	Bu::FString bob;
+	Bu::String bob;
 	bob.append("ab ");
 	bob += "cd ";
 	bob += "efg";
@@ -39,7 +39,7 @@ Bu::FString genThing()
 	return bob;
 }
 
-void thing( Bu::FString str )
+void thing( Bu::String str )
 {
 	printf("Hey:  %s\n", str.getStr() );
 }
@@ -49,21 +49,21 @@ void copyfunc( std::string temp )
 	temp += "Hi";
 }
 
-void copyfunc( Bu::FString temp )
+void copyfunc( Bu::String temp )
 {
 	temp += "Hi";
 }
 
 void doTimings()
 {
-	Bu::FString fs1, fs2;
+	Bu::String fs1, fs2;
 	std::string ss1, ss2;
 	double dStart, dEnd, tfs1, tfs2, tfs3, tss1, tss2, tss3;
 	int nChars = 500000, nChunks=5000, nCopies=5000000, nChunkSize=1024*4;
 	char *buf = new char[nChunkSize];
 	memset( buf, '!', nChunkSize );
 
-	printf("Timing Bu::FString single chars...\n");
+	printf("Timing Bu::String single chars...\n");
 	dStart = getTime();
 	for( int j = 0; j < nChars; j++ ) fs1 += (char)('a'+(j%26));
 	fs1.getStr();
@@ -77,7 +77,7 @@ void doTimings()
 	dEnd = getTime();
 	tss1 = dEnd-dStart;
 
-	printf("Timing Bu::FString %d char chunks...\n", nChunkSize);
+	printf("Timing Bu::String %d char chunks...\n", nChunkSize);
 	dStart = getTime();
 	for( int j = 0; j < nChunks; j++ ) fs2.append(buf, nChunkSize);
 	fs2.getStr();
@@ -93,9 +93,9 @@ void doTimings()
 
 	fs2 = "Hello there.";
 	ss2 = "Hello there.";
-	printf("Timing Bu::FString copies...\n");
+	printf("Timing Bu::String copies...\n");
 	dStart = getTime();
-	for( int j = 0; j < nCopies; j++ ) Bu::FString stmp = fs2;
+	for( int j = 0; j < nCopies; j++ ) Bu::String stmp = fs2;
 	dEnd = getTime();
 	tfs3 = dEnd-dStart;
 
@@ -107,7 +107,7 @@ void doTimings()
 
 	printf(
 		"Results:       singles:        chunks:         copies:\n"
-		"Bu::FString    %10.2f/s   %10.2f/s   %10.2f/s\n"
+		"Bu::String    %10.2f/s   %10.2f/s   %10.2f/s\n"
 		"std::string    %10.2f/s   %10.2f/s   %10.2f/s\n",
 		nChars/tfs1, nChunks/tfs2, nCopies/tfs3,
 		nChars/tss1, nChunks/tss2, nCopies/tss3 );
@@ -118,16 +118,16 @@ void doTimings()
 #define pem printf("---------\n%08tX: %s\n%08tX: %s\n", (ptrdiff_t)str.getStr(), str.getStr(), (ptrdiff_t)str2.getStr(), str2.getStr() );
 int main( )
 {
-	Bu::FString fs1;
+	Bu::String fs1;
 	for( int j = 0; j < 500000; j++ ) fs1 += (char)('a'+(j%26));
 	return 0;
 
-	Bu::FString str("th");
+	Bu::String str("th");
 
 	str.prepend("Hello ");
 	str.append("ere.");
 
-	Bu::FString str2( str );
+	Bu::String str2( str );
 	pem;
 	str += "  What's up?";
 	pem;
diff --git a/src/tests/fstrstd.cpp b/src/tests/fstrstd.cpp
index 86d7c5c..4209c65 100644
--- a/src/tests/fstrstd.cpp
+++ b/src/tests/fstrstd.cpp
@@ -6,11 +6,11 @@
  */
 
 #include 
-#include "bu/fstring.h"
+#include "bu/string.h"
 
 int main()
 {
-	Bu::FString s("Hey there, dude.\n");
+	Bu::String s("Hey there, dude.\n");
 
 //	std::cout << s << 5;
 }
diff --git a/src/tests/hash2.cpp b/src/tests/hash2.cpp
index 4db248e..5f1dd09 100644
--- a/src/tests/hash2.cpp
+++ b/src/tests/hash2.cpp
@@ -5,12 +5,12 @@
  * terms of the license contained in the file LICENSE.
  */
 
-#include 
+#include 
 #include 
 
 int main()
 {
-	Bu::Hash hCmd;
+	Bu::Hash hCmd;
 
 	hCmd.insert("help", 5 );
 	hCmd.insert("exit", 5 );
diff --git a/src/tests/heap.cpp b/src/tests/heap.cpp
index 7538936..3576f25 100644
--- a/src/tests/heap.cpp
+++ b/src/tests/heap.cpp
@@ -10,7 +10,7 @@
 
 #include "bu/formatter.h"
 #include "bu/heap.h"
-#include "bu/fstring.h"
+#include "bu/string.h"
 #include "bu/file.h"
 
 typedef struct num
@@ -38,15 +38,15 @@ typedef struct num
 	}
 } num;
 
-void printHeap( Bu::Heap &h, int j )
+void printHeap( Bu::Heap &h, int j )
 {
 //	return;
-	Bu::FString sFName;
+	Bu::String sFName;
 	sFName.format("graph-step-%02d.dot", j );
 	Bu::File fOut( sFName, Bu::File::WriteNew );
 	Bu::Formatter f( fOut );
 	f << "Graph step: " << j << ", total size: " << h.getSize() << f.nl;
-	for( Bu::Heap::iterator i = h.begin(); i; i++ )
+	for( Bu::Heap::iterator i = h.begin(); i; i++ )
 	{
 		f << *i << f.nl;
 	}
@@ -73,7 +73,7 @@ int main()
 	}
 	printf("\n");
 */
-	Bu::Heap hStr;
+	Bu::Heap hStr;
 	int j = 0;
 
 	hStr.enqueue("George");
@@ -100,7 +100,7 @@ int main()
 	}
 	printf("\n");
 
-	Bu::List lStr;
+	Bu::List lStr;
 
 	lStr.insertSorted("George");
 	lStr.insertSorted("George");
@@ -110,7 +110,7 @@ int main()
 	lStr.insertSorted("Brianna");
 	lStr.insertSorted("Kate");
 	lStr.insertSorted("Soggy");
-	for( Bu::List::iterator i = lStr.begin(); i; i++ )
+	for( Bu::List::iterator i = lStr.begin(); i; i++ )
 	{
 		printf("\"%s\" ", (*i).getStr() );
 	}
diff --git a/src/tests/listsort.cpp b/src/tests/listsort.cpp
index 60d9611..00e7268 100644
--- a/src/tests/listsort.cpp
+++ b/src/tests/listsort.cpp
@@ -7,7 +7,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 using namespace Bu;
 
@@ -25,7 +25,7 @@ int main()
 	il.sortI( cmp );
 	*/
 
-	FString a("Soggy"), b("Sam");
+	String a("Soggy"), b("Sam");
 
 	if( a < b )
 	{
@@ -36,7 +36,7 @@ int main()
 		sio << "Good" << sio.nl;
 	}
 
-	typedef List StrList;
+	typedef List StrList;
 
 	StrList lNames;
 
diff --git a/src/tests/mmparse.cpp b/src/tests/mmparse.cpp
index b2c3bf5..1123d21 100644
--- a/src/tests/mmparse.cpp
+++ b/src/tests/mmparse.cpp
@@ -6,7 +6,7 @@
  */
 
 #include "bu/minimacro.h"
-#include "bu/fstring.h"
+#include "bu/string.h"
 
 int main()
 {
diff --git a/src/tests/optparser.cpp b/src/tests/optparser.cpp
index f5d1512..ae658df 100644
--- a/src/tests/optparser.cpp
+++ b/src/tests/optparser.cpp
@@ -72,7 +72,7 @@ public:
 
 	int iBob;
 	float dBob;
-	Bu::FString sVar;
+	Bu::String sVar;
 };
 
 int main( int argc, char *argv[] )
diff --git a/src/tests/sha1.cpp b/src/tests/sha1.cpp
index b1c798a..84cebe5 100644
--- a/src/tests/sha1.cpp
+++ b/src/tests/sha1.cpp
@@ -28,8 +28,8 @@ int main( int argc, char *argv[] )
 				break;
 		}
 
-		Bu::FString sRes = m.getResult();
-		for( Bu::FString::iterator i = sRes.begin(); i; i++ )
+		Bu::String sRes = m.getResult();
+		for( Bu::String::iterator i = sRes.begin(); i; i++ )
 		{
 			sio << Fmt::hex(2,false) << (int)(unsigned char)(*i);
 		}
diff --git a/src/tests/signals.cpp b/src/tests/signals.cpp
index e53c16e..a8c8c4e 100644
--- a/src/tests/signals.cpp
+++ b/src/tests/signals.cpp
@@ -32,22 +32,22 @@ public:
 		sio << iState << ": void fnc1( " << a << " )" << sio.nl;
 	}
 	
-	void fnc2( int a, Bu::FString b )
+	void fnc2( int a, Bu::String b )
 	{
 		sio << iState << ": void fnc2( " << a << ", \"" << b << "\" )" << sio.nl;
 	}
 	
-	void fnc3( int a, Bu::FString b, double c )
+	void fnc3( int a, Bu::String b, double c )
 	{
 		sio << iState << ": void fnc3( " << a << ", \"" << b << "\", " << c << " )" << sio.nl;
 	}
 	
-	void fnc4( int a, Bu::FString b, double c, char d )
+	void fnc4( int a, Bu::String b, double c, char d )
 	{
 		sio << iState << ": void fnc4( " << a << ", \"" << b << "\", " << c << ", '" << d << "' )" << sio.nl;
 	}
 	
-	void fnc5( int a, Bu::FString b, double c, char d, long e )
+	void fnc5( int a, Bu::String b, double c, char d, long e )
 	{
 		sio << iState << ": void fnc5( " << a << ", \"" << b << "\", " << c << ", '" << d << "', " << e << " )" << sio.nl;
 	}
@@ -66,22 +66,22 @@ void pfnc1( int a )
 	sio <<  ": void pfnc1( " << a << " )" << sio.nl;
 }
 
-void pfnc2( int a, Bu::FString b )
+void pfnc2( int a, Bu::String b )
 {
 	sio <<  ": void pfnc2( " << a << ", \"" << b << "\" )" << sio.nl;
 }
 
-void pfnc3( int a, Bu::FString b, double c )
+void pfnc3( int a, Bu::String b, double c )
 {
 	sio <<  ": void pfnc3( " << a << ", \"" << b << "\", " << c << " )" << sio.nl;
 }
 
-void pfnc4( int a, Bu::FString b, double c, char d )
+void pfnc4( int a, Bu::String b, double c, char d )
 {
 	sio <<  ": void pfnc4( " << a << ", \"" << b << "\", " << c << ", '" << d << "' )" << sio.nl;
 }
 
-void pfnc5( int a, Bu::FString b, double c, char d, long e )
+void pfnc5( int a, Bu::String b, double c, char d, long e )
 {
 	sio <<  ": void pfnc5( " << a << ", \"" << b << "\", " << c << ", '" << d << "', " << e << " )" << sio.nl;
 }
@@ -105,22 +105,22 @@ int main()
 	cb1 = slot( &pfnc1 );
 	cb1( 5 );
 	
-	Signal2 cb2( slot( &t, &Thing::fnc2 ) );
+	Signal2 cb2( slot( &t, &Thing::fnc2 ) );
 	cb2( 5, "Hi there" );
 	cb2 = slot( &pfnc2 );
 	cb2( 5, "Hi there" );
 	
-	Signal3 cb3( slot( &t, &Thing::fnc3 ) );
+	Signal3 cb3( slot( &t, &Thing::fnc3 ) );
 	cb3( 5, "Hi there", 12.85 );
 	cb3 = slot( &pfnc3 );
 	cb3( 5, "Hi there", 12.85 );
 	
-	Signal4 cb4( slot( &t, &Thing::fnc4 ) );
+	Signal4 cb4( slot( &t, &Thing::fnc4 ) );
 	cb4( 5, "Hi there", 12.85, 'z' );
 	cb4 = slot( &pfnc4 );
 	cb4( 5, "Hi there", 12.85, 'z' );
 	
-	Signal5 cb5( slot( &t, &Thing::fnc5 ) );
+	Signal5 cb5( slot( &t, &Thing::fnc5 ) );
 	cb5( 5, "Hi there", 12.85, 'z', 849 );
 	cb5 = slot( &pfnc5 );
 	cb5( 5, "Hi there", 12.85, 'z', 849 );
diff --git a/src/tests/size.cpp b/src/tests/size.cpp
index a9a921d..841325d 100644
--- a/src/tests/size.cpp
+++ b/src/tests/size.cpp
@@ -6,15 +6,15 @@
  */
 
 #include "bu/hash.h"
-#include "bu/fstring.h"
+#include "bu/string.h"
 
 #define pSize( t ) printf("%15s: %db\n", #t, sizeof( t ) );
 
 int main()
 {
 	typedef Bu::Hash charcharHash;
-	typedef Bu::Hash strstrHash;
-	pSize( Bu::FString );
+	typedef Bu::Hash strstrHash;
+	pSize( Bu::String );
 	pSize( charcharHash );
 	pSize( strstrHash );
 }
diff --git a/src/tests/speed.cpp b/src/tests/speed.cpp
index c6770de..c78dded 100644
--- a/src/tests/speed.cpp
+++ b/src/tests/speed.cpp
@@ -5,7 +5,7 @@
  * terms of the license contained in the file LICENSE.
  */
 
-#include "bu/fstring.h"
+#include "bu/string.h"
 #include 
 
 template
@@ -50,9 +50,9 @@ void fullTest( tst t )
 
 int main()
 {
-	Bu::FString str;
+	Bu::String str;
 	for( int j = 0; j < 500; j++ )
 		str.append("Hey, this is a test string.  It will be reapeated many, many times.  How's that?");
-	fullTest( tstCopy( str ) );
+	fullTest( tstCopy( str ) );
 }
 
diff --git a/src/tests/streamstack.cpp b/src/tests/streamstack.cpp
index b8c48e7..ea9ec0b 100644
--- a/src/tests/streamstack.cpp
+++ b/src/tests/streamstack.cpp
@@ -24,7 +24,7 @@ public:
 
 	void write()
 	{
-		Bu::FString s;
+		Bu::String s;
 		time_t tNow = time( NULL );
 		s = ctime( &tNow );
 		long lSize = s.getSize()-1;
@@ -34,7 +34,7 @@ public:
 
 	void read()
 	{
-		Bu::FString s;
+		Bu::String s;
 		long lSize;
 		rStream.read( &lSize, sizeof(long) );
 		s.setSize( lSize );
diff --git a/src/tests/telnetsrv.cpp b/src/tests/telnetsrv.cpp
index 4504aaf..f62714a 100644
--- a/src/tests/telnetsrv.cpp
+++ b/src/tests/telnetsrv.cpp
@@ -36,7 +36,7 @@ public:
 		printf("New dim = (%dx%d)\n", iWidth, iHeight );
 	}
 
-	virtual void gotLine( Bu::FString &sLine )
+	virtual void gotLine( Bu::String &sLine )
 	{
 		printf("Line: \"%s\"\n", sLine.getStr() );
 		write("\n\r", 2 );
-- 
cgit v1.2.3