5 #include "Mountain/core.hpp" 21 MOUNTAIN_API
explicit Entry(std::filesystem::path&& path);
24 MOUNTAIN_API
virtual ~Entry() =
default;
26 DEFAULT_COPY_MOVE_OPERATIONS(Entry)
29 MOUNTAIN_API
virtual bool_t
Load() = 0;
34 MOUNTAIN_API
virtual void Unload() = 0;
39 MOUNTAIN_API
virtual bool_t
Reload();
46 MOUNTAIN_API
const std::filesystem::path&
GetPath()
const;
54 MOUNTAIN_API std::string
GetName()
const;
61 MOUNTAIN_API
virtual void SetName(
const std::string& newName);
bool_t m_Loaded
Whether this Entry has been loaded.
Pointer< Directory > m_Parent
The parent of this Entry.
virtual MOUNTAIN_API bool_t Reload()
Reloads the contents of this Entry.
virtual MOUNTAIN_API void Unload()=0
Unloads the contents of this Entry.
MOUNTAIN_API bool_t GetLoaded() const
Returns whether this Entry has been loaded.
MOUNTAIN_API std::string GetPathString() const
Returns the string representation of GetPath.
MOUNTAIN_API const std::filesystem::path & GetPath() const
Returns the corresponding filesystem path.
MOUNTAIN_API std::string GetName() const
Returns this Entry name.
File system entry. Can be either a File or a Directory.
virtual MOUNTAIN_API bool_t Load()=0
Loads the contents of this Entry.
virtual MOUNTAIN_API void SetName(const std::string &newName)
Renames this Entry on the file system.
Custom Mountain smart pointer. Represents both a std::shared_ptr and a std::weak_ptr.
MOUNTAIN_API Pointer< Directory > GetParent()
Returns a Pointer to the parent Directory of this Entry, with a strong reference stored in the FileMa...
Defines the Mountain::Directory class.
MOUNTAIN_API Entry(std::filesystem::path &&path)
Constructs an Entry corresponding to the given path.
Defines the Mountain::Pointer class.
virtual MOUNTAIN_API void OpenInExplorer() const
Opens this Entry in the file explorer.
virtual MOUNTAIN_API ~Entry()=default
Default Entry destruction.
virtual void SetParent(Pointer< Directory > &&newParent)
Sets the new path of this Entry.
std::filesystem::path m_Path
The underlying filesystem path of this Entry.
virtual void UpdateUtilityValues()
Updates fields of this class using the new value of m_Path.
std::string m_Name
The name of this Entry.
Contains all declarations of the Mountain Framework.