24 #ifndef PXR_USD_SDF_NAMESPACE_EDIT_H
25 #define PXR_USD_SDF_NAMESPACE_EDIT_H
83 return This(currentPath, currentPath, index);
89 const Path& newParentPath,
92 return This(currentPath,
102 const Path& newParentPath,
106 return This(currentPath,
167 return lhs < rhs ? lhs : rhs;
224 _edits.push_back(edit);
246 typedef std::function<bool(const SdfNamespaceEdit&,std::string*)>
CanEdit;
291 bool fixBackpointers =
true)
const;
299 #endif // PXR_USD_SDF_NAMESPACE_EDIT_H
SDF_API SdfBatchNamespaceEdit()
Create an empty sequence of edits.
std::vector< SdfNamespaceEditDetail > SdfNamespaceEditDetailVector
A sequence of SdfNamespaceEditDetail.
std::string reason
The reason the edit will not succeed cleanly.
Result
Validity of an edit.
SDF_API bool Process(SdfNamespaceEditVector *processedEdits, const HasObjectAtPath &hasObjectAtPath, const CanEdit &canEdit, SdfNamespaceEditDetailVector *details=NULL, bool fixBackpointers=true) const
SdfNamespaceEdit(const Path ¤tPath_, const Path &newPath_, Index index_=AtEnd)
The fully general edit.
SDF_API SdfNamespaceEditDetail()
GLsizei const GLchar *const * string
static This Rename(const Path ¤tPath, const TfToken &name)
SdfNamespaceEditDetail::Result CombineResult(SdfNamespaceEditDetail::Result lhs, SdfNamespaceEditDetail::Result rhs)
Combine two results, yielding Error over Unbatched over Okay.
Path currentPath
Path of the object when this edit starts.
Index index
Index for prim insertion.
static SDF_API const SdfPath & EmptyPath()
The empty path value, equivalent to SdfPath().
SdfNamespaceEdit edit
The edit.
SdfNamespaceEditDetail::Result CombineUnbatched(SdfNamespaceEditDetail::Result other)
Combine a result with Unbatched, yielding Error over Unbatched over Okay.
SdfNamespaceEditDetail::Result CombineError(SdfNamespaceEditDetail::Result)
Combine a result with Error, yielding Error over Unbatched over Okay.
void Add(const SdfNamespaceEdit &edit)
Add a namespace edit.
SDF_API std::ostream & operator<<(std::ostream &, const SdfNamespaceEdit &)
SDF_API bool operator==(const This &rhs) const
Edit will succeed as a batch.
Edit will succeed but not batched.
std::vector< SdfNamespaceEdit > SdfNamespaceEditVector
A sequence of SdfNamespaceEdit.
GLuint const GLchar * name
SDF_API bool operator==(const SdfNamespaceEditDetail &rhs) const
std::function< bool(const SdfPath &)> HasObjectAtPath
Functor that returns true iff an object exists at the given path.
static This ReparentAndRename(const Path ¤tPath, const Path &newParentPath, const TfToken &name, Index index)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
static This Remove(const Path ¤tPath)
Returns a namespace edit that removes the object at currentPath.
#define PXR_NAMESPACE_CLOSE_SCOPE
SDF_API SdfPath GetParentPath() const
SDF_API SdfBatchNamespaceEdit & operator=(const SdfBatchNamespaceEdit &)
Path newPath
Path of the object when this edit ends.
const SdfNamespaceEditVector & GetEdits() const
Returns the edits.
SdfNamespaceEdit()
The default edit maps the empty path to the empty path.
SDF_API bool operator!=(const This &rhs) const
static const Index AtEnd
Special index that means at the end.
static This Reorder(const Path ¤tPath, Index index)
SDF_API ~SdfBatchNamespaceEdit()
std::function< bool(const SdfNamespaceEdit &, std::string *)> CanEdit
SDF_API bool operator!=(const SdfNamespaceEditDetail &rhs) const
SDF_API SdfPath ReplaceName(TfToken const &newName) const
void Add(const SdfNamespaceEdit::Path ¤tPath, const SdfNamespaceEdit::Path &newPath, SdfNamespaceEdit::Index index=SdfNamespaceEdit::AtEnd)
Add a namespace edit.
SDF_API SdfPath ReplacePrefix(const SdfPath &oldPrefix, const SdfPath &newPrefix, bool fixTargetPaths=true) const
static This Reparent(const Path ¤tPath, const Path &newParentPath, Index index)