Nameless Engine
Loading...
Searching...
No Matches
ne::MeshDataBinaryFieldSerializer Class Reference

#include <MeshDataBinaryFieldSerializer.h>

Inheritance diagram for ne::MeshDataBinaryFieldSerializer:
ne::IBinaryFieldSerializer

Public Member Functions

virtual bool isFieldTypeSupported (const rfk::Field *pField) override
 
virtual std::variant< std::string, ErrorserializeField (const std::filesystem::path &pathToOutputDirectory, const std::string &sFilenameWithoutExtension, Serializable *pFieldOwner, const rfk::Field *pField) override
 
virtual std::optional< ErrordeserializeField (const std::filesystem::path &pathToBinaryFile, Serializable *pFieldOwner, const rfk::Field *pField) override
 
virtual bool isFieldTypeSupported (const rfk::Field *pField)=0
 
virtual std::variant< std::string, ErrorserializeField (const std::filesystem::path &pathToOutputDirectory, const std::string &sFilenameWithoutExtension, Serializable *pFieldOwner, const rfk::Field *pField)=0
 
virtual std::optional< ErrordeserializeField (const std::filesystem::path &pathToBinaryFile, Serializable *pFieldOwner, const rfk::Field *pField)=0
 

Static Private Attributes

static constexpr auto pMeshDataFileExtension = ".mbin"
 

Detailed Description

Serializer for fields of MeshData type.

Member Function Documentation

◆ deserializeField()

std::optional< Error > ne::MeshDataBinaryFieldSerializer::deserializeField ( const std::filesystem::path &  pathToBinaryFile,
Serializable pFieldOwner,
const rfk::Field *  pField 
)
overridevirtual

Deserializes data from a binary file into the specified field.

Parameters
pathToBinaryFilePath to the binary file to deserialize.
pFieldOwnerField's owner.
pFieldField to deserialize TOML value to.
Returns
Error if something went wrong, empty otherwise.

Implements ne::IBinaryFieldSerializer.

◆ isFieldTypeSupported()

bool ne::MeshDataBinaryFieldSerializer::isFieldTypeSupported ( const rfk::Field *  pField)
overridevirtual

Tests if this serializer supports serialization/deserialization of this field.

Parameters
pFieldField to test for serialization/deserialization support.
Returns
true if this serializer can be used to serialize this field, false otherwise.

Implements ne::IBinaryFieldSerializer.

◆ serializeField()

std::variant< std::string, Error > ne::MeshDataBinaryFieldSerializer::serializeField ( const std::filesystem::path &  pathToOutputDirectory,
const std::string &  sFilenameWithoutExtension,
Serializable pFieldOwner,
const rfk::Field *  pField 
)
overridevirtual

Serializes the specified field into a binary file.

Parameters
pathToOutputDirectoryPath to the directory where the resulting file will be located.
sFilenameWithoutExtensionName of the resulting file without extension.
pFieldOwnerField's owner.
pFieldField to serialize.
Returns
Error if something went wrong, otherwise full name of the resulting file (including file extension).

Implements ne::IBinaryFieldSerializer.

Member Data Documentation

◆ pMeshDataFileExtension

constexpr auto ne::MeshDataBinaryFieldSerializer::pMeshDataFileExtension = ".mbin"
staticconstexprprivate

File extension for the file that is used to store mesh data.


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