namespace CSharpParser
{
class Parser
{
private string m_strData;
private int m_nMaxLength;
private List<string> m_lData;
/*! \brief Constructor of the parser class.
*/
public Parser()
{
ClearData();
m_lData = new List<string>();
m_nMaxLength = 256;
}
public void ClearData()
{
m_strData = “”;
}
/*! \brief Add data to the \ref m_strData variable and make sure it is not larger than \ref m_nMaxLength
* \param string to be added to \ref m_strData
*/
public void AddData(string _data)
{
m_strData += _data;
if (m_strData.Length > m_nMaxLength)
{
m_strData = m_strData.Remove(m_strData.Length – m_nMaxLength);
}
}
/*! \brief Sor the data in \ref m_strData by splitting by ‘\r’ characters
*/
public void SortData()
{
string[] _data = m_strData.Split(‘\r’);
foreach (string _str in _data)
m_lData.Add(_str);
}
/*! \brief Returnt the data in the \ref m_lData list for processing by inheritance or parent
* \return List<string> List of possible strings
*/
public List<string> GetData()
{
return m_lData;
}
}
}