7#ifndef PXR_USD_SDF_FILE_FORMAT_H
8#define PXR_USD_SDF_FILE_FORMAT_H
13#include "pxr/usd/ar/ar.h"
14#include "pxr/usd/sdf/api.h"
20#include "pxr/base/tf/type.h"
27PXR_NAMESPACE_OPEN_SCOPE
38#define SDF_FILE_FORMAT_TOKENS \
39 ((TargetArg, "target"))
98 const std::string& resolvedPath)
const;
115 virtual SdfAbstractDataRefPtr
127 const std::string &identifier,
128 const std::string &realPath,
153 const std::string& file)
const = 0;
168 const std::string& resolvedPath,
169 bool metadataOnly)
const = 0;
186 const std::string& resolvedPath,
187 bool metadataOnly)
const;
204 const std::string& filePath,
205 const std::string& comment = std::string(),
234 const std::string& filePath,
235 const std::string& comment = std::string(),
244 const std::string& str)
const;
249 const SdfSpecHandle &spec,
251 size_t indent)
const;
260 const std::string& comment = std::string())
const;
318 const std::string& extension,
319 const std::string& target = std::string());
330 const std::string& extension,
331 const std::string& target = std::string());
342 const std::string& extension,
343 const std::string& target = std::string());
363 const std::string& path,
364 const std::string& target = std::string());
374 const std::string& path,
383 const std::string& extension);
391 const std::string& extension,
399 const std::string& extension,
407 const std::vector<std::string> &extensions);
415 const std::vector<std::string> &extensions,
423 const std::vector<std::string> &extensions,
441 SdfLayer* layer, SdfAbstractDataRefPtr& data);
449 SdfLayer* layer, SdfAbstractDataRefPtr& data,
473 const std::string& resolvedPath,
475 bool* didCopyData =
nullptr)
const;
479 virtual SdfLayer *_InstantiateNewLayer(
480 const SdfFileFormatConstPtr &fileFormat,
481 const std::string &identifier,
482 const std::string &realPath,
489 virtual bool _ShouldSkipAnonymousReload()
const;
522 const std::string& resolvedPath,
523 bool metadataOnly)
const;
529 const std::string _cookie;
531 const std::vector<std::string> _extensions;
532 const bool _isPrimaryFormat;
538 SDF_API
virtual ~Sdf_FileFormatFactoryBase();
539 virtual SdfFileFormatRefPtr New()
const = 0;
544class Sdf_FileFormatFactory :
public Sdf_FileFormatFactoryBase {
546 virtual SdfFileFormatRefPtr New()
const
548 return TfCreateRefPtr(
new T);
574#define SDF_DEFINE_FILE_FORMAT(FileFormatClass, BaseClass1, ...)
576#define SDF_DEFINE_FILE_FORMAT(...) SdfDefineFileFormat<__VA_ARGS__>()
578template <
class FileFormat,
class ...BaseFormats>
579void SdfDefineFileFormat()
582 .
template SetFactory<Sdf_FileFormatFactory<FileFormat>>();
608#define SDF_DEFINE_ABSTRACT_FILE_FORMAT(FileFormatClass, BaseClass1, ...)
610#define SDF_DEFINE_ABSTRACT_FILE_FORMAT(...) \
611 SdfDefineAbstractFileFormat<__VA_ARGS__>()
613template <
class FileFormat,
class ...BaseFormats>
614void SdfDefineAbstractFileFormat()
638#define SDF_FILE_FORMAT_FACTORY_ACCESS
640#define SDF_FILE_FORMAT_FACTORY_ACCESS \
641 template<typename T> friend class Sdf_FileFormatFactory
644PXR_NAMESPACE_CLOSE_SCOPE
Contains information about a resolved asset.
Interface for scene description data storage.
Contains hints about layer contents that may be used to accelerate certain composition operations.
A scene description container that can combine with other such containers to form simple component as...
Generic class that provides information about scene description fields but doesn't actually provide a...
Base class for all Sdf spec classes.
Enable a concrete base class for use with TfRefPtr.
Token for efficient comparison, assignment, and hashing of known strings.
Base class of all factory types.
TfType represents a dynamic runtime type.
static TfType const & Define()
Define a TfType with the given C++ type T and C++ base types B.
A type-list of C++ base types.
Enable a concrete base class for use with TfWeakPtr.
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...