diff options
author | Hop311 <Hop3114@gmail.com> | 2024-08-14 00:03:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-14 00:03:11 +0200 |
commit | 728d6d91700b8a3e64c6524e0496c444d3379313 (patch) | |
tree | abf72a926fbf3e255def28e47f2514156e8780ff /src/openvic-dataloader/ParseState.hpp | |
parent | d13cdd0da7a48c8f12d710e4d8c0344641e3f392 (diff) | |
parent | 35262ebf8835476e0f2c3353e132e196f7c2e615 (diff) |
Fix CSV logger file invalid pointer
Diffstat (limited to 'src/openvic-dataloader/ParseState.hpp')
-rw-r--r-- | src/openvic-dataloader/ParseState.hpp | 15 |
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; } |