TheCherno / Hazel

Hazel Engine
Apache License 2.0
11.64k stars 1.5k forks source link

Changed std::string to std::filesystem::path in the Filewatcher #603

Open nepp95 opened 1 year ago

nepp95 commented 1 year ago

Describe the issue (if no issue has been made)

std::filesystem::path is used when loading assemblies, so it makes more sense to use this for the filewatcher too, instead of converting a std::filesystem::path to std::string. This is natively supported by the library.

static bool LoadAssembly(const std::filesystem::path& filepath);
static bool LoadAppAssembly(const std::filesystem::path& filepath);

Also see: https://github.com/ThomasMonkman/filewatch#4

PR impact (Make sure to add closing keywords)

List of related issues/PRs this will solve:

Impact Issue/PR
Issues this solves None
Other PRs this solves None

Proposed fix _(Make sure you've read [on how to contribute]

Changed the occurences of std::string to std::filesystem::path where the filewatcher is concerned. Although std::string is used in other places, this didn't involve the filewatcher and have been left as is.

Additional context

Tested if it still works, which it should since this is not really a breaking change and is supported by the library. Worked fine when changing a file in the sandbox project and recompiling while running.