I found the cause of my checksum problem: the setString() function on
the field class does not reset the m_total member before adding to it:
void setString( const std::string& string )
{
m_string = string;
m_data = IntConvertor::convert(m_field) + "=" + string + "\001";
m_length = m_data.length();
const char* iter = m_data.c_str();
const char* end = iter + m_data.length();
while( iter != end )
m_total += *iter++;
}
My suggestion is that a line be added as such:
void setString( const std::string& string )
{
m_string = string;
m_data = IntConvertor::convert(m_field) + "=" + string + "\001";
m_length = m_data.length();
const char* iter = m_data.c_str();
const char* end = iter + m_data.length();
m_total = 0;
while( iter != end )
m_total += *iter++;
}
Jo Janssens
Telluride Asset Management
|