PUMA Library Reference Manual
Loading...
Searching...
No Matches
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.
 
- Public Member Functions inherited from Puma::Source
 Source ()
 Constructs an empty source object.
 
virtual ~Source ()
 Destroys the source object.
 
virtual int size ()
 Get the size of the source.
 

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.