Skip to content

Instantly share code, notes, and snippets.

@johnsyweb
Created February 5, 2013 08:41
Show Gist options
  • Save johnsyweb/4713099 to your computer and use it in GitHub Desktop.
Save johnsyweb/4713099 to your computer and use it in GitHub Desktop.
Comments are lies!
// --------------------------------------------------------------------------
// Method Name: CProtocolField::setValue
// Definition: This method sets the value attribute of the CProtocolField.
// Qualification: none
// Export: public
//
// Return: void
// Parameters: double value
//
// Preconditions: none
// Postconditions: this->getString() == value
// Exceptions: none
void
CProtocolField::setValue(const string& value)
{
myLength = value.length();
myValue = new char[myLength+1];
if (myValue != 0)
{
memcpy(myValue, value.c_str(), myLength);
}
myValue[myLength] = '\0';
myBuffer = NULL;
}
// --------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment