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(),
223 const std::string& filePath,
224 const std::string& comment = std::string(),
233 const std::string& str)
const;
238 const SdfSpecHandle &spec,
240 size_t indent)
const;
249 const std::string& comment = std::string())
const;
307 const std::string& extension,
308 const std::string& target = std::string());
319 const std::string& extension,
320 const std::string& target = std::string());
331 const std::string& extension,
332 const std::string& target = std::string());
352 const std::string& path,
353 const std::string& target = std::string());
363 const std::string& path,
372 const std::string& extension);
380 const std::string& extension,
388 const std::string& extension,
396 const std::vector<std::string> &extensions);
404 const std::vector<std::string> &extensions,
412 const std::vector<std::string> &extensions,
430 SdfLayer* layer, SdfAbstractDataRefPtr& data);
438 SdfLayer* layer, SdfAbstractDataRefPtr& data,
462 const std::string& resolvedPath,
464 bool* didCopyData =
nullptr)
const;
468 virtual SdfLayer *_InstantiateNewLayer(
469 const SdfFileFormatConstPtr &fileFormat,
470 const std::string &identifier,
471 const std::string &realPath,
478 virtual bool _ShouldSkipAnonymousReload()
const;
511 const std::string& resolvedPath,
512 bool metadataOnly)
const;
518 const std::string _cookie;
520 const std::vector<std::string> _extensions;
521 const bool _isPrimaryFormat;
527 SDF_API
virtual ~Sdf_FileFormatFactoryBase();
528 virtual SdfFileFormatRefPtr New()
const = 0;
533class Sdf_FileFormatFactory :
public Sdf_FileFormatFactoryBase {
535 virtual SdfFileFormatRefPtr New()
const
537 return TfCreateRefPtr(
new T);
563#define SDF_DEFINE_FILE_FORMAT(FileFormatClass, BaseClass1, ...)
565#define SDF_DEFINE_FILE_FORMAT(...) SdfDefineFileFormat<__VA_ARGS__>()
567template <
class FileFormat,
class ...BaseFormats>
568void SdfDefineFileFormat()
571 .
template SetFactory<Sdf_FileFormatFactory<FileFormat>>();
597#define SDF_DEFINE_ABSTRACT_FILE_FORMAT(FileFormatClass, BaseClass1, ...)
599#define SDF_DEFINE_ABSTRACT_FILE_FORMAT(...) \
600 SdfDefineAbstractFileFormat<__VA_ARGS__>()
602template <
class FileFormat,
class ...BaseFormats>
603void SdfDefineAbstractFileFormat()
627#define SDF_FILE_FORMAT_FACTORY_ACCESS
629#define SDF_FILE_FORMAT_FACTORY_ACCESS \
630 template<typename T> friend class Sdf_FileFormatFactory
633PXR_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...