Created
February 5, 2013 08:41
-
-
Save johnsyweb/4713099 to your computer and use it in GitHub Desktop.
Comments are lies!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -------------------------------------------------------------------------- | |
// 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