mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 19:29:09 +00:00
Obliterate hsBool
This commit is contained in:
@ -373,7 +373,7 @@ char pfConsoleCmd::fSigTypes[ kNumTypes ][ 8 ] = { "int", "float", "bool", "s
|
||||
|
||||
pfConsoleCmd::pfConsoleCmd(const char *group, const char *name,
|
||||
const char *paramList, const char *help,
|
||||
pfConsoleCmdPtr func, hsBool localOnly )
|
||||
pfConsoleCmdPtr func, bool localOnly )
|
||||
{
|
||||
fNext = nil;
|
||||
fPrevPtr = nil;
|
||||
|
@ -178,7 +178,7 @@ class pfConsoleCmd
|
||||
const char* fHelpString;
|
||||
|
||||
pfConsoleCmdPtr fFunction;
|
||||
hsBool fLocalOnly;
|
||||
bool fLocalOnly;
|
||||
|
||||
pfConsoleCmd *fNext;
|
||||
pfConsoleCmd **fPrevPtr;
|
||||
@ -208,7 +208,7 @@ class pfConsoleCmd
|
||||
static char fSigTypes[ kNumTypes ][ 8 ];
|
||||
|
||||
|
||||
pfConsoleCmd(const char *group, const char *name, const char *paramList, const char *help, pfConsoleCmdPtr func, hsBool localOnly = false );
|
||||
pfConsoleCmd(const char *group, const char *name, const char *paramList, const char *help, pfConsoleCmdPtr func, bool localOnly = false );
|
||||
~pfConsoleCmd();
|
||||
|
||||
void Register(const char *group, const char *name );
|
||||
|
@ -216,7 +216,7 @@ void pfConsoleContext::AddVar( const char *name, bool value )
|
||||
|
||||
//// SetVar Variants /////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfConsoleContext::SetVar( uint32_t idx, const pfConsoleCmdParam &value )
|
||||
bool pfConsoleContext::SetVar( uint32_t idx, const pfConsoleCmdParam &value )
|
||||
{
|
||||
hsAssert( fVarValues.GetCount() == fVarNames.GetCount(), "Mismatch in console var context arrays" );
|
||||
if( idx >= fVarValues.GetCount() )
|
||||
@ -238,7 +238,7 @@ hsBool pfConsoleContext::SetVar( uint32_t idx, const pfConsoleCmdParam &value )
|
||||
return true;
|
||||
}
|
||||
|
||||
hsBool pfConsoleContext::SetVar( const char *name, const pfConsoleCmdParam &value )
|
||||
bool pfConsoleContext::SetVar( const char *name, const pfConsoleCmdParam &value )
|
||||
{
|
||||
int32_t idx = FindVar( name );
|
||||
if( idx == -1 )
|
||||
@ -255,35 +255,35 @@ hsBool pfConsoleContext::SetVar( const char *name, const pfConsoleCmdParam &val
|
||||
return SetVar( idx, value );
|
||||
}
|
||||
|
||||
hsBool pfConsoleContext::SetVar( const char *name, int value )
|
||||
bool pfConsoleContext::SetVar( const char *name, int value )
|
||||
{
|
||||
pfConsoleCmdParam param;
|
||||
param.SetInt( value );
|
||||
return SetVar( name, param );
|
||||
}
|
||||
|
||||
hsBool pfConsoleContext::SetVar( const char *name, float value )
|
||||
bool pfConsoleContext::SetVar( const char *name, float value )
|
||||
{
|
||||
pfConsoleCmdParam param;
|
||||
param.SetFloat( value );
|
||||
return SetVar( name, param );
|
||||
}
|
||||
|
||||
hsBool pfConsoleContext::SetVar( const char *name, const char *value )
|
||||
bool pfConsoleContext::SetVar( const char *name, const char *value )
|
||||
{
|
||||
pfConsoleCmdParam param;
|
||||
param.SetString( (char *)value ); // Don't worry, we'll be copying it soon 'nuf
|
||||
return SetVar( name, param );
|
||||
}
|
||||
|
||||
hsBool pfConsoleContext::SetVar( const char *name, char value )
|
||||
bool pfConsoleContext::SetVar( const char *name, char value )
|
||||
{
|
||||
pfConsoleCmdParam param;
|
||||
param.SetChar( value );
|
||||
return SetVar( name, param );
|
||||
}
|
||||
|
||||
hsBool pfConsoleContext::SetVar( const char *name, bool value )
|
||||
bool pfConsoleContext::SetVar( const char *name, bool value )
|
||||
{
|
||||
pfConsoleCmdParam param;
|
||||
param.SetBool( value );
|
||||
|
@ -58,7 +58,7 @@ class pfConsoleContext
|
||||
{
|
||||
protected:
|
||||
|
||||
hsBool fAddWhenNotFound; // Controls whether we add variables on Set() calls if they're not found
|
||||
bool fAddWhenNotFound; // Controls whether we add variables on Set() calls if they're not found
|
||||
|
||||
char *fName;
|
||||
|
||||
@ -90,18 +90,18 @@ class pfConsoleContext
|
||||
void AddVar( const char *name, char value );
|
||||
void AddVar( const char *name, bool value );
|
||||
|
||||
hsBool SetVar( uint32_t idx, const pfConsoleCmdParam &value );
|
||||
bool SetVar( uint32_t idx, const pfConsoleCmdParam &value );
|
||||
|
||||
hsBool SetVar( const char *name, const pfConsoleCmdParam &value );
|
||||
hsBool SetVar( const char *name, int value );
|
||||
hsBool SetVar( const char *name, float value );
|
||||
hsBool SetVar( const char *name, const char *value );
|
||||
hsBool SetVar( const char *name, char value );
|
||||
hsBool SetVar( const char *name, bool value );
|
||||
bool SetVar( const char *name, const pfConsoleCmdParam &value );
|
||||
bool SetVar( const char *name, int value );
|
||||
bool SetVar( const char *name, float value );
|
||||
bool SetVar( const char *name, const char *value );
|
||||
bool SetVar( const char *name, char value );
|
||||
bool SetVar( const char *name, bool value );
|
||||
|
||||
// Decide whether Sets() on nonexistant variables will fail or add a new variable
|
||||
void SetAddWhenNotFound( hsBool f ) { fAddWhenNotFound = f; }
|
||||
hsBool GetAddWhenNotFound( void ) const { return fAddWhenNotFound; }
|
||||
void SetAddWhenNotFound( bool f ) { fAddWhenNotFound = f; }
|
||||
bool GetAddWhenNotFound( void ) const { return fAddWhenNotFound; }
|
||||
|
||||
static pfConsoleContext &GetRootContext( void );
|
||||
};
|
||||
|
@ -58,7 +58,7 @@ static const char kTokenSeparators[] = " =\r\n\t,";
|
||||
static const char kTokenGrpSeps[] = " =\r\n._\t,";
|
||||
|
||||
//WARNING: Potentially increments the pointer passed to it.
|
||||
static char *console_strtok( char *&line, hsBool haveCommand )
|
||||
static char *console_strtok( char *&line, bool haveCommand )
|
||||
{
|
||||
char *begin = line;
|
||||
|
||||
@ -118,7 +118,7 @@ pfConsoleEngine::~pfConsoleEngine()
|
||||
|
||||
//// PrintCmdHelp ////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char * ) )
|
||||
bool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char * ) )
|
||||
{
|
||||
pfConsoleCmd *cmd;
|
||||
pfConsoleCmdGroup *group, *subGrp;
|
||||
@ -247,15 +247,15 @@ void DummyPrintFn( const char *line )
|
||||
|
||||
//// ExecuteFile /////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfConsoleEngine::ExecuteFile( const char *fileName )
|
||||
bool pfConsoleEngine::ExecuteFile( const char *fileName )
|
||||
{
|
||||
wchar_t* wFilename = hsStringToWString(fileName);
|
||||
hsBool ret = ExecuteFile(wFilename);
|
||||
bool ret = ExecuteFile(wFilename);
|
||||
delete [] wFilename;
|
||||
return ret;
|
||||
}
|
||||
|
||||
hsBool pfConsoleEngine::ExecuteFile( const wchar_t *fileName )
|
||||
bool pfConsoleEngine::ExecuteFile( const wchar_t *fileName )
|
||||
{
|
||||
char string[ 512 ];
|
||||
int line;
|
||||
@ -298,14 +298,14 @@ hsBool pfConsoleEngine::ExecuteFile( const wchar_t *fileName )
|
||||
// requires tokenizing the entire line and searching the tokens one by one,
|
||||
// parsing them first as groups, then commands and then params.
|
||||
|
||||
hsBool pfConsoleEngine::RunCommand( char *line, void (*PrintFn)( const char * ) )
|
||||
bool pfConsoleEngine::RunCommand( char *line, void (*PrintFn)( const char * ) )
|
||||
{
|
||||
pfConsoleCmd *cmd;
|
||||
pfConsoleCmdGroup *group, *subGrp;
|
||||
int32_t numParams, i, numQuotedParams = 0;
|
||||
pfConsoleCmdParam paramArray[ fMaxNumParams + 1 ];
|
||||
char *ptr;
|
||||
hsBool valid = true;
|
||||
bool valid = true;
|
||||
|
||||
|
||||
hsAssert( line != nil, "Bad parameter to RunCommand()" );
|
||||
@ -402,10 +402,10 @@ hsBool pfConsoleEngine::RunCommand( char *line, void (*PrintFn)( const char * )
|
||||
// Converts a null-terminated string representing a parameter to a
|
||||
// pfConsoleCmdParam argument.
|
||||
|
||||
hsBool pfConsoleEngine::IConvertToParam( uint8_t type, char *string, pfConsoleCmdParam *param )
|
||||
bool pfConsoleEngine::IConvertToParam( uint8_t type, char *string, pfConsoleCmdParam *param )
|
||||
{
|
||||
char *c, expChars[] = "dDeE+-.";
|
||||
hsBool hasDecimal = false, hasLetters = false;
|
||||
bool hasDecimal = false, hasLetters = false;
|
||||
|
||||
|
||||
if( type == pfConsoleCmd::kNone )
|
||||
@ -470,11 +470,11 @@ hsBool pfConsoleEngine::IConvertToParam( uint8_t type, char *string, pfConsoleC
|
||||
// string to represent the best match of command (or group) for that string.
|
||||
// WARNING: modifies the string passed to it.
|
||||
|
||||
hsBool pfConsoleEngine::FindPartialCmd( char *line, hsBool findAgain, hsBool preserveParams )
|
||||
bool pfConsoleEngine::FindPartialCmd( char *line, bool findAgain, bool preserveParams )
|
||||
{
|
||||
pfConsoleCmd *cmd = nil;
|
||||
pfConsoleCmdGroup *group, *subGrp;
|
||||
hsBool foundMore = false;
|
||||
bool foundMore = false;
|
||||
|
||||
static char *ptr = nil, *insertLoc = nil;
|
||||
static pfConsoleCmd *lastCmd = nil;
|
||||
@ -561,7 +561,7 @@ hsBool pfConsoleEngine::FindPartialCmd( char *line, hsBool findAgain, hsBool pr
|
||||
// groups. numToSkip specifies how many matches to skip before returning one
|
||||
// (so if numToSkip = 1, then this will return the second match found).
|
||||
|
||||
hsBool pfConsoleEngine::FindNestedPartialCmd( char *line, uint32_t numToSkip, hsBool preserveParams )
|
||||
bool pfConsoleEngine::FindNestedPartialCmd( char *line, uint32_t numToSkip, bool preserveParams )
|
||||
{
|
||||
pfConsoleCmd *cmd;
|
||||
|
||||
|
@ -69,7 +69,7 @@ class pfConsoleEngine
|
||||
|
||||
static const int32_t fMaxNumParams;
|
||||
|
||||
hsBool IConvertToParam( uint8_t type, char *string, pfConsoleCmdParam *param );
|
||||
bool IConvertToParam( uint8_t type, char *string, pfConsoleCmdParam *param );
|
||||
|
||||
char fErrorMsg[ 128 ];
|
||||
char fLastErrorLine[ 512 ];
|
||||
@ -88,14 +88,14 @@ class pfConsoleEngine
|
||||
const char *GetCmdSignature( char *name );
|
||||
|
||||
// Prints out the help for a given command (or group)
|
||||
hsBool PrintCmdHelp( char *name, void (*PrintFn)( const char * ) );
|
||||
bool PrintCmdHelp( char *name, void (*PrintFn)( const char * ) );
|
||||
|
||||
// Breaks the given line into a command and parameters and runs the command
|
||||
hsBool RunCommand( char *line, void (*PrintFn)( const char * ) );
|
||||
bool RunCommand( char *line, void (*PrintFn)( const char * ) );
|
||||
|
||||
// Executes the given file as a sequence of console commands
|
||||
hsBool ExecuteFile( const char *fileName );
|
||||
hsBool ExecuteFile( const wchar_t *fileName );
|
||||
bool ExecuteFile( const char *fileName );
|
||||
bool ExecuteFile( const wchar_t *fileName );
|
||||
|
||||
// Get the last reported error
|
||||
const char *GetErrorMsg( void ) { return fErrorMsg; }
|
||||
@ -104,10 +104,10 @@ class pfConsoleEngine
|
||||
const char *GetLastErrorLine( void ) { return fLastErrorLine; }
|
||||
|
||||
// Does command completion on a partially-complete console line
|
||||
hsBool FindPartialCmd( char *line, hsBool findAgain = false, hsBool perserveParams = false );
|
||||
bool FindPartialCmd( char *line, bool findAgain = false, bool perserveParams = false );
|
||||
|
||||
// Does command completion without restrictions to any group, skipping the number of matches given
|
||||
hsBool FindNestedPartialCmd( char *line, uint32_t numToSkip, hsBool perserveParams = false );
|
||||
bool FindNestedPartialCmd( char *line, uint32_t numToSkip, bool perserveParams = false );
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user