From 2066e4911948d11cac5a234d2f7773dc5f06ba96 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 18 Mar 2024 23:41:20 +0100 Subject: Added filesystem-only starshatter::data DataLoader replacement Step by step. The intent is to find a good spot between current data representations and the standard library and put the intermediate stage there. After it matures a bit, we can move further away. --- FoundationEx/src/data.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 FoundationEx/src/data.cpp (limited to 'FoundationEx/src/data.cpp') diff --git a/FoundationEx/src/data.cpp b/FoundationEx/src/data.cpp new file mode 100644 index 0000000..643e823 --- /dev/null +++ b/FoundationEx/src/data.cpp @@ -0,0 +1,42 @@ +/* Starshatter: The Open Source Project + Copyright (c) 2021-2024, Starshatter: The Open Source Project Contributors + Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors + Copyright (c) 1997-2006, Destroyer Studios LLC. +*/ + +#include + +#include +#include + +#include + +#include "reader/file.h" + + + +namespace starshatter +{ +namespace foundation +{ +namespace data +{ + + +bool +toggle_filesystem(bool) +{ + return true; +} + + +Reader +open(const char* pathname) +{ + return {std::make_unique(std::fstream(pathname, std::ios::binary | std::ios::in))}; +} + + +} // namespace data +} // namespace foundation +} // namespace starshatter -- cgit v1.1