MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / fileOpen

Function fileOpen

src/Core/src/FileStream.cpp:8–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace OpenLoco
7{
8 static FILE* fileOpen(const std::filesystem::path& path, StreamMode mode)
9 {
10 if (mode == StreamMode::none)
11 {
12 throw Exception::InvalidArgument("Invalid mode argument");
13 }
14#ifdef _WIN32
15 FILE* fs;
16 _wfopen_s(&fs, path.wstring().c_str(), mode == StreamMode::read ? L"rb" : L"wb");
17 return fs;
18#else
19 return fopen(path.u8string().c_str(), mode == StreamMode::read ? "rb" : "wb");
20#endif
21 }
22
23 static size_t fileTell(FILE* fs)
24 {

Callers 1

openMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected