Common character processing protocol.
More...
#include <protocols.h>
|
int | back |
|
const char * | eol |
|
Common character processing protocol.
This is used to access a character from some type of streaming buffer or memory object.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 174 of file protocols.h.
virtual int ucommon::CharacterProtocol::_getch |
( |
void |
) | |
|
|
protectedpure virtual |
virtual int ucommon::CharacterProtocol::_putch |
( |
int |
code) | |
|
|
protectedpure virtual |
int ucommon::CharacterProtocol::getchar |
( |
void |
) | |
|
|
inline |
Get the next character.
- Returns
- next character or EOF.
Definition at line 219 of file protocols.h.
size_t ucommon::CharacterProtocol::getline |
( |
char * |
string, |
|
|
size_t |
size |
|
) |
| |
Get text as a line of input from the buffer.
The eol character(s) are used to mark the end of a line. Because the end of line character is stripped, the length of the string may be less than the actual count read. If at the end of the file buffer and unable to read more data an error occured then 0 is returned.
- Parameters
-
string | to save input into. |
size | limit of string to save. |
- Returns
- count of characters actually read or 0 if at end of data.
size_t ucommon::CharacterProtocol::getline |
( |
String & |
buffer) | |
|
Get a string as a line of input from the buffer.
The eol character(s) are used to mark the end of a line. Because the end of line character is stripped, the length of the string may be less than the actual count read. If at the end of the file buffer and unable to read more data an error occured then 0 is returned.
- Parameters
-
buffer | to save input into. |
- Returns
- count of characters actually read or 0 if at end of data.
size_t ucommon::CharacterProtocol::load |
( |
StringPager * |
list) | |
|
Load input to a string list.
The string list filter method is used to control loading.
- Parameters
-
- Returns
- number of items loaded.
void ucommon::CharacterProtocol::putback |
( |
int |
code) | |
|
|
inlineprotected |
Write to back buffer.
Mostly used for input format processing.
- Parameters
-
code | to write into backbuffer. |
Definition at line 199 of file protocols.h.
int ucommon::CharacterProtocol::putchar |
( |
int |
code) | |
|
|
inline |
Put the next character.
- Parameters
-
- Returns
- code or EOF if cannot put.
Definition at line 227 of file protocols.h.
size_t ucommon::CharacterProtocol::putline |
( |
const char * |
string) | |
|
Put a string as a line of output to the buffer.
The eol character is appended to the end.
- Parameters
-
- Returns
- total characters successfully written, including eol chars.
size_t ucommon::CharacterProtocol::save |
( |
const StringPager * |
list) | |
|
Save output from a string list.
- Parameters
-
- Returns
- number of items loaded.
void ucommon::CharacterProtocol::seteol |
( |
const char * |
string) | |
|
|
inlineprotected |
Set end of line marker.
Normally this is set to cr & lf, which actually supports both lf alone and cr/lf termination of lines. However, putline() will always add the full cr/lf if this mode is used. This option only effects getline() and putline().
- Parameters
-
string | for eol for getline and putline. |
Definition at line 209 of file protocols.h.
The documentation for this class was generated from the following file: