//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
+// Lluis Sanchez Gual <lluis@novell.com>
+// Michael Hutchinson <mhutchinson@novell.com>
//
// (C) 2005 Marek Sieradzki
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
-using System.Collections;
-using System.Text;
+using Mono.XBuild.Utilities;
namespace Microsoft.Build.BuildEngine {
public static class Utilities {
-
- static Hashtable charsToEscape;
-
- static Utilities ()
+
+ public static string Escape (string unescapedExpression)
{
- charsToEscape = new Hashtable ();
-
- charsToEscape.Add ('$', null);
- charsToEscape.Add ('%', null);
- charsToEscape.Add ('\'', null);
- charsToEscape.Add ('(', null);
- charsToEscape.Add (')', null);
- charsToEscape.Add ('*', null);
- charsToEscape.Add (';', null);
- charsToEscape.Add ('?', null);
- charsToEscape.Add ('@', null);
+ return MSBuildUtils.Escape (unescapedExpression);
}
-
- public static string Escape (string unescapedExpression)
+
+ internal static string FromMSBuildPath (string relPath)
{
- StringBuilder sb = new StringBuilder ();
-
- foreach (char c in unescapedExpression) {
- if (charsToEscape.Contains (c)) {
- sb.AppendFormat ("%{0:x2}", (int) c);
- } else
- sb.Append (c);
- }
-
- return sb.ToString ();
+ return MSBuildUtils.FromMSBuildPath (relPath);
}
}
+
}
#endif