mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-23 00:07:58 +02:00
Renamed Reader::getFormatedErrorMessages() to getFormattedErrorMessages. Bug #3023708 (Formatted has 2 't'). The old member function is deprecated but still present for backward compatibility.
This commit is contained in:
@@ -839,8 +839,16 @@ Reader::getLocationLineAndColumn( Location location ) const
|
||||
}
|
||||
|
||||
|
||||
// Deprecated. Preserved for backward compatibility
|
||||
std::string
|
||||
Reader::getFormatedErrorMessages() const
|
||||
{
|
||||
return getFormattedErrorMessages();
|
||||
}
|
||||
|
||||
|
||||
std::string
|
||||
Reader::getFormattedErrorMessages() const
|
||||
{
|
||||
std::string formattedMessage;
|
||||
for ( Errors::const_iterator itError = errors_.begin();
|
||||
@@ -862,7 +870,7 @@ std::istream& operator>>( std::istream &sin, Value &root )
|
||||
Json::Reader reader;
|
||||
bool ok = reader.parse(sin, root, true);
|
||||
//JSON_ASSERT( ok );
|
||||
if (!ok) throw std::runtime_error(reader.getFormatedErrorMessages());
|
||||
if (!ok) throw std::runtime_error(reader.getFormattedErrorMessages());
|
||||
return sin;
|
||||
}
|
||||
|
||||
|
@@ -54,6 +54,7 @@ duplicateStringValue( const char *value,
|
||||
if ( length == unknown )
|
||||
length = (unsigned int)strlen(value);
|
||||
char *newString = static_cast<char *>( malloc( length + 1 ) );
|
||||
JSON_ASSERT_MESSAGE( newString != 0, "Failed to allocate string value buffer" );
|
||||
memcpy( newString, value, length );
|
||||
newString[length] = 0;
|
||||
return newString;
|
||||
@@ -112,7 +113,7 @@ Value::CommentInfo::setComment( const char *text )
|
||||
{
|
||||
if ( comment_ )
|
||||
releaseStringValue( comment_ );
|
||||
JSON_ASSERT( text );
|
||||
JSON_ASSERT( text != 0 );
|
||||
JSON_ASSERT_MESSAGE( text[0]=='\0' || text[0]=='/', "Comments must start with /");
|
||||
// It seems that /**/ style comments are acceptable as well.
|
||||
comment_ = duplicateStringValue( text );
|
||||
|
Reference in New Issue
Block a user