Rudiments
|
Inherits object.
Inherited by filedescriptor, httprequest, and httpserverapi.
Public Member Functions | |
input () | |
virtual | ~input () |
virtual off64_t | setPositionRelativeToBeginning (off64_t offset) |
virtual off64_t | setPositionRelativeToCurrent (off64_t offset) |
virtual off64_t | setPositionRelativeToEnd (off64_t offset) |
virtual off64_t | getPosition () |
virtual ssize_t | read (byte_t *buffer, size_t size)=0 |
virtual ssize_t | read (char *buffer, size_t length)=0 |
virtual ssize_t | read (char *buffer)=0 |
virtual ssize_t | read (wchar_t *buffer, size_t length)=0 |
virtual ssize_t | read (wchar_t *buffer)=0 |
virtual ssize_t | readUcs2 (ucs2_t *buffer, size_t length)=0 |
virtual ssize_t | readUcs2 (ucs2_t *buffer)=0 |
virtual ssize_t | read (int16_t *buffer)=0 |
virtual ssize_t | read (int32_t *buffer)=0 |
virtual ssize_t | read (int64_t *buffer)=0 |
virtual ssize_t | read (byte_t *buffer)=0 |
virtual ssize_t | read (uint16_t *buffer)=0 |
virtual ssize_t | read (uint32_t *buffer)=0 |
virtual ssize_t | read (uint64_t *buffer)=0 |
virtual ssize_t | read (float *buffer)=0 |
virtual ssize_t | read (double *buffer)=0 |
ssize_t | read (char **buffer, const char *terminator) |
ssize_t | read (char **buffer, const char *terminator, size_t maxbytes) |
virtual ssize_t | read (byte_t *buffer, size_t size, int32_t sec, int32_t usec) |
virtual ssize_t | read (char *buffer, size_t length, int32_t sec, int32_t usec) |
virtual ssize_t | read (char *buffer, int32_t sec, int32_t usec) |
virtual ssize_t | read (wchar_t *buffer, size_t length, int32_t sec, int32_t usec) |
virtual ssize_t | read (wchar_t *buffer, int32_t sec, int32_t usec) |
virtual ssize_t | readUcs2 (ucs2_t *buffer, size_t length, int32_t sec, int32_t usec) |
virtual ssize_t | readUcs2 (ucs2_t *buffer, int32_t sec, int32_t usec) |
virtual ssize_t | read (int16_t *buffer, int32_t sec, int32_t usec) |
virtual ssize_t | read (int32_t *buffer, int32_t sec, int32_t usec) |
virtual ssize_t | read (int64_t *buffer, int32_t sec, int32_t usec) |
virtual ssize_t | read (byte_t *buffer, int32_t sec, int32_t usec) |
virtual ssize_t | read (uint16_t *buffer, int32_t sec, int32_t usec) |
virtual ssize_t | read (uint32_t *buffer, int32_t sec, int32_t usec) |
virtual ssize_t | read (uint64_t *buffer, int32_t sec, int32_t usec) |
virtual ssize_t | read (float *buffer, int32_t sec, int32_t usec) |
virtual ssize_t | read (double *buffer, int32_t sec, int32_t usec) |
ssize_t | read (char **buffer, const char *terminator, int32_t sec, int32_t usec) |
ssize_t | read (char **buffer, const char *terminator, size_t maxbytes, int32_t sec, int32_t usec) |
ssize_t | read (char **buffer, const char *terminator, size_t maxbytes, char escapechar, int32_t sec, int32_t usec) |
Public Member Functions inherited from object | |
virtual | ~object () |
The input class provides a base class for things from which input can be taken (file descriptors, files, sockets, etc.)
input::input | ( | ) |
Creates an instance of the input class.
|
virtual |
Deletes this instance of the input class.
|
inlinevirtual |
Returns the position at which the next read will occur or -1 on failure.
This implementation of the method ignores "offset" and always returns -1, however a child class might implement this method to actually set the position.
Reimplemented in filedescriptor.
|
pure virtual |
Reads a byte from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads a byte from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads "size" bytes from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads "size" bytes from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
inline |
Reads from the file desciptor into "buffer" until "terminator" is encountered.
Note that "buffer" is allocated internally and must be freed by the calling program.
Returns the number of bytes that were read or RESULT_ERROR if an error occurred.
|
inline |
Reads from the file desciptor into "buffer" until "terminator" is encountered with a timeout of "sec" seconds and "usec" microseconds.
Note that "buffer" is allocated internally and must be freed by the calling program.
Returns the number of bytes that were read or RESULT_ERROR if an error occurred.
|
inline |
Reads from the file desciptor into "buffer" until "terminator" is encountered.
Note that "buffer" is allocated internally and must be freed by the calling program.
Returns the number of bytes that were read, RESULT_ERROR if an error occurred or RESULT_MAX if maxbytes were read before the terminator was encountered.
Setting maxbytes to 0 disables it.
ssize_t input::read | ( | char ** | buffer, |
const char * | terminator, | ||
size_t | maxbytes, | ||
char | escapechar, | ||
int32_t | sec, | ||
int32_t | usec | ||
) |
Reads from the file desciptor into "buffer" until "terminator" is encountered, using "escapechar" as an escape character, with a timeout of "sec" seconds and "usec" microseconds.
Note that "buffer" is allocated internally and must be freed by the calling program.
Setting "escapechar" to '\0' disables it.
Returns the number of bytes that were read, RESULT_ERROR if an error occurred or RESULT_MAX if maxbytes were read before the terminator was encountered.
Setting maxbytes to 0 disables it.
|
inline |
Reads from the file desciptor into "buffer" until "terminator" is encountered with a timeout of "sec" seconds and "usec" microseconds.
Note that "buffer" is allocated internally and must be freed by the calling program.
Returns the number of bytes that were read, RESULT_ERROR if an error occurred or RESULT_MAX if maxbytes were read before the terminator was encountered.
Setting maxbytes to 0 disables it.
|
pure virtual |
Reads a character from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads a character from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads "length" characters from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads "length" characters from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads a double-precision floating point number from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads a double-precision floating point number from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads a floating point number from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads a floating point number from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads a 16-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads a 16-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads a 32-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads a 32-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads a 64-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads a 64-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads an unsigned 16-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads an unsigned 16-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads an unsigned 32-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads an unsigned 32-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads an unsigned 64-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads an unsigned 64-bit integer from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads a character from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads a character from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads "length" characters from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads "length" characters from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads a character from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads a character from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
pure virtual |
Reads "length" characters from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
Implemented in httprequest, and filedescriptor.
|
virtual |
Reads "length" characters from the file descriptor into "buffer". Returns the number of bytes that were successfully read or RESULT_ERROR if an error occurred.
In this implementation of the method, "sec" and "usec" are ignored, however a child class might implement a timeout using them. In that case, the method would return RESULT_TIMEOUT if a timeout occurred.
Reimplemented in filedescriptor.
|
inlinevirtual |
Sets the position (relative to the beginning of the file descriptor) at which the next read will occur to "offset". Returns that position on success or -1 on failure.
This implementation of the method ignores "offset" and always returns -1, however a child class might implement this method to actually set the position.
Reimplemented in filedescriptor.
|
inlinevirtual |
Advances the position at which the next read will occur by "offset" bytes. Returns that position on success or -1 on failure.
This implementation of the method ignores "offset" and always returns -1, however a child class might implement this method to actually set the position.
Reimplemented in filedescriptor.
|
inlinevirtual |
Sets the position at which the next read will occur to the end of the file plus "offset" bytes. Generally, "offset" will be negative. Returns the position on success or -1 on failure.
This implementation of the method ignores "offset" and always returns -1, however a child class might implement this method to actually set the position.
Reimplemented in filedescriptor.