libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Ship::Json Class Referencefinal

Resource type representing a parsed JSON document. More...

#include <Json.h>

Inheritance diagram for Ship::Json:
[legend]
Collaboration diagram for Ship::Json:
[legend]

Public Member Functions

 Json ()
 Default-constructs an empty Json resource.
 
void * GetPointer () override
 Returns a pointer to the nlohmann::json data object.
 
size_t GetPointerSize () override
 Returns the size of the serialized JSON data in bytes.
 
- Public Member Functions inherited from Ship::Resource< void >
void * GetRawPointer () override
 Returns a type-erased raw pointer to the underlying resource data.
 
 IResource (std::shared_ptr< ResourceInitData > initData)
 Constructs an IResource with the given initialization data.
 
- Public Member Functions inherited from Ship::IResource
 IResource (std::shared_ptr< ResourceInitData > initData)
 Constructs an IResource with the given initialization data.
 
virtual ~IResource ()
 
bool IsDirty ()
 Returns true if the resource has been marked dirty.
 
void Dirty ()
 Marks the resource as dirty.
 
std::shared_ptr< ResourceInitDataGetInitData ()
 Returns the initialization data used to load this resource.
 

Public Attributes

nlohmann::json Data
 Parsed JSON document.
 
size_t DataSize
 Size in bytes of the original serialized JSON string.
 

Additional Inherited Members

- Static Public Attributes inherited from Ship::IResource
static const std::string gAltAssetPrefix = "alt/"
 Path prefix that identifies an "alt asset" override.
 

Detailed Description

Resource type representing a parsed JSON document.

The JSON data is deserialized into a nlohmann::json object and exposed through the typed Resource interface. Use ResourceType::Json when registering a factory for this type.

Constructor & Destructor Documentation

◆ Json()

Ship::Json::Json ( )

Default-constructs an empty Json resource.

Member Function Documentation

◆ GetPointer()

void * Ship::Json::GetPointer ( )
overridevirtual

Returns a pointer to the nlohmann::json data object.

Returns
Pointer to the Data member.

Implements Ship::Resource< void >.

◆ GetPointerSize()

size_t Ship::Json::GetPointerSize ( )
overridevirtual

Returns the size of the serialized JSON data in bytes.

Returns
Value of DataSize.

Implements Ship::IResource.

Member Data Documentation

◆ Data

nlohmann::json Ship::Json::Data

Parsed JSON document.

◆ DataSize

size_t Ship::Json::DataSize

Size in bytes of the original serialized JSON string.


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