Exemplo n.º 1
0
static vsString ExtractWhitespaceStringToken( vsString &string )	// pull out a string defined by whitespace
{
	vsString label;

	size_t len = string.length();
	size_t index = 0;

	for ( index = 0; index < len; index++ )
	{
		if ( IsWhitespace(string[index]) )	// this character isn't alphabetic, so isn't part of the label
		{
			index--;					// back up one character
			break;						// exit the loop
		}
	}

	label = string.substr(0, index+1);
	string.erase(0,index+1);

	return label;
}
Exemplo n.º 2
0
static vsString ExtractNumberToken( vsString &string )
{
	vsAssert(IsNumeric(string[0]), "Tried to extract a number from something that isn't a number!");
	// okay.  We need to find
	vsString numberString;

	size_t len = string.length();
	size_t index = 0;

	for ( index = 0; index < len; index++ )
	{
		if ( !IsNumeric(string[index]) )	// this character isn't alphabetic, so isn't part of the label
		{
			index--;					// back up one character
			break;						// exit the loop
		}
	}

	numberString = string.substr(0, index+1);
	string.erase(0,index+1);

	return numberString;
}