#include <MeshDataBinaryFieldSerializer.h>
|
virtual bool | isFieldTypeSupported (const rfk::Field *pField) override |
|
virtual std::variant< std::string, Error > | serializeField (const std::filesystem::path &pathToOutputDirectory, const std::string &sFilenameWithoutExtension, Serializable *pFieldOwner, const rfk::Field *pField) override |
|
virtual std::optional< Error > | deserializeField (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, Error > | serializeField (const std::filesystem::path &pathToOutputDirectory, const std::string &sFilenameWithoutExtension, Serializable *pFieldOwner, const rfk::Field *pField)=0 |
|
virtual std::optional< Error > | deserializeField (const std::filesystem::path &pathToBinaryFile, Serializable *pFieldOwner, const rfk::Field *pField)=0 |
|
Serializer for fields of MeshData
type.
◆ 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
-
pathToBinaryFile | Path to the binary file to deserialize. |
pFieldOwner | Field's owner. |
pField | Field 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
-
pField | Field 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
-
pathToOutputDirectory | Path to the directory where the resulting file will be located. |
sFilenameWithoutExtension | Name of the resulting file without extension. |
pFieldOwner | Field's owner. |
pField | Field to serialize. |
- Returns
- Error if something went wrong, otherwise full name of the resulting file (including file extension).
Implements ne::IBinaryFieldSerializer.
◆ 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: