HDK
|
#include <usdcFileFormat.h>
Public Types | |
using | string = std::string |
typedef std::map< std::string, std::string > | FileFormatArguments |
![]() | |
typedef std::map< std::string, std::string > | FileFormatArguments |
![]() | |
typedef void(* | UniqueChangedFuncPtr )(TfRefBase const *, bool) |
Public Member Functions | |
virtual SdfAbstractDataRefPtr | InitData (const FileFormatArguments &args) const override |
virtual bool | CanRead (const string &file) const override |
Returns true if file can be read by this format. More... | |
virtual bool | Read (SdfLayer *layer, const string &resolvedPath, bool metadataOnly) const override |
virtual bool | WriteToFile (const SdfLayer &layer, const string &filePath, const string &comment=string(), const FileFormatArguments &args=FileFormatArguments()) const override |
virtual bool | SaveToFile (const SdfLayer &layer, const string &filePath, const string &comment=string(), const FileFormatArguments &args=FileFormatArguments()) const override |
virtual bool | ReadFromString (SdfLayer *layer, const string &str) const override |
virtual bool | WriteToString (const SdfLayer &layer, string *str, const string &comment=string()) const override |
virtual bool | WriteToStream (const SdfSpecHandle &spec, std::ostream &out, size_t indent) const override |
Write the provided spec to out indented indent levels. More... | |
![]() | |
SdfFileFormat (const SdfFileFormat &)=delete | |
SdfFileFormat & | operator= (const SdfFileFormat &)=delete |
SDF_API const SdfSchemaBase & | GetSchema () const |
Returns the schema for this format. More... | |
SDF_API const TfToken & | GetFormatId () const |
Returns the format identifier. More... | |
SDF_API const TfToken & | GetTarget () const |
Returns the target for this file format. More... | |
SDF_API const std::string & | GetFileCookie () const |
Returns the cookie to be used when writing files with this format. More... | |
SDF_API const TfToken & | GetVersionString () const |
Returns the current version of this file format. More... | |
SDF_API bool | IsPrimaryFormatForExtensions () const |
SDF_API const std::vector < std::string > & | GetFileExtensions () const |
Returns a list of extensions that this format supports. More... | |
SDF_API const std::string & | GetPrimaryFileExtension () const |
SDF_API bool | IsSupportedExtension (const std::string &extension) const |
virtual SDF_API bool | IsPackage () const |
virtual SDF_API std::string | GetPackageRootLayerPath (const std::string &resolvedPath) const |
virtual SDF_API FileFormatArguments | GetDefaultFileFormatArguments () const |
SDF_API SdfAbstractDataRefPtr | InitDetachedData (const FileFormatArguments &args) const |
SDF_API SdfLayerRefPtr | NewLayer (const SdfFileFormatConstPtr &fileFormat, const std::string &identifier, const std::string &realPath, const ArAssetInfo &assetInfo, const FileFormatArguments &args) const |
Instantiate a layer. More... | |
SDF_API bool | ShouldSkipAnonymousReload () const |
SDF_API bool | ShouldReadAnonymousLayers () const |
SDF_API bool | ReadDetached (SdfLayer *layer, const std::string &resolvedPath, bool metadataOnly) const |
virtual SDF_API std::set < std::string > | GetExternalAssetDependencies (const SdfLayer &layer) const |
SDF_API bool | SupportsReading () const |
SDF_API bool | SupportsWriting () const |
SDF_API bool | SupportsEditing () const |
![]() | |
TfRefBase () | |
TfRefBase (TfRefBase const &) | |
TfRefBase & | operator= (TfRefBase const &) |
size_t | GetCurrentCount () const |
Return the current reference count of this object. More... | |
bool | IsUnique () const |
Return true if only one TfRefPtr points to this object. More... | |
void | SetShouldInvokeUniqueChangedListener (bool shouldCall) |
![]() | |
TfWeakBase () | |
TfWeakBase (const TfWeakBase &) | |
const TfWeakBase & | __GetTfWeakBase__ () const |
const TfWeakBase & | operator= (const TfWeakBase &) |
void | EnableNotification2 () const |
TF_API void const * | GetUniqueIdentifier () const |
Protected Member Functions | |
UsdUsdcFileFormat () | |
virtual | ~UsdUsdcFileFormat () |
![]() | |
SDF_API | SdfFileFormat (const TfToken &formatId, const TfToken &versionString, const TfToken &target, const std::string &extension) |
Constructor. More... | |
SDF_API | SdfFileFormat (const TfToken &formatId, const TfToken &versionString, const TfToken &target, const std::string &extension, const SdfSchemaBase &schema) |
SdfFileFormat (const TfToken &formatId, const TfToken &versionString, const TfToken &target, const std::string &extension, const SdfSchemaBase &&schema)=delete | |
Disallow temporary SdfSchemaBase objects being passed to the c'tor. More... | |
SDF_API | SdfFileFormat (const TfToken &formatId, const TfToken &versionString, const TfToken &target, const std::vector< std::string > &extensions) |
Constructor. More... | |
SDF_API | SdfFileFormat (const TfToken &formatId, const TfToken &versionString, const TfToken &target, const std::vector< std::string > &extensions, const SdfSchemaBase &schema) |
SdfFileFormat (const TfToken &formatId, const TfToken &versionString, const TfToken &target, const std::vector< std::string > &extensions, const SdfSchemaBase &&schema)=delete | |
Disallow temporary SdfSchemaBase objects being passed to the c'tor. More... | |
virtual SDF_API | ~SdfFileFormat () |
Destructor. More... | |
SDF_API bool | _ReadAndCopyLayerDataToMemory (SdfLayer *layer, const std::string &resolvedPath, bool metadataOnly, bool *didCopyData=nullptr) const |
virtual SDF_API SdfLayer * | _InstantiateNewLayer (const SdfFileFormatConstPtr &fileFormat, const std::string &identifier, const std::string &realPath, const ArAssetInfo &assetInfo, const FileFormatArguments &args) const |
virtual SDF_API bool | _ShouldSkipAnonymousReload () const |
virtual SDF_API bool | _ShouldReadAnonymousLayers () const |
![]() | |
virtual TF_API | ~TfRefBase () |
![]() | |
~TfWeakBase () | |
TfRefPtr< Tf_Remnant > | _Register () const |
template<class T > | |
TfRefPtr< Tf_Remnant > | _Register (T *tempRmnt) const |
bool | _HasRemnant () const |
Protected Attributes | |
SDF_FILE_FORMAT_FACTORY_ACCESS | |
Friends | |
class | UsdUsdFileFormat |
Additional Inherited Members | |
![]() | |
static SDF_API std::string | GetFileExtension (const std::string &s) |
static SDF_API std::set < std::string > | FindAllFileFormatExtensions () |
static SDF_API std::set < std::string > | FindAllDerivedFileFormatExtensions (const TfType &baseType) |
static SDF_API bool | FormatSupportsReading (const std::string &extension, const std::string &target=std::string()) |
static SDF_API bool | FormatSupportsWriting (const std::string &extension, const std::string &target=std::string()) |
static SDF_API bool | FormatSupportsEditing (const std::string &extension, const std::string &target=std::string()) |
static SDF_API SdfFileFormatConstPtr | FindById (const TfToken &formatId) |
static SDF_API SdfFileFormatConstPtr | FindByExtension (const std::string &path, const std::string &target=std::string()) |
static SDF_API SdfFileFormatConstPtr | FindByExtension (const std::string &path, const FileFormatArguments &args) |
![]() | |
static TF_API void | SetUniqueChangedListener (UniqueChangedListener listener) |
![]() | |
static SDF_API void | _SetLayerData (SdfLayer *layer, SdfAbstractDataRefPtr &data) |
static SDF_API void | _SetLayerData (SdfLayer *layer, SdfAbstractDataRefPtr &data, SdfLayerHints hints) |
static SDF_API SdfAbstractDataConstPtr | _GetLayerData (const SdfLayer &layer) |
Get the internal data for layer . More... | |
File format for binary Usd files.
Definition at line 31 of file usdcFileFormat.h.
typedef std::map<std::string, std::string> SdfFileFormat::FileFormatArguments |
Type for specifying additional file format-specific arguments to the various API below.
Definition at line 102 of file fileFormat.h.
using UsdUsdcFileFormat::string = std::string |
Definition at line 35 of file usdcFileFormat.h.
|
protected |
|
protectedvirtual |
|
overridevirtual |
Returns true if file
can be read by this format.
Implements SdfFileFormat.
|
overridevirtual |
This method allows the file format to bind to whatever data container is appropriate.
Returns a shared pointer to an SdfAbstractData implementation.
Reimplemented from SdfFileFormat.
|
overridevirtual |
Reads scene description from the asset specified by resolvedPath
into the layer layer
.
metadataOnly
is a flag that asks for only the layer metadata to be read in, which can be much faster if that is all that is required. Note that this is just a hint: some FileFormat readers may disregard this flag and still fully populate the layer contents.
Returns true if the asset is successfully read into layer
, false otherwise.
Implements SdfFileFormat.
|
overridevirtual |
Reads data in the string str
into the layer layer
. If the file is successfully read, this method returns true. Otherwise, false is returned and errors are posted.
Reimplemented from SdfFileFormat.
|
overridevirtual |
Write the content in layer
to the file at filePath
, which is the backing store for layer
itself. If the content is successfully written, this method returns true. Otherwise, false is returned and errors are posted. The default implementation just calls WriteToFile() passing all the same arguments.
The purpose of this member function is to provide a distinction between a "Save" operation that updates the backing store for the layer
itself and an "Export" operation that writes the layer
data to a distinct asset. File formats that retain all data in memory can typically override only WriteToFile(), but formats that do not may need to take different action on "Save" vs "Export".
Reimplemented from SdfFileFormat.
|
overridevirtual |
Writes the content in layer
into the file at filePath
. If the content is successfully written, this method returns true. Otherwise, false is returned and errors are posted. The default implementation returns false.
This member function makes no distinction between a "Save" operation that updates the backing store for the layer
itself and an "Export" operation that writes the layer
data to a distinct asset. For file formats that retain all data in memory this is typically fine. But for file formats that handle data requests by reading from the backing store, this distinction can be important. In that case, additionally override the member function SaveToFile() to take different action.
Reimplemented from SdfFileFormat.
|
overridevirtual |
Write the provided spec
to out
indented indent
levels.
Reimplemented from SdfFileFormat.
|
overridevirtual |
Writes the content in layer
to the string str
. This function should write a textual representation of layer
to the stream that can be read back in via ReadFromString.
Reimplemented from SdfFileFormat.
|
friend |
Definition at line 77 of file usdcFileFormat.h.
|
protected |
Definition at line 71 of file usdcFileFormat.h.