5 #include "Mountain/core.hpp" 37 MOUNTAIN_API
explicit File(std::filesystem::path&& filepath);
40 MOUNTAIN_API
~File()
override;
42 DEFAULT_COPY_MOVE_OPERATIONS(File)
45 MOUNTAIN_API bool_t
Load()
override;
51 MOUNTAIN_API
void Load(
const char_t* data,
size_t size);
54 MOUNTAIN_API
void Unload()
override;
66 MOUNTAIN_API
void Delete()
const;
69 MOUNTAIN_API bool_t
Exists();
84 template <
typename T =
char_t>
89 template <
typename T =
char_t>
95 MOUNTAIN_API int64_t
GetSize()
const;
98 MOUNTAIN_API
void SetName(
const std::string& newName)
override;
111 std::string m_NameNoExtension;
112 std::string m_Extension;
113 std::string m_PathNoExtension;
114 Type m_Type = Type::Unknown;
116 int8_t* m_Data =
nullptr;
130 #include "Mountain/file/file.inl" Defines the Mountain::Entry class.
MOUNTAIN_API bool_t Load() override
Loads the contents of this File.
MOUNTAIN_API bool_t Exists()
Get whether this file exists on the file system or is just a virtual file representation.
Type
Type of file according to file extension.
File system entry. Can be either a File or a Directory.
Defines the Mountain::Resource class.
MOUNTAIN_API void SetName(const std::string &newName) override
Sets the name of this File.
Static class used to add, load, get, or unload Resources.
MOUNTAIN_API File(std::filesystem::path &&filepath)
Constructs a File corresponding to the given path.
const T * GetData() const
Returns a const pointer to the raw loaded data.
MOUNTAIN_API void OpenInExplorer() const override
Opens this File in the file explorer.
void UpdateUtilityValues() override
Updates fields of this class using the new value of m_Path.
Represents an image in memory.
MOUNTAIN_API void Delete() const
Deletes the corresponding filesystem file.
MOUNTAIN_API std::string GetExtension() const
Returns the file extension of this File.
MOUNTAIN_API int64_t GetSize() const
Returns the size of the loaded data.
MOUNTAIN_API std::string GetPathNoExtension() const
Returns the name of this File without the file extension.
Defines the Mountain::Pointer class.
MOUNTAIN_API std::string GetNameNoExtension() const
Returns the name of this File without the file extension.
MOUNTAIN_API void Unload() override
Unloads the contents of this File.
Holds the necessary information to draw text using a Font.
MOUNTAIN_API Type GetType() const
Returns the Type of this File.
MOUNTAIN_API void OpenFile() const
Opens this File on the user's computer using the default software for its file extension.
MOUNTAIN_API ~File() override
Destructs the File instance by calling PostUnload.
Defines a file on the filesystem.
MOUNTAIN_API Pointer< Resource > GetResource() const
Returns the stored Pointer to the Resource loaded from this File.
Contains all declarations of the Mountain Framework.