From f144f14d9c13f58afdcc86210824b25d9bf13a12 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Wed, 26 Jan 2022 20:50:24 +0100 Subject: Improve parsing data type --- src/LargeFileStream.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/LargeFileStream.hpp') 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 #include #include +#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(); -- cgit v1.2.3