diff options
Diffstat (limited to 'src/variable.cpp')
| -rw-r--r-- | src/variable.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
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 ) : | |||
| 17 | memset( &uVal, 0, sizeof(uVal) ); | 17 | memset( &uVal, 0, sizeof(uVal) ); |
| 18 | if( eType == typeString || eType == typeRef ) | 18 | if( eType == typeString || eType == typeRef ) |
| 19 | { | 19 | { |
| 20 | uVal.sVal = new Bu::FString; | 20 | uVal.sVal = new Bu::String; |
| 21 | } | 21 | } |
| 22 | else if( eType == typeList ) | 22 | else if( eType == typeList ) |
| 23 | { | 23 | { |
| @@ -46,18 +46,18 @@ Variable::Variable( bool bVal ) : | |||
| 46 | uVal.bVal = bVal; | 46 | uVal.bVal = bVal; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | Variable::Variable( const Bu::FString &sVal ) : | 49 | Variable::Variable( const Bu::String &sVal ) : |
| 50 | eType( typeString ) | 50 | eType( typeString ) |
| 51 | { | 51 | { |
| 52 | memset( &uVal, 0, sizeof(uVal) ); | 52 | memset( &uVal, 0, sizeof(uVal) ); |
| 53 | uVal.sVal = new Bu::FString( sVal ); | 53 | uVal.sVal = new Bu::String( sVal ); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | Variable::Variable( const char *sVal ) : | 56 | Variable::Variable( const char *sVal ) : |
| 57 | eType( typeString ) | 57 | eType( typeString ) |
| 58 | { | 58 | { |
| 59 | memset( &uVal, 0, sizeof(uVal) ); | 59 | memset( &uVal, 0, sizeof(uVal) ); |
| 60 | uVal.sVal = new Bu::FString( sVal ); | 60 | uVal.sVal = new Bu::String( sVal ); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | Variable::Variable( const Variable &v ) : | 63 | Variable::Variable( const Variable &v ) : |
| @@ -66,7 +66,7 @@ Variable::Variable( const Variable &v ) : | |||
| 66 | memset( &uVal, 0, sizeof(uVal) ); | 66 | memset( &uVal, 0, sizeof(uVal) ); |
| 67 | if( eType == typeString || eType == typeRef ) | 67 | if( eType == typeString || eType == typeRef ) |
| 68 | { | 68 | { |
| 69 | uVal.sVal = new Bu::FString( *v.uVal.sVal ); | 69 | uVal.sVal = new Bu::String( *v.uVal.sVal ); |
| 70 | } | 70 | } |
| 71 | else if( eType == typeList ) | 71 | else if( eType == typeList ) |
| 72 | { | 72 | { |
| @@ -99,7 +99,7 @@ Variable::Variable( const class AstLeaf &l ) | |||
| 99 | 99 | ||
| 100 | case AstNode::typeDataString: | 100 | case AstNode::typeDataString: |
| 101 | eType = typeString; | 101 | eType = typeString; |
| 102 | uVal.sVal = new Bu::FString( l.getStrValue() ); | 102 | uVal.sVal = new Bu::String( l.getStrValue() ); |
| 103 | break; | 103 | break; |
| 104 | 104 | ||
| 105 | case AstNode::typeDataNone: | 105 | case AstNode::typeDataNone: |
| @@ -118,7 +118,7 @@ Variable::Variable( const StrList &lst ) | |||
| 118 | if( lst.getSize() == 1 ) | 118 | if( lst.getSize() == 1 ) |
| 119 | { | 119 | { |
| 120 | eType = typeString; | 120 | eType = typeString; |
| 121 | uVal.sVal = new Bu::FString( lst.first() ); | 121 | uVal.sVal = new Bu::String( lst.first() ); |
| 122 | } | 122 | } |
| 123 | else | 123 | else |
| 124 | { | 124 | { |
| @@ -149,7 +149,7 @@ Variable::~Variable() | |||
| 149 | } | 149 | } |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | Variable Variable::mkRef( const Bu::FString &sVal ) | 152 | Variable Variable::mkRef( const Bu::String &sVal ) |
| 153 | { | 153 | { |
| 154 | Variable v( typeRef ); | 154 | Variable v( typeRef ); |
| 155 | (*v.uVal.sVal) = sVal; | 155 | (*v.uVal.sVal) = sVal; |
| @@ -179,7 +179,7 @@ bool Variable::getBool() const | |||
| 179 | return uVal.bVal; | 179 | return uVal.bVal; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | const Bu::FString &Variable::getString() const | 182 | const Bu::String &Variable::getString() const |
| 183 | { | 183 | { |
| 184 | if( eType != typeString && eType != typeRef ) throw Bu::ExceptionBase("Wrong variable type."); | 184 | if( eType != typeString && eType != typeRef ) throw Bu::ExceptionBase("Wrong variable type."); |
| 185 | return *uVal.sVal; | 185 | return *uVal.sVal; |
| @@ -263,9 +263,9 @@ bool Variable::toBool() const | |||
| 263 | return false; | 263 | return false; |
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | Bu::FString Variable::toString() const | 266 | Bu::String Variable::toString() const |
| 267 | { | 267 | { |
| 268 | Bu::FString sRet; | 268 | Bu::String sRet; |
| 269 | switch( eType ) | 269 | switch( eType ) |
| 270 | { | 270 | { |
| 271 | case typeNone: | 271 | case typeNone: |
| @@ -417,7 +417,7 @@ const Variable &Variable::operator=( const Variable &rhs ) | |||
| 417 | reset( rhs.eType ); | 417 | reset( rhs.eType ); |
| 418 | if( rhs.eType == typeString || rhs.eType == typeRef ) | 418 | if( rhs.eType == typeString || rhs.eType == typeRef ) |
| 419 | { | 419 | { |
| 420 | uVal.sVal = new Bu::FString( *rhs.uVal.sVal ); | 420 | uVal.sVal = new Bu::String( *rhs.uVal.sVal ); |
| 421 | } | 421 | } |
| 422 | else if( rhs.eType == typeList ) | 422 | else if( rhs.eType == typeList ) |
| 423 | { | 423 | { |
| @@ -455,10 +455,10 @@ const Variable &Variable::operator=( const bool &rhs ) | |||
| 455 | return *this; | 455 | return *this; |
| 456 | } | 456 | } |
| 457 | 457 | ||
| 458 | const Variable &Variable::operator=( const Bu::FString &rhs ) | 458 | const Variable &Variable::operator=( const Bu::String &rhs ) |
| 459 | { | 459 | { |
| 460 | reset( typeString ); | 460 | reset( typeString ); |
| 461 | uVal.sVal = new Bu::FString( rhs ); | 461 | uVal.sVal = new Bu::String( rhs ); |
| 462 | 462 | ||
| 463 | return *this; | 463 | return *this; |
| 464 | } | 464 | } |
| @@ -471,7 +471,7 @@ const Variable &Variable::operator+=( const Variable &rhs ) | |||
| 471 | reset( rhs.eType ); | 471 | reset( rhs.eType ); |
| 472 | if( eType == typeString || eType == typeRef ) | 472 | if( eType == typeString || eType == typeRef ) |
| 473 | { | 473 | { |
| 474 | uVal.sVal = new Bu::FString( *rhs.uVal.sVal ); | 474 | uVal.sVal = new Bu::String( *rhs.uVal.sVal ); |
| 475 | } | 475 | } |
| 476 | else if( eType == typeList ) | 476 | else if( eType == typeList ) |
| 477 | { | 477 | { |
| @@ -521,7 +521,7 @@ const Variable &Variable::operator<<( const Variable &rhs ) | |||
| 521 | reset( rhs.eType ); | 521 | reset( rhs.eType ); |
| 522 | if( eType == typeString ) | 522 | if( eType == typeString ) |
| 523 | { | 523 | { |
| 524 | uVal.sVal = new Bu::FString( *rhs.uVal.sVal ); | 524 | uVal.sVal = new Bu::String( *rhs.uVal.sVal ); |
| 525 | } | 525 | } |
| 526 | else if( eType == typeList ) | 526 | else if( eType == typeList ) |
| 527 | { | 527 | { |
