GeoTessCPP
2.1
Software to facilitate storage and retrieval of 3D information about the Earth.
|
#include <IFStreamAscii.h>
Public Member Functions | |
IFStreamAscii () | |
virtual | ~IFStreamAscii () |
void | close () |
void | flush () |
const string & | getBeginBlockCommentDelimiter () const |
int | getBlankLinesRead () const |
int | getBlockCommentLinesRead () const |
int | getBytesRead () const |
const string & | getCommentDelimiter () const |
int | getCommentLinesRead () const |
int | getDataLinesRead () const |
const string & | getEndBlockCommentDelimiter () const |
const string & | getFileName () const |
void | getLine (string &buf) |
void | getline (string &s) |
const string & | getStringDelimiter () const |
int | getTotalLinesRead () const |
const string & | getWhitespaceDelimiters () const |
bool | isEOF () const |
bool | isOpen () |
bool | next () |
void | openForRead (const string &fn) |
void | openForWrite (const string &fn) |
bool | read (string &token) |
byte | readByte () |
bool | readByte (byte &b) |
double | readDouble () |
bool | readDouble (double &d) |
float | readFloat () |
bool | readFloat (float &f) |
int | readInteger () |
bool | readInteger (int &i) |
bool | readLine (string &ln) |
LONG_INT | readLong () |
bool | readLong (LONG_INT &l) |
short | readShort () |
bool | readShort (short &s) |
string | readString () |
bool | readString (string &s) |
bool | readType (byte &b) |
bool | readType (short &s) |
bool | readType (int &i) |
bool | readType (LONG_INT &l) |
bool | readType (float &f) |
bool | readType (double &d) |
void | resetReader () |
void | setBeginBlockCommentDelimiter (const string &begBlkCmntDelim) |
void | setBlockCommentDelimiters (const string &begBlk, const string &endBlk) |
void | setCommentDelimiter (const string &cmntDelim) |
void | setDefaultDelimiters () |
void | setDelimiters (const string &wspcDelims, const string &strgDelim, const string &cmntDelim, const string &begBlk, const string &endBlk) |
void | setEndBlockCommentDelimiter (const string &endBlkCmntDelim) |
void | setStringDelimiter (const string &strgDelim) |
void | setWhitespaceDelimiters (const string &wsDelims) |
void | tokenize (const string &str, vector< string > &tokens) |
void | writeBool (bool b) |
void | writeBoolNL (bool b) |
void | writeByte (byte b) |
void | writeByteNL (byte b) |
void | writeDouble (double d) |
void | writeDoubleNL (double d) |
void | writeFloat (float f) |
void | writeFloatNL (float f) |
void | writeInt (int i) |
void | writeIntNL (int i) |
void | writeLong (LONG_INT l) |
void | writeLongNL (LONG_INT l) |
void | writeNL () |
void | writeShort (short s) |
void | writeShortNL (short s) |
void | writeString (const string &s) |
void | writeStringNL (const string &s) |
void | writeType (const string &s) |
void | writeType (bool b) |
void | writeType (byte b) |
void | writeType (short s) |
void | writeType (int i) |
void | writeType (LONG_INT l) |
void | writeType (float f) |
void | writeType (double d) |
void | writeTypeNL (const string &s) |
void | writeTypeNL (bool b) |
void | writeTypeNL (byte b) |
void | writeTypeNL (short s) |
void | writeTypeNL (int i) |
void | writeTypeNL (LONG_INT l) |
void | writeTypeNL (float f) |
void | writeTypeNL (double d) |
Opens ascii file for read and write access. The read portion is configured to parse generically formatted ascii files from an input stream.
Functionality is provided to read elemental, strings, booleans, bytes, shorts, ints, longs, floats, or doubles, as-well-as array input forms of each (except strings). Alternatively, indivdual lines can be read and parsed by the caller if desired. To perform elemental reads a tokenized scanner is provided that must be configured by the user with a White-Space (WS) definition. The WS delimiters default to a space, tab, and a comma. A single comment line delimiter and block comment start and end delimiters can also be set by the caller. These default to "//", "slash-*", and '*-slash" respectively.
|
inline |
Default constructor.
|
inlinevirtual |
Destructor.
|
inline |
Close the input stream if it is open.
|
inline |
Close the input stream if it is open.
|
inline |
Return the begin block comment delimiter string.
|
inline |
Return the current number of blank lines read from the input stream.
|
inline |
Return the current number of block comment lines read from the input stream.
|
inline |
Return the current number of bytes read from the input stream.
|
inline |
Return the comment delimiter string.
|
inline |
Return the current number of comment lines read from the input stream.
|
inline |
Return the current number of data lines read from the input stream.
|
inline |
Return the end block comment delimiter string.
|
inline |
Return the opened file name.
void geotess::IFStreamAscii::getLine | ( | string & | buf | ) |
Returns the next line in the input stream in the string buf.
|
inline |
Read a single line from the underlying istream. Added by sballar 2013-03-22.
|
inline |
Return the string delimiter string.
|
inline |
Return the current number of total lines read from the input stream.
|
inline |
Return the whitespace delimiter string.
|
inline |
Returns true if EOF is reached.
|
inline |
Returns true if the stream is open.
|
inline |
Skips to the next token.
Read the next string. Return true if SUCCESSFUL
void geotess::IFStreamAscii::openForRead | ( | const string & | fn | ) |
Open stream for read or write access.
void geotess::IFStreamAscii::openForWrite | ( | const string & | fn | ) |
|
inline |
Reads the next token (string) from the input file stream. If eof() occurs false is returned. Otherwise true is returned.
Reads and returns a single token from the stream.
The new token is contained in the input string reference token. The function returns true if successful. If eof() is reached false is returned.
|
inline |
Read and return the next byte.
|
inline |
Read the next byte. Return true if SUCCESSFUL
|
inline |
Read and return the next double.
|
inline |
Read the next double. Return true if SUCCESSFUL
|
inline |
Read and return the next float.
|
inline |
Read the next float. Return true if SUCCESSFUL
|
inline |
Read and return the next int.
|
inline |
Read the next int. Return true if SUCCESSFUL
bool geotess::IFStreamAscii::readLine | ( | string & | ln | ) |
Read a new line into ln from the stream. If eof() then return false. Otherwise return true.
|
inline |
Read and return the next long.
|
inline |
Read the next long. Return true if SUCCESSFUL
|
inline |
Read and return the next short.
|
inline |
Read the next short. Return true if SUCCESSFUL
|
inline |
Read the next string. Return true if SUCCESSFUL
|
inline |
Read the next string. Return true if SUCCESSFUL
|
inline |
Read the next byte. Return true if SUCCESSFUL
|
inline |
Read the next short. Return true if SUCCESSFUL
|
inline |
Read the next int. Return true if SUCCESSFUL
|
inline |
Read the next long. Return true if SUCCESSFUL
|
inline |
Read the next float. Return true if SUCCESSFUL
|
inline |
Read the next double. Return true if SUCCESSFUL
void geotess::IFStreamAscii::resetReader | ( | ) |
Resets all parameters back to their initial state (excluding delimiters).
|
inline |
Set the begin block comment delimiter string.
|
inline |
Sets the begin and end block comment strings for this IFStreamAscii object.
|
inline |
Set the comment delimiter string.
void geotess::IFStreamAscii::setDefaultDelimiters | ( | ) |
Sets the default delimiter settings.
|
inline |
Sets the whitespace, string, comment, and block comment delimiters for this IFStreamAscii object.
|
inline |
Set the end block comment delimiter string.
|
inline |
Set the string delimiter string.
|
inline |
Set the whitespace delimiter string.
void geotess::IFStreamAscii::tokenize | ( | const string & | str, |
vector< string > & | tokens | ||
) |
Tokenize the input string (str) and place the tokens into the input array list.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |