devilutionX/Source/utils/file_util.h
Gleb Mazovetskiy 7e1fea6f76 clang-format all files in {Source,test}/
Also includes a few manual tweaks to comments and newlines for better results.

Co-authored-by: Anders Jenbo <anders@jenbo.dk>
2021-11-24 23:44:12 +01:00

25 lines
730 B
C++

#pragma once
#include <cstdint>
#include <cstdio>
#include <fstream>
#include <memory>
#include "utils/stdcompat/optional.hpp"
#include "utils/stdcompat/string_view.hpp"
namespace devilution {
bool FileExists(const char *path);
bool FileExistsAndIsWriteable(const char *path);
bool GetFileSize(const char *path, std::uintmax_t *size);
bool ResizeFile(const char *path, std::uintmax_t size);
void RemoveFile(const char *lpFileName);
std::optional<std::fstream> CreateFileStream(const char *path, std::ios::openmode mode);
FILE *FOpen(const char *path, const char *mode);
#if defined(_WIN64) || defined(_WIN32)
std::unique_ptr<wchar_t[]> ToWideChar(string_view path);
#endif
} // namespace devilution