Add IOMode parameter for file IO operations.
This commit is contained in:
parent
6e7a91bc98
commit
a1f0cafeb3
|
@ -130,8 +130,8 @@ interface EventDriverFiles {
|
|||
|
||||
ulong getSize(FileFD file);
|
||||
|
||||
void write(FileFD file, ulong offset, const(ubyte)[] buffer, FileIOCallback on_write_finish);
|
||||
void read(FileFD file, ulong offset, ubyte[] buffer, FileIOCallback on_read_finish);
|
||||
void write(FileFD file, ulong offset, const(ubyte)[] buffer, IOMode mode, FileIOCallback on_write_finish);
|
||||
void read(FileFD file, ulong offset, ubyte[] buffer, IOMode mode, FileIOCallback on_read_finish);
|
||||
void cancelWrite(FileFD file);
|
||||
void cancelRead(FileFD file);
|
||||
|
||||
|
|
|
@ -227,12 +227,12 @@ final class LibasyncEventDriverFiles : EventDriverFiles {
|
|||
assert(false, "TODO!");
|
||||
}
|
||||
|
||||
override void write(FileFD file, ulong offset, const(ubyte)[] buffer, FileIOCallback on_write_finish)
|
||||
override void write(FileFD file, ulong offset, const(ubyte)[] buffer, IOMode mode, FileIOCallback on_write_finish)
|
||||
{
|
||||
assert(false, "TODO!");
|
||||
}
|
||||
|
||||
override void read(FileFD file, ulong offset, ubyte[] buffer, FileIOCallback on_read_finish)
|
||||
override void read(FileFD file, ulong offset, ubyte[] buffer, IOMode mode, FileIOCallback on_read_finish)
|
||||
{
|
||||
assert(false, "TODO!");
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ final class ThreadedFileEventDriver(Events : EventDriverEvents) : EventDriverFil
|
|||
}
|
||||
}
|
||||
|
||||
final override void write(FileFD file, ulong offset, const(ubyte)[] buffer, FileIOCallback on_write_finish)
|
||||
final override void write(FileFD file, ulong offset, const(ubyte)[] buffer, IOMode, FileIOCallback on_write_finish)
|
||||
{
|
||||
//assert(this.writable);
|
||||
auto f = &m_files[file].write;
|
||||
|
@ -205,7 +205,7 @@ log("start task");
|
|||
assert(res, "Cancelling write when no write is in progress.");
|
||||
}
|
||||
|
||||
final override void read(FileFD file, ulong offset, ubyte[] buffer, FileIOCallback on_read_finish)
|
||||
final override void read(FileFD file, ulong offset, ubyte[] buffer, IOMode, FileIOCallback on_read_finish)
|
||||
{
|
||||
auto f = &m_files[file].read;
|
||||
assert(f.callback is null, "Concurrent file reads are not allowed.");
|
||||
|
|
|
@ -234,12 +234,12 @@ final class WinAPIEventDriverFiles : EventDriverFiles {
|
|||
assert(false, "TODO!");
|
||||
}
|
||||
|
||||
override void write(FileFD file, ulong offset, const(ubyte)[] buffer, FileIOCallback on_write_finish)
|
||||
override void write(FileFD file, ulong offset, const(ubyte)[] buffer, IOMode mode, FileIOCallback on_write_finish)
|
||||
{
|
||||
assert(false, "TODO!");
|
||||
}
|
||||
|
||||
override void read(FileFD file, ulong offset, ubyte[] buffer, FileIOCallback on_read_finish)
|
||||
override void read(FileFD file, ulong offset, ubyte[] buffer, IOMode mode, FileIOCallback on_read_finish)
|
||||
{
|
||||
assert(false, "TODO!");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue