summaryrefslogtreecommitdiff
path: root/src/variable.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-12-30 15:44:06 -0700
committerMike Buland <eichlan@xagasoft.com>2011-12-30 15:44:06 -0700
commitba7897ebadbc03d99200fda03a574a57b650e429 (patch)
treeb13548a7c33e52d9f09e1563b1b284a041edb216 /src/variable.cpp
parentf2ee67558acbe3c418a7558587b56158d593d88d (diff)
downloadstage-ba7897ebadbc03d99200fda03a574a57b650e429.tar.gz
stage-ba7897ebadbc03d99200fda03a574a57b650e429.tar.bz2
stage-ba7897ebadbc03d99200fda03a574a57b650e429.tar.xz
stage-ba7897ebadbc03d99200fda03a574a57b650e429.zip
Dictionaries can be created, in operator works.
Diffstat (limited to 'src/variable.cpp')
-rw-r--r--src/variable.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/variable.cpp b/src/variable.cpp
index db7726c..1e5cc9b 100644
--- a/src/variable.cpp
+++ b/src/variable.cpp
@@ -210,6 +210,23 @@ Variable Variable::to( Type e ) const
210 eType, e ); 210 eType, e );
211} 211}
212 212
213void Variable::insert( const Variable &vKey, const Variable &vValue )
214{
215 if( eType != tDictionary )
216 throw Bu::ExceptionBase("Insert on non-dictionary.");
217 hValue->insert( vKey, vValue );
218}
219
220bool Variable::has( const Variable &vKey )
221{
222 if( eType == tDictionary )
223 return hValue->has( vKey );
224// else if( eType == tList )
225// return lValue->contains( vKey );
226 else
227 throw Bu::ExceptionBase("Insert on non-dictionary.");
228}
229
213Variable &Variable::operator=( const Variable &rhs ) 230Variable &Variable::operator=( const Variable &rhs )
214{ 231{
215 deinitType(); 232 deinitType();