aboutsummaryrefslogtreecommitdiff
path: root/src/dictionary.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-20 18:16:38 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-20 18:16:38 +0000
commit7292af7c475c61920987ec498144a3fd1e90f1e8 (patch)
tree4bc09eea26fb13915395642311f0617f1c0bff4e /src/dictionary.cpp
parent4a6e25854a3b70c8d7a526a22a78760b97118669 (diff)
downloadlibgats-7292af7c475c61920987ec498144a3fd1e90f1e8.tar.gz
libgats-7292af7c475c61920987ec498144a3fd1e90f1e8.tar.bz2
libgats-7292af7c475c61920987ec498144a3fd1e90f1e8.tar.xz
libgats-7292af7c475c61920987ec498144a3fd1e90f1e8.zip
Updated with new Bu::String.
Diffstat (limited to 'src/dictionary.cpp')
-rw-r--r--src/dictionary.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/dictionary.cpp b/src/dictionary.cpp
index 4430e73..aaba7b8 100644
--- a/src/dictionary.cpp
+++ b/src/dictionary.cpp
@@ -11,7 +11,7 @@
11template<> 11template<>
12uint32_t Bu::__calcHashCode<Gats::String>( const Gats::String &s ) 12uint32_t Bu::__calcHashCode<Gats::String>( const Gats::String &s )
13{ 13{
14 return __calcHashCode( dynamic_cast<const Bu::FString &>(s) ); 14 return __calcHashCode( dynamic_cast<const Bu::String &>(s) );
15} 15}
16 16
17Gats::Dictionary::Dictionary() 17Gats::Dictionary::Dictionary()
@@ -56,119 +56,119 @@ void Gats::Dictionary::read( Bu::Stream &rIn, char cType )
56 } 56 }
57} 57}
58 58
59void Gats::Dictionary::insert( const Bu::FString &sKey, char i ) 59void Gats::Dictionary::insert( const Bu::String &sKey, char i )
60{ 60{
61 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert( 61 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert(
62 sKey, new Gats::Integer( i ) 62 sKey, new Gats::Integer( i )
63 ); 63 );
64} 64}
65 65
66void Gats::Dictionary::insert( const Bu::FString &sKey, unsigned char i ) 66void Gats::Dictionary::insert( const Bu::String &sKey, unsigned char i )
67{ 67{
68 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert( 68 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert(
69 sKey, new Gats::Integer( i ) 69 sKey, new Gats::Integer( i )
70 ); 70 );
71} 71}
72 72
73void Gats::Dictionary::insert( const Bu::FString &sKey, signed char i ) 73void Gats::Dictionary::insert( const Bu::String &sKey, signed char i )
74{ 74{
75 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert( 75 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert(
76 sKey, new Gats::Integer( i ) 76 sKey, new Gats::Integer( i )
77 ); 77 );
78} 78}
79 79
80void Gats::Dictionary::insert( const Bu::FString &sKey, unsigned short i ) 80void Gats::Dictionary::insert( const Bu::String &sKey, unsigned short i )
81{ 81{
82 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert( 82 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert(
83 sKey, new Gats::Integer( i ) 83 sKey, new Gats::Integer( i )
84 ); 84 );
85} 85}
86 86
87void Gats::Dictionary::insert( const Bu::FString &sKey, signed short i ) 87void Gats::Dictionary::insert( const Bu::String &sKey, signed short i )
88{ 88{
89 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert( 89 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert(
90 sKey, new Gats::Integer( i ) 90 sKey, new Gats::Integer( i )
91 ); 91 );
92} 92}
93 93
94void Gats::Dictionary::insert( const Bu::FString &sKey, unsigned int i ) 94void Gats::Dictionary::insert( const Bu::String &sKey, unsigned int i )
95{ 95{
96 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert( 96 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert(
97 sKey, new Gats::Integer( i ) 97 sKey, new Gats::Integer( i )
98 ); 98 );
99} 99}
100 100
101void Gats::Dictionary::insert( const Bu::FString &sKey, signed int i ) 101void Gats::Dictionary::insert( const Bu::String &sKey, signed int i )
102{ 102{
103 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert( 103 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert(
104 sKey, new Gats::Integer( i ) 104 sKey, new Gats::Integer( i )
105 ); 105 );
106} 106}
107 107
108void Gats::Dictionary::insert( const Bu::FString &sKey, unsigned long i ) 108void Gats::Dictionary::insert( const Bu::String &sKey, unsigned long i )
109{ 109{
110 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert( 110 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert(
111 sKey, new Gats::Integer( i ) 111 sKey, new Gats::Integer( i )
112 ); 112 );
113} 113}
114 114
115void Gats::Dictionary::insert( const Bu::FString &sKey, signed long i ) 115void Gats::Dictionary::insert( const Bu::String &sKey, signed long i )
116{ 116{
117 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert( 117 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert(
118 sKey, new Gats::Integer( i ) 118 sKey, new Gats::Integer( i )
119 ); 119 );
120} 120}
121 121
122void Gats::Dictionary::insert( const Bu::FString &sKey, unsigned long long i ) 122void Gats::Dictionary::insert( const Bu::String &sKey, unsigned long long i )
123{ 123{
124 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert( 124 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert(
125 sKey, new Gats::Integer( i ) 125 sKey, new Gats::Integer( i )
126 ); 126 );
127} 127}
128 128
129void Gats::Dictionary::insert( const Bu::FString &sKey, signed long long i ) 129void Gats::Dictionary::insert( const Bu::String &sKey, signed long long i )
130{ 130{
131 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert( 131 ((Bu::Hash<Gats::String, Gats::Object *> *)this)->insert(
132 sKey, new Gats::Integer( i ) 132 sKey, new Gats::Integer( i )
133 ); 133 );
134} 134}
135/* 135/*
136void Gats::Dictionary::insert( const Bu::FString &sKey, bool b ) 136void Gats::Dictionary::insert( const Bu::String &sKey, bool b )
137{ 137{
138 Bu::Hash<Gats::String, Gats::Object *>::insert( 138 Bu::Hash<Gats::String, Gats::Object *>::insert(
139 sKey, new Gats::Boolean( b ) 139 sKey, new Gats::Boolean( b )
140 ); 140 );
141}*/ 141}*/
142 142
143void Gats::Dictionary::insert( const Bu::FString &sKey, float d ) 143void Gats::Dictionary::insert( const Bu::String &sKey, float d )
144{ 144{
145 Bu::Hash<Gats::String, Gats::Object *>::insert( 145 Bu::Hash<Gats::String, Gats::Object *>::insert(
146 sKey, new Gats::Float( d ) 146 sKey, new Gats::Float( d )
147 ); 147 );
148} 148}
149 149
150void Gats::Dictionary::insert( const Bu::FString &sKey, double d ) 150void Gats::Dictionary::insert( const Bu::String &sKey, double d )
151{ 151{
152 Bu::Hash<Gats::String, Gats::Object *>::insert( 152 Bu::Hash<Gats::String, Gats::Object *>::insert(
153 sKey, new Gats::Float( d ) 153 sKey, new Gats::Float( d )
154 ); 154 );
155} 155}
156 156
157void Gats::Dictionary::insert( const Bu::FString &sKey, const char *s ) 157void Gats::Dictionary::insert( const Bu::String &sKey, const char *s )
158{ 158{
159 Bu::Hash<Gats::String, Gats::Object *>::insert( 159 Bu::Hash<Gats::String, Gats::Object *>::insert(
160 sKey, new Gats::String( s ) 160 sKey, new Gats::String( s )
161 ); 161 );
162} 162}
163 163
164void Gats::Dictionary::insert( const Bu::FString &sKey, const Bu::FString &s ) 164void Gats::Dictionary::insert( const Bu::String &sKey, const Bu::String &s )
165{ 165{
166 Bu::Hash<Gats::String, Gats::Object *>::insert( 166 Bu::Hash<Gats::String, Gats::Object *>::insert(
167 sKey, new Gats::String( s ) 167 sKey, new Gats::String( s )
168 ); 168 );
169} 169}
170 170
171bool Gats::Dictionary::getBool( const Bu::FString &sKey ) 171bool Gats::Dictionary::getBool( const Bu::String &sKey )
172{ 172{
173 Gats::Boolean *pOb = dynamic_cast<Gats::Boolean *>( get( sKey ) ); 173 Gats::Boolean *pOb = dynamic_cast<Gats::Boolean *>( get( sKey ) );
174 if( !pOb ) 174 if( !pOb )
@@ -178,7 +178,7 @@ bool Gats::Dictionary::getBool( const Bu::FString &sKey )
178 return pOb->getValue(); 178 return pOb->getValue();
179} 179}
180 180
181int64_t Gats::Dictionary::getInt( const Bu::FString &sKey ) 181int64_t Gats::Dictionary::getInt( const Bu::String &sKey )
182{ 182{
183 Gats::Integer *pOb = dynamic_cast<Gats::Integer *>( get( sKey ) ); 183 Gats::Integer *pOb = dynamic_cast<Gats::Integer *>( get( sKey ) );
184 if( !pOb ) 184 if( !pOb )
@@ -188,7 +188,7 @@ int64_t Gats::Dictionary::getInt( const Bu::FString &sKey )
188 return pOb->getValue(); 188 return pOb->getValue();
189} 189}
190 190
191double Gats::Dictionary::getFloat( const Bu::FString &sKey ) 191double Gats::Dictionary::getFloat( const Bu::String &sKey )
192{ 192{
193 Gats::Float *pOb = dynamic_cast<Gats::Float *>( get( sKey ) ); 193 Gats::Float *pOb = dynamic_cast<Gats::Float *>( get( sKey ) );
194 if( !pOb ) 194 if( !pOb )
@@ -198,7 +198,7 @@ double Gats::Dictionary::getFloat( const Bu::FString &sKey )
198 return pOb->getValue(); 198 return pOb->getValue();
199} 199}
200 200
201Bu::FString Gats::Dictionary::getStr( const Bu::FString &sKey ) 201Bu::String Gats::Dictionary::getStr( const Bu::String &sKey )
202{ 202{
203 Gats::String *pOb = dynamic_cast<Gats::String *>( get( sKey ) ); 203 Gats::String *pOb = dynamic_cast<Gats::String *>( get( sKey ) );
204 if( !pOb ) 204 if( !pOb )
@@ -208,7 +208,7 @@ Bu::FString Gats::Dictionary::getStr( const Bu::FString &sKey )
208 return *pOb; 208 return *pOb;
209} 209}
210 210
211Gats::List *Gats::Dictionary::getList( const Bu::FString &sKey ) 211Gats::List *Gats::Dictionary::getList( const Bu::String &sKey )
212{ 212{
213 Gats::List *pOb = dynamic_cast<Gats::List *>( get( sKey ) ); 213 Gats::List *pOb = dynamic_cast<Gats::List *>( get( sKey ) );
214 if( !pOb ) 214 if( !pOb )
@@ -218,7 +218,7 @@ Gats::List *Gats::Dictionary::getList( const Bu::FString &sKey )
218 return pOb; 218 return pOb;
219} 219}
220 220
221Gats::Dictionary *Gats::Dictionary::getDict( const Bu::FString &sKey ) 221Gats::Dictionary *Gats::Dictionary::getDict( const Bu::String &sKey )
222{ 222{
223 Gats::Dictionary *pOb = dynamic_cast<Gats::Dictionary *>( get( sKey ) ); 223 Gats::Dictionary *pOb = dynamic_cast<Gats::Dictionary *>( get( sKey ) );
224 if( !pOb ) 224 if( !pOb )
@@ -228,7 +228,7 @@ Gats::Dictionary *Gats::Dictionary::getDict( const Bu::FString &sKey )
228 return pOb; 228 return pOb;
229} 229}
230 230
231bool Gats::Dictionary::getBool( const Bu::FString &sKey ) const 231bool Gats::Dictionary::getBool( const Bu::String &sKey ) const
232{ 232{
233 Gats::Boolean *pOb = dynamic_cast<Gats::Boolean *>( get( sKey ) ); 233 Gats::Boolean *pOb = dynamic_cast<Gats::Boolean *>( get( sKey ) );
234 if( !pOb ) 234 if( !pOb )
@@ -238,7 +238,7 @@ bool Gats::Dictionary::getBool( const Bu::FString &sKey ) const
238 return pOb->getValue(); 238 return pOb->getValue();
239} 239}
240 240
241int64_t Gats::Dictionary::getInt( const Bu::FString &sKey ) const 241int64_t Gats::Dictionary::getInt( const Bu::String &sKey ) const
242{ 242{
243 Gats::Integer *pOb = dynamic_cast<Gats::Integer *>( get( sKey ) ); 243 Gats::Integer *pOb = dynamic_cast<Gats::Integer *>( get( sKey ) );
244 if( !pOb ) 244 if( !pOb )
@@ -248,7 +248,7 @@ int64_t Gats::Dictionary::getInt( const Bu::FString &sKey ) const
248 return pOb->getValue(); 248 return pOb->getValue();
249} 249}
250 250
251double Gats::Dictionary::getFloat( const Bu::FString &sKey ) const 251double Gats::Dictionary::getFloat( const Bu::String &sKey ) const
252{ 252{
253 Gats::Float *pOb = dynamic_cast<Gats::Float *>( get( sKey ) ); 253 Gats::Float *pOb = dynamic_cast<Gats::Float *>( get( sKey ) );
254 if( !pOb ) 254 if( !pOb )
@@ -258,7 +258,7 @@ double Gats::Dictionary::getFloat( const Bu::FString &sKey ) const
258 return pOb->getValue(); 258 return pOb->getValue();
259} 259}
260 260
261Bu::FString Gats::Dictionary::getStr( const Bu::FString &sKey ) const 261Bu::String Gats::Dictionary::getStr( const Bu::String &sKey ) const
262{ 262{
263 Gats::String *pOb = dynamic_cast<Gats::String *>( get( sKey ) ); 263 Gats::String *pOb = dynamic_cast<Gats::String *>( get( sKey ) );
264 if( !pOb ) 264 if( !pOb )
@@ -268,7 +268,7 @@ Bu::FString Gats::Dictionary::getStr( const Bu::FString &sKey ) const
268 return *pOb; 268 return *pOb;
269} 269}
270 270
271Gats::List *Gats::Dictionary::getList( const Bu::FString &sKey ) const 271Gats::List *Gats::Dictionary::getList( const Bu::String &sKey ) const
272{ 272{
273 Gats::List *pOb = dynamic_cast<Gats::List *>( get( sKey ) ); 273 Gats::List *pOb = dynamic_cast<Gats::List *>( get( sKey ) );
274 if( !pOb ) 274 if( !pOb )
@@ -278,7 +278,7 @@ Gats::List *Gats::Dictionary::getList( const Bu::FString &sKey ) const
278 return pOb; 278 return pOb;
279} 279}
280 280
281Gats::Dictionary *Gats::Dictionary::getDict( const Bu::FString &sKey ) const 281Gats::Dictionary *Gats::Dictionary::getDict( const Bu::String &sKey ) const
282{ 282{
283 Gats::Dictionary *pOb = dynamic_cast<Gats::Dictionary *>( get( sKey ) ); 283 Gats::Dictionary *pOb = dynamic_cast<Gats::Dictionary *>( get( sKey ) );
284 if( !pOb ) 284 if( !pOb )