summaryrefslogtreecommitdiffhomepage
path: root/FoundationEx/include
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-03-18 23:41:20 +0100
committerAki <please@ignore.pl>2024-03-18 23:41:20 +0100
commit2066e4911948d11cac5a234d2f7773dc5f06ba96 (patch)
tree27c7672aad884d1307736b3d15e704d7d786b314 /FoundationEx/include
parent3df6ccddcbd881c2474746f5f1758b095c866a67 (diff)
downloadstarshatter-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/include')
-rw-r--r--FoundationEx/include/starshatter/foundation/data.h26
-rw-r--r--FoundationEx/include/starshatter/foundation/reader.h6
2 files changed, 30 insertions, 2 deletions
diff --git a/FoundationEx/include/starshatter/foundation/data.h b/FoundationEx/include/starshatter/foundation/data.h
new file mode 100644
index 0000000..20308a2
--- /dev/null
+++ b/FoundationEx/include/starshatter/foundation/data.h
@@ -0,0 +1,26 @@
+/* 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.
+*/
+
+#pragma once
+
+#include "reader.h"
+
+
+namespace starshatter
+{
+namespace foundation
+{
+namespace data
+{
+
+
+bool toggle_filesystem(bool enabled);
+Reader open(const char* pathname);
+
+
+} // namespace data
+} // namespace foundation
+} // namespace starshatter
diff --git a/FoundationEx/include/starshatter/foundation/reader.h b/FoundationEx/include/starshatter/foundation/reader.h
index 7ec81b4..69472c8 100644
--- a/FoundationEx/include/starshatter/foundation/reader.h
+++ b/FoundationEx/include/starshatter/foundation/reader.h
@@ -9,6 +9,8 @@
#include <cstddef>
#include <memory>
+#include <Text.h>
+
namespace starshatter
{
@@ -40,7 +42,7 @@ struct BaseReader
virtual Count read(Char* dest, Count bytes) = 0;
virtual Count peek(Char* dest) const = 0;
virtual Count peek(Char* dest, Count bytes) const = 0;
- virtual const Char* data() const = 0;
+ virtual Text more() = 0;
};
@@ -73,7 +75,7 @@ struct Reader : public BaseReader<char>
Count read(char* dest, Count bytes) override;
Count peek(char* dest) const override;
Count peek(char* dest, Count bytes) const override;
- const char* data() const override;
+ Text more() override;
private:
Base actual;
};