cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
input.cpp File Reference
#include "cddefines.h"
#include "trace.h"
#include "input.h"
Include dependency graph for input.cpp:

Go to the source code of this file.

Functions

bool lgIsCommentSeq (const char *s, bool lgColumn0, bool lgReportVisible)
 
bool lgIsExpungedCommentSeq (const char *s)
 
bool lgInputComment (const char *chLine)
 
bool lgInputEOF (const char *chLine)
 
void StripComment (string &s, bool lgStripVisible)
 
size_t GetString (const string &s, size_t p, string &buf)
 
char GetEscape (const string &s, size_t &p)
 
void input_readvector (const char *chFile, vector< double > &vec, bool *lgError)
 
void input_readvector (const char *chFile, double vector[], long n, bool *lgEOF)
 

Variables

t_input input
 

Function Documentation

char GetEscape ( const string &  s,
size_t &  p 
)

GetEscape: This routine is the placeholder for treating character escape sequences. For the moment we treat none. On exit, *p will point one character beyond the escape sequence.

Definition at line 173 of file input.cpp.

References DEBUG_ENTRY.

Referenced by GetString().

size_t GetString ( const string &  s,
size_t  p,
string &  buf 
)

GetString: retrieve a string between double quotes s : string to be parsed s[p] : place in string where to start parsing, should point to first set of double quotes buf : buffer that will hold the string between double quotes return value : pointer just beyond second set of double quotes, or string::npos in case of failure (second set of double quotes wasn't found)

Definition at line 152 of file input.cpp.

References ASSERT, DEBUG_ENTRY, and GetEscape().

Referenced by Parser::GetQuote(), and StripComment().

Here is the call graph for this function:

void input_readvector ( const char *  chFile,
vector< double > &  vec,
bool *  lgError 
)

input_readvector: read numbers from the file chFile and store them in a vector

Parameters
chFilefile name to read from
vecvector - the numbers that were read from the input line(s)
lgErrordid an error occur reading the file?

Definition at line 246 of file input.cpp.

References AS_LOCAL_ONLY, DEBUG_ENTRY, mode_r, and open_data().

Referenced by ParseGrid(), and ParseMonitorResults().

Here is the call graph for this function:

void input_readvector ( const char *  chFile,
double  vector[],
long  n,
bool *  lgEOF 
)

input_readvector: read n numbers from the file chFile and store them in vector[]

Parameters
chFilefile name to read from
vectorvector[n] - the numbers that were read from the input line(s)
nnumber of elements in vector[] that we need to read
lgEOFwas EOF reached before enough numbers were read?

Definition at line 270 of file input.cpp.

References AS_LOCAL_ONLY, DEBUG_ENTRY, mode_r, and open_data().

Here is the call graph for this function:

bool lgInputComment ( const char *  chLine)

lgInputComment - parse comment - check if argument is comment string, either upper or lower case - returns true if line is a comment, false if not

Parameters
*chLinethe input line string

Definition at line 72 of file input.cpp.

References DEBUG_ENTRY, lgIsCommentSeq(), and TotalInsanity().

Referenced by Parser::isComment().

Here is the call graph for this function:

bool lgInputEOF ( const char *  chLine)

lgInputEOF - is this line an EOF marker?

Definition at line 84 of file input.cpp.

Referenced by cdMain(), Parser::last(), and ParseInit().

bool lgIsCommentSeq ( const char *  s,
bool  lgColumn0,
bool  lgReportVisible 
)

lgIsCommentSeq - is the string pointer s pointing to a comment sequence? lgColumn0 indicates whether we are in column 0 or not; the set of valid comment characters depends on this if lgReportVisible is true, visible comments will be reported, otherwise not

Definition at line 31 of file input.cpp.

References DEBUG_ENTRY, and t_input::lgDeprecatedComment.

Referenced by cdRead(), lgInputComment(), and StripComment().

bool lgIsExpungedCommentSeq ( const char *  s)

lgIsExpungedCommentSeq - does the string s start with an old-style comment?

Definition at line 59 of file input.cpp.

References DEBUG_ENTRY.

Referenced by Parser::CommandError().

void StripComment ( string &  s,
bool  lgStripVisible 
)

StripComment- strips comment part off the command line s if lgStripVisible is false, visible comments are retained hidden comments are always stripped this routine also removes EOL characters

Definition at line 98 of file input.cpp.

References DEBUG_ENTRY, GetString(), t_input::lgBracketFound, lgIsCommentSeq(), and t_input::lgUnderscoreFound.

Referenced by cdRead(), and Parser::setline().

Here is the call graph for this function:

Variable Documentation

t_input input