#pragma once #include #include "Result.hpp" #include #include "types.hpp" #include namespace geode::utils::file { GEODE_DLL Result readString(std::string const& path); GEODE_DLL Result readString(std::wstring const& path); GEODE_DLL Result readString(ghc::filesystem::path const& path); GEODE_DLL Result readBinary(std::string const& path); GEODE_DLL Result readBinary(std::wstring const& path); GEODE_DLL Result readBinary(ghc::filesystem::path const& path); GEODE_DLL Result<> writeString(std::string const& path, std::string const& data); GEODE_DLL Result<> writeString(std::wstring const& path, std::string const& data); GEODE_DLL Result<> writeString(ghc::filesystem::path const& path, std::string const& data); GEODE_DLL Result<> writeBinary(std::string const& path, byte_array const& data); GEODE_DLL Result<> writeBinary(std::wstring const& path, byte_array const& data); GEODE_DLL Result<> writeBinary(ghc::filesystem::path const& path, byte_array const& data); GEODE_DLL Result<> createDirectory(std::string const& path); GEODE_DLL Result<> createDirectoryAll(std::string const& path); GEODE_DLL Result> listFiles(std::string const& path); GEODE_DLL Result> listFilesRecursively(std::string const& path); /** * Unzip file to directory * @param from File to unzip * @param to Directory to unzip to * @returns Ok on success, Error on error */ GEODE_DLL Result<> unzipTo( ghc::filesystem::path const& from, ghc::filesystem::path const& to ); }