geode/loader/include/Geode/utils/file.hpp
HJfod 6d2718ce09 rename utils namespaces to be consistent + add file picking function +
implement it on windows via NFD + settings are pretty much finished
2022-09-26 13:53:40 +03:00

28 lines
1.5 KiB
C++

#pragma once
#include <Geode/DefaultInclude.hpp>
#include "Result.hpp"
#include <string>
#include "types.hpp"
#include "fs/filesystem.hpp"
namespace geode::utils::file {
GEODE_DLL Result<std::string> readString(std::string const& path);
GEODE_DLL Result<std::string> readString(std::wstring const& path);
GEODE_DLL Result<std::string> readString(ghc::filesystem::path const& path);
GEODE_DLL Result<byte_array> readBinary(std::string const& path);
GEODE_DLL Result<byte_array> readBinary(std::wstring const& path);
GEODE_DLL Result<byte_array> 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<std::vector<std::string>> listFiles(std::string const& path);
GEODE_DLL Result<std::vector<std::string>> listFilesRecursively(std::string const& path);
}