diff options
author | Mike Buland <eichlan@xagasoft.com> | 2013-03-05 03:16:21 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2013-03-05 03:16:21 +0000 |
commit | 86eb61d18b97230bb47f6651e44597cef7e4c24b (patch) | |
tree | e803acb50fc889f32ad15439eed8a40ff7e19dea /cs-dotnet/src | |
parent | 713a4cc24da81b513962a85d4b4c43fb6b79419d (diff) | |
download | libgats-86eb61d18b97230bb47f6651e44597cef7e4c24b.tar.gz libgats-86eb61d18b97230bb47f6651e44597cef7e4c24b.tar.bz2 libgats-86eb61d18b97230bb47f6651e44597cef7e4c24b.tar.xz libgats-86eb61d18b97230bb47f6651e44597cef7e4c24b.zip |
Added more helpers to the GatsDictionary in the C# version.
Diffstat (limited to 'cs-dotnet/src')
-rw-r--r-- | cs-dotnet/src/gatsdictionary.cs | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/cs-dotnet/src/gatsdictionary.cs b/cs-dotnet/src/gatsdictionary.cs index 722b13e..9949b85 100644 --- a/cs-dotnet/src/gatsdictionary.cs +++ b/cs-dotnet/src/gatsdictionary.cs | |||
@@ -242,7 +242,7 @@ namespace Com.Xagasoft.Gats | |||
242 | 242 | ||
243 | public bool IsReadOnly | 243 | public bool IsReadOnly |
244 | { | 244 | { |
245 | get { return false; } // return this.Value.IsReadOnly; } | 245 | get { return false; } |
246 | } | 246 | } |
247 | 247 | ||
248 | public void Add( KeyValuePair<string,GatsObject> pair ) | 248 | public void Add( KeyValuePair<string,GatsObject> pair ) |
@@ -255,6 +255,41 @@ namespace Com.Xagasoft.Gats | |||
255 | Value.Clear(); | 255 | Value.Clear(); |
256 | } | 256 | } |
257 | 257 | ||
258 | public GatsDictionary GetDict( string Key ) | ||
259 | { | ||
260 | return this[Key] as GatsDictionary; | ||
261 | } | ||
262 | |||
263 | public GatsList GetList( string Key ) | ||
264 | { | ||
265 | return this[Key] as GatsList; | ||
266 | } | ||
267 | |||
268 | public long GetInt( string Key ) | ||
269 | { | ||
270 | return (this[Key] as GatsInteger).Value; | ||
271 | } | ||
272 | |||
273 | public bool GetBool( string Key ) | ||
274 | { | ||
275 | return (this[Key] as GatsBoolean).Value; | ||
276 | } | ||
277 | |||
278 | public double GetFloat( string Key ) | ||
279 | { | ||
280 | return (this[Key] as GatsFloat).Value; | ||
281 | } | ||
282 | |||
283 | public byte[] GetString( string Key ) | ||
284 | { | ||
285 | return (this[Key] as GatsString).Value; | ||
286 | } | ||
287 | |||
288 | public string GetUtf8String( string Key ) | ||
289 | { | ||
290 | return (this[Key] as GatsString).ToString(); | ||
291 | } | ||
292 | |||
258 | public bool Contains( KeyValuePair<string,GatsObject> pair ) | 293 | public bool Contains( KeyValuePair<string,GatsObject> pair ) |
259 | { | 294 | { |
260 | return ((IDictionary<string,GatsObject>)Value).Contains( pair ); | 295 | return ((IDictionary<string,GatsObject>)Value).Contains( pair ); |