PUMA Library Reference Manual
No Matches
Puma::KeyboardSource Class Reference

#include <Puma/KeyboardSource.h>

+ Inheritance diagram for Puma::KeyboardSource:


Keyboard input wrapper implementing the Source interface.

Public Member Functions

virtual int read (char *dest, int n)
 Read one byte from the keyboard into the given string. More...
- Public Member Functions inherited from Puma::Source
 Source ()
 Constructs an empty source object. More...
virtual ~Source ()
 Destroys the source object. More...
virtual int read (char *buffer, int n)=0
 Read n bytes from the source into the given string buffer. More...
virtual int size ()
 Get the size of the source. More...

Member Function Documentation

◆ read()

virtual int Puma::KeyboardSource::read ( char *  dest,
int  n 

Read one byte from the keyboard into the given string.

destThe string used as buffer for the bytes read.
nThe number of bytes to read.
The number of bytes read, or -1 in case of errors.

Implements Puma::Source.