Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22207/Util
Modified Files:
StringHelper.cs
Log Message:
Refactored the Dialect out of the StringHelper
Index: StringHelper.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/StringHelper.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** StringHelper.cs 15 Apr 2004 13:21:19 -0000 1.10
--- StringHelper.cs 15 Apr 2004 21:07:19 -0000 1.11
***************
*** 15,19 ****
public const string SqlParameter = "?";
! public static Dialect.Dialect Dialect;
[Obsolete("Use String.Join() instead of this method. It does the same thing")]
--- 15,19 ----
public const string SqlParameter = "?";
! // public static Dialect.Dialect Dialect;
[Obsolete("Use String.Join() instead of this method. It does the same thing")]
***************
*** 130,141 ****
public static string Suffix(string name, string suffix) {
! if (suffix == null)
! return name;
!
! char quote = name[0];
! if (UnQuote(name) != name)
! return Dialect.QuoteForColumnName(UnQuote(name) + suffix);
! else
! return Dialect.QuoteForColumnName(name + suffix);
}
--- 130,136 ----
public static string Suffix(string name, string suffix) {
! return (suffix == null) ?
! name :
! name + suffix;
}
***************
*** 194,213 ****
return results;
}
!
! public static string UnQuote(string name) {
! return Dialect.UnQuote(name);
! }
!
! public static void UnQuoteInPlace(string[] names) {
! for (int i=0; i<names.Length; i++)
! names[i] = UnQuote(names[i]);
! }
!
! public static string[] UnQuote(string[] names) {
! string[] unquoted = new string[ names.Length ];
! for (int i=0; i<names.Length; i++)
! unquoted[i] = UnQuote(names[i]);
! return unquoted;
! }
}
}
--- 189,213 ----
return results;
}
! //
! // [Obsolete("Should directly call Dialect instead")]
! // public static string UnQuote(string name) {
! // return Dialect.UnQuote(name);
! // }
! //
! // [Obsolete("Should directly call Dialect instead")]
! // public static void UnQuoteInPlace(string[] names)
! // {
! // for (int i=0; i<names.Length; i++)
! // names[i] = UnQuote(names[i]);
! // }
! //
! // [Obsolete("Should directly call Dialect instead")]
! // public static string[] UnQuote(string[] names)
! // {
! // string[] unquoted = new string[ names.Length ];
! // for (int i=0; i<names.Length; i++)
! // unquoted[i] = UnQuote(names[i]);
! // return unquoted;
! // }
}
}
|