GeoTessCPP
2.2.3
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 () |
void | resetPos () |
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 82 of file IFStreamAscii.h.
|
inline |
Default constructor.
Definition at line 174 of file IFStreamAscii.h.
|
inlinevirtual |
Destructor.
Definition at line 186 of file IFStreamAscii.h.
|
inline |
Close the input stream if it is open.
Definition at line 202 of file IFStreamAscii.h.
|
inline |
Close the input stream if it is open.
Definition at line 213 of file IFStreamAscii.h.
|
inline |
Return the begin block comment delimiter string.
Definition at line 354 of file IFStreamAscii.h.
|
inline |
Return the current number of blank lines read from the input stream.
Definition at line 394 of file IFStreamAscii.h.
|
inline |
Return the current number of block comment lines read from the input stream.
Definition at line 410 of file IFStreamAscii.h.
|
inline |
Return the current number of bytes read from the input stream.
Definition at line 418 of file IFStreamAscii.h.
|
inline |
Return the comment delimiter string.
Definition at line 327 of file IFStreamAscii.h.
|
inline |
Return the current number of comment lines read from the input stream.
Definition at line 402 of file IFStreamAscii.h.
|
inline |
Return the current number of data lines read from the input stream.
Definition at line 386 of file IFStreamAscii.h.
|
inline |
Return the end block comment delimiter string.
Definition at line 370 of file IFStreamAscii.h.
|
inline |
Return the opened file name.
Definition at line 255 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 169 of file IFStreamAscii.h.
|
inline |
Return the string delimiter string.
Definition at line 311 of file IFStreamAscii.h.
|
inline |
Return the current number of total lines read from the input stream.
Definition at line 378 of file IFStreamAscii.h.
|
inline |
Return the whitespace delimiter string.
Definition at line 295 of file IFStreamAscii.h.
|
inline |
Returns true if EOF is reached.
Definition at line 609 of file IFStreamAscii.h.
|
inline |
Returns true if the stream is open.
Definition at line 197 of file IFStreamAscii.h.
|
inline |
Skips to the next token.
Read the next string. Return true if SUCCESSFUL
Definition at line 635 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 577 of file IFStreamAscii.h.
|
inline |
Read and return the next byte.
Definition at line 644 of file IFStreamAscii.h.
|
inline |
Read the next byte. Return true if SUCCESSFUL
Definition at line 654 of file IFStreamAscii.h.
|
inline |
Read and return the next double.
Definition at line 829 of file IFStreamAscii.h.
|
inline |
Read the next double. Return true if SUCCESSFUL
Definition at line 839 of file IFStreamAscii.h.
|
inline |
Read and return the next float.
Definition at line 792 of file IFStreamAscii.h.
|
inline |
Read the next float. Return true if SUCCESSFUL
Definition at line 802 of file IFStreamAscii.h.
|
inline |
Read and return the next int.
Definition at line 718 of file IFStreamAscii.h.
|
inline |
Read the next int. Return true if SUCCESSFUL
Definition at line 728 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 755 of file IFStreamAscii.h.
|
inline |
Read the next long. Return true if SUCCESSFUL
Definition at line 765 of file IFStreamAscii.h.
|
inline |
Read and return the next short.
Definition at line 681 of file IFStreamAscii.h.
|
inline |
Read the next short. Return true if SUCCESSFUL
Definition at line 691 of file IFStreamAscii.h.
|
inline |
Read the next string. Return true if SUCCESSFUL
Definition at line 617 of file IFStreamAscii.h.
|
inline |
Read the next string. Return true if SUCCESSFUL
Definition at line 627 of file IFStreamAscii.h.
|
inline |
Read the next byte. Return true if SUCCESSFUL
Definition at line 451 of file IFStreamAscii.h.
|
inline |
Read the next double. Return true if SUCCESSFUL
Definition at line 526 of file IFStreamAscii.h.
|
inline |
Read the next float. Return true if SUCCESSFUL
Definition at line 511 of file IFStreamAscii.h.
|
inline |
Read the next int. Return true if SUCCESSFUL
Definition at line 481 of file IFStreamAscii.h.
|
inline |
Read the next long. Return true if SUCCESSFUL
Definition at line 496 of file IFStreamAscii.h.
|
inline |
Read the next short. Return true if SUCCESSFUL
Definition at line 466 of file IFStreamAscii.h.
|
inline |
Resets the read stream position to the beginning of the file. The reset only occurs if the stream is currently open. Otherwise, no action occurs. The ascii stream can only be set to the beginning for read access by closing the file and reopening again for read access.
Definition at line 225 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 346 of file IFStreamAscii.h.
|
inline |
Sets the begin and end block comment strings for this IFStreamAscii object.
Definition at line 336 of file IFStreamAscii.h.
|
inline |
Set the comment delimiter string.
Definition at line 319 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 271 of file IFStreamAscii.h.
|
inline |
Set the end block comment delimiter string.
Definition at line 362 of file IFStreamAscii.h.
|
inline |
Set the string delimiter string.
Definition at line 303 of file IFStreamAscii.h.
|
inline |
Set the whitespace delimiter string.
Definition at line 287 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 539 of file IFStreamAscii.h.
|
inline |
Definition at line 540 of file IFStreamAscii.h.
|
inline |
Definition at line 543 of file IFStreamAscii.h.
|
inline |
Definition at line 544 of file IFStreamAscii.h.
|
inline |
Definition at line 563 of file IFStreamAscii.h.
|
inline |
Definition at line 564 of file IFStreamAscii.h.
|
inline |
Definition at line 559 of file IFStreamAscii.h.
|
inline |
Definition at line 560 of file IFStreamAscii.h.
|
inline |
Definition at line 551 of file IFStreamAscii.h.
|
inline |
Definition at line 552 of file IFStreamAscii.h.
|
inline |
Definition at line 555 of file IFStreamAscii.h.
|
inline |
Definition at line 556 of file IFStreamAscii.h.
|
inline |
Definition at line 567 of file IFStreamAscii.h.
|
inline |
Definition at line 547 of file IFStreamAscii.h.
|
inline |
Definition at line 548 of file IFStreamAscii.h.
|
inline |
Definition at line 535 of file IFStreamAscii.h.
|
inline |
Definition at line 536 of file IFStreamAscii.h.
|
inline |
Definition at line 541 of file IFStreamAscii.h.
|
inline |
Definition at line 545 of file IFStreamAscii.h.
|
inline |
Definition at line 537 of file IFStreamAscii.h.
|
inline |
Definition at line 565 of file IFStreamAscii.h.
|
inline |
Definition at line 561 of file IFStreamAscii.h.
|
inline |
Definition at line 553 of file IFStreamAscii.h.
|
inline |
Definition at line 557 of file IFStreamAscii.h.
|
inline |
Definition at line 549 of file IFStreamAscii.h.
|
inline |
Definition at line 542 of file IFStreamAscii.h.
|
inline |
Definition at line 546 of file IFStreamAscii.h.
|
inline |
Definition at line 538 of file IFStreamAscii.h.
|
inline |
Definition at line 566 of file IFStreamAscii.h.
|
inline |
Definition at line 562 of file IFStreamAscii.h.
|
inline |
Definition at line 554 of file IFStreamAscii.h.
|
inline |
Definition at line 558 of file IFStreamAscii.h.
|
inline |
Definition at line 550 of file IFStreamAscii.h.