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

ResourceFactory specialization for binary-format resource files. More...

#include <ResourceFactoryBinary.h>

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

Protected Member Functions

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.
 

Additional Inherited Members

- 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.
 

Detailed Description

ResourceFactory specialization for binary-format resource files.

Validates that the file carries a BinaryReader and that its format tag equals RESOURCE_FORMAT_BINARY. Subclass this when implementing a factory that deserializes a binary (.otr / .o2r) resource.

Member Function Documentation

◆ FileHasValidFormatAndReader()

bool Ship::ResourceFactoryBinary::FileHasValidFormatAndReader ( std::shared_ptr< File file,
std::shared_ptr< Ship::ResourceInitData initData 
)
overrideprotectedvirtual

Validates that the file uses the binary format and contains a BinaryReader.

Parameters
fileRaw file data to inspect.
initDataMetadata from the file header.
Returns
true if the format is binary and the reader is a BinaryReader.

Implements Ship::ResourceFactory.


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