diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-01-26 20:50:24 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-01-26 20:50:24 +0100 |
| commit | f144f14d9c13f58afdcc86210824b25d9bf13a12 (patch) | |
| tree | c04de1c77020eaa0f0b52d5e4d5b90b13d6553da /src/LargeFileStream.hpp | |
| parent | 0fa6b682f5fcc63d3b212eeb52d998d0e33062ba (diff) | |
Improve parsing data type
Diffstat (limited to 'src/LargeFileStream.hpp')
| -rw-r--r-- | src/LargeFileStream.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/LargeFileStream.hpp b/src/LargeFileStream.hpp index b80d8e4..64a7600 100644 --- a/src/LargeFileStream.hpp +++ b/src/LargeFileStream.hpp @@ -1,9 +1,12 @@ -#define BUFFER_SIZE (1024 * 1024 / 2) +#pragma once +#include "Types.hpp" #include <fstream> #include <iostream> #include <string> +#define BUFFER_SIZE (1024 * 1024 / 2) + namespace pgnp { using namespace std; @@ -13,11 +16,11 @@ class LargeFileStream { /// @brief In memory buffer char buffer[BUFFER_SIZE]; /// @brief Number of chuck read minus 1 - long chuck_count; + ull chuck_count; /// @brief Number of byte read during the last file access - long last_read_size; + ull last_read_size; /// @brief Keep track of the file offset (to prevent backward read) - long last_loc; + ull last_loc; /// @brief Use a string as file content std::string content; /// @brief Use to shortcut some methods @@ -34,7 +37,7 @@ public: /// @brief Emulate file access with a string void FromString(std::string content); /// @brief Allow array like access to the file - char operator[](long loc); + char operator[](ull loc); /// @brief Check if we reach the EOF bool IsEOF(); |
