PUMA Library Reference Manual
Puma::KeyboardSource Class Reference

#include <Puma/KeyboardSource.h>

+ Inheritance diagram for Puma::KeyboardSource:

Description

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 size ()
 Get the size of the source. More...
 

Member Function Documentation

◆ read()

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

Read one byte from the keyboard into the given string.

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

Implements Puma::Source.