Assimp  v3.1.1 (June 2014)
ParseResult Struct Reference

Result of parsing (wraps ParseErrorCode) More...

Public Member Functions

void Clear ()
 Reset error code. More...
 
ParseErrorCode Code () const
 Get the error code. More...
 
bool IsError () const
 Whether the result is an error. More...
 
size_t Offset () const
 Get the error offset, if IsError(), 0 otherwise. More...
 
 operator bool () const
 Conversion to bool, returns true, iff !IsError(). More...
 
bool operator== (const ParseResult &that) const
 
bool operator== (ParseErrorCode code) const
 
 ParseResult ()
 Default constructor, no error. More...
 
 ParseResult (ParseErrorCode code, size_t offset)
 Constructor to set an error. More...
 
void Set (ParseErrorCode code, size_t offset=0)
 Update error code and offset. More...
 

Friends

bool operator== (ParseErrorCode code, const ParseResult &err)
 

Detailed Description

Result of parsing (wraps ParseErrorCode)

ParseResult ok = doc.Parse("[42]");
if (!ok) {
fprintf(stderr, "JSON parse error: %s (%u)",
exit(EXIT_FAILURE);
}
See Also
GenericReader::Parse, GenericDocument::Parse

Constructor & Destructor Documentation

ParseResult::ParseResult ( )
inline

Default constructor, no error.

ParseResult::ParseResult ( ParseErrorCode  code,
size_t  offset 
)
inline

Constructor to set an error.

Member Function Documentation

void ParseResult::Clear ( )
inline

Reset error code.

ParseErrorCode ParseResult::Code ( ) const
inline

Get the error code.

bool ParseResult::IsError ( ) const
inline

Whether the result is an error.

size_t ParseResult::Offset ( ) const
inline

Get the error offset, if IsError(), 0 otherwise.

ParseResult::operator bool ( ) const
inline

Conversion to bool, returns true, iff !IsError().

bool ParseResult::operator== ( const ParseResult that) const
inline
bool ParseResult::operator== ( ParseErrorCode  code) const
inline
void ParseResult::Set ( ParseErrorCode  code,
size_t  offset = 0 
)
inline

Update error code and offset.

Friends And Related Function Documentation

bool operator== ( ParseErrorCode  code,
const ParseResult err 
)
friend

The documentation for this struct was generated from the following file: