GeoTessCPP
2.6.1
Software to facilitate storage and retrieval of 3D information about the Earth.
|
Opens ascii file for read and write access. More...
#include <IFStreamAscii.h>
Public Member Functions | |
void | getLine (string &buf) |
void | getline (string &s) |
IFStreamAscii () | |
virtual | ~IFStreamAscii () |
void | openForRead (const string &fn) |
void | openForWrite (const string &fn) |
bool | isOpen () |
void | close () |
void | flush () |
bool | read (string &token) |
bool | readLine (string &ln) |
void | tokenize (const string &str, vector< string > &tokens) |
const string & | getFileName () const |
void | setDefaultDelimiters () |
void | resetReader () |
void | setDelimiters (const string &wspcDelims, const string &strgDelim, const string &cmntDelim, const string &begBlk, const string &endBlk) |
void | setWhitespaceDelimiters (const string &wsDelims) |
const string & | getWhitespaceDelimiters () const |
void | setStringDelimiter (const string &strgDelim) |
const string & | getStringDelimiter () const |
void | setCommentDelimiter (const string &cmntDelim) |
const string & | getCommentDelimiter () const |
void | setBlockCommentDelimiters (const string &begBlk, const string &endBlk) |
void | setBeginBlockCommentDelimiter (const string &begBlkCmntDelim) |
const string & | getBeginBlockCommentDelimiter () const |
void | setEndBlockCommentDelimiter (const string &endBlkCmntDelim) |
const string & | getEndBlockCommentDelimiter () const |
int | getTotalLinesRead () const |
int | getDataLinesRead () const |
int | getBlankLinesRead () const |
int | getCommentLinesRead () const |
int | getBlockCommentLinesRead () const |
int | getBytesRead () const |
bool | isEOF () const |
bool | next () |
string | readString () |
bool | readString (string &s) |
byte | readByte () |
bool | readType (byte &b) |
bool | readByte (byte &b) |
short | readShort () |
bool | readType (short &s) |
bool | readShort (short &s) |
int | readInteger () |
bool | readType (int &i) |
bool | readInteger (int &i) |
LONG_INT | readLong () |
bool | readType (LONG_INT &l) |
bool | readLong (LONG_INT &l) |
float | readFloat () |
bool | readType (float &f) |
bool | readFloat (float &f) |
double | readDouble () |
bool | readType (double &d) |
bool | readDouble (double &d) |
void | writeString (const string &s) |
void | writeStringNL (const string &s) |
void | writeType (const string &s) |
void | writeTypeNL (const string &s) |
void | writeBool (bool b) |
void | writeBoolNL (bool b) |
void | writeType (bool b) |
void | writeTypeNL (bool b) |
void | writeByte (byte b) |
void | writeByteNL (byte b) |
void | writeType (byte b) |
void | writeTypeNL (byte b) |
void | writeShort (short s) |
void | writeShortNL (short s) |
void | writeType (short s) |
void | writeTypeNL (short s) |
void | writeInt (int i) |
void | writeIntNL (int i) |
void | writeType (int i) |
void | writeTypeNL (int i) |
void | writeLong (LONG_INT l) |
void | writeLongNL (LONG_INT l) |
void | writeType (LONG_INT l) |
void | writeTypeNL (LONG_INT l) |
void | writeFloat (float f) |
void | writeFloatNL (float f) |
void | writeType (float f) |
void | writeTypeNL (float f) |
void | writeDouble (double d) |
void | writeDoubleNL (double d) |
void | writeType (double d) |
void | writeTypeNL (double d) |
void | writeNL () |
Opens ascii file for read and write access.
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.
Definition at line 80 of file IFStreamAscii.h.
|
inline |
Default constructor.
Definition at line 172 of file IFStreamAscii.h.
|
inlinevirtual |
Destructor.
Definition at line 182 of file IFStreamAscii.h.
|
inline |
Close the input stream if it is open.
Definition at line 198 of file IFStreamAscii.h.
|
inline |
Close the input stream if it is open.
Definition at line 209 of file IFStreamAscii.h.
|
inline |
Return the begin block comment delimiter string.
Definition at line 321 of file IFStreamAscii.h.
|
inline |
Return the current number of blank lines read from the input stream.
Definition at line 351 of file IFStreamAscii.h.
|
inline |
Return the current number of block comment lines read from the input stream.
Definition at line 363 of file IFStreamAscii.h.
|
inline |
Return the current number of bytes read from the input stream.
Definition at line 369 of file IFStreamAscii.h.
|
inline |
Return the comment delimiter string.
Definition at line 298 of file IFStreamAscii.h.
|
inline |
Return the current number of comment lines read from the input stream.
Definition at line 357 of file IFStreamAscii.h.
|
inline |
Return the current number of data lines read from the input stream.
Definition at line 345 of file IFStreamAscii.h.
|
inline |
Return the end block comment delimiter string.
Definition at line 333 of file IFStreamAscii.h.
|
inline |
Return the opened file name.
Definition at line 236 of file IFStreamAscii.h.
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.
Definition at line 167 of file IFStreamAscii.h.
|
inline |
Return the string delimiter string.
Definition at line 286 of file IFStreamAscii.h.
|
inline |
Return the current number of total lines read from the input stream.
Definition at line 339 of file IFStreamAscii.h.
|
inline |
Return the whitespace delimiter string.
Definition at line 274 of file IFStreamAscii.h.
|
inline |
Returns true if EOF is reached.
Definition at line 558 of file IFStreamAscii.h.
|
inline |
Returns true if the stream is open.
Definition at line 193 of file IFStreamAscii.h.
|
inline |
Skips to the next token.
Read the next string. Return true if SUCCESSFUL
Definition at line 584 of file IFStreamAscii.h.
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.
Definition at line 526 of file IFStreamAscii.h.
|
inline |
Read and return the next byte.
Definition at line 593 of file IFStreamAscii.h.
|
inline |
Read the next byte. Return true if SUCCESSFUL
Definition at line 603 of file IFStreamAscii.h.
|
inline |
Read and return the next double.
Definition at line 778 of file IFStreamAscii.h.
|
inline |
Read the next double. Return true if SUCCESSFUL
Definition at line 788 of file IFStreamAscii.h.
|
inline |
Read and return the next float.
Definition at line 741 of file IFStreamAscii.h.
|
inline |
Read the next float. Return true if SUCCESSFUL
Definition at line 751 of file IFStreamAscii.h.
|
inline |
Read and return the next int.
Definition at line 667 of file IFStreamAscii.h.
|
inline |
Read the next int. Return true if SUCCESSFUL
Definition at line 677 of file IFStreamAscii.h.
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.
Definition at line 704 of file IFStreamAscii.h.
|
inline |
Read the next long. Return true if SUCCESSFUL
Definition at line 714 of file IFStreamAscii.h.
|
inline |
Read and return the next short.
Definition at line 630 of file IFStreamAscii.h.
|
inline |
Read the next short. Return true if SUCCESSFUL
Definition at line 640 of file IFStreamAscii.h.
|
inline |
Read the next string. Return true if SUCCESSFUL
Definition at line 566 of file IFStreamAscii.h.
|
inline |
Read the next string. Return true if SUCCESSFUL
Definition at line 576 of file IFStreamAscii.h.
|
inline |
Read the next byte. Return true if SUCCESSFUL
Definition at line 400 of file IFStreamAscii.h.
|
inline |
Read the next double. Return true if SUCCESSFUL
Definition at line 475 of file IFStreamAscii.h.
|
inline |
Read the next float. Return true if SUCCESSFUL
Definition at line 460 of file IFStreamAscii.h.
|
inline |
Read the next int. Return true if SUCCESSFUL
Definition at line 430 of file IFStreamAscii.h.
|
inline |
Read the next long. Return true if SUCCESSFUL
Definition at line 445 of file IFStreamAscii.h.
|
inline |
Read the next short. Return true if SUCCESSFUL
Definition at line 415 of file IFStreamAscii.h.
void geotess::IFStreamAscii::resetReader | ( | ) |
Resets all parameters back to their initial state (excluding delimiters).
|
inline |
Set the begin block comment delimiter string.
Definition at line 315 of file IFStreamAscii.h.
|
inline |
Sets the begin and end block comment strings for this IFStreamAscii object.
Definition at line 305 of file IFStreamAscii.h.
|
inline |
Set the comment delimiter string.
Definition at line 292 of file IFStreamAscii.h.
void geotess::IFStreamAscii::setDefaultDelimiters | ( | ) |
Sets the default delimiter settings.
|
inline |
Sets the whitespace, string, comment, and block comment delimiters for this IFStreamAscii object.
Definition at line 252 of file IFStreamAscii.h.
|
inline |
Set the end block comment delimiter string.
Definition at line 327 of file IFStreamAscii.h.
|
inline |
Set the string delimiter string.
Definition at line 280 of file IFStreamAscii.h.
|
inline |
Set the whitespace delimiter string.
Definition at line 268 of file IFStreamAscii.h.
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 |
Definition at line 488 of file IFStreamAscii.h.
|
inline |
Definition at line 489 of file IFStreamAscii.h.
|
inline |
Definition at line 492 of file IFStreamAscii.h.
|
inline |
Definition at line 493 of file IFStreamAscii.h.
|
inline |
Definition at line 512 of file IFStreamAscii.h.
|
inline |
Definition at line 513 of file IFStreamAscii.h.
|
inline |
Definition at line 508 of file IFStreamAscii.h.
|
inline |
Definition at line 509 of file IFStreamAscii.h.
|
inline |
Definition at line 500 of file IFStreamAscii.h.
|
inline |
Definition at line 501 of file IFStreamAscii.h.
|
inline |
Definition at line 504 of file IFStreamAscii.h.
|
inline |
Definition at line 505 of file IFStreamAscii.h.
|
inline |
Definition at line 516 of file IFStreamAscii.h.
|
inline |
Definition at line 496 of file IFStreamAscii.h.
|
inline |
Definition at line 497 of file IFStreamAscii.h.
|
inline |
Definition at line 484 of file IFStreamAscii.h.
|
inline |
Definition at line 485 of file IFStreamAscii.h.
|
inline |
Definition at line 490 of file IFStreamAscii.h.
|
inline |
Definition at line 494 of file IFStreamAscii.h.
|
inline |
Definition at line 486 of file IFStreamAscii.h.
|
inline |
Definition at line 514 of file IFStreamAscii.h.
|
inline |
Definition at line 510 of file IFStreamAscii.h.
|
inline |
Definition at line 502 of file IFStreamAscii.h.
|
inline |
Definition at line 506 of file IFStreamAscii.h.
|
inline |
Definition at line 498 of file IFStreamAscii.h.
|
inline |
Definition at line 491 of file IFStreamAscii.h.
|
inline |
Definition at line 495 of file IFStreamAscii.h.
|
inline |
Definition at line 487 of file IFStreamAscii.h.
|
inline |
Definition at line 515 of file IFStreamAscii.h.
|
inline |
Definition at line 511 of file IFStreamAscii.h.
|
inline |
Definition at line 503 of file IFStreamAscii.h.
|
inline |
Definition at line 507 of file IFStreamAscii.h.
|
inline |
Definition at line 499 of file IFStreamAscii.h.