summaryrefslogtreecommitdiff
path: root/csgo-loader/csgo-server/RemoteCode/FileReader.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'csgo-loader/csgo-server/RemoteCode/FileReader.hpp')
-rw-r--r--csgo-loader/csgo-server/RemoteCode/FileReader.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/csgo-loader/csgo-server/RemoteCode/FileReader.hpp b/csgo-loader/csgo-server/RemoteCode/FileReader.hpp
index 50e9667..85e5770 100644
--- a/csgo-loader/csgo-server/RemoteCode/FileReader.hpp
+++ b/csgo-loader/csgo-server/RemoteCode/FileReader.hpp
@@ -1 +1,32 @@
#pragma once
+
+#include <fstream>
+#include <cstdint>
+#include <vector>
+#include <iterator>
+
+using ByteArray = std::vector< uint8_t >;
+
+namespace RemoteCode
+{
+ class FileReader
+ {
+ // Contents of the file.
+ ByteArray m_Contents;
+
+ public:
+ FileReader() = default;
+
+ // Constructor (ignores exception-handling).
+ FileReader(const char *FileName) { Start(FileName); }
+
+ // Read a file.
+ bool Start(const char *FileName);
+
+ // Self-explanatory.
+ size_t GetFileLength() { return m_Contents.size(); }
+
+ // Allow the user to walk the data.
+ operator uint8_t *() { return m_Contents.data(); }
+ };
+} \ No newline at end of file