예제 #1
0
bool Utils::toBoolean( const std::string& pstring )
{

    if ( ignoreCaseCompare( pstring, "true" )
        || ignoreCaseCompare( pstring, "T" )
        || pstring == "1" )
        return true;
    else
        return false;
}
예제 #2
0
파일: CinReader.cpp 프로젝트: dga/school
bool CinReader::testBoolInput (string input)
{
	if (input.length() > 0)
	{
		if (input.length() == 1)
		{
			if (toupper(input[0]) == 'T' || toupper(input[0]) == 'F')
				return true;
			else
				return false;
		}
		else
		{
			if (ignoreCaseCompare(input, "TRUE") || 
			    ignoreCaseCompare(input, "FALSE"))
				return true;
			else
				return false;
		}
	}
	else
		return false;
}