aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Asset.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/Asset.h')
-rw-r--r--src/crepe/Asset.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/crepe/Asset.h b/src/crepe/Asset.h
index cb413f4..f6e6782 100644
--- a/src/crepe/Asset.h
+++ b/src/crepe/Asset.h
@@ -1,7 +1,5 @@
#pragma once
-#include <fstream>
-#include <iostream>
#include <string>
namespace crepe {
@@ -9,8 +7,8 @@ namespace crepe {
/**
* \brief Asset location helper
*
- * This class is used to locate and canonicalize paths to game asset files, and
- * should *always* be used when retrieving files from disk.
+ * This class is used to locate game asset files, and should *always* be used
+ * instead of reading file paths directly.
*/
class Asset {
public:
@@ -18,24 +16,28 @@ public:
* \param src Unique identifier to asset
*/
Asset(const std::string & src);
-
-public:
/**
- * \brief Get an input stream to the contents of this asset
- * \return Input stream with file contents
+ * \param src Unique identifier to asset
*/
- std::istream & get_stream();
+ Asset(const char * src);
+
+public:
/**
- * \brief Get the canonical path to this asset
- * \return Canonical path to this asset
+ * \brief Get the path to this asset
+ * \return path to this asset
*/
- const std::string & get_canonical() const;
+ const std::string & get_path() const noexcept;
private:
- //! Canonical path to asset
+ //! path to asset
const std::string src;
- //! File handle (stream)
- std::ifstream file;
+
+private:
+ std::string find_asset(const std::string & src) const;
+ /**
+ * \returns The path to the current executable
+ */
+ std::string whereami() const noexcept;
};
} // namespace crepe