aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Asset.cpp
diff options
context:
space:
mode:
authormax-001 <maxsmits21@knpmail.nl>2024-10-09 10:54:50 +0200
committermax-001 <maxsmits21@knpmail.nl>2024-10-09 10:54:50 +0200
commitf5b4e2c84326bd96c78ad1f6e4481c1970e54444 (patch)
treeaa75ef01ace01d86ffda93632e0b40dc11e0dcbc /src/crepe/Asset.cpp
parent765550bce8a81c6f0c79c0083b14ef68e0c900b2 (diff)
parent6b7a670d60fec808e4fd1fcf3a8df2c503dcbdf4 (diff)
Merge remote-tracking branch 'origin/master' into max/POC-ECS-homemade
Diffstat (limited to 'src/crepe/Asset.cpp')
-rw-r--r--src/crepe/Asset.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/crepe/Asset.cpp b/src/crepe/Asset.cpp
new file mode 100644
index 0000000..15ddc27
--- /dev/null
+++ b/src/crepe/Asset.cpp
@@ -0,0 +1,14 @@
+#include <filesystem>
+
+#include "Asset.h"
+
+using namespace crepe;
+
+Asset::Asset(const std::string & src) {
+ this->src = std::filesystem::canonical(src);
+ this->file = std::ifstream(this->src, std::ios::in | std::ios::binary);
+}
+
+const std::istream & Asset::read() { return this->file; }
+
+const char * Asset::canonical() { return this->src.c_str(); }