cesium-native 0.66.0
Loading...
Searching...
No Matches
CesiumGltf::File Struct Referencefinal

A reference to an external file. Files MAY be referenced by a URI (or IRI) or a buffer view index. More...

#include <CesiumGltf/File.h>

Inheritance diagram for CesiumGltf::File:
CesiumGltf::NamedObject CesiumUtility::ExtensibleObject

Classes

struct  MimeType
 Known values for The media type or MIME type of the external file. More...
 

Public Member Functions

int64_t getSizeBytes () const
 Calculates the size in bytes of this object, including the contents of all collections, pointers, and strings. This will NOT include the size of any extensions attached to the object. Calling this method may be slow as it requires traversing the object's entire structure.
 
- Public Member Functions inherited from CesiumGltf::NamedObject
int64_t getSizeBytes () const
 Calculates the size in bytes of this object, including the contents of all collections, pointers, and strings. Calling this method may be slow as it requires traversing the object's entire structure.
 
- Public Member Functions inherited from CesiumUtility::ExtensibleObject
template<typename T>
bool hasExtension () const noexcept
 Checks if an extension exists given its static type.
 
template<typename T>
const T * getExtension () const noexcept
 Gets an extension given its static type.
 
template<typename T>
T * getExtension () noexcept
 Gets an extension given its static type.
 
const JsonValue * getGenericExtension (const std::string &extensionName) const noexcept
 Gets a generic extension with the given name as a CesiumUtility::JsonValue.
 
JsonValue * getGenericExtension (const std::string &extensionName) noexcept
 Gets a generic extension with the given name as a CesiumUtility::JsonValue.
 
template<typename T, typename... ConstructorArgumentTypes>
T & addExtension (ConstructorArgumentTypes &&... constructorArguments)
 Adds a statically-typed extension to this object.
 
template<typename T>
void removeExtension ()
 Removes a statically-typed extension from this object.
 
int64_t getSizeBytes () const
 Calculates the size in bytes of this ExtensibleObject, including all of its extras but NOT including its extensions. Calling this method may be slow as it requires traversing the entire object.
 

Public Attributes

std::vector< CesiumGltf::Alias > aliases
 An array of aliases used for files within this external file. Aliases allow overriding inner file URIs.
 
int32_t bufferView = -1
 The index of the bufferView that contains the file data.
 
std::string mimeType = MimeType::model_gltf_json
 The media type or MIME type of the external file.
 
std::optional< std::string > uri
 The URI (or IRI) of the external file.
 
- Public Attributes inherited from CesiumGltf::NamedObject
std::string name
 The user-defined name of this object.
 
- Public Attributes inherited from CesiumUtility::ExtensibleObject
std::unordered_map< std::string, std::any > extensions
 The extensions attached to this object.
 
JsonValue::Object extras
 Application-specific data.
 
JsonValue::Object unknownProperties
 Unknown properties that exist on this object but do not have any representation in the statically-typed classes.
 

Static Public Attributes

static constexpr const char * TypeName = "File"
 The original name of this type.
 

Detailed Description

A reference to an external file. Files MAY be referenced by a URI (or IRI) or a buffer view index.

Definition at line 19 of file File.h.

Member Function Documentation

◆ getSizeBytes()

int64_t CesiumGltf::File::getSizeBytes ( ) const
inline

Calculates the size in bytes of this object, including the contents of all collections, pointers, and strings. This will NOT include the size of any extensions attached to the object. Calling this method may be slow as it requires traversing the object's entire structure.

Definition at line 74 of file File.h.

Member Data Documentation

◆ aliases

std::vector<CesiumGltf::Alias> CesiumGltf::File::aliases

An array of aliases used for files within this external file. Aliases allow overriding inner file URIs.

Definition at line 40 of file File.h.

◆ bufferView

int32_t CesiumGltf::File::bufferView = -1

The index of the bufferView that contains the file data.

This field MUST NOT be defined when uri is defined.

Definition at line 47 of file File.h.

◆ mimeType

std::string CesiumGltf::File::mimeType = MimeType::model_gltf_json

The media type or MIME type of the external file.

Known values are defined in MimeType.

This field is required and MUST always be defined.

Definition at line 57 of file File.h.

◆ TypeName

const char* CesiumGltf::File::TypeName = "File"
staticconstexpr

The original name of this type.

Definition at line 23 of file File.h.

◆ uri

std::optional<std::string> CesiumGltf::File::uri

The URI (or IRI) of the external file.

Relative paths are relative to the current glTF asset. Instead of referencing an external file, this field MAY contain a data:-URI. This field MUST NOT be defined when bufferView is defined.

Definition at line 66 of file File.h.


The documentation for this struct was generated from the following file: