Author: ankit
Date: 2007-07-10 11:08:05 -0400 (Tue, 10 Jul 2007)
New Revision: 81719
Modified:
trunk/monodevelop/Extras/prj2make-sharp-lib/ChangeLog
trunk/monodevelop/Extras/prj2make-sharp-lib/MsPrjHelper.cs
trunk/monodevelop/Extras/prj2make-sharp-lib/SlnFileFormat.cs
trunk/monodevelop/Extras/prj2make-sharp-lib/VS2003SlnFileFormat.cs
Log:
* MsPrjHelper.cs (GetSlnFileVersion): Use static Regex objects -
SlnFileFormat.SlnVersionRegex and SlnFileFormat.ProjectRegex .
* VS2003SlnFileFormat (GetSlnFileVersion): Likewise.
* SlnFileFormat.cs (SlnVersionRegex):
(ProjectRegex): Make internal.
Modified: trunk/monodevelop/Extras/prj2make-sharp-lib/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/prj2make-sharp-lib/ChangeLog 2007-07-10
15:07:05 UTC (rev 81718)
+++ trunk/monodevelop/Extras/prj2make-sharp-lib/ChangeLog 2007-07-10
15:08:05 UTC (rev 81719)
@@ -1,5 +1,13 @@
2007-07-10 Ankit Jain <[EMAIL PROTECTED]>
+ * MsPrjHelper.cs (GetSlnFileVersion): Use static Regex objects -
+ SlnFileFormat.SlnVersionRegex and SlnFileFormat.ProjectRegex .
+ * VS2003SlnFileFormat (GetSlnFileVersion): Likewise.
+ * SlnFileFormat.cs (SlnVersionRegex):
+ (ProjectRegex): Make internal.
+
+2007-07-10 Ankit Jain <[EMAIL PROTECTED]>
+
* MsPrjHelper.cs (projNameInfo):
(projGuidInfo): Should not be static.
(ParseSolution): Use 'using' pattern with the StreamReader.
Modified: trunk/monodevelop/Extras/prj2make-sharp-lib/MsPrjHelper.cs
===================================================================
--- trunk/monodevelop/Extras/prj2make-sharp-lib/MsPrjHelper.cs 2007-07-10
15:07:05 UTC (rev 81718)
+++ trunk/monodevelop/Extras/prj2make-sharp-lib/MsPrjHelper.cs 2007-07-10
15:08:05 UTC (rev 81719)
@@ -93,11 +93,9 @@
Match match;
FileStream fis = new FileStream(strInSlnFile,
FileMode.Open, FileAccess.Read, FileShare.Read);
StreamReader reader = new StreamReader(fis);
- Regex regex = new Regex(@"Microsoft Visual Studio
Solution File, Format Version (\d.\d\d)");
-
strInput = reader.ReadLine();
- match = regex.Match(strInput);
+ match = SlnFileFormat.SlnVersionRegex.Match(strInput);
if (match.Success)
{
strVersion = match.Groups[1].Value;
@@ -140,14 +138,12 @@
{
FileStream fis = new FileStream(fname,FileMode.Open,
FileAccess.Read, FileShare.Read);
using (StreamReader reader = new StreamReader(fis)) {
- Regex regex = new
Regex(@"Project\(""\{(.*)\}""\) = ""(.*)"", ""(.*)"", ""(\{.*\})""");
-
while (true)
{
string s = reader.ReadLine();
Match match;
- match = regex.Match(s);
+ match =
SlnFileFormat.ProjectRegex.Match(s);
if (match.Success)
{
string projectName =
match.Groups[2].Value;
Modified: trunk/monodevelop/Extras/prj2make-sharp-lib/SlnFileFormat.cs
===================================================================
--- trunk/monodevelop/Extras/prj2make-sharp-lib/SlnFileFormat.cs
2007-07-10 15:07:05 UTC (rev 81718)
+++ trunk/monodevelop/Extras/prj2make-sharp-lib/SlnFileFormat.cs
2007-07-10 15:08:05 UTC (rev 81719)
@@ -850,7 +850,7 @@
// static regexes
static Regex projectRegex = null;
- static Regex ProjectRegex {
+ internal static Regex ProjectRegex {
get {
if (projectRegex == null)
projectRegex = new
Regex(@"Project\(""\{(.*)\}""\) = ""(.*)"", ""(.*)"", ""(\{.*\})""");
@@ -868,7 +868,7 @@
}
static Regex slnVersionRegex = null;
- static Regex SlnVersionRegex {
+ internal static Regex SlnVersionRegex {
get {
if (slnVersionRegex == null)
slnVersionRegex = new Regex
(@"Microsoft Visual Studio Solution File, Format Version (\d.\d\d)");
Modified: trunk/monodevelop/Extras/prj2make-sharp-lib/VS2003SlnFileFormat.cs
===================================================================
--- trunk/monodevelop/Extras/prj2make-sharp-lib/VS2003SlnFileFormat.cs
2007-07-10 15:07:05 UTC (rev 81718)
+++ trunk/monodevelop/Extras/prj2make-sharp-lib/VS2003SlnFileFormat.cs
2007-07-10 15:08:05 UTC (rev 81719)
@@ -143,13 +143,11 @@
string strInput = null;
Match match;
StreamReader reader = new StreamReader(strInSlnFile);
- Regex regex = new Regex(@"Microsoft Visual Studio
Solution File, Format Version (\d.\d\d)");
-
strInput = reader.ReadLine();
- match = regex.Match(strInput);
+ match = SlnFileFormat.SlnVersionRegex.Match(strInput);
if (!match.Success) {
- match = regex.Match (reader.ReadLine ());
+ match = SlnFileFormat.SlnVersionRegex.Match
(reader.ReadLine ());
}
if (match.Success)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches