aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data/IniConfig.cs
diff options
context:
space:
mode:
authorlbsa712007-10-30 09:05:31 +0000
committerlbsa712007-10-30 09:05:31 +0000
commit67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch)
tree20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Framework/Data/IniConfig.cs
parent* Deleted .user file (diff)
downloadopensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz
* Optimized usings
* Shortened type references * Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Framework/Data/IniConfig.cs')
-rw-r--r--OpenSim/Framework/Data/IniConfig.cs22
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*/
28using System.IO; 28using System.IO;
29using System.Text.RegularExpressions; 29using 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