7#ifndef PXR_USD_SDF_CHILDREN_UTILS_H
8#define PXR_USD_SDF_CHILDREN_UTILS_H
13#include "pxr/usd/sdf/api.h"
17PXR_NAMESPACE_OPEN_SCOPE
25template<
class ChildPolicy>
26class Sdf_ChildrenUtils
31 typedef typename ChildPolicy::KeyType KeyType;
35 typedef typename ChildPolicy::FieldType FieldType;
40 static bool CreateSpec(
41 const SdfLayerHandle &layer,
45 return CreateSpec(get_pointer(layer), childPath, specType, inert);
50 static bool CreateSpec(
61 static bool IsValidName(
const FieldType &newName);
65 static bool IsValidName(
const std::string &newName);
70 const FieldType &newName);
78 const FieldType &newName);
89 static bool SetChildren(
90 const SdfLayerHandle &layer,
92 const std::vector<typename ChildPolicy::ValueType> &values);
96 static bool InsertChild(
97 const SdfLayerHandle &layer,
99 const typename ChildPolicy::ValueType& value,
104 static bool RemoveChild(
105 const SdfLayerHandle &layer,
107 const typename ChildPolicy::KeyType& key);
117 static bool MoveChildForBatchNamespaceEdit(
118 const SdfLayerHandle &layer,
120 const typename ChildPolicy::ValueType& value,
121 const typename ChildPolicy::FieldType& newName,
126 static bool RemoveChildForBatchNamespaceEdit(
127 const SdfLayerHandle &layer,
129 const typename ChildPolicy::KeyType& key)
131 return RemoveChild(layer, path, key);
138 static bool CanMoveChildForBatchNamespaceEdit(
139 const SdfLayerHandle &layer,
141 const typename ChildPolicy::ValueType& value,
142 const typename ChildPolicy::FieldType& newName,
144 std::string* whyNot);
149 static bool CanRemoveChildForBatchNamespaceEdit(
150 const SdfLayerHandle &layer,
152 const typename ChildPolicy::FieldType& key,
153 std::string* whyNot);
158PXR_NAMESPACE_CLOSE_SCOPE
Indicates if an operation is allowed and, if not, why not.
A scene description container that can combine with other such containers to form simple component as...
A path value used to locate objects in layers or scenegraphs.
Base class for all Sdf spec classes.
SdfSpecType
An enum that specifies the type of an object.