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

Binary factory for Json resources (version 0). More...

#include <JsonFactory.h>

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

Public Member Functions

std::shared_ptr< IResourceReadResource (std::shared_ptr< File > file, std::shared_ptr< Ship::ResourceInitData > initData) override
 Deserializes a binary file into a Json resource.
 
- Public Member Functions inherited from Ship::ResourceFactory
virtual std::shared_ptr< IResourceReadResource (std::shared_ptr< File > file, std::shared_ptr< ResourceInitData > initData)=0
 Deserializes a File into an IResource.
 

Additional Inherited Members

- Protected Member Functions inherited from Ship::ResourceFactoryBinary
bool FileHasValidFormatAndReader (std::shared_ptr< File > file, std::shared_ptr< Ship::ResourceInitData > initData) override
 Validates that the file uses the binary format and contains a BinaryReader.
 

Detailed Description

Binary factory for Json resources (version 0).

Reads a JSON string from a File's BinaryReader, parses it, and produces a Json resource.

Member Function Documentation

◆ ReadResource()

std::shared_ptr< IResource > Ship::ResourceFactoryBinaryJsonV0::ReadResource ( std::shared_ptr< File file,
std::shared_ptr< Ship::ResourceInitData initData 
)
override

Deserializes a binary file into a Json resource.

Parameters
fileRaw file data with a BinaryReader.
initDataMetadata parsed from the file header.
Returns
Shared pointer to the constructed Json, or nullptr on failure.

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