diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-12-30 15:44:06 -0700 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-12-30 15:44:06 -0700 |
commit | ba7897ebadbc03d99200fda03a574a57b650e429 (patch) | |
tree | b13548a7c33e52d9f09e1563b1b284a041edb216 /src/variable.cpp | |
parent | f2ee67558acbe3c418a7558587b56158d593d88d (diff) | |
download | stage-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.cpp | 17 |
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 | ||
213 | void 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 | |||
220 | bool 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 | |||
213 | Variable &Variable::operator=( const Variable &rhs ) | 230 | Variable &Variable::operator=( const Variable &rhs ) |
214 | { | 231 | { |
215 | deinitType(); | 232 | deinitType(); |