Mercurial > repos > IBBoard.Ini
comparison IniFile.cs @ 2:2dde4c1d19d9
Closes #6 - Create INI parser
* Add more documentation
* Change NonExistantIniSection so that the constructor won't cause an exception
* Fix IniFileReader so that the reading from string actually reads from the parameter
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 12 Jan 2009 20:34:07 +0000 |
parents | f9444f1786cd |
children | 01fc09ab63e2 |
comparison
equal
deleted
inserted
replaced
1:f9444f1786cd | 2:2dde4c1d19d9 |
---|---|
71 | 71 |
72 return section; | 72 return section; |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 | 76 /// <summary> |
77 /// Checks whether the IniFile contains an <see cref=" IniSection"/> with the specified name | |
78 /// </summary> | |
79 /// <param name="sectionName"> | |
80 /// The name of the section to look for | |
81 /// </param> | |
82 /// <returns> | |
83 /// <code>true</code> if the section is in the file, else <code>false</code> | |
84 /// </returns> | |
77 public bool HasSection(string sectionName) | 85 public bool HasSection(string sectionName) |
78 { | 86 { |
79 return sections.ContainsKey(sectionName.Trim()); | 87 return sections.ContainsKey(sectionName.Trim()); |
80 } | 88 } |
81 | 89 |
90 /// <summary> | |
91 /// Gets an array of the <see cref=" IniSection"/>s in the file | |
92 /// </summary> | |
82 public IniSection[] Sections | 93 public IniSection[] Sections |
83 { | 94 { |
84 get | 95 get |
85 { | 96 { |
86 IniSection[] col = new IniSection[sections.Count]; | 97 IniSection[] col = new IniSection[sections.Count]; |