8#ifndef PXR_USD_USD_VALIDATION_ERROR_H
9#define PXR_USD_USD_VALIDATION_ERROR_H
12#include "pxr/usd/sdf/path.h"
14#include "pxr/usd/usd/property.h"
18PXR_NAMESPACE_OPEN_SCOPE
80 const SdfLayerHandle &layer=SdfLayerHandle());
93 if (!_layer || _objectPath.
IsEmpty()) {
96 return _layer->HasSpec(_objectPath);
122 return SdfPropertySpecHandle();
124 return _layer->GetPropertyAtPath(_objectPath);
135 return SdfPrimSpecHandle();
137 return _layer->GetPrimAtPath(_objectPath);
159 return _usdStage->GetPrimAtPath(_objectPath);
170 return _usdStage->GetPropertyAtPath(_objectPath);
178 return (_layer == other._layer) &&
179 (_usdStage == other._usdStage) &&
180 (_objectPath == other._objectPath);
186 return !(*
this == other);
190 UsdStagePtr _usdStage;
191 SdfLayerHandle _layer;
196using UsdValidationErrorSites = std::vector<UsdValidationErrorSite>;
231 const UsdValidationErrorSites &errorSites,
232 const std::string &errorMsg);
235 return (_name == other._name) &&
236 (_errorType == other._errorType) &&
237 (_errorSites == other._errorSites) &&
238 (_errorMsg == other._errorMsg) &&
239 (_validator == other._validator);
243 return !(*
this == other);
255 return std::move(_name);
276 return std::move(_errorSites);
320 return _errorType == UsdValidationErrorType::None;
340 UsdValidationErrorSites _errorSites;
341 std::string _errorMsg;
349PXR_NAMESPACE_CLOSE_SCOPE
A path value used to locate objects in layers or scenegraphs.
bool IsEmpty() const noexcept
Returns true if this is the empty path (SdfPath::EmptyPath()).
Token for efficient comparison, assignment, and hashing of known strings.
bool IsValid() const
Return true if this is a valid object, false otherwise.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Base class for UsdAttribute and UsdRelationship scenegraph objects.
UsdValidationError is an entity returned by a validation task, which is associated with a UsdValidato...
USD_API UsdValidationError()
A default constructed UsdValidationError signifies no error.
TfToken GetName() &&
Returns the name token of the UsdValidationError by-value.
const UsdValidationErrorSites & GetSites() const &
Returns the UsdValidationErrorSite associated with this UsdValidationError.
UsdValidationErrorType GetType() const
Returns the UsdValidationErrorType associated with this UsdValidationError.
USD_API TfToken GetIdentifier() const
An identifier for the error constructed from the validator name this error was generated from and its...
const TfToken & GetName() const &
Returns the name token of the UsdValidationError.
const std::string & GetMessage() const
Returns the message associated with this UsdValidationError.
bool HasNoError() const
Returns true if UsdValidationErrorType is UsdValidationErrorType::None, false otherwise.
const UsdValidator * GetValidator() const
Returns the UsdValidator that reported this error.
UsdValidationErrorSites GetSites() &&
Returns the UsdValidationErrorSite associated with this UsdValidationError by-value.
USD_API UsdValidationError(const TfToken &name, const UsdValidationErrorType &errorType, const UsdValidationErrorSites &errorSites, const std::string &errorMsg)
Instantiate a ValidationError by providing its name, errorType, errorSites and an errorMsg.
USD_API std::string GetErrorAsString() const
Returns UsdValidationErrorType and ErrorMessage concatenated as a string.
UsdValidationErrorType reflects severity of a validation error, which can then be reported appropriat...
UsdValidator is a class describing a single test.
UsdValidationErrorSite is important information available from a ValidationError, which annotates the...
bool operator!=(const UsdValidationErrorSite &other) const
Returns false if other UsdValidationErrorSite has same valued members as this UsdValidationErrorSite,...
bool IsProperty() const
Returns true if UsdValidationErrorSite represents a property on a stage, false otherwise.
bool IsValidSpecInLayer() const
Returns true if the objectPath and layer represent a spec in the layer; false otherwise.
UsdProperty GetProperty() const
Returns UsdProperty associated with this UsdValidationErrorSite, that is when UsdStage is present and...
bool IsPrim() const
Returns true if UsdValidationErrorSite represents a prim on a stage, false otherwise.
UsdPrim GetPrim() const
Returns UsdPrim associated with this UsdValidationErrorSite, that is when UsdStage is present and obj...
USD_API UsdValidationErrorSite(const UsdStagePtr &usdStage, const SdfPath &objectPath, const SdfLayerHandle &layer=SdfLayerHandle())
Initialize an UsdValidationErrorSite using a usdStage and an objectPath.
bool operator==(const UsdValidationErrorSite &other) const
Returns true if other UsdValidationErrorSite has same valued members as this UsdValidationErrorSite,...
USD_API UsdValidationErrorSite(const SdfLayerHandle &layer, const SdfPath &objectPath)
Initialize an UsdValidationErrorSite using a layer and an objectPath.
const SdfPrimSpecHandle GetPrimSpec() const
Returns the SdfPrimSpecHandle associated with this ValidationErrorSite's layer and objectPath.
const UsdStagePtr & GetStage() const
Returns the UsdStage associated with this UsdValidationErrorSite; nullptr othewrise.
bool IsValid() const
Returns true if UsdValidationErrorSite instance can either point to a prim or property spec in a laye...
const SdfLayerHandle & GetLayer() const
Returns the SdfLayerHandle associated with this UsdValidatorErrorSite.
const SdfPropertySpecHandle GetPropertySpec() const
Returns the SdfPropertySpecHandle associated with this ValidationErrorSite's layer and objectPath.