ECSTASY
All in the name
Loading...
Searching...
No Matches
ISerializer.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_SERIALIZATION_ISERIALIZER_HPP_
13#define ECSTASY_SERIALIZATION_ISERIALIZER_HPP_
14
15#include <filesystem>
16#include <iostream>
17
19{
32 public:
39 virtual ~ISerializer() = default;
40
47 virtual void clear() = 0;
48
57 [[nodiscard]] virtual size_t size() const = 0;
58
69 virtual void importFile(const std::filesystem::path &filename) = 0;
70
81 virtual void importBytes(const std::string &content) = 0;
82
91 virtual void importStream(std::istream &stream) = 0;
92
103 virtual void exportFile(const std::filesystem::path &filename) const = 0;
104
115 [[nodiscard]] virtual std::string exportBytes() const = 0;
116
125 virtual void exportStream(std::ostream &stream) const = 0;
126 };
127} // namespace ecstasy::serialization
128
129#endif /* !ECSTASY_SERIALIZATION_ISERIALIZER_HPP_ */
Interface for all serializer classes.
virtual size_t size() const =0
Get the size of the serializer content (in bytes).
virtual void exportFile(const std::filesystem::path &filename) const =0
Export the serializer content to a file.
virtual void importFile(const std::filesystem::path &filename)=0
Import data from a file into the serializer.
virtual void clear()=0
Clear the serializer content.
virtual void importStream(std::istream &stream)=0
Import data from a stream into the serializer.
virtual void exportStream(std::ostream &stream) const =0
Export the serializer content to a stream.
virtual void importBytes(const std::string &content)=0
Import data from a string into the serializer.
virtual ~ISerializer()=default
Destroy the ISerializer.
virtual std::string exportBytes() const =0
Export the serializer content to a string.
Namespace regrouping the serialization ecstasy classes.
Definition AType.hpp:26