src/Web.cpp
/// <summary>
/// Copies the current web response (only valid before another web event) into a supplied buffer.
/// </summary>
/// <param name="responseBuffer">The buffer to place the response.</param>
/// <param name="length">The maximum length of the buffer.</param>
/// <param name="parts">Array of character pointers to populate after parsing.</param>
/// <param name="partCount">The part count.</param>

Copies the current web response (only valid before another web event) into a supplied buffer.

The buffer to place the response.
The maximum length of the buffer.
Array of character pointers to populate after parsing.
The part count.
Copies the current web response ( only valid before another web event ) into a supplied buffer . The buffer to place the response . The maximum length of the buffer . Array of character pointers to populate after parsing . The part count .
void Web::getResponse(char* responseBuffer, int length, char** parts, int partCount)
{
	strncpy(responseBuffer, response, length);
	if (parts && partCount > 0)
	{
		int count = 0;
		int index = 0;
		parts[count++] = &responseBuffer[index];
		while (count < partCount && ++index<length && responseBuffer[index])
		{
			if (responseBuffer[index] == '|')
			{
				parts[count++] = &responseBuffer[index + 1];
				responseBuffer[index] = '\0';
			}
		}
	}
}
void Web :: getResponse ( char * responseBuffer , int length , char * * parts , int partCount ) { strncpy ( responseBuffer , response , length ) ; if ( parts && partCount > 0 ) { int count = 0 ; int index = 0 ; parts [ count ++ ] = & responseBuffer [ index ] ; while ( count < partCount && ++ index < length && responseBuffer [ index ] ) { if ( responseBuffer [ index ] == ' ' ) { parts [ count ++ ] = & responseBuffer [ index + 1 ] ; responseBuffer [ index ] = ' \0 ' ; } } } }
<summary>
Copies the current web response (only valid before another web event) into a supplied buffer.
<summary > Copies the current web response ( only valid before another web event ) into a supplied buffer .