WvStreams
wvstreamex3.cc
1/*
2 * A WvStream example.
3 *
4 * Some text about this example...
5 */
6
7#include <wvstream.h>
8
9int main()
10{
11 char buffer[10];
12 size_t numread;
13
14 while (wvcon->isok())
15 {
16 numread = wvcon->read(buffer, sizeof(buffer));
17 if (numread)
18 {
19 wvcon->print("You said: ");
20 wvcon->write(buffer, numread);
21 wvcon->print(" (%s bytes)\n", numread);
22 }
23 }
24}
virtual bool isok() const
return true if the stream is actually usable right now
Definition: wvstream.cc:445
virtual size_t write(const void *buf, size_t count)
Write data to the stream.
Definition: wvstream.cc:532
virtual size_t read(void *buf, size_t count)
read a data block on the stream.
Definition: wvstream.cc:490