24 #ifndef PXR_USD_SDF_FILE_FORMAT_H 25 #define PXR_USD_SDF_FILE_FORMAT_H 30 #include "pxr/usd/ar/ar.h" 31 #include "pxr/usd/sdf/api.h" 37 #include "pxr/base/tf/type.h" 44 PXR_NAMESPACE_OPEN_SCOPE
55 #define SDF_FILE_FORMAT_TOKENS \ 56 ((TargetArg, "target")) 115 const std::string& resolvedPath)
const;
132 virtual SdfAbstractDataRefPtr
144 const std::string &identifier,
145 const std::string &realPath,
170 const std::string& file)
const = 0;
185 const std::string& resolvedPath,
186 bool metadataOnly)
const = 0;
203 const std::string& resolvedPath,
204 bool metadataOnly)
const;
213 const std::string& filePath,
214 const std::string& comment = std::string(),
223 const std::string& str)
const;
228 const SdfSpecHandle &spec,
230 size_t indent)
const;
239 const std::string& comment = std::string())
const;
269 static SdfFileFormatConstPtr
FindById(
283 const std::string& path,
284 const std::string& target = std::string());
294 const std::string& path,
303 const std::string& extension);
311 const std::string& extension,
319 const std::string& extension,
327 const std::vector<std::string> &extensions);
335 const std::vector<std::string> &extensions,
343 const std::vector<std::string> &extensions,
361 SdfLayer* layer, SdfAbstractDataRefPtr& data);
369 SdfLayer* layer, SdfAbstractDataRefPtr& data,
393 const std::string& resolvedPath,
395 bool* didCopyData =
nullptr)
const;
399 virtual SdfLayer *_InstantiateNewLayer(
400 const SdfFileFormatConstPtr &fileFormat,
401 const std::string &identifier,
402 const std::string &realPath,
409 virtual bool _ShouldSkipAnonymousReload()
const;
442 const std::string& resolvedPath,
443 bool metadataOnly)
const;
449 const std::string _cookie;
451 const std::vector<std::string> _extensions;
452 const bool _isPrimaryFormat;
458 SDF_API
virtual ~Sdf_FileFormatFactoryBase();
459 virtual SdfFileFormatRefPtr New()
const = 0;
463 template <
typename T>
464 class Sdf_FileFormatFactory :
public Sdf_FileFormatFactoryBase {
466 virtual SdfFileFormatRefPtr New()
const 468 return TfCreateRefPtr(
new T);
494 #define SDF_DEFINE_FILE_FORMAT(FileFormatClass, BaseClass1, ...) 496 #define SDF_DEFINE_FILE_FORMAT(...) SdfDefineFileFormat<__VA_ARGS__>() 498 template <
class FileFormat,
class ...BaseFormats>
499 void SdfDefineFileFormat()
502 .
template SetFactory<Sdf_FileFormatFactory<FileFormat>>();
528 #define SDF_DEFINE_ABSTRACT_FILE_FORMAT(FileFormatClass, BaseClass1, ...) 530 #define SDF_DEFINE_ABSTRACT_FILE_FORMAT(...) \ 531 SdfDefineAbstractFileFormat<__VA_ARGS__>() 533 template <
class FileFormat,
class ...BaseFormats>
534 void SdfDefineAbstractFileFormat()
558 #define SDF_FILE_FORMAT_FACTORY_ACCESS 560 #define SDF_FILE_FORMAT_FACTORY_ACCESS \ 561 template<typename T> friend class Sdf_FileFormatFactory 564 PXR_NAMESPACE_CLOSE_SCOPE
A scene description container that can combine with other such containers to form simple component as...
Standard pointer typedefs.
Generic class that provides information about scene description fields but doesn't actually provide a...
Base class for all Sdf spec classes.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Base class of all factory types.
Enable a concrete base class for use with TfRefPtr.
Token for efficient comparison, assignment, and hashing of known strings.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
A type-list of C++ base types.
static TfType const & Define()
Define a TfType with the given C++ type T and C++ base types B.
This file defines some macros that are useful for declaring and using static TfTokens.
Contains hints about layer contents that may be used to accelerate certain composition operations.
Enable a concrete base class for use with TfWeakPtr.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
Interface for scene description data storage.
Contains information about a resolved asset.