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/tools/bnfcompile.cpp | 26 +++++++++++++------------- src/tools/mkunit.cpp | 34 +++++++++++++++++----------------- src/tools/myriad.cpp | 6 +++--- src/tools/parser.cpp | 2 +- src/tools/viewcsv.cpp | 10 +++++----- 5 files changed, 39 insertions(+), 39 deletions(-) (limited to 'src/tools') diff --git a/src/tools/bnfcompile.cpp b/src/tools/bnfcompile.cpp index 16e75a5..b7b363c 100644 --- a/src/tools/bnfcompile.cpp +++ b/src/tools/bnfcompile.cpp @@ -123,7 +123,7 @@ public: } } - virtual FString tokenToString( const Token &t ) + virtual String tokenToString( const Token &t ) { switch( (TokenType)t.iToken ) { @@ -146,7 +146,7 @@ public: private: Stream &rSrc; QueueBuf qbIn; - FString sBuf; + String sBuf; }; class BnfParser @@ -201,9 +201,9 @@ private: next(); if( pCur->iToken == tokIdentifier ) { - hTokens.insert( pCur->vExtra.get(), ++iLastToken ); + hTokens.insert( pCur->vExtra.get(), ++iLastToken ); sio << "Added token[" << iLastToken << "]: " - << pCur->vExtra.get() << sio.nl; + << pCur->vExtra.get() << sio.nl; } else if( pCur->iToken == tokSemiColon ) break; @@ -214,7 +214,7 @@ private: void nonTerminal() { - Bu::FString sNtName = pCur->vExtra.get(); + Bu::String sNtName = pCur->vExtra.get(); Parser::NonTerminal nt; p.addNonTerminal( sNtName ); sio.incIndent(); @@ -258,8 +258,8 @@ private: { case tokIdentifier: { - const Bu::FString &sName = - pCur->vExtra.get(); + const Bu::String &sName = + pCur->vExtra.get(); if( hTokens.has( sName ) ) { pr.append( @@ -292,8 +292,8 @@ private: next(); if( pCur->iToken != tokIdentifier ) tokenError("tokIdentifier"); - Bu::FString sName = - pCur->vExtra.get(); + Bu::String sName = + pCur->vExtra.get(); next(); if( pCur->iToken != tokCloseSquare ) tokenError("tokCloseSquare"); @@ -317,8 +317,8 @@ private: next(); if( pCur->iToken != tokIdentifier ) tokenError("tokIdentifier"); - Bu::FString sName = - pCur->vExtra.get(); + Bu::String sName = + pCur->vExtra.get(); next(); if( pCur->iToken != tokCloseCurly ) tokenError("tokCloseCurly"); @@ -366,14 +366,14 @@ private: pCur = l.nextToken(); } - void tokenError( const FString &s ) + void tokenError( const String &s ) { throw ExceptionBase( ("Expected " + s + " but found " + l.tokenToString( *pCur ) + ".").getStr() ); } private: - typedef Bu::Hash TokenHash; + typedef Bu::Hash TokenHash; TokenHash hTokens; BnfLexer &l; BnfLexer::Token *pCur; diff --git a/src/tools/mkunit.cpp b/src/tools/mkunit.cpp index 12ce65f..c0b7b8b 100644 --- a/src/tools/mkunit.cpp +++ b/src/tools/mkunit.cpp @@ -15,7 +15,7 @@ public: { } - Bu::FString sName; + Bu::String sName; bool bExpectPass; }; typedef Bu::List TestList; @@ -23,7 +23,7 @@ typedef Bu::List TestList; class Suite { public: - Bu::FString sName; + Bu::String sName; TestList lTest; }; //typedef Bu::List SuiteList; @@ -66,7 +66,7 @@ Bu::Formatter &operator<<( Bu::Formatter &f, const Suite &s ) class Parser { public: - Parser( const Bu::FString &sFile ) : + Parser( const Bu::String &sFile ) : sIn( sFile ), fIn( sFile, File::Read ), bIn( fIn ), @@ -99,10 +99,10 @@ public: return cBuf; } - TokType nextToken( Variant &v, Bu::FString &sWsOut, int &iLineStart, + TokType nextToken( Variant &v, Bu::String &sWsOut, int &iLineStart, int &iCharStart ) { - Bu::FString sTok, sWs; + Bu::String sTok, sWs; char buf; try @@ -307,7 +307,7 @@ public: void firstPass() { Variant v; - Bu::FString sWs; + Bu::String sWs; int iL, iC; for(;;) { @@ -322,7 +322,7 @@ public: if( nextToken( v, sWs, iL, iC ) != tokFluff ) throw Bu::ExceptionBase("%d:%d: Expected string " "following suite.", iL, iC ); - s.sName = v.get(); + s.sName = v.get(); if( nextToken( v, sWs, iL, iC ) != tokChar || v.get() != '{' ) throw Bu::ExceptionBase("%d:%d: Expected {, got " @@ -346,7 +346,7 @@ public: throw Bu::ExceptionBase("%d:%d: Expected " "string following test.", iL, iC ); Test t; - t.sName = v.get(); + t.sName = v.get(); if( nextToken( v, sWs, iL, iC ) != tokBlock ) throw Bu::ExceptionBase("%d:%d: Expected " "{...} block.", @@ -380,7 +380,7 @@ public: } } - void secondPass( const Bu::FString &sOut ) + void secondPass( const Bu::String &sOut ) { File fOut( sOut, File::WriteNew ); Formatter f( fOut ); @@ -393,7 +393,7 @@ public: iChar = 0; bool bHasIncluded = false; - Bu::FString sWs; + Bu::String sWs; Variant v; int iL, iC; for(;;) @@ -408,7 +408,7 @@ public: if( nextToken( v, sWs, iL, iC ) != tokFluff ) throw Bu::ExceptionBase("%d:%d: Expected string " "following suite.", iL, iC ); - s.sName = v.get(); + s.sName = v.get(); if( nextToken( v, sWs, iL, iC ) != tokChar || v.get() != '{' ) throw Bu::ExceptionBase("%d:%d: Expected {", @@ -421,7 +421,7 @@ public: bHasIncluded = true; } - Bu::FString sClass = "_UnitSuite_" + s.sName; + Bu::String sClass = "_UnitSuite_" + s.sName; f << "class " << sClass << " : public Bu::UnitSuite" << f.nl << "{" << f.nl << "public:" << f.nl @@ -441,7 +441,7 @@ public: } else if( t == tokEof ) { - Bu::FString sClass = "_UnitSuite_" + s.sName; + Bu::String sClass = "_UnitSuite_" + s.sName; f << sWs << f.nl << "int main( int argc, char *argv[] )" << f.nl << "{" << f.nl << "\treturn " << sClass << "().run( argc, argv );" << f.nl << "}" << f.nl; @@ -458,7 +458,7 @@ public: { case tokFluff: fOut.write( sWs ); - fOut.write( v.get() ); + fOut.write( v.get() ); break; case tokTest: @@ -468,7 +468,7 @@ public: throw Bu::ExceptionBase("%d:%d: Expected " "string following test.", iL, iC ); Test t; - t.sName = v.get(); + t.sName = v.get(); if( nextToken( v, sWs, iL, iC ) != tokBlock ) throw Bu::ExceptionBase("%d:%d: Expected " "{...} block.", @@ -499,7 +499,7 @@ public: fOut.write( sWs ); f << f.nl << "#line " << iL << " \"" << sIn << "\"" << f.nl; - fOut.write( v.get() ); + fOut.write( v.get() ); break; @@ -521,7 +521,7 @@ public: } private: - Bu::FString sIn; + Bu::String sIn; File fIn; Buffer bIn; char cBuf; diff --git a/src/tools/myriad.cpp b/src/tools/myriad.cpp index b6e435d..7d7956e 100644 --- a/src/tools/myriad.cpp +++ b/src/tools/myriad.cpp @@ -75,9 +75,9 @@ public: int iBlockSize; int iPreallocate; int iStream; - Bu::FString sFile; - Bu::FString sSrc; - Bu::FString sDst; + Bu::String sFile; + Bu::String sSrc; + Bu::String sDst; }; Bu::Formatter &operator>>( Bu::Formatter &f, Mode &e ) diff --git a/src/tools/parser.cpp b/src/tools/parser.cpp index 7933f31..8350343 100644 --- a/src/tools/parser.cpp +++ b/src/tools/parser.cpp @@ -118,7 +118,7 @@ public: case '8': case '9': { - Bu::FString sTmp; + Bu::String sTmp; sTmp += b; qbIn.seek( 1 ); for(;;) diff --git a/src/tools/viewcsv.cpp b/src/tools/viewcsv.cpp index d81525e..9be1291 100644 --- a/src/tools/viewcsv.cpp +++ b/src/tools/viewcsv.cpp @@ -38,7 +38,7 @@ public: return 0; } - Bu::FString sFileIn; + Bu::String sFileIn; bool bHeader; }; @@ -245,10 +245,10 @@ public: setHeaderRow( !bHeaderRow ); } - Bu::FString prompt( const Bu::FString &sPrompt ) + Bu::String prompt( const Bu::String &sPrompt ) { int maxx, maxy; - Bu::FString sStr; + Bu::String sStr; RegEx re( sPrompt ); @@ -292,7 +292,7 @@ public: sysCaret.reset(); } - void findNext( const Bu::FString &sTerm ) + void findNext( const Bu::String &sTerm ) { RegEx re( sTerm ); @@ -398,7 +398,7 @@ int main( int argc, char *argv[] ) CsvView view( doc ); view.setHeaderRow( opt.bHeader ); - Bu::FString sSearchTerm; + Bu::String sSearchTerm; bool bRun = true; do -- cgit v1.2.3