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"
44PXR_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;
297 const std::string& extension,
298 const std::string& target = std::string());
309 const std::string& extension,
310 const std::string& target = std::string());
321 const std::string& extension,
322 const std::string& target = std::string());
342 const std::string& path,
343 const std::string& target = std::string());
353 const std::string& path,
362 const std::string& extension);
370 const std::string& extension,
378 const std::string& extension,
386 const std::vector<std::string> &extensions);
394 const std::vector<std::string> &extensions,
402 const std::vector<std::string> &extensions,
420 SdfLayer* layer, SdfAbstractDataRefPtr& data);
428 SdfLayer* layer, SdfAbstractDataRefPtr& data,
452 const std::string& resolvedPath,
454 bool* didCopyData =
nullptr)
const;
458 virtual SdfLayer *_InstantiateNewLayer(
459 const SdfFileFormatConstPtr &fileFormat,
460 const std::string &identifier,
461 const std::string &realPath,
468 virtual bool _ShouldSkipAnonymousReload()
const;
501 const std::string& resolvedPath,
502 bool metadataOnly)
const;
508 const std::string _cookie;
510 const std::vector<std::string> _extensions;
511 const bool _isPrimaryFormat;
517 SDF_API
virtual ~Sdf_FileFormatFactoryBase();
518 virtual SdfFileFormatRefPtr New()
const = 0;
523class Sdf_FileFormatFactory :
public Sdf_FileFormatFactoryBase {
525 virtual SdfFileFormatRefPtr New()
const
527 return TfCreateRefPtr(
new T);
553#define SDF_DEFINE_FILE_FORMAT(FileFormatClass, BaseClass1, ...)
555#define SDF_DEFINE_FILE_FORMAT(...) SdfDefineFileFormat<__VA_ARGS__>()
557template <
class FileFormat,
class ...BaseFormats>
558void SdfDefineFileFormat()
561 .
template SetFactory<Sdf_FileFormatFactory<FileFormat>>();
587#define SDF_DEFINE_ABSTRACT_FILE_FORMAT(FileFormatClass, BaseClass1, ...)
589#define SDF_DEFINE_ABSTRACT_FILE_FORMAT(...) \
590 SdfDefineAbstractFileFormat<__VA_ARGS__>()
592template <
class FileFormat,
class ...BaseFormats>
593void SdfDefineAbstractFileFormat()
617#define SDF_FILE_FORMAT_FACTORY_ACCESS
619#define SDF_FILE_FORMAT_FACTORY_ACCESS \
620 template<typename T> friend class Sdf_FileFormatFactory
623PXR_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...