19#include <piduino/memory.h>
20#include <piduino/flags.h>
21#include <piduino/global.h>
A type-safe flags class for bitwise operations on enum values.
Abstract base class for input/output devices.
virtual bool isOpen() const
Returns true if the device is currently open.
OpenModeFlag
Flags that specify how the device is to be opened.
@ NotOpen
Device is not open.
@ AtEnd
Set the stream's position indicator to the end of the stream on opening.
@ ReadOnly
Open the device for input operations only.
@ Truncate
Discard any existing content when opening the device.
@ Unbuffered
Open the device in unbuffered mode (implementation-defined).
@ WriteOnly
Open the device for output operations only.
@ ReadWrite
Open the device for both input and output operations.
@ Binary
Open the device in binary mode (no text translation).
@ IosModes
Combination of all standard I/O modes.
@ Append
Set the stream's position indicator to the end of the stream before each output operation.
bool isWritable() const
Returns true if the device is writable.
virtual std::string errorString() const
Returns a human-readable description of the last error.
bool isDebug() const
Returns true if debug mode is enabled.
void setTextModeEnabled(bool enabled)
Enables or disables text mode for the device.
IoDevice()
Constructs a new IoDevice object.
Flags< OpenModeFlag > OpenMode
Type representing a combination of OpenModeFlag values.
OpenMode openMode() const
Returns the current open mode of the device.
std::unique_ptr< Private > d_ptr
Pointer to the private implementation.
bool isReadable() const
Returns true if the device is readable.
bool isBuffered() const
Returns true if the device is buffered.
virtual void close()
Closes the device.
void setDebug(bool enabled)
Enables or disables debug mode for the device.
virtual int error() const
Returns the code of the last error.
IoDevice(Private &dd)
Constructs an IoDevice with a given private implementation.
virtual ~IoDevice()
Destroys the IoDevice object.
bool isTextModeEnabled() const
Returns true if text mode is enabled.
virtual bool isSequential() const
Returns true if this device is sequential; otherwise returns false.
virtual bool open(OpenMode mode)
Opens the device with the specified open mode.
Internal implementation class for GpioDevice.
#define PIMP_DECLARE_PRIVATE(Class)
PIMP_DECLARE_PRIVATE.
Global namespace for Piduino.