Loading...
Searching...
No Matches
UsdValidationError Class Reference

UsdValidationError is an entity returned by a validation task, which is associated with a UsdValidator. More...

#include <validationError.h>

Public Member Functions

USD_API UsdValidationError ()
 A default constructed UsdValidationError signifies no error.
 
USD_API UsdValidationError (const UsdValidationErrorType &errorType, const UsdValidationErrorSites &errorSites, const std::string &errorMsg)
 Instantiate a ValidationError by providing its errorType, errorSites and an errorMsg.
 
bool operator== (const UsdValidationError &other) const
 
bool operator!= (const UsdValidationError &other) const
 
UsdValidationErrorType GetType () const
 Returns the UsdValidationErrorType associated with this UsdValidationError.
 
const UsdValidationErrorSites & GetSites () const
 Returns the UsdValidationErrorSite associated with this UsdValidationError.
 
const UsdValidatorGetValidator () const
 Returns the UsdValidator that reported this error.
 
const std::string & GetMessage () const
 Returns the message associated with this UsdValidationError.
 
USD_API std::string GetErrorAsString () const
 Returns UsdValidationErrorType and ErrorMessage concatenated as a string.
 
bool HasNoError () const
 Returns true if UsdValidationErrorType is UsdValidationErrorType::None, false otherwise.
 

Friends

class UsdValidator
 

Detailed Description

UsdValidationError is an entity returned by a validation task, which is associated with a UsdValidator.

A UsdValidationError instance contains important information, like:

  • UsdValidationErrorType - severity of an error,
  • UsdValidationErrorSites - on what sites validationError was reported by a validation task,
  • Message - Message governing more information associated with the error. Such a message is provided by the validator writer, when providing implementation for the validation task function.

UsdValidationError instances will be stored in the UsdValidationContext responsible for executing a set of UsdValidators.

Definition at line 217 of file validationError.h.

Constructor & Destructor Documentation

◆ UsdValidationError() [1/2]

USD_API UsdValidationError ( )

A default constructed UsdValidationError signifies no error.

◆ UsdValidationError() [2/2]

USD_API UsdValidationError ( const UsdValidationErrorType errorType,
const UsdValidationErrorSites &  errorSites,
const std::string &  errorMsg 
)

Instantiate a ValidationError by providing its errorType, errorSites and an errorMsg.

Member Function Documentation

◆ GetErrorAsString()

USD_API std::string GetErrorAsString ( ) const

Returns UsdValidationErrorType and ErrorMessage concatenated as a string.

◆ GetMessage()

const std::string & GetMessage ( ) const
inline

Returns the message associated with this UsdValidationError.

Definition at line 266 of file validationError.h.

◆ GetSites()

const UsdValidationErrorSites & GetSites ( ) const
inline

Returns the UsdValidationErrorSite associated with this UsdValidationError.

Definition at line 250 of file validationError.h.

◆ GetType()

UsdValidationErrorType GetType ( ) const
inline

Returns the UsdValidationErrorType associated with this UsdValidationError.

Definition at line 243 of file validationError.h.

◆ GetValidator()

const UsdValidator * GetValidator ( ) const
inline

Returns the UsdValidator that reported this error.

This will return nullptr if there is no UsdValidator associated with this error. This will never be nullptr for validation errors returned from calls to UsdValidator::Validate.

Definition at line 260 of file validationError.h.

◆ HasNoError()

bool HasNoError ( ) const
inline

Returns true if UsdValidationErrorType is UsdValidationErrorType::None, false otherwise.

Definition at line 277 of file validationError.h.

◆ operator!=()

bool operator!= ( const UsdValidationError other) const
inline

Definition at line 237 of file validationError.h.

◆ operator==()

bool operator== ( const UsdValidationError other) const
inline

Definition at line 230 of file validationError.h.

Friends And Related Function Documentation

◆ UsdValidator

friend class UsdValidator
friend

Definition at line 284 of file validationError.h.


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