fix(file): add Blizzard::File::Flush

This commit is contained in:
phaneron 2025-03-15 23:55:16 -04:00
parent c305acb5f9
commit e68a482072
3 changed files with 34 additions and 0 deletions

View file

@ -11,6 +11,7 @@
#include "bc/file/CreateDirectory.hpp"
#include "bc/file/Delete.hpp"
#include "bc/file/Exists.hpp"
#include "bc/file/Flush.hpp"
#include "bc/file/GetFileInfo.hpp"
#include "bc/file/GetPos.hpp"
#include "bc/file/GetWorkingDirectory.hpp"

18
bc/file/Flush.cpp Normal file
View file

@ -0,0 +1,18 @@
#include "bc/file/Flush.cpp"
#include "bc/system/file/Stacked.hpp"
namespace Blizzard {
namespace File {
// flush
bool Flush(StreamRecord* file) {
System_File::Stacked::FileParms parms;
parms.op = offsetof(Filesystem, flush);
parms.file = file;
auto fs = System_File::Stacked::s_manager;
return fs ? fs->flush(fs, &parms) : false;
}
} // namespace File
} // namespace Blizzard

15
bc/file/Flush.hpp Normal file
View file

@ -0,0 +1,15 @@
#ifndef BC_FILE_FLUSH_HPP
#define BC_FILE_FLUSH_HPP
#include "bc/file/Types.hpp"
namespace Blizzard {
namespace File {
// flush
bool Flush(StreamRecord* file);
} // namespace File
} // namespace Blizzard
#endif