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;
221 const std::string& filePath,
222 const std::string& comment = std::string(),
240 const std::string& filePath,
241 const std::string& comment = std::string(),
250 const std::string& str)
const;
255 const SdfSpecHandle &spec,
257 size_t indent)
const;
266 const std::string& comment = std::string())
const;
324 const std::string& extension,
325 const std::string& target = std::string());
336 const std::string& extension,
337 const std::string& target = std::string());
348 const std::string& extension,
349 const std::string& target = std::string());
369 const std::string& path,
370 const std::string& target = std::string());
380 const std::string& path,
389 const std::string& extension);
397 const std::string& extension,
405 const std::string& extension,
413 const std::vector<std::string> &extensions);
421 const std::vector<std::string> &extensions,
429 const std::vector<std::string> &extensions,
447 SdfLayer* layer, SdfAbstractDataRefPtr& data);
455 SdfLayer* layer, SdfAbstractDataRefPtr& data,
479 const std::string& resolvedPath,
481 bool* didCopyData =
nullptr)
const;
485 virtual SdfLayer *_InstantiateNewLayer(
486 const SdfFileFormatConstPtr &fileFormat,
487 const std::string &identifier,
488 const std::string &realPath,
495 virtual bool _ShouldSkipAnonymousReload()
const;
528 const std::string& resolvedPath,
529 bool metadataOnly)
const;
535 const std::string _cookie;
537 const std::vector<std::string> _extensions;
538 const bool _isPrimaryFormat;
544 SDF_API
virtual ~Sdf_FileFormatFactoryBase();
545 virtual SdfFileFormatRefPtr New()
const = 0;
550class Sdf_FileFormatFactory :
public Sdf_FileFormatFactoryBase {
552 virtual SdfFileFormatRefPtr New()
const
554 return TfCreateRefPtr(
new T);
580#define SDF_DEFINE_FILE_FORMAT(FileFormatClass, BaseClass1, ...)
582#define SDF_DEFINE_FILE_FORMAT(...) SdfDefineFileFormat<__VA_ARGS__>()
584template <
class FileFormat,
class ...BaseFormats>
585void SdfDefineFileFormat()
588 .
template SetFactory<Sdf_FileFormatFactory<FileFormat>>();
614#define SDF_DEFINE_ABSTRACT_FILE_FORMAT(FileFormatClass, BaseClass1, ...)
616#define SDF_DEFINE_ABSTRACT_FILE_FORMAT(...) \
617 SdfDefineAbstractFileFormat<__VA_ARGS__>()
619template <
class FileFormat,
class ...BaseFormats>
620void SdfDefineAbstractFileFormat()
644#define SDF_FILE_FORMAT_FACTORY_ACCESS
646#define SDF_FILE_FORMAT_FACTORY_ACCESS \
647 template<typename T> friend class Sdf_FileFormatFactory
650PXR_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...