Add IOMode parameter for file IO operations.

This commit is contained in:
Sönke Ludwig 2017-01-19 00:24:38 +01:00
parent 6e7a91bc98
commit a1f0cafeb3
No known key found for this signature in database
GPG key ID: D95E8DB493EE314C
4 changed files with 8 additions and 8 deletions

View file

@ -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);

View 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!");
}

View file

@ -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.");

View file

@ -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!");
}