diff options
author | Aki <please@ignore.pl> | 2024-03-18 23:41:20 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-03-18 23:41:20 +0100 |
commit | 2066e4911948d11cac5a234d2f7773dc5f06ba96 (patch) | |
tree | 27c7672aad884d1307736b3d15e704d7d786b314 /FoundationEx/src/data.cpp | |
parent | 3df6ccddcbd881c2474746f5f1758b095c866a67 (diff) | |
download | starshatter-2066e4911948d11cac5a234d2f7773dc5f06ba96.zip starshatter-2066e4911948d11cac5a234d2f7773dc5f06ba96.tar.gz starshatter-2066e4911948d11cac5a234d2f7773dc5f06ba96.tar.bz2 |
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.
Diffstat (limited to 'FoundationEx/src/data.cpp')
-rw-r--r-- | FoundationEx/src/data.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
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 <starshatter/foundation/data.h> + +#include <fstream> +#include <memory> + +#include <starshatter/foundation/reader.h> + +#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<FileReader>(std::fstream(pathname, std::ios::binary | std::ios::in))}; +} + + +} // namespace data +} // namespace foundation +} // namespace starshatter |