changeset 9:5b0052b5585f

Closes #11 - Add getter methods to IniFile and IniSection * Add method implementations
author IBBoard <dev@ibboard.co.uk>
date Sat, 21 Feb 2009 11:01:04 +0000
parents 2bba3fb360ed
children 848e7b151d3c
files IniFile.cs IniSection.cs
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/IniFile.cs	Sat Feb 21 10:56:47 2009 +0000
+++ b/IniFile.cs	Sat Feb 21 11:01:04 2009 +0000
@@ -128,7 +128,8 @@
 		/// </returns>
 		public string GetSectionLineValue(string sectionName, string lineKey)
 		{
-			return null;
+			IniSection section = this[sectionName];
+			return section.GetLineValue(lineKey);
 		}
 		
 		/// <summary>
@@ -149,7 +150,8 @@
 		/// </returns>
 		public string GetSectionLineValue(string sectionName, string lineKey, string defaultValue)
 		{
-			return null;
+			IniSection section = this[sectionName];
+			return section.GetLineValue(lineKey, defaultValue);
 		}
 	}
 }
--- a/IniSection.cs	Sat Feb 21 10:56:47 2009 +0000
+++ b/IniSection.cs	Sat Feb 21 11:01:04 2009 +0000
@@ -150,7 +150,8 @@
 		/// </returns>
 		public string GetLineValue(string lineKey)
 		{
-			return null;
+			IniKeyValuePairLine line = this[lineKey];
+			return (line == null ? null : line.Value);;
 		}
 		
 		/// <summary>
@@ -168,7 +169,8 @@
 		/// </returns>
 		public string GetLineValue(string lineKey, string defaultValue)
 		{
-			return null;
+			string lineValue = GetLineValue(lineKey);
+			return (lineValue == null ? defaultValue : lineValue);
 		}
 	}
 }