diff options
Diffstat (limited to 'src/openvic-dataloader/File.cpp')
-rw-r--r-- | src/openvic-dataloader/File.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/openvic-dataloader/File.cpp b/src/openvic-dataloader/File.cpp index e4d3773..9e721a8 100644 --- a/src/openvic-dataloader/File.cpp +++ b/src/openvic-dataloader/File.cpp @@ -16,4 +16,8 @@ const char* File::path() const noexcept { bool File::is_valid() const noexcept { return _buffer.index() != 0 && !_buffer.valueless_by_exception() && visit_buffer([](auto&& buffer) { return buffer.data() != nullptr; }); +} + +std::size_t File::size() const noexcept { + return _buffer.index() != 0 && !_buffer.valueless_by_exception() ? _buffer_size : 0; }
\ No newline at end of file |