diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-05 14:24:39 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-05 14:24:39 +0200 |
commit | b99e38badb82c5cc79771a77c5f6ea180c67ee4f (patch) | |
tree | 9cc3381095363b8ee8e1ce19130345cc3a9bb375 /src/crepe/api | |
parent | 202a9ec288ded78771e1f7e4c711a7612b201b9d (diff) |
move Asset from crepe::api to crepe
Diffstat (limited to 'src/crepe/api')
-rw-r--r-- | src/crepe/api/Asset.cpp | 14 | ||||
-rw-r--r-- | src/crepe/api/Asset.h | 24 | ||||
-rw-r--r-- | src/crepe/api/CMakeLists.txt | 2 |
3 files changed, 0 insertions, 40 deletions
diff --git a/src/crepe/api/Asset.cpp b/src/crepe/api/Asset.cpp deleted file mode 100644 index 92ee50e..0000000 --- a/src/crepe/api/Asset.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include <filesystem> - -#include "Asset.h" - -using namespace crepe::api; - -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(); } diff --git a/src/crepe/api/Asset.h b/src/crepe/api/Asset.h deleted file mode 100644 index 259c696..0000000 --- a/src/crepe/api/Asset.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include <fstream> -#include <iostream> -#include <string> - -namespace crepe::api { - -class Asset { -public: - Asset(const std::string & src); - -public: - //! Get an input stream to the contents of this resource - const std::istream & read(); - //! Get the canonical path to this resource - const char * canonical(); - -private: - std::string src; - std::ifstream file; -}; - -} // namespace crepe::api diff --git a/src/crepe/api/CMakeLists.txt b/src/crepe/api/CMakeLists.txt index 54c7fdc..9548594 100644 --- a/src/crepe/api/CMakeLists.txt +++ b/src/crepe/api/CMakeLists.txt @@ -1,11 +1,9 @@ target_sources(crepe PUBLIC # AudioSource.cpp - Asset.cpp ) target_sources(crepe PUBLIC FILE_SET HEADERS FILES AudioSource.h Component.h - Asset.h ) |