Nameless Engine
Loading...
Searching...
No Matches
IBinaryFieldSerializer.hpp
1#pragma once
2
3// Standard.
4#include <optional>
5#include <filesystem>
6#include <string>
7#include <variant>
8
9// Custom.
10#include "misc/Error.h"
11
12// External.
13#include "Refureku/Refureku.h"
14
15namespace ne {
16 class Serializable;
17
25 public:
26 IBinaryFieldSerializer() = default;
27 virtual ~IBinaryFieldSerializer() = default;
28
36 virtual bool isFieldTypeSupported(const rfk::Field* pField) = 0;
37
49 [[nodiscard]] virtual std::variant<std::string, Error> serializeField(
50 const std::filesystem::path& pathToOutputDirectory,
51 const std::string& sFilenameWithoutExtension,
52 Serializable* pFieldOwner,
53 const rfk::Field* pField) = 0;
54
64 [[nodiscard]] virtual std::optional<Error> deserializeField(
65 const std::filesystem::path& pathToBinaryFile,
66 Serializable* pFieldOwner,
67 const rfk::Field* pField) = 0;
68 };
69} // namespace ne
Definition: IBinaryFieldSerializer.hpp:24
virtual bool isFieldTypeSupported(const rfk::Field *pField)=0
virtual std::optional< Error > deserializeField(const std::filesystem::path &pathToBinaryFile, Serializable *pFieldOwner, 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
Definition: Serializable.h:113