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. --- c++-libbu++/default.bld | 2 +- cs-dotnet/src/gatsdictionary.cs | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/c++-libbu++/default.bld b/c++-libbu++/default.bld index f67b59b..2414f01 100644 --- a/c++-libbu++/default.bld +++ b/c++-libbu++/default.bld @@ -83,7 +83,7 @@ rule "unit" profile "build" { - execute("../libbu++/mkunit \"${INPUT}\" \"${OUTPUT}\""); + execute("../../libbu++/mkunit \"${INPUT}\" \"${OUTPUT}\""); } } 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