Input/Output


Enumerations

enum  suplib::readopt {
  suplib::READ_PHYS = 0x00, suplib::READ_LOGICAL = 0x01, suplib::STRIP = 0x02, suplib::CLEAN = 0x04,
  suplib::RAW = 0x08
}
 Control options for getrecord. More...

Functions

istream & suplib::getrecord (istream &is, string &str, int opt, char delim, char continuation)
 Reads physical and logical lines.

Enumeration Type Documentation

Control options for getrecord.

Enumerator:
READ_PHYS  A single physical line makes up a record. A physical line is defined to be all characters up to the delim character. The delim character is not returned. This ignores any line continuation character. This is the default.
READ_LOGICAL  A record may span multiple physical lines if the end-of-line delimiter is preceded by the continuation character. For ease of use, whitespace characters between the continuation character and the delim character are ignored.
STRIP  remove all trailing whitespace from the end of a record.
CLEAN  on a line with a continuation character, remove any white space following the continuation character, and add a delimiter directly following the continuation character. It has no effect on physical records or the final line in a continued logical record.
RAW  return the input record (logical or physical) as is, without removing white space. end of line delimiters will be returned, but because they must be explicitly place din the string (becasue getline() is used to read from the input stream and it silently removes delimiters), there may be an extra delimiter at the end of the record if the input stream ended without a trailing delimiter

Definition at line 47 of file io.h.


Function Documentation

istream & suplib::getrecord ( istream &  is,
string &  str,
int  opt,
char  delim,
char  continuation 
)

Reads physical and logical lines.

Parameters:
is the istream from which to read.
str the string into which to read.
opt the control options.
delim the character which indicates the end of a physical line.
continuation the character directly proceeding the delim which indicates a logical record continues on the following physical line.
getrecord reads a line from the specified istream. It always reads a complete line, enlarging the string as necessary. The opt argument specifies a set of control flag, which are created by logically OR'ing suplib::readopt values.

Returns:
It returns the input istream after attempting to read lines from it.

Definition at line 60 of file getrecord.cc.


Generated on Thu Oct 2 20:49:06 2008 for suplibxx by  doxygen 1.5.6