JWS C++ Library
C++ language utility library
|
Abstract class to read this object from an input stream. More...
#include <readable.h>
Public Member Functions | |
virtual | ~Readable () |
Deletes this Readable. | |
virtual void | read (std::istream &in)=0 throw (jwscxx::base::IO_error, jwscxx::base::Arg_error) |
Reads this Readable from an input stream. | |
virtual void | read (const char *fname) throw (jwscxx::base::IO_error, jwscxx::base::Arg_error) |
Reads this Readable from a file. | |
Static Public Member Functions | |
static const char * | read_field_value (std::istream &in, const char *field_name, char *field_buf, size_t buf_len, char separator=':') throw (jwscxx::base::Arg_error, jwscxx::base::IO_error) |
Reads a line off in into a buffer and returns a pointer to the field value in the buffer. | |
static const char * | read_field_value (std::istream &in, const char *field_name, char separator=':') throw (jwscxx::base::Arg_error, jwscxx::base::IO_error) |
Reads a line off in into an internal buffer and returns a pointer to the field value in the buffer. |
Abstract class to read this object from an input stream.
Definition at line 66 of file readable.h.
virtual jwscxx::base::Readable::~Readable | ( | ) | [inline, virtual] |
Deletes this Readable.
Definition at line 71 of file readable.h.
virtual void jwscxx::base::Readable::read | ( | std::istream & | in | ) | throw (jwscxx::base::IO_error, jwscxx::base::Arg_error) [pure virtual] |
Reads this Readable from an input stream.
Implemented in jwscxx::graphics::Camera_f, jwscxx::graphics::Camera_d, jwscxx::graphics::Stereo_camera_f, jwscxx::graphics::Stereo_camera_d, jwscxx::graphics::Parapiped_f, jwscxx::graphics::Parapiped_d, jwscxx::graphics::Polygon_f, and jwscxx::graphics::Polygon_d.
void Readable::read | ( | const char * | fname | ) | throw (jwscxx::base::IO_error, jwscxx::base::Arg_error) [virtual] |
Reads this Readable from a file.
fname | Input file to read from. |
jwscxx::base::IO_error | Could not read from fname. |
jwscxx::base::Arg_error | Invalid arguments in the file to read from. |
Definition at line 71 of file readable.cpp.
const char * Readable::read_field_value | ( | std::istream & | in, |
const char * | field_name, | ||
char * | field_buf, | ||
size_t | buf_len, | ||
char | separator = ':' |
||
) | throw (jwscxx::base::Arg_error, jwscxx::base::IO_error) [static] |
Reads a line off in into a buffer and returns a pointer to the field value in the buffer.
Reads a line off the input stream as a field with format:
field name: field value
Where the separator here is a ':'.
in | Input stream to read the field line from. |
field_name | Name of the field to get the value of. |
field_buf | Buffer to read the line of input into. |
buf_len | Length of the buffer. |
separator | Character separating the field name and value. The default is ':'. |
jwscxx::base::Arg_error | Either the field is not the one named or it is not formatted properly. |
jwscxx::base::IO_error | Could not read a line from the input stream. |
Definition at line 130 of file readable.cpp.
const char * Readable::read_field_value | ( | std::istream & | in, |
const char * | field_name, | ||
char | separator = ':' |
||
) | throw (jwscxx::base::Arg_error, jwscxx::base::IO_error) [static] |
Reads a line off in into an internal buffer and returns a pointer to the field value in the buffer.
Reads a line off the input stream as a field with format:
field name: field value
Where the separator here is a ':'.
in | Input stream to read the field line from. |
field_name | Name of the field to get the value of. |
separator | Character separating the field name and value. The default is ':'. |
jwscxx::base::Arg_error | Either the field is not the one named or it is not formatted properly. |
jwscxx::base::IO_error | Could not read a line from the input stream. |
Definition at line 217 of file readable.cpp.