41#ifndef _DWMTERMIOS_HH_
42#define _DWMTERMIOS_HH_
78 bool IsSet(
const std::string & flagName)
const;
84 bool Set(
const std::string & flagName);
90 bool Unset(
const std::string & flagName);
129 struct termios & _termios;
154 struct termios & _termios;
179 struct termios & _termios;
204 struct termios & _termios;
284 bool Set(
int fd,
int action);
297 struct termios _termios;
308 static const ControlCharName_t k_controlCharNames[];
310 static std::string PrintableControlChar(cc_t cc);
312 static const ControlCharName_t *
313 FindControlChar(
const std::string & ccName);
315 static const ControlCharName_t *
316 FindControlChar(cc_t cc);
Encapsulates termios control flags.
Definition DwmTermios.hh:166
const TermioFlagInfo_t * KnownFlags() const
Returns the known control flags.
TermioControlFlags(struct termios &t)
Constructor.
Base class for input, output, control and local termio flags.
Definition DwmTermios.hh:71
bool IsSet(const std::string &flagName) const
Returns true if the given flagName is set, else returns false.
bool Set(const std::string &flagName)
Sets the flag for the given flagName.
virtual const TermioFlagInfo_t * KnownFlags() const =0
Returns the known flags.
friend std::ostream & operator<<(std::ostream &os, const TermioFlags &flags)
Prints to an ostream.
bool Unset(const std::string &flagName)
Unsets the flag for the given flagName.
Encapsulates termios local flags.
Definition DwmTermios.hh:191
TermioLocalFlags(struct termios &t)
Constructor.
const TermioFlagInfo_t * KnownFlags() const
Returns the known local flags.
Encapsulates termios output flags.
Definition DwmTermios.hh:141
const TermioFlagInfo_t * KnownFlags() const
Returns the known output flags.
TermioOutputFlags(struct termios &t)
Constructor.
Encapsulates a struct termios.
Definition DwmTermios.hh:215
long InputSpeed() const
Returns the input speed.
long OutputSpeed(long outputSpeed)
Sets and returns the input speed.
bool Get(int fd)
Gets the termios for the given file descriptor.
cc_t ControlChar(const std::string &ccName) const
Returns the control char value for the given control char named ccName.
bool operator==(const Termios &t) const
operator ==
TermioOutputFlags & OutputFlags()
Returns a reference to the output flags.
long InputSpeed(long inputSpeed)
Sets and returns the input speed.
cc_t ControlChar(const std::string &ccName, cc_t val)
Sets and returns the control char value for the given control char named ccName.
TermioInputFlags & InputFlags()
Returns a reference to the input flags.
TermioLocalFlags & LocalFlags()
Returns a reference to the local flags.
long OutputSpeed() const
Returns the input speed.
bool Set(int fd, int action)
Applies the termios to the given file descriptor.
friend std::ostream & operator<<(std::ostream &os, const Termios &t)
Prints to an ostream.
TermioControlFlags & ControlFlags()
Returns a reference to the control flags.
Holds termios flag values and names.
Definition DwmTermios.hh:60