24 #ifndef PXR_USD_SDF_CHILDREN_UTILS_H
25 #define PXR_USD_SDF_CHILDREN_UTILS_H
30 #include "pxr/usd/sdf/api.h"
34 PXR_NAMESPACE_OPEN_SCOPE
42 template<
class ChildPolicy>
43 class Sdf_ChildrenUtils
48 typedef typename ChildPolicy::KeyType KeyType;
52 typedef typename ChildPolicy::FieldType FieldType;
57 static bool CreateSpec(
58 const SdfLayerHandle &layer,
62 return CreateSpec(get_pointer(layer), childPath, specType, inert);
67 static bool CreateSpec(
78 static bool IsValidName(
const FieldType &newName);
82 static bool IsValidName(
const std::string &newName);
87 const FieldType &newName);
95 const FieldType &newName);
106 static bool SetChildren(
107 const SdfLayerHandle &layer,
109 const std::vector<typename ChildPolicy::ValueType> &values);
113 static bool InsertChild(
114 const SdfLayerHandle &layer,
116 const typename ChildPolicy::ValueType& value,
121 static bool RemoveChild(
122 const SdfLayerHandle &layer,
124 const typename ChildPolicy::KeyType& key);
134 static bool MoveChildForBatchNamespaceEdit(
135 const SdfLayerHandle &layer,
137 const typename ChildPolicy::ValueType& value,
138 const typename ChildPolicy::FieldType& newName,
143 static bool RemoveChildForBatchNamespaceEdit(
144 const SdfLayerHandle &layer,
146 const typename ChildPolicy::KeyType& key)
148 return RemoveChild(layer, path, key);
155 static bool CanMoveChildForBatchNamespaceEdit(
156 const SdfLayerHandle &layer,
158 const typename ChildPolicy::ValueType& value,
159 const typename ChildPolicy::FieldType& newName,
161 std::string* whyNot);
166 static bool CanRemoveChildForBatchNamespaceEdit(
167 const SdfLayerHandle &layer,
169 const typename ChildPolicy::FieldType& key,
170 std::string* whyNot);
175 PXR_NAMESPACE_CLOSE_SCOPE
177 #endif // PXR_USD_SDF_CHILDREN_UTILS_H
A unit of scene description that you combine with other units of scene description to form a shot...
Base class for all Sdf spec classes.
Indicates if an operation is allowed and, if not, why not.
A path value used to locate objects in layers or scenegraphs.
SdfSpecType
An enum that specifies the type of an object.