From c435c7daa9df1b08dc85132fcd1c154bea9b69e2 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 20 Jan 2011 18:21:03 +0000 Subject: Fixes to use libbu++ Bu::String --- src/action.cpp | 2 +- src/action.h | 6 +++--- src/ast.cpp | 4 ++-- src/ast.h | 6 +++--- src/astleaf.cpp | 8 ++++---- src/astleaf.h | 10 +++++----- src/build.l | 6 +++--- src/buildparser.cpp | 18 +++++++++--------- src/buildparser.h | 16 ++++++++-------- src/cache.cpp | 6 +++--- src/cache.h | 14 +++++++------- src/conditionplugger.cpp | 4 ++-- src/context.cpp | 34 +++++++++++++++++----------------- src/context.h | 32 ++++++++++++++++---------------- src/function.h | 4 ++-- src/functionast.cpp | 2 +- src/functionast.h | 4 ++-- src/functiondirname.cpp | 14 +++++++------- src/functiondirname.h | 2 +- src/functiondirs.cpp | 2 +- src/functiondirs.h | 2 +- src/functionexecute.cpp | 4 ++-- src/functionexecute.h | 2 +- src/functionexists.cpp | 4 ++-- src/functionexists.h | 2 +- src/functionfilename.cpp | 12 ++++++------ src/functionfilename.h | 2 +- src/functionfiles.cpp | 2 +- src/functionfiles.h | 2 +- src/functiongetmakedeps.cpp | 8 ++++---- src/functiongetmakedeps.h | 2 +- src/functionmatches.cpp | 14 +++++++------- src/functionmatches.h | 6 +++--- src/functionplugger.cpp | 4 ++-- src/functionregex.cpp | 12 ++++++------ src/functionregex.h | 6 +++--- src/functionreplace.cpp | 4 ++-- src/functionreplace.h | 2 +- src/functiontargets.cpp | 2 +- src/functiontargets.h | 2 +- src/functiontostring.cpp | 6 +++--- src/functiontostring.h | 2 +- src/functionunlink.cpp | 2 +- src/functionunlink.h | 2 +- src/location.cpp | 2 +- src/location.h | 6 +++--- src/main.cpp | 18 +++++++++--------- src/profile.cpp | 4 ++-- src/profile.h | 6 +++--- src/rule.cpp | 14 +++++++------- src/rule.h | 18 +++++++++--------- src/runner.cpp | 28 ++++++++++++++-------------- src/runner.h | 8 ++++---- src/target.cpp | 32 ++++++++++++++++---------------- src/target.h | 32 ++++++++++++++++---------------- src/types.h | 8 ++++---- src/variable.cpp | 32 ++++++++++++++++---------------- src/variable.h | 12 ++++++------ src/view.h | 26 +++++++++++++------------- src/viewdefault.cpp | 38 +++++++++++++++++++------------------- src/viewdefault.h | 30 +++++++++++++++--------------- src/viewmake.cpp | 24 ++++++++++++------------ src/viewmake.h | 24 ++++++++++++------------ src/viewplugger.cpp | 4 ++-- 64 files changed, 333 insertions(+), 333 deletions(-) (limited to 'src') diff --git a/src/action.cpp b/src/action.cpp index 8b10641..1a2b8b1 100644 --- a/src/action.cpp +++ b/src/action.cpp @@ -20,7 +20,7 @@ Action::~Action() pAst = NULL; } -const Bu::FString &Action::getName() const +const Bu::String &Action::getName() const { return sName; } diff --git a/src/action.h b/src/action.h index 7f60095..de08911 100644 --- a/src/action.h +++ b/src/action.h @@ -1,7 +1,7 @@ #ifndef ACTION_H #define ACTION_H -#include +#include class Action { @@ -9,7 +9,7 @@ public: Action( const class AstBranch *pRoot ); virtual ~Action(); - const Bu::FString &getName() const; + const Bu::String &getName() const; void call( class Runner *pRunner ); @@ -19,7 +19,7 @@ public: static Action *genDefaultDefault(); private: - Bu::FString sName; + Bu::String sName; const class AstBranch *pRoot; class Ast *pAst; }; diff --git a/src/ast.cpp b/src/ast.cpp index 6b213ea..005372b 100644 --- a/src/ast.cpp +++ b/src/ast.cpp @@ -53,7 +53,7 @@ void Ast::addNode( YYLTYPE &loc, AstNode::Type eType, bool bVal ) addNode( new AstLeaf( loc, eType, bVal ) ); } -void Ast::addNode( YYLTYPE &loc, AstNode::Type eType, const Bu::FString &sVal ) +void Ast::addNode( YYLTYPE &loc, AstNode::Type eType, const Bu::String &sVal ) { addNode( new AstLeaf( loc, eType, sVal ) ); } @@ -87,7 +87,7 @@ void Ast::addNode( AstNode::Type eType, bool bVal ) addNode( none, eType, bVal ); } -void Ast::addNode( AstNode::Type eType, const Bu::FString &sVal ) +void Ast::addNode( AstNode::Type eType, const Bu::String &sVal ) { YYLTYPE none = {-1, -1, -1, -1}; addNode( none, eType, sVal ); diff --git a/src/ast.h b/src/ast.h index c62406b..3cc7206 100644 --- a/src/ast.h +++ b/src/ast.h @@ -3,7 +3,7 @@ #include "bu/list.h" #include "bu/stack.h" -#include "bu/fstring.h" +#include "bu/string.h" #include "bu/formatter.h" #include "astnode.h" @@ -24,14 +24,14 @@ public: void addNode( struct YYLTYPE &loc, AstNode::Type eType, float fVal ); void addNode( struct YYLTYPE &loc, AstNode::Type eType, bool bVal ); void addNode( struct YYLTYPE &loc, AstNode::Type eType, - const Bu::FString &sVal ); + const Bu::String &sVal ); void addNode( struct YYLTYPE &loc, AstNode::Type eType, const char *sVal ); void addNode( AstNode::Type eType ); void addNode( AstNode::Type eType, int iVal ); void addNode( AstNode::Type eType, float fVal ); void addNode( AstNode::Type eType, bool bVal ); - void addNode( AstNode::Type eType, const Bu::FString &sVal ); + void addNode( AstNode::Type eType, const Bu::String &sVal ); void addNode( AstNode::Type eType, const char *sVal ); void addNode( AstNode *pNode ); diff --git a/src/astleaf.cpp b/src/astleaf.cpp index 5182a58..c192dbf 100644 --- a/src/astleaf.cpp +++ b/src/astleaf.cpp @@ -27,7 +27,7 @@ AstLeaf::AstLeaf( const Location &loc, Type eType, bool bNew ) : setBoolValue( bNew ); } -AstLeaf::AstLeaf( const Location &loc, Type eType, const Bu::FString &sNew ) : +AstLeaf::AstLeaf( const Location &loc, Type eType, const Bu::String &sNew ) : AstNode( loc, eType ), sVal( NULL ) { @@ -68,12 +68,12 @@ void AstLeaf::setBoolValue( bool bNew ) bVal = bNew; } -void AstLeaf::setStrValue( const Bu::FString &sNew ) +void AstLeaf::setStrValue( const Bu::String &sNew ) { if( getDataType() != typeDataString ) throw Bu::ExceptionBase("Type is not string."); if( sVal == NULL ) - sVal = new Bu::FString( sNew ); + sVal = new Bu::String( sNew ); else *sVal = sNew; } @@ -99,7 +99,7 @@ bool AstLeaf::getBoolValue() const return bVal; } -Bu::FString &AstLeaf::getStrValue() const +Bu::String &AstLeaf::getStrValue() const { if( getDataType() != typeDataString ) throw Bu::ExceptionBase("Type is not string."); diff --git a/src/astleaf.h b/src/astleaf.h index cdcb2ae..85293f1 100644 --- a/src/astleaf.h +++ b/src/astleaf.h @@ -2,7 +2,7 @@ #define AST_LEAF_H #include "astnode.h" -#include "bu/fstring.h" +#include "bu/string.h" #include "bu/formatter.h" class AstLeaf : public AstNode @@ -12,19 +12,19 @@ public: AstLeaf( const Location &loc, Type eType, int iNew ); AstLeaf( const Location &loc, Type eType, float fNew ); AstLeaf( const Location &loc, Type eType, bool bNew ); - AstLeaf( const Location &loc, Type eType, const Bu::FString &sNew ); + AstLeaf( const Location &loc, Type eType, const Bu::String &sNew ); AstLeaf( const Location &loc, Type eType, const char *sNew ); virtual ~AstLeaf(); void setIntValue( int iNew ); void setFloatValue( float fNew ); void setBoolValue( bool bNew ); - void setStrValue( const Bu::FString &sNew ); + void setStrValue( const Bu::String &sNew ); int getIntValue() const; float getFloatValue() const; bool getBoolValue() const; - Bu::FString &getStrValue() const; + Bu::String &getStrValue() const; private: union @@ -32,7 +32,7 @@ private: int iVal; float fVal; bool bVal; - Bu::FString *sVal; + Bu::String *sVal; }; }; diff --git a/src/build.l b/src/build.l index dc4ddda..7b770f7 100644 --- a/src/build.l +++ b/src/build.l @@ -1,8 +1,8 @@ %{ #include "buildparser.h" - #include "bu/fstring.h" + #include "bu/string.h" -char *fstrdup( const Bu::FString &s ) +char *fstrdup( const Bu::String &s ) { char *sRet = new char[s.getSize()+1]; memcpy( sRet, s.getStr(), s.getSize()+1 ); @@ -17,7 +17,7 @@ char *rstrdup( const char *sIn ) } void build_error( YYLTYPE *locp, yyscan_t yyscanner, BuildParser &bld, const char *msg ); -Bu::FString sBuf; +Bu::String sBuf; int iStrDepth = 0; %} diff --git a/src/buildparser.cpp b/src/buildparser.cpp index 125a31e..f5c3132 100644 --- a/src/buildparser.cpp +++ b/src/buildparser.cpp @@ -17,7 +17,7 @@ BuildParser::~BuildParser() int build_parse( yyscan_t yyscanner, BuildParser &bld ); -void BuildParser::load( const Bu::FString &sFile ) +void BuildParser::load( const Bu::String &sFile ) { yyscan_t scanner; @@ -39,7 +39,7 @@ void BuildParser::load( const Bu::FString &sFile ) // Bu::sio << xAst; } -bool BuildParser::isKeyword( const Bu::FString &sStr ) +bool BuildParser::isKeyword( const Bu::String &sStr ) { if( sStr == "important" ) return true; @@ -52,7 +52,7 @@ bool BuildParser::isKeyword( const Bu::FString &sStr ) return false; } -bool BuildParser::isCond( const Bu::FString &sStr ) +bool BuildParser::isCond( const Bu::String &sStr ) { if( sStr == "filetime" ) return true; @@ -63,7 +63,7 @@ bool BuildParser::isCond( const Bu::FString &sStr ) return false; } -void BuildParser::include( const Bu::FString &sStr, void *scanner, YYLTYPE *loc ) +void BuildParser::include( const Bu::String &sStr, void *scanner, YYLTYPE *loc ) { for( StrList::iterator pi = lIncludePaths.begin(); pi; pi++ ) { @@ -80,12 +80,12 @@ void BuildParser::include( const Bu::FString &sStr, void *scanner, YYLTYPE *loc build__create_buffer( fIn, YY_READ_BUF_SIZE, scanner ), scanner ); - Bu::FString::const_iterator i = sStr.find('/'); + Bu::String::const_iterator i = sStr.find('/'); if( i ) { for(;;) { - Bu::FString::const_iterator j = i.find('/'); + Bu::String::const_iterator j = i.find('/'); if( !j ) break; i = j+1; @@ -99,7 +99,7 @@ void BuildParser::include( const Bu::FString &sStr, void *scanner, YYLTYPE *loc } return; } - Bu::FString msg("Could not open include file: "); + Bu::String msg("Could not open include file: "); msg += sStr; error( loc->first_line, loc->last_line, @@ -117,14 +117,14 @@ void BuildParser::endInclude( YYLTYPE *loc ) } void BuildParser::error( int iLine1, int iLine2, int iCol1, int iCol2, - const Bu::FString &sMsg ) + const Bu::String &sMsg ) { throw Bu::ExceptionBase("%s: %d-%d:%d-%d: %s", sFilename.peek().getStr(), iLine1, iLine2, iCol1, iCol2, sMsg.getStr() ); } -void BuildParser::addIncludePath( const Bu::FString &sPath ) +void BuildParser::addIncludePath( const Bu::String &sPath ) { lIncludePaths.append( sPath + "/" ); } diff --git a/src/buildparser.h b/src/buildparser.h index 8e2af6c..7e6e348 100644 --- a/src/buildparser.h +++ b/src/buildparser.h @@ -4,7 +4,7 @@ #include "build.tab.h" #include "bu/stack.h" -#include "bu/fstring.h" +#include "bu/string.h" #include "types.h" class BuildParser @@ -13,22 +13,22 @@ public: BuildParser( class Ast &rAst ); virtual ~BuildParser(); - void load( const Bu::FString &sFile ); + void load( const Bu::String &sFile ); - bool isKeyword( const Bu::FString &sStr ); - bool isCond( const Bu::FString &sStr ); - void include( const Bu::FString &sStr, void *scanner, YYLTYPE *loc ); + bool isKeyword( const Bu::String &sStr ); + bool isCond( const Bu::String &sStr ); + void include( const Bu::String &sStr, void *scanner, YYLTYPE *loc ); void endInclude( YYLTYPE *loc ); void error( int iLine1, int iLine2, int iCol1, int iCol2, - const Bu::FString &sMsg ); + const Bu::String &sMsg ); class Ast &xAst; - void addIncludePath( const Bu::FString &sPath ); + void addIncludePath( const Bu::String &sPath ); private: - Bu::Stack sFilename; + Bu::Stack sFilename; Bu::Stack sLocation; StrList lIncludePaths; }; diff --git a/src/cache.cpp b/src/cache.cpp index de505b8..d6269e3 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -15,7 +15,7 @@ Cache::~Cache() save(); } -void Cache::bind( const Bu::FString &sCacheFile ) +void Cache::bind( const Bu::String &sCacheFile ) { this->sCacheFile = sCacheFile; load(); @@ -51,12 +51,12 @@ void Cache::save() ar << hRequires << hVariables; } -StrList Cache::getRequires( const Bu::FString &sOutput ) +StrList Cache::getRequires( const Bu::String &sOutput ) { return hRequires.get( sOutput ); } -void Cache::setRequires( const Bu::FString &sOutput, StrList lReqs ) +void Cache::setRequires( const Bu::String &sOutput, StrList lReqs ) { hRequires.insert( sOutput, lReqs ); bCacheChanged = true; diff --git a/src/cache.h b/src/cache.h index 8932091..57df281 100644 --- a/src/cache.h +++ b/src/cache.h @@ -2,7 +2,7 @@ #define CACHE_H #include -#include +#include #include #include @@ -17,21 +17,21 @@ private: virtual ~Cache(); public: - void bind( const Bu::FString &sCacheFile ); + void bind( const Bu::String &sCacheFile ); void load(); void save(); - StrList getRequires( const Bu::FString &sOutput ); - void setRequires( const Bu::FString &sOutput, StrList lReqs ); + StrList getRequires( const Bu::String &sOutput ); + void setRequires( const Bu::String &sOutput, StrList lReqs ); private: bool bCacheChanged; - Bu::FString sCacheFile; + Bu::String sCacheFile; bool bIsLoaded; - typedef Bu::Hash ReqHash; + typedef Bu::Hash ReqHash; ReqHash hRequires; - typedef Bu::Hash VarHash; + typedef Bu::Hash VarHash; VarHash hVariables; }; diff --git a/src/conditionplugger.cpp b/src/conditionplugger.cpp index 3edfa00..53f613a 100644 --- a/src/conditionplugger.cpp +++ b/src/conditionplugger.cpp @@ -24,13 +24,13 @@ ConditionPlugger::ConditionPlugger() if( strncmp("pluginCondition", de->d_name, 15 ) ) continue; - Bu::FString sFile("/usr/lib/build/"); + Bu::String sFile("/usr/lib/build/"); sFile += de->d_name; char *s = de->d_name; for(; *s && *s != '.'; s++ ) { } registerExternalPlugin( sFile, - Bu::FString( de->d_name, (ptrdiff_t)s-(ptrdiff_t)de->d_name ) + Bu::String( de->d_name, (ptrdiff_t)s-(ptrdiff_t)de->d_name ) ); } diff --git a/src/context.cpp b/src/context.cpp index 1125248..dc2e6a1 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -42,7 +42,7 @@ void Context::addFunction( Function *pFunction ) hFunction.insert( pFunction->getName(), pFunction ); } -void Context::addVariable( const Bu::FString &sName, const Variable &vValue ) +void Context::addVariable( const Bu::String &sName, const Variable &vValue ) { for( ScopeStack::iterator i = sVars.begin(); i; i++ ) { @@ -61,12 +61,12 @@ void Context::addAction( Action *pAction ) hAction.insert( pAction->getName(), pAction ); } -Action *Context::getAction( const Bu::FString &sName ) +Action *Context::getAction( const Bu::String &sName ) { return hAction.get( sName ); } -void Context::addTargetToTag( Target *pTarget, const Bu::FString &sTag ) +void Context::addTargetToTag( Target *pTarget, const Bu::String &sTag ) { if( !hTag.has( sTag ) ) { @@ -83,12 +83,12 @@ void Context::addTargetToTags( Target *pTarget, const StrList &sTags ) } } -TargetList &Context::getTag( const Bu::FString &sTag ) +TargetList &Context::getTag( const Bu::String &sTag ) { return hTag.get( sTag ); } -Variable &Context::getVariable( const Bu::FString &sName ) +Variable &Context::getVariable( const Bu::String &sName ) { for( ScopeStack::iterator i = sVars.begin(); i; i++ ) { @@ -100,7 +100,7 @@ Variable &Context::getVariable( const Bu::FString &sName ) throw Bu::ExceptionBase("No such variable."); } -void Context::delVariable( const Bu::FString &sName ) +void Context::delVariable( const Bu::String &sName ) { for( ScopeStack::iterator i = sVars.begin(); i; i++ ) { @@ -150,7 +150,7 @@ void Context::popScope() sVars.pop(); } -Variable Context::call( const Bu::FString &sName, Variable &input, +Variable Context::call( const Bu::String &sName, Variable &input, VarList lParams ) { if( !hFunction.has( sName ) ) @@ -171,18 +171,18 @@ Variable Context::call( const Bu::FString &sName, Variable &input, #include using namespace Bu; -Bu::FString Context::expand( const Bu::FString &sInS ) +Bu::String Context::expand( const Bu::String &sInS ) { - Bu::FString sRet; - Bu::FString sIn = sInS; + Bu::String sRet; + Bu::String sIn = sInS; for( int iPass = 0; iPass < 2; iPass++ ) { - Bu::FString::const_iterator b = sIn.begin(); + Bu::String::const_iterator b = sIn.begin(); sRet.clear(); for(;;) { - Bu::FString::const_iterator e = b.find('$'); + Bu::String::const_iterator e = b.find('$'); if( !e ) { sRet.append( b ); @@ -198,7 +198,7 @@ Bu::FString Context::expand( const Bu::FString &sInS ) { b++; e = b.find('}'); - Bu::FString sVar( b, e ); + Bu::String sVar( b, e ); try { sRet.append( getVariable( sVar ).toString() ); @@ -214,8 +214,8 @@ Bu::FString Context::expand( const Bu::FString &sInS ) { b++; e = b.find(')'); - Bu::FString sCmd( b, e ); - Bu::FString sBuf; + Bu::String sCmd( b, e ); + Bu::String sBuf; try { //sio << "Executing command: >>>" << sCmd << "<<<" << sio.nl; @@ -250,7 +250,7 @@ Bu::FString Context::expand( const Bu::FString &sInS ) return sRet; } -Target *Context::getTarget( const Bu::FString &sOutput ) +Target *Context::getTarget( const Bu::String &sOutput ) { return hTarget.get( sOutput ); } @@ -347,7 +347,7 @@ void Context::buildTargetTree( Runner &r ) } } -void Context::buildTargetTree( class Runner &r, class Target *pTarget, const Bu::FString &sInput, Rule *pMaster, StrList &lNewIns ) +void Context::buildTargetTree( class Runner &r, class Target *pTarget, const Bu::String &sInput, Rule *pMaster, StrList &lNewIns ) { Target *pNewTarget = NULL; for( RuleHash::iterator i = hRule.begin(); i; i++ ) diff --git a/src/context.h b/src/context.h index 0d9aaff..4eaeb25 100644 --- a/src/context.h +++ b/src/context.h @@ -2,7 +2,7 @@ #define CONTEXT_H #include "bu/hash.h" -#include "bu/fstring.h" +#include "bu/string.h" #include "variable.h" @@ -22,27 +22,27 @@ public: void addTarget( Target *pTarget ); void addRule( Rule *pRule ); void addFunction( Function *pFunction ); - void addVariable( const Bu::FString &sName, const Variable &vValue ); + void addVariable( const Bu::String &sName, const Variable &vValue ); void addAction( Action *pAction ); - Action *getAction( const Bu::FString &sName ); + Action *getAction( const Bu::String &sName ); - void addTargetToTag( Target *pTarget, const Bu::FString &sTag ); + void addTargetToTag( Target *pTarget, const Bu::String &sTag ); void addTargetToTags( Target *pTarget, const StrList &sTags ); - TargetList &getTag( const Bu::FString &sTag ); + TargetList &getTag( const Bu::String &sTag ); - Variable &getVariable( const Bu::FString &sName ); - void delVariable( const Bu::FString &sName ); + Variable &getVariable( const Bu::String &sName ); + void delVariable( const Bu::String &sName ); void pushScope(); void pushScope( const VarHash &hNewVars ); VarHash &getScope(); void popScope(); - Variable call( const Bu::FString &sName, Variable &input, VarList lParams ); + Variable call( const Bu::String &sName, Variable &input, VarList lParams ); - Bu::FString expand( const Bu::FString &sIn ); + Bu::String expand( const Bu::String &sIn ); - Target *getTarget( const Bu::FString &sOutput ); + Target *getTarget( const Bu::String &sOutput ); TargetList getExplicitTargets(); /** @@ -77,15 +77,15 @@ public: void printBasicInfo(); private: - void buildTargetTree( class Runner &r, class Target *pTarget, const Bu::FString &sInput, class Rule *pMaster, StrList &lNewIns ); + void buildTargetTree( class Runner &r, class Target *pTarget, const Bu::String &sInput, class Rule *pMaster, StrList &lNewIns ); private: - typedef Bu::Hash TargetHash; - typedef Bu::Hash RuleHash; - typedef Bu::Hash FunctionHash; - typedef Bu::Hash ActionHash; + typedef Bu::Hash TargetHash; + typedef Bu::Hash RuleHash; + typedef Bu::Hash FunctionHash; + typedef Bu::Hash ActionHash; typedef Bu::List ScopeStack; - typedef Bu::Hash TagHash; + typedef Bu::Hash TagHash; TargetHash hTarget; RuleHash hRule; diff --git a/src/function.h b/src/function.h index 9573bd3..1575bfd 100644 --- a/src/function.h +++ b/src/function.h @@ -1,7 +1,7 @@ #ifndef FUNCTION_H #define FUNCTION_H -#include "bu/fstring.h" +#include "bu/string.h" #include "variable.h" class Function @@ -10,7 +10,7 @@ public: Function(); virtual ~Function(); - virtual Bu::FString getName() const=0; + virtual Bu::String getName() const=0; virtual Variable call( Variable &input, VarList lParams )=0; diff --git a/src/functionast.cpp b/src/functionast.cpp index ceee460..d4ec61f 100644 --- a/src/functionast.cpp +++ b/src/functionast.cpp @@ -20,7 +20,7 @@ FunctionAst::~FunctionAst() { } -Bu::FString FunctionAst::getName() const +Bu::String FunctionAst::getName() const { return sName; } diff --git a/src/functionast.h b/src/functionast.h index b971683..0de564f 100644 --- a/src/functionast.h +++ b/src/functionast.h @@ -9,11 +9,11 @@ public: FunctionAst( const class AstBranch *pRoot, class Runner *pRunner ); virtual ~FunctionAst(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); private: - Bu::FString sName; + Bu::String sName; const class AstBranch *pRoot; class Runner *pRunner; }; diff --git a/src/functiondirname.cpp b/src/functiondirname.cpp index f72d181..7fc3bf2 100644 --- a/src/functiondirname.cpp +++ b/src/functiondirname.cpp @@ -12,30 +12,30 @@ FunctionDirName::~FunctionDirName() { } -Bu::FString FunctionDirName::getName() const +Bu::String FunctionDirName::getName() const { return "dirName"; } Variable FunctionDirName::call( Variable &input, VarList /*lParams*/ ) { - Bu::FString sFile; + Bu::String sFile; sFile = input.getString(); - Bu::FString::const_iterator i = sFile.begin(); - Bu::FString::const_iterator io; + Bu::String::const_iterator i = sFile.begin(); + Bu::String::const_iterator io; for(;;) { - Bu::FString::const_iterator b = i.find('/'); + Bu::String::const_iterator b = i.find('/'); if( !b ) { - return Variable( Bu::FString( sFile.begin(), io ) ); + return Variable( Bu::String( sFile.begin(), io ) ); } io = b; i = b+1; if( !i ) { - return Variable( Bu::FString( sFile.begin(), io ) ); + return Variable( Bu::String( sFile.begin(), io ) ); } } } diff --git a/src/functiondirname.h b/src/functiondirname.h index 830a992..45a943e 100644 --- a/src/functiondirname.h +++ b/src/functiondirname.h @@ -9,7 +9,7 @@ public: FunctionDirName(); virtual ~FunctionDirName(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/functiondirs.cpp b/src/functiondirs.cpp index dee3c4c..e3b88dd 100644 --- a/src/functiondirs.cpp +++ b/src/functiondirs.cpp @@ -17,7 +17,7 @@ FunctionDirs::~FunctionDirs() { } -Bu::FString FunctionDirs::getName() const +Bu::String FunctionDirs::getName() const { return "dirs"; } diff --git a/src/functiondirs.h b/src/functiondirs.h index 5edfaf9..899c1ac 100644 --- a/src/functiondirs.h +++ b/src/functiondirs.h @@ -9,7 +9,7 @@ public: FunctionDirs(); virtual ~FunctionDirs(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/functionexecute.cpp b/src/functionexecute.cpp index 0b0aabf..070ca53 100644 --- a/src/functionexecute.cpp +++ b/src/functionexecute.cpp @@ -18,7 +18,7 @@ FunctionExecute::~FunctionExecute() { } -Bu::FString FunctionExecute::getName() const +Bu::String FunctionExecute::getName() const { return "execute"; } @@ -30,7 +30,7 @@ Variable FunctionExecute::call( Variable &/*input*/, VarList lParams ) pContext->getView()->cmdStarted( lParams.first().getString() ); Process pCmd( Process::Both, "/bin/bash", "/bin/bash", "-c", lParams.first().getString().getStr(), NULL ); - FString sStdOut, sStdErr; + String sStdOut, sStdErr; do { char buf[4096]; diff --git a/src/functionexecute.h b/src/functionexecute.h index ebeaa7f..b70a2c5 100644 --- a/src/functionexecute.h +++ b/src/functionexecute.h @@ -9,7 +9,7 @@ public: FunctionExecute(); virtual ~FunctionExecute(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/functionexists.cpp b/src/functionexists.cpp index 2207f84..5c71874 100644 --- a/src/functionexists.cpp +++ b/src/functionexists.cpp @@ -14,14 +14,14 @@ FunctionExists::~FunctionExists() { } -Bu::FString FunctionExists::getName() const +Bu::String FunctionExists::getName() const { return "exists"; } Variable FunctionExists::call( Variable &input, VarList lParams ) { - Bu::FString sFile; + Bu::String sFile; if( input.getType() != Variable::typeNone ) { sFile = input.toString(); diff --git a/src/functionexists.h b/src/functionexists.h index 8a3001a..f4629fb 100644 --- a/src/functionexists.h +++ b/src/functionexists.h @@ -9,7 +9,7 @@ public: FunctionExists(); virtual ~FunctionExists(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/functionfilename.cpp b/src/functionfilename.cpp index 57aada9..40f0048 100644 --- a/src/functionfilename.cpp +++ b/src/functionfilename.cpp @@ -12,28 +12,28 @@ FunctionFileName::~FunctionFileName() { } -Bu::FString FunctionFileName::getName() const +Bu::String FunctionFileName::getName() const { return "fileName"; } Variable FunctionFileName::call( Variable &input, VarList /*lParams*/ ) { - Bu::FString sFile; + Bu::String sFile; sFile = input.getString(); - Bu::FString::const_iterator i = sFile.begin(); + Bu::String::const_iterator i = sFile.begin(); for(;;) { - Bu::FString::const_iterator b = i.find('/'); + Bu::String::const_iterator b = i.find('/'); if( !b ) { - return Variable( Bu::FString( i ) ); + return Variable( Bu::String( i ) ); } i = b+1; if( !i ) { - return Variable( Bu::FString( i ) ); + return Variable( Bu::String( i ) ); } } } diff --git a/src/functionfilename.h b/src/functionfilename.h index 1401fc7..8f1cd13 100644 --- a/src/functionfilename.h +++ b/src/functionfilename.h @@ -9,7 +9,7 @@ public: FunctionFileName(); virtual ~FunctionFileName(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/functionfiles.cpp b/src/functionfiles.cpp index e0f8268..cd5b122 100644 --- a/src/functionfiles.cpp +++ b/src/functionfiles.cpp @@ -17,7 +17,7 @@ FunctionFiles::~FunctionFiles() { } -Bu::FString FunctionFiles::getName() const +Bu::String FunctionFiles::getName() const { return "files"; } diff --git a/src/functionfiles.h b/src/functionfiles.h index 711288a..3828c3e 100644 --- a/src/functionfiles.h +++ b/src/functionfiles.h @@ -9,7 +9,7 @@ public: FunctionFiles(); virtual ~FunctionFiles(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/functiongetmakedeps.cpp b/src/functiongetmakedeps.cpp index cfe5459..fda6aa2 100644 --- a/src/functiongetmakedeps.cpp +++ b/src/functiongetmakedeps.cpp @@ -18,7 +18,7 @@ FunctionGetMakeDeps::~FunctionGetMakeDeps() { } -Bu::FString FunctionGetMakeDeps::getName() const +Bu::String FunctionGetMakeDeps::getName() const { return "getMakeDeps"; } @@ -30,7 +30,7 @@ Variable FunctionGetMakeDeps::call( Variable &/*input*/, VarList lParams ) lParams.first().getString().getStr(), NULL ); // Gather all data from the command. - Bu::FString sBuf; + Bu::String sBuf; do { char buf[4096]; @@ -43,7 +43,7 @@ Variable FunctionGetMakeDeps::call( Variable &/*input*/, VarList lParams ) Variable vRet( Variable::typeList ); - Bu::FString::iterator i, j; + Bu::String::iterator i, j; i = sBuf.find(':')+2; while( i ) { @@ -51,7 +51,7 @@ Variable FunctionGetMakeDeps::call( Variable &/*input*/, VarList lParams ) // always a space after a word for( j = i; j && *j != ' ' && *j != '\n' && *j != '\r'; j++ ) { } - Bu::FString sTmp( i, j ); + Bu::String sTmp( i, j ); vRet.append( sTmp ); // Find the begining of the next word, trickier, we don't want to go diff --git a/src/functiongetmakedeps.h b/src/functiongetmakedeps.h index b8f20d5..566a96b 100644 --- a/src/functiongetmakedeps.h +++ b/src/functiongetmakedeps.h @@ -9,7 +9,7 @@ public: FunctionGetMakeDeps(); virtual ~FunctionGetMakeDeps(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/functionmatches.cpp b/src/functionmatches.cpp index 5b96fa8..0f76316 100644 --- a/src/functionmatches.cpp +++ b/src/functionmatches.cpp @@ -14,14 +14,14 @@ FunctionMatches::~FunctionMatches() { } -Bu::FString FunctionMatches::getName() const +Bu::String FunctionMatches::getName() const { return "matches"; } -bool FunctionMatches::globcmp( const Bu::FString &sTxt, const Bu::FString &sMatches ) +bool FunctionMatches::globcmp( const Bu::String &sTxt, const Bu::String &sMatches ) { - Bu::FString::const_iterator t, g; + Bu::String::const_iterator t, g; t = sTxt.begin(); g = sMatches.begin(); @@ -36,7 +36,7 @@ bool FunctionMatches::globcmp( const Bu::FString &sTxt, const Bu::FString &sMatc return true; // Now attempt to scan for the remainder as a matched set { - Bu::FString::const_iterator tn = t+1, gn = g+1, gi=g+1; + Bu::String::const_iterator tn = t+1, gn = g+1, gi=g+1; bool bFoundMatch = false; while( tn && gn ) { @@ -87,7 +87,7 @@ bool FunctionMatches::globcmp( const Bu::FString &sTxt, const Bu::FString &sMatc return true; } -bool FunctionMatches::matchlist( const Bu::FString &sTxt, VarList &lParams ) +bool FunctionMatches::matchlist( const Bu::String &sTxt, VarList &lParams ) { for( VarList::iterator i = lParams.begin(); i; i++ ) { @@ -114,7 +114,7 @@ Variable FunctionMatches::call( Variable &input, VarList lParams ) { case Variable::typeString: { - Bu::FString sTxt = input.getString(); + Bu::String sTxt = input.getString(); return Variable( matchlist( sTxt, lParams ) ); } break; @@ -126,7 +126,7 @@ Variable FunctionMatches::call( Variable &input, VarList lParams ) { if( (*i).getType() != Variable::typeString ) continue; - Bu::FString sTxt = (*i).getString(); + Bu::String sTxt = (*i).getString(); if( matchlist( sTxt, lParams ) ) vRet.append( *i ); } diff --git a/src/functionmatches.h b/src/functionmatches.h index 7757a44..92ffe26 100644 --- a/src/functionmatches.h +++ b/src/functionmatches.h @@ -13,9 +13,9 @@ public: * Really basic globbing function, it doesn't handle character classes, * just * and ?. We can expand on it later, it may be handy. */ - bool globcmp( const Bu::FString &sTxt, const Bu::FString &sMatches ); - bool matchlist( const Bu::FString &sTxt, VarList &lParams ); - virtual Bu::FString getName() const; + bool globcmp( const Bu::String &sTxt, const Bu::String &sMatches ); + bool matchlist( const Bu::String &sTxt, VarList &lParams ); + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/functionplugger.cpp b/src/functionplugger.cpp index c8d3fd2..035e5b9 100644 --- a/src/functionplugger.cpp +++ b/src/functionplugger.cpp @@ -42,13 +42,13 @@ FunctionPlugger::FunctionPlugger() if( strncmp("pluginFunction", de->d_name, 15 ) ) continue; - Bu::FString sFile("/usr/lib/build/"); + Bu::String sFile("/usr/lib/build/"); sFile += de->d_name; char *s = de->d_name; for(; *s && *s != '.'; s++ ) { } registerExternalPlugin( sFile, - Bu::FString( de->d_name, (ptrdiff_t)s-(ptrdiff_t)de->d_name ) + Bu::String( de->d_name, (ptrdiff_t)s-(ptrdiff_t)de->d_name ) ); } diff --git a/src/functionregex.cpp b/src/functionregex.cpp index f0abc35..c80f527 100644 --- a/src/functionregex.cpp +++ b/src/functionregex.cpp @@ -13,7 +13,7 @@ FunctionRegEx::~FunctionRegEx() { } -Bu::FString FunctionRegEx::getName() const +Bu::String FunctionRegEx::getName() const { return "regex"; } @@ -47,7 +47,7 @@ Variable FunctionRegEx::call( Variable &input, VarList lParams ) else if( lParams.getSize() == 2 ) { Bu::RegEx re( lParams.first().getString() ); - Bu::FString sPat = lParams.last().getString(); + Bu::String sPat = lParams.last().getString(); switch( input.getType() ) { case Variable::typeString: @@ -83,10 +83,10 @@ Variable FunctionRegEx::call( Variable &input, VarList lParams ) "regex does not work on non-string or non-list types."); } -Bu::FString FunctionRegEx::replace( Bu::RegEx &re, const Bu::FString &sSrc, - const Bu::FString &sPat ) +Bu::String FunctionRegEx::replace( Bu::RegEx &re, const Bu::String &sSrc, + const Bu::String &sPat ) { - Bu::FString sOut; + Bu::String sOut; int iStart, iEnd; re.getSubStringRange( 0, iStart, iEnd ); // Get the range of the full match @@ -94,7 +94,7 @@ Bu::FString FunctionRegEx::replace( Bu::RegEx &re, const Bu::FString &sSrc, if( iStart > 0 ) sOut.append( sSrc, 0, iStart ); - for( Bu::FString::const_iterator i = sPat.begin(); i; i++ ) + for( Bu::String::const_iterator i = sPat.begin(); i; i++ ) { if( *i == '\\' ) { diff --git a/src/functionregex.h b/src/functionregex.h index 2096a64..edc21c6 100644 --- a/src/functionregex.h +++ b/src/functionregex.h @@ -14,11 +14,11 @@ public: FunctionRegEx(); virtual ~FunctionRegEx(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); - Bu::FString replace( Bu::RegEx &re, const Bu::FString &sSrc, - const Bu::FString &sPat ); + Bu::String replace( Bu::RegEx &re, const Bu::String &sSrc, + const Bu::String &sPat ); }; #endif diff --git a/src/functionreplace.cpp b/src/functionreplace.cpp index b341e44..589ef55 100644 --- a/src/functionreplace.cpp +++ b/src/functionreplace.cpp @@ -12,14 +12,14 @@ FunctionReplace::~FunctionReplace() { } -Bu::FString FunctionReplace::getName() const +Bu::String FunctionReplace::getName() const { return "replace"; } Variable FunctionReplace::call( Variable &input, VarList lParams ) { - Bu::FString sA, sB; + Bu::String sA, sB; sA = lParams.first().getString(); sB = lParams.last().getString(); switch( input.getType() ) diff --git a/src/functionreplace.h b/src/functionreplace.h index 1bf4dae..05442d8 100644 --- a/src/functionreplace.h +++ b/src/functionreplace.h @@ -9,7 +9,7 @@ public: FunctionReplace(); virtual ~FunctionReplace(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/functiontargets.cpp b/src/functiontargets.cpp index adafdfb..3fd145e 100644 --- a/src/functiontargets.cpp +++ b/src/functiontargets.cpp @@ -14,7 +14,7 @@ FunctionTargets::~FunctionTargets() { } -Bu::FString FunctionTargets::getName() const +Bu::String FunctionTargets::getName() const { return "targets"; } diff --git a/src/functiontargets.h b/src/functiontargets.h index 9b65d30..a6e7d21 100644 --- a/src/functiontargets.h +++ b/src/functiontargets.h @@ -9,7 +9,7 @@ public: FunctionTargets(); virtual ~FunctionTargets(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/functiontostring.cpp b/src/functiontostring.cpp index 1d614ce..bc5db6c 100644 --- a/src/functiontostring.cpp +++ b/src/functiontostring.cpp @@ -16,15 +16,15 @@ FunctionToString::~FunctionToString() { } -Bu::FString FunctionToString::getName() const +Bu::String FunctionToString::getName() const { return "toString"; } Variable FunctionToString::call( Variable &input, VarList lParams ) { - Bu::FString sStr; - Bu::FString sSep; + Bu::String sStr; + Bu::String sSep; if( lParams.getSize() == 0 ) { sSep = " "; diff --git a/src/functiontostring.h b/src/functiontostring.h index 3c3ecc7..c5bc50d 100644 --- a/src/functiontostring.h +++ b/src/functiontostring.h @@ -9,7 +9,7 @@ public: FunctionToString(); virtual ~FunctionToString(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/functionunlink.cpp b/src/functionunlink.cpp index d8ad899..48985bb 100644 --- a/src/functionunlink.cpp +++ b/src/functionunlink.cpp @@ -17,7 +17,7 @@ FunctionUnlink::~FunctionUnlink() { } -Bu::FString FunctionUnlink::getName() const +Bu::String FunctionUnlink::getName() const { return "unlink"; } diff --git a/src/functionunlink.h b/src/functionunlink.h index ac3f21e..ab95615 100644 --- a/src/functionunlink.h +++ b/src/functionunlink.h @@ -9,7 +9,7 @@ public: FunctionUnlink(); virtual ~FunctionUnlink(); - virtual Bu::FString getName() const; + virtual Bu::String getName() const; virtual Variable call( Variable &input, VarList lParams ); }; diff --git a/src/location.cpp b/src/location.cpp index 03b8b43..933379c 100644 --- a/src/location.cpp +++ b/src/location.cpp @@ -19,7 +19,7 @@ Location::Location( struct YYLTYPE &loc ) : { } -Location::Location( const Bu::FString &sFile, int iStartRow, int iStartCol, +Location::Location( const Bu::String &sFile, int iStartRow, int iStartCol, int iEndRow, int iEndCol ) : sFile( sFile ), iStartRow( iStartRow ), diff --git a/src/location.h b/src/location.h index 76699e3..db329bb 100644 --- a/src/location.h +++ b/src/location.h @@ -1,19 +1,19 @@ #ifndef LOCATION_H #define LOCATION_H -#include +#include class Location { public: Location(); Location( struct YYLTYPE &loc ); - Location( const Bu::FString &sFile, int iStartRow, int iStartCol, + Location( const Bu::String &sFile, int iStartRow, int iStartCol, int iEndRow, int iEndCol ); virtual ~Location(); private: - const Bu::FString sFile; + const Bu::String sFile; int iStartRow; int iStartCol; int iEndRow; diff --git a/src/main.cpp b/src/main.cpp index 7637443..caa33e6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,7 +40,7 @@ public: bool bClean = false; addHelpBanner("build mark 3\n"); - Bu::FString sViews("Select a view from: "); + Bu::String sViews("Select a view from: "); StrList lViews = ViewPlugger::getInstance().getPluginList(); for( StrList::iterator i = lViews.begin(); i; i++ ) { @@ -159,10 +159,10 @@ public: return 0; } - Bu::FString sView; - Bu::FString sAction; - Bu::FString sConfig; - Bu::FString sCacheFile; + Bu::String sView; + Bu::String sAction; + Bu::String sConfig; + Bu::String sCacheFile; bool bDot; bool bDebug; bool bAutoInclude; @@ -174,7 +174,7 @@ public: int main( int argc, char *argv[] ) { - typedef Bu::List StrList; + typedef Bu::List StrList; StrList lShareList; lShareList.append("/usr/share/build/").append("./share/"); Ast ast; @@ -221,8 +221,8 @@ int main( int argc, char *argv[] ) int iSplit; for( iSplit = 0; (*env)[iSplit] != '='; iSplit++ ) { } cnt.addVariable( - FString( *env, iSplit ), - FString( *env+iSplit+1 ) + String( *env, iSplit ), + String( *env+iSplit+1 ) ); } } @@ -230,7 +230,7 @@ int main( int argc, char *argv[] ) if( opts.bAutoInclude ) { DIR *d; - Bu::FString sAutoDir; + Bu::String sAutoDir; for( StrList::iterator i = lShareList.begin(); i; i++ ) { sAutoDir = *i + "autoinclude"; diff --git a/src/profile.cpp b/src/profile.cpp index fd21097..a9c1d5b 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -35,7 +35,7 @@ Profile::~Profile() pAst = NULL; } -const Bu::FString &Profile::getName() const +const Bu::String &Profile::getName() const { return sName; } @@ -86,7 +86,7 @@ void Profile::setCondition() { if( (*i)->getType() == AstNode::typeCondition ) { - Bu::FString sCond = dynamic_cast(*i)->getStrValue(); + Bu::String sCond = dynamic_cast(*i)->getStrValue(); delete pCond; pCond = ConditionPlugger::getInstance().instantiate( sCond ); } diff --git a/src/profile.h b/src/profile.h index dbcc1ea..4f89306 100644 --- a/src/profile.h +++ b/src/profile.h @@ -1,7 +1,7 @@ #ifndef PROFILE_H #define PROFILE_H -#include +#include class Profile { @@ -10,7 +10,7 @@ public: Profile( const Profile &rSrc ); virtual ~Profile(); - const Bu::FString &getName() const; + const Bu::String &getName() const; const class AstBranch *getRoot() const; const class Condition *getCond() const; bool shouldExec( class Runner &r, class Target &rTarget ) const; @@ -21,7 +21,7 @@ private: void setCondition(); private: - Bu::FString sName; + Bu::String sName; const class AstBranch *pRoot; class Condition *pCond; class Ast *pAst; diff --git a/src/rule.cpp b/src/rule.cpp index 2cbb2ad..81e775e 100644 --- a/src/rule.cpp +++ b/src/rule.cpp @@ -11,7 +11,7 @@ #include using namespace Bu; -Rule::Rule( const Bu::FString &sName ) : +Rule::Rule( const Bu::String &sName ) : sName( sName ), pInput( NULL ) { @@ -21,7 +21,7 @@ Rule::~Rule() { } -const Bu::FString &Rule::getName() const +const Bu::String &Rule::getName() const { return sName; } @@ -73,7 +73,7 @@ void Rule::prepTarget( class Target *pTarget ) } } -Target *Rule::createTarget( class Runner &r, const Bu::FString &sInput, +Target *Rule::createTarget( class Runner &r, const Bu::String &sInput, Target *pParent ) { r.getContext().pushScope( pParent->getVars() ); @@ -114,7 +114,7 @@ Target *Rule::createTarget( class Runner &r, const Bu::FString &sInput, return pTrg; } -bool Rule::ruleMatches( Runner &r, const Bu::FString &sInput ) +bool Rule::ruleMatches( Runner &r, const Bu::String &sInput ) { r.getContext().pushScope(); r.getContext().addVariable("INPUT", sInput ); @@ -131,7 +131,7 @@ bool Rule::ruleMatches( Runner &r, const Bu::FString &sInput ) return false; } -void Rule::addTag( const Bu::FString &sTag ) +void Rule::addTag( const Bu::String &sTag ) { lsTags.append( sTag ); } @@ -141,12 +141,12 @@ const StrList &Rule::getTagList() const return lsTags; } -void Rule::setDisplay( const Bu::FString &sStr ) +void Rule::setDisplay( const Bu::String &sStr ) { sDisplay = sStr; } -const Bu::FString &Rule::getDisplay() const +const Bu::String &Rule::getDisplay() const { return (sDisplay.isSet())?(sDisplay):(sName); } diff --git a/src/rule.h b/src/rule.h index 5344d02..d8accf0 100644 --- a/src/rule.h +++ b/src/rule.h @@ -8,10 +8,10 @@ class Rule { friend Bu::Formatter &operator<<( Bu::Formatter &f, const Rule &t ); public: - Rule( const Bu::FString &sName ); + Rule( const Bu::String &sName ); virtual ~Rule(); - const Bu::FString &getName() const; + const Bu::String &getName() const; void setInput( const AstBranch *pNewInput ); const AstBranch *getInput() const; @@ -22,21 +22,21 @@ public: void addProfile( const AstBranch *pProfile ); void prepTarget( class Target *pTarget ); - class Target *createTarget( class Runner &r, const Bu::FString &sInput, + class Target *createTarget( class Runner &r, const Bu::String &sInput, class Target *pParent ); - bool ruleMatches( class Runner &r, const Bu::FString &sInput ); + bool ruleMatches( class Runner &r, const Bu::String &sInput ); - void addTag( const Bu::FString &sTag ); + void addTag( const Bu::String &sTag ); const StrList &getTagList() const; - void setDisplay( const Bu::FString &sStr ); - const Bu::FString &getDisplay() const; + void setDisplay( const Bu::String &sStr ); + const Bu::String &getDisplay() const; void addRequires( const AstBranch *pBr ); private: - Bu::FString sName; - Bu::FString sDisplay; + Bu::String sName; + Bu::String sDisplay; const AstBranch *pInput; AstBranchList lOutput; ProfileHash hProfiles; diff --git a/src/runner.cpp b/src/runner.cpp index e1f3da9..64ad8e8 100644 --- a/src/runner.cpp +++ b/src/runner.cpp @@ -47,7 +47,7 @@ void Runner::initialize() Variable Runner::execFunc( const AstBranch *pFunc, Variable &vIn ) { - Bu::FString sName = dynamic_cast( + Bu::String sName = dynamic_cast( (*pFunc->getBranchBegin()).first())->getStrValue(); VarList lParams; @@ -382,7 +382,7 @@ Variable Runner::run( AstBranch::NodeList::const_iterator n ) { case AstNode::typeError: { - Bu::FString sMsg = rCont.expand( pExpr->getStrValue() ); + Bu::String sMsg = rCont.expand( pExpr->getStrValue() ); rCont.getView()->userError( sMsg.getStr() ); throw Bu::ExceptionBase( sMsg.getStr() ); } @@ -470,7 +470,7 @@ Variable Runner::run( AstBranch::NodeList::const_iterator n ) { AstBranch::NodeList::const_iterator n = (*pExpr->getBranchBegin()).begin(); - Bu::FString sVar = dynamic_cast( + Bu::String sVar = dynamic_cast( *n )->getStrValue(); rCont.delVariable( sVar ); } @@ -511,7 +511,7 @@ Variable Runner::run( AstBranch::NodeList::const_iterator n ) { AstBranch::BranchList::const_iterator b = pExpr->getBranchBegin(); - Bu::FString sVar = dynamic_cast( + Bu::String sVar = dynamic_cast( (*b).first() )->getStrValue(); b++; Variable v = execExpr( (*b).begin() ); @@ -585,7 +585,7 @@ Variable Runner::run( AstBranch::NodeList::const_iterator n ) { AstBranch::BranchList::const_iterator b = pExpr->getBranchBegin(); - Bu::FString sName = dynamic_cast( + Bu::String sName = dynamic_cast( (*b).first() )->getStrValue(); b++; @@ -709,7 +709,7 @@ Variable Runner::run( AstBranch::NodeList::const_iterator n ) { AstBranch::BranchList::const_iterator b = pExpr->getBranchBegin(); - Bu::FString sProfile = dynamic_cast( + Bu::String sProfile = dynamic_cast( (*b).first() )->getStrValue(); b++; @@ -747,7 +747,7 @@ Variable Runner::run( AstBranch::NodeList::const_iterator n ) } else { - Bu::FString sTag = vTags.toString(); + Bu::String sTag = vTags.toString(); if( sTag.isSet() ) { rCont.addTargetToTag( pCurTarget, sTag ); @@ -774,7 +774,7 @@ Variable Runner::run( AstBranch::NodeList::const_iterator n ) } else { - Bu::FString sTag = vTags.toString(); + Bu::String sTag = vTags.toString(); if( sTag.isSet() ) { pCurRule->addTag( sTag ); @@ -810,7 +810,7 @@ Variable Runner::run( AstBranch::NodeList::const_iterator n ) return vReturn; } -void Runner::execProfile( Target *pTarget, const Bu::FString &sProfile ) +void Runner::execProfile( Target *pTarget, const Bu::String &sProfile ) { rCont.pushScope( pTarget->getVars() ); run( (*(pTarget->getProfile( sProfile )->getRoot()-> @@ -818,7 +818,7 @@ void Runner::execProfile( Target *pTarget, const Bu::FString &sProfile ) rCont.popScope(); } -void Runner::execAction( const Bu::FString &sName ) +void Runner::execAction( const Bu::String &sName ) { try { @@ -828,7 +828,7 @@ void Runner::execAction( const Bu::FString &sName ) } catch( Bu::HashException &e ) { - Bu::FString sError("No such action '" + sName + "' found."); + Bu::String sError("No such action '" + sName + "' found."); rCont.getView()->sysError( sError ); } } @@ -838,7 +838,7 @@ Context &Runner::getContext() return rCont; } -Target *Runner::buildTarget( const Bu::FString &sOutput, +Target *Runner::buildTarget( const Bu::String &sOutput, AstBranch::NodeList::const_iterator n ) { Target *pTrg = NULL; @@ -868,7 +868,7 @@ Target *Runner::buildTarget( const Bu::FString &sOutput, return pTrg; } -Rule *Runner::buildRule( const Bu::FString &sName, +Rule *Runner::buildRule( const Bu::String &sName, AstBranch::NodeList::const_iterator n ) { Rule *pRule = new Rule( sName ); @@ -886,7 +886,7 @@ Variable Runner::doSet( const AstBranch *pRoot ) { AstBranch::NodeList::const_iterator n = (*pRoot->getBranchBegin()).begin(); - Bu::FString sVar = dynamic_cast( *n )->getStrValue(); + Bu::String sVar = dynamic_cast( *n )->getStrValue(); n++; const AstLeaf *pLeaf = dynamic_cast( *n ); n++; diff --git a/src/runner.h b/src/runner.h index 98894da..0efcb44 100644 --- a/src/runner.h +++ b/src/runner.h @@ -20,15 +20,15 @@ public: Variable run( AstBranch::NodeList::const_iterator n ); class Variable execFunc( const class AstBranch *pFunc, class Variable &vIn ); - void execProfile( class Target *pTarget, const Bu::FString &sProfile ); - void execAction( const Bu::FString &sName ); + void execProfile( class Target *pTarget, const Bu::String &sProfile ); + void execAction( const Bu::String &sName ); Context &getContext(); private: - class Target *buildTarget( const Bu::FString &sOutput, + class Target *buildTarget( const Bu::String &sOutput, AstBranch::NodeList::const_iterator n ); - class Rule *buildRule( const Bu::FString &sName, + class Rule *buildRule( const Bu::String &sName, AstBranch::NodeList::const_iterator n ); void attachDefaults(); Variable doSet( const AstBranch *pRoot ); diff --git a/src/target.cpp b/src/target.cpp index 958fcf5..3a90c01 100644 --- a/src/target.cpp +++ b/src/target.cpp @@ -23,7 +23,7 @@ Target::Target( bool bExplicit ) : { } -Target::Target( const Bu::FString &sOutput, bool bExplicit ) : +Target::Target( const Bu::String &sOutput, bool bExplicit ) : bExplicit( bExplicit ), lsOutput( sOutput ), iDepCount( 0 ) @@ -34,7 +34,7 @@ Target::~Target() { } -void Target::addInput( const Bu::FString &sInput ) +void Target::addInput( const Bu::String &sInput ) { lsInput.append( sInput ); } @@ -62,7 +62,7 @@ void Target::resetInputList( const StrList &lInputs ) } } -void Target::addRequires( const Bu::FString &sReq ) +void Target::addRequires( const Bu::String &sReq ) { lsRequires.append( sReq ); } @@ -101,7 +101,7 @@ void Target::buildRequires( Runner &r ) { for( VarList::iterator j = v.begin(); j; j++ ) { - Bu::FString sReq = (*j).toString(); + Bu::String sReq = (*j).toString(); addRequires( sReq ); /* try { @@ -112,7 +112,7 @@ void Target::buildRequires( Runner &r ) } else { - Bu::FString sReq = v.toString(); + Bu::String sReq = v.toString(); addRequires( sReq ); /* try { @@ -127,7 +127,7 @@ void Target::buildRequires( Runner &r ) c.setRequires( lsOutput.first(), lsRequires ); } -void Target::addOutput( const Bu::FString &sOutput ) +void Target::addOutput( const Bu::String &sOutput ) { lsOutput.append( sOutput ); } @@ -137,22 +137,22 @@ const StrList &Target::getOutputList() const return lsOutput; } -void Target::setPrefix( const Bu::FString &sPrefix ) +void Target::setPrefix( const Bu::String &sPrefix ) { this->sPrefix = sPrefix; } -const Bu::FString &Target::getPrefix() const +const Bu::String &Target::getPrefix() const { return sPrefix; } -void Target::setRule( const Bu::FString &sRule ) +void Target::setRule( const Bu::String &sRule ) { this->sRule = sRule; } -const Bu::FString &Target::getRule() const +const Bu::String &Target::getRule() const { return sRule; } @@ -196,12 +196,12 @@ void Target::addProfile( const class Profile *pSrc ) hProfiles.insert( pSrc->getName(), new Profile( *pSrc ) ); } -bool Target::hasProfile( const Bu::FString &sName ) const +bool Target::hasProfile( const Bu::String &sName ) const { return hProfiles.has( sName ); } -const Profile *Target::getProfile( const Bu::FString &sName ) const +const Profile *Target::getProfile( const Bu::String &sName ) const { return hProfiles.get( sName ); } @@ -217,18 +217,18 @@ const VarHash &Target::getVars() const return hVars; } -void Target::setDisplay( const Bu::FString &sNewDisplay ) +void Target::setDisplay( const Bu::String &sNewDisplay ) { if( !sDisplay.isSet() ) sDisplay = sNewDisplay; } -const Bu::FString &Target::getDisplay() const +const Bu::String &Target::getDisplay() const { return sDisplay; } -void Target::process( class Runner &r, const Bu::FString &sProfile ) +void Target::process( class Runner &r, const Bu::String &sProfile ) { r.getContext().getView()->beginTarget( sProfile, *this ); bRun = true; @@ -320,7 +320,7 @@ void Target::mergeUnder( const Target *pSrc ) void Target::merge( StrList &lOut, const StrList &lIn ) { - Bu::Heap hStr; + Bu::Heap hStr; for( StrList::const_iterator i = lOut.begin(); i; i++ ) { hStr.enqueue( *i ); diff --git a/src/target.h b/src/target.h index 25af1f4..b325682 100644 --- a/src/target.h +++ b/src/target.h @@ -9,14 +9,14 @@ class Target friend Bu::Formatter &operator<<( Bu::Formatter &f, const Target &t ); public: Target( bool bExplicit ); - Target( const Bu::FString &sOutput, bool bExplicit ); + Target( const Bu::String &sOutput, bool bExplicit ); virtual ~Target(); - void addInput( const Bu::FString &sInput ); + void addInput( const Bu::String &sInput ); const StrList &getInputList() const; void resetInputList( const StrList &lInputs ); - void addRequires( const Bu::FString &sReq ); + void addRequires( const Bu::String &sReq ); void addRequires( const AstBranch *pBr ); const StrList &getRequiresList() const; /** @@ -27,14 +27,14 @@ public: void gatherRequires( class Runner &r ); void buildRequires( class Runner &r ); - void addOutput( const Bu::FString &sOutput ); + void addOutput( const Bu::String &sOutput ); const StrList &getOutputList() const; - void setPrefix( const Bu::FString &sPrefix ); - const Bu::FString &getPrefix() const; + void setPrefix( const Bu::String &sPrefix ); + const Bu::String &getPrefix() const; - void setRule( const Bu::FString &sRule ); - const Bu::FString &getRule() const; + void setRule( const Bu::String &sRule ); + const Bu::String &getRule() const; bool hasRule() const; bool isExplicit() const; @@ -44,16 +44,16 @@ public: void addProfile( const class AstBranch *pProfRoot ); void addProfile( const class Profile *pSrc ); - bool hasProfile( const Bu::FString &sName ) const; - const class Profile *getProfile( const Bu::FString &sName ) const; + bool hasProfile( const Bu::String &sName ) const; + const class Profile *getProfile( const Bu::String &sName ) const; void setVars( const VarHash &hNewVars ); const VarHash &getVars() const; - void setDisplay( const Bu::FString &sNewDisplay ); - const Bu::FString &getDisplay() const; + void setDisplay( const Bu::String &sNewDisplay ); + const Bu::String &getDisplay() const; - void process( class Runner &r, const Bu::FString &sProfile ); + void process( class Runner &r, const Bu::String &sProfile ); void mergeUnder( const Target *pSrc ); @@ -74,12 +74,12 @@ private: StrList lsInput; StrList lsRequires; StrList lsOutput; - Bu::FString sPrefix; - Bu::FString sRule; + Bu::String sPrefix; + Bu::String sRule; VarHash hVars; TargetList lDeps; ProfileHash hProfiles; - Bu::FString sDisplay; + Bu::String sDisplay; bool bRun; AstBranchList lbRequires; int iDepCount; diff --git a/src/types.h b/src/types.h index e405e35..9b8ecdf 100644 --- a/src/types.h +++ b/src/types.h @@ -1,22 +1,22 @@ #ifndef TYPES_H #define TYPES_H -#include "bu/fstring.h" +#include "bu/string.h" #include "bu/list.h" #include "bu/hash.h" -typedef Bu::List StrList; +typedef Bu::List StrList; class Variable; typedef Bu::List VarList; -typedef Bu::Hash VarHash; +typedef Bu::Hash VarHash; class Condition; class Target; typedef Bu::List TargetList; class Profile; -typedef Bu::Hash ProfileHash; +typedef Bu::Hash ProfileHash; class AstNode; class AstBranch; diff --git a/src/variable.cpp b/src/variable.cpp index 87571b6..494338d 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -17,7 +17,7 @@ Variable::Variable( Type t ) : memset( &uVal, 0, sizeof(uVal) ); if( eType == typeString || eType == typeRef ) { - uVal.sVal = new Bu::FString; + uVal.sVal = new Bu::String; } else if( eType == typeList ) { @@ -46,18 +46,18 @@ Variable::Variable( bool bVal ) : uVal.bVal = bVal; } -Variable::Variable( const Bu::FString &sVal ) : +Variable::Variable( const Bu::String &sVal ) : eType( typeString ) { memset( &uVal, 0, sizeof(uVal) ); - uVal.sVal = new Bu::FString( sVal ); + uVal.sVal = new Bu::String( sVal ); } Variable::Variable( const char *sVal ) : eType( typeString ) { memset( &uVal, 0, sizeof(uVal) ); - uVal.sVal = new Bu::FString( sVal ); + uVal.sVal = new Bu::String( sVal ); } Variable::Variable( const Variable &v ) : @@ -66,7 +66,7 @@ Variable::Variable( const Variable &v ) : memset( &uVal, 0, sizeof(uVal) ); if( eType == typeString || eType == typeRef ) { - uVal.sVal = new Bu::FString( *v.uVal.sVal ); + uVal.sVal = new Bu::String( *v.uVal.sVal ); } else if( eType == typeList ) { @@ -99,7 +99,7 @@ Variable::Variable( const class AstLeaf &l ) case AstNode::typeDataString: eType = typeString; - uVal.sVal = new Bu::FString( l.getStrValue() ); + uVal.sVal = new Bu::String( l.getStrValue() ); break; case AstNode::typeDataNone: @@ -118,7 +118,7 @@ Variable::Variable( const StrList &lst ) if( lst.getSize() == 1 ) { eType = typeString; - uVal.sVal = new Bu::FString( lst.first() ); + uVal.sVal = new Bu::String( lst.first() ); } else { @@ -149,7 +149,7 @@ Variable::~Variable() } } -Variable Variable::mkRef( const Bu::FString &sVal ) +Variable Variable::mkRef( const Bu::String &sVal ) { Variable v( typeRef ); (*v.uVal.sVal) = sVal; @@ -179,7 +179,7 @@ bool Variable::getBool() const return uVal.bVal; } -const Bu::FString &Variable::getString() const +const Bu::String &Variable::getString() const { if( eType != typeString && eType != typeRef ) throw Bu::ExceptionBase("Wrong variable type."); return *uVal.sVal; @@ -263,9 +263,9 @@ bool Variable::toBool() const return false; } -Bu::FString Variable::toString() const +Bu::String Variable::toString() const { - Bu::FString sRet; + Bu::String sRet; switch( eType ) { case typeNone: @@ -417,7 +417,7 @@ const Variable &Variable::operator=( const Variable &rhs ) reset( rhs.eType ); if( rhs.eType == typeString || rhs.eType == typeRef ) { - uVal.sVal = new Bu::FString( *rhs.uVal.sVal ); + uVal.sVal = new Bu::String( *rhs.uVal.sVal ); } else if( rhs.eType == typeList ) { @@ -455,10 +455,10 @@ const Variable &Variable::operator=( const bool &rhs ) return *this; } -const Variable &Variable::operator=( const Bu::FString &rhs ) +const Variable &Variable::operator=( const Bu::String &rhs ) { reset( typeString ); - uVal.sVal = new Bu::FString( rhs ); + uVal.sVal = new Bu::String( rhs ); return *this; } @@ -471,7 +471,7 @@ const Variable &Variable::operator+=( const Variable &rhs ) reset( rhs.eType ); if( eType == typeString || eType == typeRef ) { - uVal.sVal = new Bu::FString( *rhs.uVal.sVal ); + uVal.sVal = new Bu::String( *rhs.uVal.sVal ); } else if( eType == typeList ) { @@ -521,7 +521,7 @@ const Variable &Variable::operator<<( const Variable &rhs ) reset( rhs.eType ); if( eType == typeString ) { - uVal.sVal = new Bu::FString( *rhs.uVal.sVal ); + uVal.sVal = new Bu::String( *rhs.uVal.sVal ); } else if( eType == typeList ) { diff --git a/src/variable.h b/src/variable.h index c8679a8..260c96a 100644 --- a/src/variable.h +++ b/src/variable.h @@ -30,7 +30,7 @@ public: Variable( int iVal ); Variable( double fVal ); Variable( bool bVal ); - Variable( const Bu::FString &sVal ); + Variable( const Bu::String &sVal ); Variable( const char *sVal ); Variable( const Variable &v ); Variable( const class AstLeaf &l ); @@ -43,7 +43,7 @@ public: Variable( const VarList &lst ); virtual ~Variable(); - static Variable mkRef( const Bu::FString &sVal ); + static Variable mkRef( const Bu::String &sVal ); Type getType() const; @@ -52,7 +52,7 @@ public: int getInt() const; double getFloat() const; bool getBool() const; - const Bu::FString &getString() const; + const Bu::String &getString() const; const VarList &getList() const; // Conversion functions, they'll return the requested type, maybe an error @@ -60,7 +60,7 @@ public: int toInt() const; double toFloat() const; bool toBool() const; - Bu::FString toString() const; + Bu::String toString() const; VarList toList() const; Variable toType( Type eNewType ) const; @@ -76,7 +76,7 @@ public: const Variable &operator=( const int &rhs ); const Variable &operator=( const double &rhs ); const Variable &operator=( const bool &rhs ); - const Variable &operator=( const Bu::FString &rhs ); + const Variable &operator=( const Bu::String &rhs ); const Variable &operator+=( const Variable &rhs ); const Variable &operator<<( const Variable &rhs ); @@ -100,7 +100,7 @@ private: int iVal; double fVal; bool bVal; - Bu::FString *sVal; + Bu::String *sVal; VarList *lVal; } uVal; diff --git a/src/view.h b/src/view.h index fb172aa..389ad15 100644 --- a/src/view.h +++ b/src/view.h @@ -1,7 +1,7 @@ #ifndef VIEW_H #define VIEW_H -#include +#include #include "types.h" /** @@ -17,28 +17,28 @@ public: View(); virtual ~View(); - virtual void beginAction( const Bu::FString &sAction )=0; + virtual void beginAction( const Bu::String &sAction )=0; virtual void endAction()=0; - virtual void skipTarget( const Bu::FString &sProfile, + virtual void skipTarget( const Bu::String &sProfile, const Target &rTarget )=0; - virtual void beginTarget( const Bu::FString &sProfile, + virtual void beginTarget( const Bu::String &sProfile, const Target &rTarget )=0; - virtual void processTarget( const Bu::FString &sProfile, + virtual void processTarget( const Bu::String &sProfile, const Target &rTarget )=0; virtual void endTarget()=0; virtual void buildRequires( const Target &rTarget )=0; - virtual void cmdStarted( const Bu::FString &sCmd )=0; - virtual void cmdFinished( const Bu::FString &sStdOut, - const Bu::FString &sStdErr, long iExit )=0; + virtual void cmdStarted( const Bu::String &sCmd )=0; + virtual void cmdFinished( const Bu::String &sStdOut, + const Bu::String &sStdErr, long iExit )=0; - virtual void userError( const Bu::FString &sMsg )=0; - virtual void userWarning( const Bu::FString &sMsg )=0; - virtual void userNotice( const Bu::FString &sMsg )=0; + virtual void userError( const Bu::String &sMsg )=0; + virtual void userWarning( const Bu::String &sMsg )=0; + virtual void userNotice( const Bu::String &sMsg )=0; - virtual void sysError( const Bu::FString &sMsg )=0; - virtual void sysWarning( const Bu::FString &sMsg )=0; + virtual void sysError( const Bu::String &sMsg )=0; + virtual void sysWarning( const Bu::String &sMsg )=0; private: }; diff --git a/src/viewdefault.cpp b/src/viewdefault.cpp index 49ba7e8..8b7e345 100644 --- a/src/viewdefault.cpp +++ b/src/viewdefault.cpp @@ -47,7 +47,7 @@ ViewDefault::~ViewDefault() } } -void ViewDefault::beginAction( const Bu::FString &/*sAction*/ ) +void ViewDefault::beginAction( const Bu::String &/*sAction*/ ) { } @@ -55,13 +55,13 @@ void ViewDefault::endAction() { } -void ViewDefault::skipTarget( const Bu::FString &/*sProfile*/, +void ViewDefault::skipTarget( const Bu::String &/*sProfile*/, const Target &/*rTarget*/ ) { iCurrent++; } -void ViewDefault::beginTarget( const Bu::FString &sProfile, +void ViewDefault::beginTarget( const Bu::String &sProfile, const Target &rTarget ) { if( iDepth == 0 ) @@ -76,7 +76,7 @@ void ViewDefault::beginTarget( const Bu::FString &sProfile, sCurProfile = sProfile; } -void ViewDefault::drawTargetHdr( const Bu::FString &sProfile, +void ViewDefault::drawTargetHdr( const Bu::String &sProfile, const Target &rTarget ) { if( bDispedTrg == false ) @@ -93,7 +93,7 @@ void ViewDefault::drawTargetHdr( const Bu::FString &sProfile, } } -void ViewDefault::processTarget( const Bu::FString &sProfile, +void ViewDefault::processTarget( const Bu::String &sProfile, const Target &rTarget ) { drawTargetHdr( sProfile, rTarget ); @@ -125,23 +125,23 @@ void ViewDefault::buildRequires( const Target &rTarget ) bDisped = true; } -void ViewDefault::cmdStarted( const Bu::FString &/*sCmd*/ ) +void ViewDefault::cmdStarted( const Bu::String &/*sCmd*/ ) { } -void ViewDefault::cmdFinished( const Bu::FString &sStdOut, - const Bu::FString &sStdErr, long /*iExit*/ ) +void ViewDefault::cmdFinished( const Bu::String &sStdOut, + const Bu::String &sStdErr, long /*iExit*/ ) { if( sStdOut.isSet() ) { - Bu::FString::const_iterator b; + Bu::String::const_iterator b; b = sStdOut.begin(); while( b ) { - Bu::FString::const_iterator e, max; + Bu::String::const_iterator e, max; max = b + 78; for( e = b; e != max && *e != '\n'; e++ ) { } - sio << C_BR_GREEN << "| " << C_RESET << FString( b, e ) << sio.nl; + sio << C_BR_GREEN << "| " << C_RESET << String( b, e ) << sio.nl; b = e; if( *b == '\n' ) b++; @@ -150,14 +150,14 @@ void ViewDefault::cmdFinished( const Bu::FString &sStdOut, } if( sStdErr.isSet() ) { - Bu::FString::const_iterator b; + Bu::String::const_iterator b; b = sStdErr.begin(); while( b ) { - Bu::FString::const_iterator e, max; + Bu::String::const_iterator e, max; max = b + 78; for( e = b; e != max && *e != '\n'; e++ ) { } - sio << C_BR_RED << "| " << C_RESET << FString( b, e ) << sio.nl; + sio << C_BR_RED << "| " << C_RESET << String( b, e ) << sio.nl; b = e; if( *b == '\n' ) b++; @@ -169,31 +169,31 @@ void ViewDefault::cmdFinished( const Bu::FString &sStdOut, bDisped = true; } -void ViewDefault::userError( const Bu::FString &sMsg ) +void ViewDefault::userError( const Bu::String &sMsg ) { sio << C_BR_RED << "Error: " << sMsg << C_RESET << sio.nl; bDisped = true; } -void ViewDefault::userWarning( const Bu::FString &sMsg ) +void ViewDefault::userWarning( const Bu::String &sMsg ) { sio << C_BR_YELLOW << "Warning: " << sMsg << C_RESET << sio.nl; bDisped = true; } -void ViewDefault::userNotice( const Bu::FString &sMsg ) +void ViewDefault::userNotice( const Bu::String &sMsg ) { sio << C_BR_GREEN << "Notice: " << sMsg << C_RESET << sio.nl; bDisped = true; } -void ViewDefault::sysError( const Bu::FString &sMsg ) +void ViewDefault::sysError( const Bu::String &sMsg ) { sio << C_BR_RED << sMsg << C_RESET << sio.nl; bDisped = true; } -void ViewDefault::sysWarning( const Bu::FString &sMsg ) +void ViewDefault::sysWarning( const Bu::String &sMsg ) { sio << C_BR_YELLOW << sMsg << C_RESET << sio.nl; bDisped = true; diff --git a/src/viewdefault.h b/src/viewdefault.h index 2c3db0e..ee9302b 100644 --- a/src/viewdefault.h +++ b/src/viewdefault.h @@ -9,30 +9,30 @@ public: ViewDefault(); virtual ~ViewDefault(); - virtual void beginAction( const Bu::FString &sAction ); + virtual void beginAction( const Bu::String &sAction ); virtual void endAction(); - virtual void skipTarget( const Bu::FString &sProfile, + virtual void skipTarget( const Bu::String &sProfile, const Target &rTarget ); - virtual void beginTarget( const Bu::FString &sProfile, + virtual void beginTarget( const Bu::String &sProfile, const Target &rTarget ); - virtual void processTarget( const Bu::FString &sProfile, + virtual void processTarget( const Bu::String &sProfile, const Target &rTarget ); virtual void endTarget(); virtual void buildRequires( const Target &rTarget ); - virtual void cmdStarted( const Bu::FString &sCmd ); - virtual void cmdFinished( const Bu::FString &sStdOut, - const Bu::FString &sStdErr, long iExit ); + virtual void cmdStarted( const Bu::String &sCmd ); + virtual void cmdFinished( const Bu::String &sStdOut, + const Bu::String &sStdErr, long iExit ); - virtual void userError( const Bu::FString &sMsg ); - virtual void userWarning( const Bu::FString &sMsg ); - virtual void userNotice( const Bu::FString &sMsg ); + virtual void userError( const Bu::String &sMsg ); + virtual void userWarning( const Bu::String &sMsg ); + virtual void userNotice( const Bu::String &sMsg ); - virtual void sysError( const Bu::FString &sMsg ); - virtual void sysWarning( const Bu::FString &sMsg ); + virtual void sysError( const Bu::String &sMsg ); + virtual void sysWarning( const Bu::String &sMsg ); - void drawTargetHdr( const Bu::FString &sProfile, const Target &rTarget ); + void drawTargetHdr( const Bu::String &sProfile, const Target &rTarget ); private: bool bFirst; @@ -41,8 +41,8 @@ private: int iDepth; int iTotal; int iCurrent; - Bu::FString sCurProfile; - Bu::FString sTopTarget; + Bu::String sCurProfile; + Bu::String sTopTarget; }; #endif diff --git a/src/viewmake.cpp b/src/viewmake.cpp index 39d1327..14f5526 100644 --- a/src/viewmake.cpp +++ b/src/viewmake.cpp @@ -17,7 +17,7 @@ ViewMake::~ViewMake() { } -void ViewMake::beginAction( const Bu::FString &/*sAction*/ ) +void ViewMake::beginAction( const Bu::String &/*sAction*/ ) { } @@ -25,17 +25,17 @@ void ViewMake::endAction() { } -void ViewMake::skipTarget( const Bu::FString &/*sProfile*/, +void ViewMake::skipTarget( const Bu::String &/*sProfile*/, const Target &/*rTarget*/ ) { } -void ViewMake::beginTarget( const Bu::FString &/*sProfile*/, +void ViewMake::beginTarget( const Bu::String &/*sProfile*/, const Target &/*rTarget*/ ) { } -void ViewMake::processTarget( const Bu::FString &/*sProfile*/, +void ViewMake::processTarget( const Bu::String &/*sProfile*/, const Target &/*rTarget*/ ) { } @@ -48,38 +48,38 @@ void ViewMake::buildRequires( const Target &/*rTarget*/ ) { } -void ViewMake::cmdStarted( const Bu::FString &sCmd ) +void ViewMake::cmdStarted( const Bu::String &sCmd ) { sio << sCmd << sio.nl; } -void ViewMake::cmdFinished( const Bu::FString &sStdOut, - const Bu::FString &sStdErr, long /*iExit*/ ) +void ViewMake::cmdFinished( const Bu::String &sStdOut, + const Bu::String &sStdErr, long /*iExit*/ ) { sio << sStdOut << sStdErr; } -void ViewMake::userError( const Bu::FString &sMsg ) +void ViewMake::userError( const Bu::String &sMsg ) { sio << "Error: " << sMsg << sio.nl; } -void ViewMake::userWarning( const Bu::FString &sMsg ) +void ViewMake::userWarning( const Bu::String &sMsg ) { sio << "Warning: " << sMsg << sio.nl; } -void ViewMake::userNotice( const Bu::FString &sMsg ) +void ViewMake::userNotice( const Bu::String &sMsg ) { sio << "Notice: " << sMsg << sio.nl; } -void ViewMake::sysError( const Bu::FString &sMsg ) +void ViewMake::sysError( const Bu::String &sMsg ) { sio << sMsg << sio.nl; } -void ViewMake::sysWarning( const Bu::FString &sMsg ) +void ViewMake::sysWarning( const Bu::String &sMsg ) { sio << sMsg << sio.nl; } diff --git a/src/viewmake.h b/src/viewmake.h index 9100a86..8960ef0 100644 --- a/src/viewmake.h +++ b/src/viewmake.h @@ -9,28 +9,28 @@ public: ViewMake(); virtual ~ViewMake(); - virtual void beginAction( const Bu::FString &sAction ); + virtual void beginAction( const Bu::String &sAction ); virtual void endAction(); - virtual void skipTarget( const Bu::FString &sProfile, + virtual void skipTarget( const Bu::String &sProfile, const Target &rTarget ); - virtual void beginTarget( const Bu::FString &sProfile, + virtual void beginTarget( const Bu::String &sProfile, const Target &rTarget ); - virtual void processTarget( const Bu::FString &sProfile, + virtual void processTarget( const Bu::String &sProfile, const Target &rTarget ); virtual void endTarget(); virtual void buildRequires( const Target &rTarget ); - virtual void cmdStarted( const Bu::FString &sCmd ); - virtual void cmdFinished( const Bu::FString &sStdOut, - const Bu::FString &sStdErr, long iExit ); + virtual void cmdStarted( const Bu::String &sCmd ); + virtual void cmdFinished( const Bu::String &sStdOut, + const Bu::String &sStdErr, long iExit ); - virtual void userError( const Bu::FString &sMsg ); - virtual void userWarning( const Bu::FString &sMsg ); - virtual void userNotice( const Bu::FString &sMsg ); + virtual void userError( const Bu::String &sMsg ); + virtual void userWarning( const Bu::String &sMsg ); + virtual void userNotice( const Bu::String &sMsg ); - virtual void sysError( const Bu::FString &sMsg ); - virtual void sysWarning( const Bu::FString &sMsg ); + virtual void sysError( const Bu::String &sMsg ); + virtual void sysWarning( const Bu::String &sMsg ); }; #endif diff --git a/src/viewplugger.cpp b/src/viewplugger.cpp index 58f3605..cdde2f6 100644 --- a/src/viewplugger.cpp +++ b/src/viewplugger.cpp @@ -19,13 +19,13 @@ ViewPlugger::ViewPlugger() if( strncmp("pluginView", de->d_name, 15 ) ) continue; - Bu::FString sFile("/usr/lib/build/"); + Bu::String sFile("/usr/lib/build/"); sFile += de->d_name; char *s = de->d_name; for(; *s && *s != '.'; s++ ) { } registerExternalPlugin( sFile, - Bu::FString( de->d_name, (ptrdiff_t)s-(ptrdiff_t)de->d_name ) + Bu::String( de->d_name, (ptrdiff_t)s-(ptrdiff_t)de->d_name ) ); } -- cgit v1.2.3