8#ifndef PXR_USD_VALIDATION_USD_VALIDATION_FIXER_H
9#define PXR_USD_VALIDATION_USD_VALIDATION_FIXER_H
13#include "pxr/usd/usd/timeCode.h"
14#include "pxr/usdValidation/usdValidation/api.h"
18PXR_NAMESPACE_OPEN_SCOPE
28using FixerCanApplyFn =
86 const TfToken &name,
const std::string &description,
87 const FixerImplFn &fixerImplFn,
const FixerCanApplyFn &canApplyFn,
102 return std::move(_name);
114 return std::move(_description);
126 return std::move(_errorName);
142 return std::move(_keywords);
176 std::string _description;
177 FixerImplFn _fixerImplFn;
178 FixerCanApplyFn _canApplyFn;
183PXR_NAMESPACE_CLOSE_SCOPE
Token for efficient comparison, assignment, and hashing of known strings.
Defines a mapping from scene graph paths to Sdf spec paths in a SdfLayer where edits should be direct...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
UsdValidationError is an entity returned by a validation task, which is associated with a UsdValidati...
A UsdValidationFixer represents a fix that can be applied to fix a specific validation error.
TfToken GetName() &&
Return the name of this fixer by-value.
const TfToken & GetErrorName() const &
Returns the error name that this fixer can fix, if any.
USDVALIDATION_API bool ApplyFix(const UsdValidationError &error, const UsdEditTarget &editTarget, const UsdTimeCode &timeCode=UsdTimeCode::Default()) const
Applies the fix for the given error at the given time code and edit target.
TfToken GetErrorName() &&
Returns the error name that this fixer can fix, if any, by-value.
const std::string & GetDescription() const &
Returns the description of this fixer.
USDVALIDATION_API bool IsAssociatedWithErrorName(const TfToken &errorName) const
Returns true if this fixer is associated with the given error name.
const TfToken & GetName() const &
Returns the name of this fixer.
std::string GetDescription() &&
Return the description of this fixer by-value.
TfTokenVector GetKeywords() &&
Return the keywords associated with this fixer by-value.
USDVALIDATION_API bool CanApplyFix(const UsdValidationError &error, const UsdEditTarget &editTarget, const UsdTimeCode &timeCode=UsdTimeCode::Default()) const
Returns true if this fixer can be applied to the given error and edit target; false otherwise.
const TfTokenVector & GetKeywords() const &
Returns the keywords associated with this fixer.
USDVALIDATION_API bool HasKeyword(const TfToken &keyword) const
Returns true if this fixer has the given keyword.
USDVALIDATION_API UsdValidationFixer(const TfToken &name, const std::string &description, const FixerImplFn &fixerImplFn, const FixerCanApplyFn &canApplyFn, const TfTokenVector &keywords=TfTokenVector(), const TfToken &errorName=TfToken())
Construct a UsdValidationFixer with the given name and description.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.