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

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

#include <ResourceFactoryXML.h>

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

Protected Member Functions

bool FileHasValidFormatAndReader (std::shared_ptr< File > file, std::shared_ptr< Ship::ResourceInitData > initData) override
 Validates that the file uses the XML format and contains an XMLDocument.
 

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 XML-format resource files.

Validates that the file carries an XMLDocument and that its format tag equals RESOURCE_FORMAT_XML. Subclass this when implementing a factory that deserializes an XML-based resource.

Member Function Documentation

◆ FileHasValidFormatAndReader()

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

Validates that the file uses the XML format and contains an XMLDocument.

Parameters
fileRaw file data to inspect.
initDataMetadata from the file header.
Returns
true if the format is XML and the reader is an XMLDocument.

Implements Ship::ResourceFactory.


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