diff options
Diffstat (limited to 'OpenSim/Framework/Data/IniConfig.cs')
-rw-r--r-- | OpenSim/Framework/Data/IniConfig.cs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/OpenSim/Framework/Data/IniConfig.cs b/OpenSim/Framework/Data/IniConfig.cs index f0f63b4..048b491 100644 --- a/OpenSim/Framework/Data/IniConfig.cs +++ b/OpenSim/Framework/Data/IniConfig.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | using System.IO; | 28 | using System.IO; |
29 | using System.Text.RegularExpressions; | 29 | using System.Text.RegularExpressions; |
30 | |||
30 | /* | 31 | /* |
31 | Taken from public code listing at by Alex Pinsker | 32 | Taken from public code listing at by Alex Pinsker |
32 | http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html | 33 | http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html |
@@ -52,7 +53,8 @@ namespace OpenSim.Framework.Data | |||
52 | RegexOptions.Compiled | | 53 | RegexOptions.Compiled | |
53 | RegexOptions.CultureInvariant); | 54 | RegexOptions.CultureInvariant); |
54 | } | 55 | } |
55 | static private Regex _iniKeyValuePatternRegex; | 56 | |
57 | private static Regex _iniKeyValuePatternRegex; | ||
56 | 58 | ||
57 | public IniFile(string iniFileName) | 59 | public IniFile(string iniFileName) |
58 | { | 60 | { |
@@ -62,7 +64,7 @@ namespace OpenSim.Framework.Data | |||
62 | public string ParseFileReadValue(string key) | 64 | public string ParseFileReadValue(string key) |
63 | { | 65 | { |
64 | using (StreamReader reader = | 66 | using (StreamReader reader = |
65 | new StreamReader(_iniFileName)) | 67 | new StreamReader(_iniFileName)) |
66 | { | 68 | { |
67 | do | 69 | do |
68 | { | 70 | { |
@@ -72,18 +74,16 @@ namespace OpenSim.Framework.Data | |||
72 | if (match.Success) | 74 | if (match.Success) |
73 | { | 75 | { |
74 | string currentKey = | 76 | string currentKey = |
75 | match.Groups["Key"].Value as string; | 77 | match.Groups["Key"].Value as string; |
76 | if (currentKey != null && | 78 | if (currentKey != null && |
77 | currentKey.Trim().CompareTo(key) == 0) | 79 | currentKey.Trim().CompareTo(key) == 0) |
78 | { | 80 | { |
79 | string value = | 81 | string value = |
80 | match.Groups["Value"].Value as string; | 82 | match.Groups["Value"].Value as string; |
81 | return value; | 83 | return value; |
82 | } | 84 | } |
83 | } | 85 | } |
84 | 86 | } while (reader.Peek() != -1); | |
85 | } | ||
86 | while (reader.Peek() != -1); | ||
87 | } | 87 | } |
88 | return null; | 88 | return null; |
89 | } | 89 | } |
@@ -91,6 +91,8 @@ namespace OpenSim.Framework.Data | |||
91 | public string IniFileName | 91 | public string IniFileName |
92 | { | 92 | { |
93 | get { return _iniFileName; } | 93 | get { return _iniFileName; } |
94 | } private string _iniFileName; | 94 | } |
95 | |||
96 | private string _iniFileName; | ||
95 | } | 97 | } |
96 | } | 98 | } \ No newline at end of file |