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
138 const std::string &identifier,
139 const std::string &realPath,
164 const std::string& file)
const = 0;
179 const std::string& resolvedPath,
180 bool metadataOnly)
const = 0;
189 const std::string& filePath,
190 const std::string& comment = std::string(),
199 const std::string& str)
const;
204 const SdfSpecHandle &spec,
206 size_t indent)
const;
215 const std::string& comment = std::string())
const;
245 static SdfFileFormatConstPtr
FindById(
259 const std::string& path,
260 const std::string& target = std::string());
270 const std::string& path,
279 const std::string& extension);
287 const std::string& extension,
295 const std::string& extension,
303 const std::vector<std::string> &extensions);
311 const std::vector<std::string> &extensions,
319 const std::vector<std::string> &extensions,
337 SdfLayer* layer, SdfAbstractDataRefPtr& data);
345 SdfLayer* layer, SdfAbstractDataRefPtr& data,
354 virtual SdfLayer *_InstantiateNewLayer(
355 const SdfFileFormatConstPtr &fileFormat,
356 const std::string &identifier,
357 const std::string &realPath,
364 virtual bool _ShouldSkipAnonymousReload()
const;
377 const std::string _cookie;
379 const std::vector<std::string> _extensions;
380 const bool _isPrimaryFormat;
386 SDF_API
virtual ~Sdf_FileFormatFactoryBase();
387 virtual SdfFileFormatRefPtr New()
const = 0;
391 template <
typename T>
392 class Sdf_FileFormatFactory :
public Sdf_FileFormatFactoryBase {
394 virtual SdfFileFormatRefPtr New()
const 396 return TfCreateRefPtr(
new T);
422 #define SDF_DEFINE_FILE_FORMAT(FileFormatClass, BaseClass1, ...) 424 #define SDF_DEFINE_FILE_FORMAT(...) SdfDefineFileFormat<__VA_ARGS__>() 426 template <
class FileFormat,
class ...BaseFormats>
427 void SdfDefineFileFormat()
430 .
template SetFactory<Sdf_FileFormatFactory<FileFormat>>();
456 #define SDF_DEFINE_ABSTRACT_FILE_FORMAT(FileFormatClass, BaseClass1, ...) 458 #define SDF_DEFINE_ABSTRACT_FILE_FORMAT(...) \ 459 SdfDefineAbstractFileFormat<__VA_ARGS__>() 461 template <
class FileFormat,
class ...BaseFormats>
462 void SdfDefineAbstractFileFormat()
486 #define SDF_FILE_FORMAT_FACTORY_ACCESS 488 #define SDF_FILE_FORMAT_FACTORY_ACCESS \ 489 template<typename T> friend class Sdf_FileFormatFactory 492 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.