private void WriteComment(string comment)
{
int index = 0;
while (true)
{
if (comment.Length <= index + kCommentWrapLength)
{
m_Writer.WriteLine (m_Indentation + "// " + comment.Substring (index));
break;
}
else
{
int wrapIndex = comment.IndexOf (' ', index + kCommentWrapLength);
if (wrapIndex < 0)
{
m_Writer.WriteLine (m_Indentation + "// " + comment.Substring (index));
break;
}
else
{
m_Writer.WriteLine (m_Indentation + "// " + comment.Substring (index, wrapIndex-index));
index = wrapIndex + 1;
}
}
}
}