29#ifndef Pt_System_FileDevice_h
30#define Pt_System_FileDevice_h
32#include <Pt/System/Api.h>
33#include <Pt/System/IODevice.h>
147 void open(
const Path& path, std::ios::openmode mode);
169 std::size_t onBeginRead(
EventLoop& loop,
char* buffer, std::size_t n,
bool& eof);
172 std::size_t onEndRead(
EventLoop& loop,
char* buffer, std::size_t n,
bool& eof);
175 std::size_t onBeginWrite(
EventLoop& loop,
const char* buffer, std::size_t n);
178 std::size_t onEndWrite(
EventLoop& loop,
const char* buffer, std::size_t n);
187 void onSetTimeout(std::size_t timeout);
190 bool onSeekable()
const;
193 pos_type onSeek(off_type offset, std::ios::seekdir sd);
196 std::size_t onRead(
char* buffer, std::size_t count,
bool& eof);
199 std::size_t onWrite(
const char* buffer, std::size_t count);
202 std::size_t onPeek(
char* buffer, std::size_t count);
211 class FileDeviceImpl* _impl;
Multicast Signal to call multiple slots.
Definition Signal.h:190
Event loop of a thread or process.
Definition EventLoop.h:83
bool isOpen() const
Returns true if file is open.
Definition FileDevice.h:164
void open(const Path &path, std::ios::openmode mode)
Opens the file.
void beginOpen(const Path &path, std::ios::openmode mode)
Begin opening the file.
FileDevice()
Default Constructor.
void endOpen()
End opening the file.
FileDevice(const Path &path, std::ios::openmode mode)
Construct with path to file.
void onCancel()
Blocks until operation has cancelled.
Signal< FileDevice & > & opened()
Notifies that the file was opened.
Definition FileDevice.h:159
virtual bool onRun()
Check if ready and run.
IODevice()
Default Constructor.
Represents a path in the file-system.
Definition Path.h:48
System programming
Definition Connection.h:26
Core module.
Definition Allocator.h:33