nicko 2004/05/30 03:50:09
Modified: src/Util OptionConverter.cs
Log:
Removed unused methods:
ConcatenateArrays, ToInt, FindAndSubst
Renamed method SubstVars to SubstituteVariables
Revision Changes Path
1.4 +93 -93 logging-log4net/src/Util/OptionConverter.cs
Index: OptionConverter.cs
===================================================================
RCS file: /home/cvs/logging-log4net/src/Util/OptionConverter.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- OptionConverter.cs 23 Feb 2004 03:18:04 -0000 1.3
+++ OptionConverter.cs 30 May 2004 10:50:09 -0000 1.4
@@ -50,42 +50,42 @@
#region Public Static Methods
- /// <summary>
- /// Concatenates two string arrays.
- /// </summary>
- /// <param name="l">Left array.</param>
- /// <param name="r">Right array.</param>
- /// <returns>Array containing both left and right
arrays.</returns>
- public static string[] ConcatenateArrays(string[] l, string[]
r)
- {
- return (string[])ConcatenateArrays(l, r);
- }
-
- /// <summary>
- /// Concatenates two arrays.
- /// </summary>
- /// <param name="l">Left array</param>
- /// <param name="r">Right array</param>
- /// <returns>Array containing both left and right
arrays.</returns>
- public static Array ConcatenateArrays(Array l, Array r)
- {
- if (l == null)
- {
- throw new ArgumentNullException("l");
- }
- if (r == null)
- {
- throw new ArgumentNullException("r");
- }
-
- int len = l.Length + r.Length;
- Array a = Array.CreateInstance(l.GetType(), len);
-
- Array.Copy(l, 0, a, 0, l.Length);
- Array.Copy(r, 0, a, l.Length, r.Length);
+// /// <summary>
+// /// Concatenates two string arrays.
+// /// </summary>
+// /// <param name="l">Left array.</param>
+// /// <param name="r">Right array.</param>
+// /// <returns>Array containing both left and right
arrays.</returns>
+// public static string[] ConcatenateArrays(string[] l, string[]
r)
+// {
+// return (string[])ConcatenateArrays(l, r);
+// }
- return a;
- }
+// /// <summary>
+// /// Concatenates two arrays.
+// /// </summary>
+// /// <param name="l">Left array</param>
+// /// <param name="r">Right array</param>
+// /// <returns>Array containing both left and right
arrays.</returns>
+// public static Array ConcatenateArrays(Array l, Array r)
+// {
+// if (l == null)
+// {
+// throw new ArgumentNullException("l");
+// }
+// if (r == null)
+// {
+// throw new ArgumentNullException("r");
+// }
+//
+// int len = l.Length + r.Length;
+// Array a = Array.CreateInstance(l.GetType(), len);
+//
+// Array.Copy(l, 0, a, 0, l.Length);
+// Array.Copy(r, 0, a, l.Length, r.Length);
+//
+// return a;
+// }
/// <summary>
/// Converts string escape characters back to their correct
values.
@@ -150,32 +150,32 @@
return defaultValue;
}
- /// <summary>
- /// Converts a string to an integer.
- /// </summary>
- /// <param name="argValue">String to convert.</param>
- /// <param name="defaultValue">The default value.</param>
- /// <remarks>
- /// <paramref name="defaultValue"/> is returned when <paramref
name="argValue"/>
- /// cannot be converted to a <see cref="int" /> value.
- /// </remarks>
- /// <returns>The <see cref="int" /> value of <paramref
name="argValue" />.</returns>
- public static int ToInt(string argValue, int defaultValue)
- {
- if (argValue != null)
- {
- string s = argValue.Trim();
- try
- {
- return int.Parse(s,
NumberFormatInfo.InvariantInfo);
- }
- catch (Exception e)
- {
- LogLog.Error("OptionConverter: [" + s +
"] is not in proper int form.", e);
- }
- }
- return defaultValue;
- }
+// /// <summary>
+// /// Converts a string to an integer.
+// /// </summary>
+// /// <param name="argValue">String to convert.</param>
+// /// <param name="defaultValue">The default value.</param>
+// /// <remarks>
+// /// <paramref name="defaultValue"/> is returned when <paramref
name="argValue"/>
+// /// cannot be converted to a <see cref="int" /> value.
+// /// </remarks>
+// /// <returns>The <see cref="int" /> value of <paramref
name="argValue" />.</returns>
+// public static int ToInt(string argValue, int defaultValue)
+// {
+// if (argValue != null)
+// {
+// string s = argValue.Trim();
+// try
+// {
+// return int.Parse(s,
NumberFormatInfo.InvariantInfo);
+// }
+// catch (Exception e)
+// {
+// LogLog.Error("OptionConverter: [" + s +
"] is not in proper int form.", e);
+// }
+// }
+// return defaultValue;
+// }
/// <summary>
/// Parses a file size into a number.
@@ -389,37 +389,37 @@
throw new ArgumentException("Cannot convert source
object [" + sourceObject.ToString() + "] to target type [" + targetType.Name +
"]", "sourceObject");
}
- /// <summary>
- /// Finds the value corresponding to <paramref name="key"/> in
- /// <paramref name="props"/> and then perform variable
substitution
- /// on the found value.
- /// </summary>
- /// <param name="key">The key to lookup.</param>
- /// <param name="props">The association to use for
lookups.</param>
- /// <returns>The substituted result.</returns>
- public static string FindAndSubst(string key,
System.Collections.IDictionary props)
- {
- if (props == null)
- {
- throw new ArgumentNullException("props");
- }
-
- string v = props[key] as string;
- if (v == null)
- {
- return null;
- }
-
- try
- {
- return SubstVars(v, props);
- }
- catch(Exception e)
- {
- LogLog.Error("OptionConverter: Bad option value
[" + v + "].", e);
- return v;
- }
- }
+// /// <summary>
+// /// Finds the value corresponding to <paramref name="key"/> in
+// /// <paramref name="props"/> and then perform variable
substitution
+// /// on the found value.
+// /// </summary>
+// /// <param name="key">The key to lookup.</param>
+// /// <param name="props">The association to use for
lookups.</param>
+// /// <returns>The substituted result.</returns>
+// public static string FindAndSubst(string key,
System.Collections.IDictionary props)
+// {
+// if (props == null)
+// {
+// throw new ArgumentNullException("props");
+// }
+//
+// string v = props[key] as string;
+// if (v == null)
+// {
+// return null;
+// }
+//
+// try
+// {
+// return SubstituteVariables(v, props);
+// }
+// catch(Exception e)
+// {
+// LogLog.Error("OptionConverter: Bad option value
[" + v + "].", e);
+// return v;
+// }
+// }
/// <summary>
/// Instantiates an object given a class name.
@@ -501,7 +501,7 @@
/// </para>
/// </remarks>
/// <returns>The result of the substitutions.</returns>
- public static string SubstVars(string value,
System.Collections.IDictionary props)
+ public static string SubstituteVariables(string value,
System.Collections.IDictionary props)
{
StringBuilder buf = new StringBuilder();