code::AsciiLineReader Class Reference

List of all members.

Detailed Description

Collection of utilities for parsing ascii strings; not a `Reader' in the WDSSII sense.

Takes a buffer of ascii char and returns a SmartPtr to a vector of strings containing individual lines of data (it looks for a newline character). It does NOT append the newline character to the strings, nor will it append EOF characters.

Author:
: Karen Cooper
Version:
:
Id
code_AsciiLineReader.h,v 1.11 2009/06/02 20:17:39 lakshman Exp


Static Public Member Functions

static SmartPtr< std::vector<
std::string > > 
getLines (const Buffer &buf, std::string *last_unterminated_line=0)
 Splits text into a vector of lines.
static void read (BOIStream &s, std::string &str, char skip=' ')
 like scanf("%s") for BOStreams.
static void read (BOIStream &s, int &val, char skip=' ')
 like atoi() for BOStreams.
static void read (BOIStream &s, short &val, char skip=' ')
 like atoi() for BOStreams.
static void read (BOIStream &s, float &val, char skip=' ')
 like atof() for BOStreams.
static void write (BOOStream &s, const std::string &str)
 like printf("%s") for BOStreams.
static void write (BOOStream &s, float val)
 like printf("%f") for BOStreams.
static void write (BOOStream &s, int val)
 like printf("%d") for BOStreams.
static void write (BOOStream &s, short val)
 like printf("%hd") for BOStreams.


Member Function Documentation

static SmartPtr< std::vector< std::string > > code::AsciiLineReader::getLines ( const Buffer buf,
std::string *  last_unterminated_line = 0 
) [static]

Splits text into a vector of lines.

Anything after the last linefeed goes into the optional `unterminated_last_line' argument -- NOT the vector.

Depending on your reading mode, you may have to append the first string from your next buffer to this string.

`last_unterminated_line' is unchanged if `buf' ends with a linefeed.

static void code::AsciiLineReader::read ( BOIStream s,
float &  val,
char  skip = ' ' 
) [static]

like atof() for BOStreams.

Skips leading skip/whitespace chars.

static void code::AsciiLineReader::read ( BOIStream s,
short &  val,
char  skip = ' ' 
) [static]

like atoi() for BOStreams.

Skips leading skip/whitespace chars.

static void code::AsciiLineReader::read ( BOIStream s,
int &  val,
char  skip = ' ' 
) [static]

like atoi() for BOStreams.

Skips leading skip/whitespace chars.

static void code::AsciiLineReader::read ( BOIStream s,
std::string &  str,
char  skip = ' ' 
) [static]

like scanf("%s") for BOStreams.

Skips leading skip/whitespace chars.

static void code::AsciiLineReader::write ( BOOStream s,
short  val 
) [static]

like printf("%hd") for BOStreams.

static void code::AsciiLineReader::write ( BOOStream s,
int  val 
) [static]

like printf("%d") for BOStreams.

static void code::AsciiLineReader::write ( BOOStream s,
float  val 
) [static]

like printf("%f") for BOStreams.

static void code::AsciiLineReader::write ( BOOStream s,
const std::string &  str 
) [static]

like printf("%s") for BOStreams.


Generated on Fri May 4 13:40:12 2012 for WDSS-IIw2 by  doxygen 1.4.7