src/JsonParser.cpp
// string literal: null / true / false
/*
need setType outside parseLiteral
literal should not be "" or NULL
*/
string literal: null / true / false
need setType outside parseLiteral
literal should not be "" or NULL
string literal : null / true / false need setType outside parseLiteral literal should not be " " or NULL
int JsonParser::parseLiteral(JsonValue& value, const char* literal, ValueType vType)
{
	assert(*m_pJson == literal[0]);
	m_pJson++;
	literal++;
	int i = 0;
	for (i = 0; literal[i]; i++) 
	{
		if (m_pJson[i] != literal[i])
			return eInvalidValue;
	}
	m_pJson += i;
	value.setType(vType);
	return eOk;
}
int JsonParser :: parseLiteral ( JsonValue & value , const char * literal , ValueType vType ) { assert ( * m_pJson == literal [ 0 ] ) ; m_pJson ++ ; literal ++ ; int i = 0 ; for ( i = 0 ; literal [ i ] ; i ++ ) { if ( m_pJson [ i ] != literal [ i ] ) return eInvalidValue ; } m_pJson += i ; value . setType ( vType ) ; return eOk ; }
string literal: null / true / false
need setType outside parseLiteral
literal should not be "" or NULL
string literal : null / true / false need setType outside parseLiteral literal should not be " " or NULL
// literal[i] != '\0'