aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/openvic-dataloader/ParseState.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/openvic-dataloader/ParseState.hpp b/src/openvic-dataloader/ParseState.hpp
index a9a9953..6d635ee 100644
--- a/src/openvic-dataloader/ParseState.hpp
+++ b/src/openvic-dataloader/ParseState.hpp
@@ -96,6 +96,21 @@ namespace ovdl {
FileParseState(const char* path, lexy::buffer<Encoding, MemoryResource>&& buffer, detail::Encoding encoding)
: FileParseState(file_type { path, std::move(buffer) }, encoding) {}
+ FileParseState(const FileParseState&) = delete;
+ FileParseState& operator=(const FileParseState&) = delete;
+
+ FileParseState(FileParseState&& other)
+ : _file { std::move(other._file) },
+ _logger { this->file() },
+ BasicParseState(std::move(other)) {}
+
+ FileParseState& operator=(FileParseState&& rhs) {
+ this->~FileParseState();
+ new (this) FileParseState(std::move(rhs));
+
+ return *this;
+ }
+
file_type& file() {
return _file;
}