MCPcopy Create free account
hub / github.com/Apache553/SubtitleFontHelper / GetFileContent

Method GetFileContent

SubtitleFontAutoLoaderDaemon/Common.cpp:73–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73std::string sfh::GetFileContent(const std::wstring& path)
74{
75 std::string ret;
76 wil::unique_file fp;
77 if (_wfopen_s(fp.put(), path.c_str(), L"rb"))
78 throw std::runtime_error("unable to open file");
79 fseek(fp.get(), 0, SEEK_END);
80 ret.resize(ftell(fp.get()));
81 rewind(fp.get());
82 fread(ret.data(), sizeof(char), ret.size(), fp.get());
83 return ret;
84}
85
86std::wstring sfh::GetCurrentProcessUserSid()
87{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected