From 86eb61d18b97230bb47f6651e44597cef7e4c24b Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 5 Mar 2013 03:16:21 +0000 Subject: Added more helpers to the GatsDictionary in the C# version. --- cs-dotnet/src/gatsdictionary.cs | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'cs-dotnet') 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 public bool IsReadOnly { - get { return false; } // return this.Value.IsReadOnly; } + get { return false; } } public void Add( KeyValuePair pair ) @@ -255,6 +255,41 @@ namespace Com.Xagasoft.Gats Value.Clear(); } + public GatsDictionary GetDict( string Key ) + { + return this[Key] as GatsDictionary; + } + + public GatsList GetList( string Key ) + { + return this[Key] as GatsList; + } + + public long GetInt( string Key ) + { + return (this[Key] as GatsInteger).Value; + } + + public bool GetBool( string Key ) + { + return (this[Key] as GatsBoolean).Value; + } + + public double GetFloat( string Key ) + { + return (this[Key] as GatsFloat).Value; + } + + public byte[] GetString( string Key ) + { + return (this[Key] as GatsString).Value; + } + + public string GetUtf8String( string Key ) + { + return (this[Key] as GatsString).ToString(); + } + public bool Contains( KeyValuePair pair ) { return ((IDictionary)Value).Contains( pair ); -- cgit v1.2.3