Beispiel #1
0
Gwen::String ColorPicker::GetColorFromName( Gwen::String name )
{
	if ( name.find("Red") != Gwen::String::npos )
		return "Red";
	if ( name.find("Green") != Gwen::String::npos )
		return "Green";
	if ( name.find("Blue") != Gwen::String::npos )
		return "Blue";
	if ( name.find("Alpha") != Gwen::String::npos )
		return "Alpha";
	else
		return "";
}
Beispiel #2
0
gwen::String ColorPicker::GetColorFromName( gwen::String name )
{
	if ( name.find( "Red" ) != gwen::String::npos )
	{ return "Red"; }

	if ( name.find( "Green" ) != gwen::String::npos )
	{ return "Green"; }

	if ( name.find( "Blue" ) != gwen::String::npos )
	{ return "Blue"; }

	if ( name.find( "Alpha" ) != gwen::String::npos )
	{ return "Alpha"; }
	else
	{ return ""; }
}
Beispiel #3
0
void Gwen::Utility::Strings::Split( const Gwen::String& str, const Gwen::String& seperator, Strings::List& outbits, bool bLeave )
{
	int iOffset = 0;
	int iLength = str.length();
	int iSepLen = seperator.length();

	size_t i = str.find( seperator, 0 );
	while ( i != std::string::npos )
	{
		outbits.push_back( str.substr( iOffset, i-iOffset ) );
		iOffset = i + iSepLen;

		i = str.find( seperator, iOffset );
		if ( bLeave ) iOffset -= iSepLen;
	}

	outbits.push_back( str.substr( iOffset, iLength-iOffset ) );
}