You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by ni...@apache.org on 2004/06/02 18:21:55 UTC
cvs commit: logging-log4net/src/Util Transform.cs
nicko 2004/06/02 09:21:55
Modified: src/Util Transform.cs
Log:
Updated parameter names in line with guidelines.
Revision Changes Path
1.4 +13 -13 logging-log4net/src/Util/Transform.cs
Index: Transform.cs
===================================================================
RCS file: /home/cvs/logging-log4net/src/Util/Transform.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Transform.cs 23 Feb 2004 03:18:04 -0000 1.3
+++ Transform.cs 2 Jun 2004 16:21:55 -0000 1.4
@@ -49,42 +49,42 @@
/// Write a string to an XmlWriter
/// </summary>
/// <param name="writer">the writer to write to</param>
- /// <param name="text">the string to write</param>
+ /// <param name="stringData">the string to write</param>
/// <remarks>
/// The test is escaped either using XML escape entities
/// or using CDATA sections.
/// </remarks>
- public static void WriteEscapedXmlString(XmlWriter writer, string text)
+ public static void WriteEscapedXmlString(XmlWriter writer, string stringData)
{
// Write either escaped text or CDATA sections
- int weightCData = 12 * (1 + CountSubstrings(text, CDATA_END));
- int weightStringEscapes = 3*(CountSubstrings(text, "<") + CountSubstrings(text, ">")) + 4*CountSubstrings(text, "&");
+ int weightCData = 12 * (1 + CountSubstrings(stringData, CDATA_END));
+ int weightStringEscapes = 3*(CountSubstrings(stringData, "<") + CountSubstrings(stringData, ">")) + 4*CountSubstrings(stringData, "&");
if (weightStringEscapes <= weightCData)
{
// Write string using string escapes
- writer.WriteString(text);
+ writer.WriteString(stringData);
}
else
{
// Write string using CDATA section
- int end = text.IndexOf(CDATA_END);
+ int end = stringData.IndexOf(CDATA_END);
if (end < 0)
{
- writer.WriteCData(text);
+ writer.WriteCData(stringData);
}
else
{
int start = 0;
while (end > -1)
{
- writer.WriteCData(text.Substring(start, end - start));
- if (end == text.Length - 3)
+ writer.WriteCData(stringData.Substring(start, end - start));
+ if (end == stringData.Length - 3)
{
- start = text.Length;
+ start = stringData.Length;
writer.WriteString(CDATA_END);
break;
}
@@ -92,13 +92,13 @@
{
writer.WriteString(CDATA_UNESCAPABLE_TOKEN);
start = end + 2;
- end = text.IndexOf(CDATA_END, start);
+ end = stringData.IndexOf(CDATA_END, start);
}
}
- if (start < text.Length)
+ if (start < stringData.Length)
{
- writer.WriteCData(text.Substring(start));
+ writer.WriteCData(stringData.Substring(start));
}
}
}