Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
input.cpp File Reference
#include "cddefines.h"
#include "trace.h"
#include "optimize.h"
#include "parser.h"
#include "input.h"
Include dependency graph for input.cpp:

Functions

bool lgIsCommentSeq (const string &s, size_t p, bool lgReportVisible)
 
bool lgIsExpungedCommentSeq (const string &s)
 
bool lgInputComment (const string &chLine)
 
bool lgInputEOF (const string &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)
 
string MakeInputLine (long i)
 
void input_readvector (const string &chFile, vector< double > &vec)
 

Variables

t_input input
 

Function Documentation

◆ GetEscape()

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.

References DEBUG_ENTRY.

Referenced by GetString().

◆ 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)

References ASSERT, DEBUG_ENTRY, and GetEscape().

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

Here is the call graph for this function:

◆ input_readvector()

void input_readvector ( const string & chFile,
vector< double > & vec )

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)

References DEBUG_ENTRY, ES_NONE, DataParser::getline(), and DataParser::getTokenOptional().

Referenced by ParseGrid(), and ParseMonitorResults().

Here is the call graph for this function:

◆ lgInputComment()

bool lgInputComment ( const string & 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

References DEBUG_ENTRY, and lgIsCommentSeq().

Referenced by Parser::isComment().

Here is the call graph for this function:

◆ lgInputEOF()

bool lgInputEOF ( const string & chLine)

lgInputEOF - is this line an EOF marker?

References DEBUG_ENTRY.

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

◆ lgIsCommentSeq()

bool lgIsCommentSeq ( const string & s,
size_t p,
bool lgReportVisible )

lgIsCommentSeq - is the string s[p] pointing to a comment sequence? if lgReportVisible is true, visible comments will be reported, otherwise not

References DEBUG_ENTRY.

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

◆ lgIsExpungedCommentSeq()

bool lgIsExpungedCommentSeq ( const string & s)

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

References DEBUG_ENTRY.

Referenced by Parser::CommandError().

◆ MakeInputLine()

string MakeInputLine ( long i)

MakeInputLine: generate input lines for optimizer and grid commands i : index of varied command, should be less than optimize.nvary

References ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, and optimize.

Referenced by grid_do(), optimize_do(), optimize_func(), and vary_input().

Here is the call graph for this function:

◆ StripComment()

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

References DEBUG_ENTRY, GetString(), input, and lgIsCommentSeq().

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

Here is the call graph for this function:

Variable Documentation

◆ input