MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / WriteFile

Method WriteFile

Source/pfile.cpp:533–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531}
532
533bool SaveWriter::WriteFile(const char *filename, const byte *data, size_t size)
534{
535 const std::string path = dir_ + filename;
536 FILE *file = OpenFile(path.c_str(), "wb");
537 if (file == nullptr) {
538 return false;
539 }
540 if (std::fwrite(data, size, 1, file) != 1) {
541 std::fclose(file);
542 return false;
543 }
544 std::fclose(file);
545 return true;
546}
547
548void SaveWriter::RemoveHashEntries(bool (*fnGetName)(uint8_t, char *))
549{

Callers 2

~SaveHelperMethod · 0.45
EncodeHeroFunction · 0.45

Calls 1

OpenFileFunction · 0.85

Tested by

no test coverage detected