summaryrefslogtreecommitdiff
path: root/src/variable.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-12-18 01:26:16 -0700
committerMike Buland <eichlan@xagasoft.com>2011-12-18 01:26:16 -0700
commit16a5fdbed6f57d62f2ac44f37988c35319222d79 (patch)
tree2e127c3276425fcc4e102db642553086e07f7065 /src/variable.cpp
parenteb053bb851d729fbe4db7959143df5cfb2063793 (diff)
downloadstage-16a5fdbed6f57d62f2ac44f37988c35319222d79.tar.gz
stage-16a5fdbed6f57d62f2ac44f37988c35319222d79.tar.bz2
stage-16a5fdbed6f57d62f2ac44f37988c35319222d79.tar.xz
stage-16a5fdbed6f57d62f2ac44f37988c35319222d79.zip
Added list & dictionary types to Variable.
Also, all the operators to use against other Variables.
Diffstat (limited to 'src/variable.cpp')
-rw-r--r--src/variable.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/variable.cpp b/src/variable.cpp
index 3954ccd..fab0c46 100644
--- a/src/variable.cpp
+++ b/src/variable.cpp
@@ -1,12 +1,46 @@
1#include "variable.h" 1#include "variable.h"
2 2
3Variable::Variable() : 3Variable::Variable() :
4 eType( Undef ), 4 eType( Null ),
5 bNull( true ),
6 iValue( 0 ) 5 iValue( 0 )
7{ 6{
8} 7}
9 8
9Variable::Variable( Type eType ) :
10 eType( eType ),
11 iValue( 0 )
12{
13 if( eType == String )
14 {
15 sValue = new Bu::String();
16 }
17}
18
19Variable::Variable( int64_t iValue ) :
20 eType( Int ),
21 iValue( iValue )
22{
23}
24
25Variable::Variable( double fValue ) :
26 eType( Float ),
27 fValue( fValue )
28{
29}
30
31Variable::Variable( bool bValue ) :
32 eType( Bool ),
33 bValue( bValue )
34{
35}
36
37Variable::Variable( const Bu::String &sValue ) :
38 eType( String ),
39 iValue( 0 )
40{
41 this->sValue = new Bu::String( sValue );
42}
43
10Variable::~Variable() 44Variable::~Variable()
11{ 45{
12 if( eType == String ) 46 if( eType == String )