20 lines
No EOL
320 B
C++
20 lines
No EOL
320 B
C++
#include "input_device.h"
|
|
|
|
InputDevice::InputDevice(std::istream &in)
|
|
: inStream(in)
|
|
{
|
|
}
|
|
|
|
InputDevice::~InputDevice()
|
|
{
|
|
}
|
|
|
|
unsigned char InputDevice::read()
|
|
{
|
|
char c;
|
|
if (!inStream.get(c)) {
|
|
// If stream is at EOF or error, return 0
|
|
return 0;
|
|
}
|
|
return static_cast<unsigned char>(c);
|
|
} |