OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
 
Loading...
Searching...
No Matches
FileReader.h
Go to the documentation of this file.
1#pragma once
2
3#include "utils_export.h"
4#include <filesystem>
5#include <vector>
6
7namespace Utils
8{
10 {
11 public:
12 enum class BufferStrategy
13 {
14 Unbuffered,
15 Buffered
16 };
17
18 FileReader(const std::filesystem::path& filePath);
19
20 long long Read(BufferStrategy bufferStrategy = BufferStrategy::Buffered, std::ios::openmode mode = DEFAULT_OPENMODE);
21 void Clear();
22 const std::vector<char>& GetBuffer() const;
23
24 private:
25 const std::filesystem::path m_filePath;
26 std::vector<char> m_buffer;
27
28 static inline constexpr std::ios::openmode DEFAULT_OPENMODE = std::ios::in|std::ios::binary;
29 static inline constexpr size_t BUFFER_SIZE = 1024;
30
31 };
32}
#define UTILS_EXPORT