Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DataParser Class Reference

#include <parser.h>

Public Member Functions

 DataParser ()
 
 DataParser (const string &name, eod_style es, access_scheme as=AS_DEFAULT)
 
void open (const string &name, eod_style es, access_scheme as=AS_DEFAULT)
 
void close ()
 
bool isOpen () const
 
void checkMagic (long i0)
 
void checkMagic (long i0, long i1)
 
void checkMagic (long i0, long i1, long i2)
 
void checkMagic (long i0, long i1, long i2, long i3)
 
bool getline ()
 
void setline (const string &line)
 
template<typename T >
bool getTokenOptional (T &var)
 
template<typename T >
size_t getTokenOptional (T var[], size_t n)
 
template<typename T >
void getToken (T &var)
 
template<typename T >
void getToken (T var[], size_t n)
 
bool getQuoteOptional (string &str)
 
void getQuote (string &str)
 
bool getKeywordOptional (string &str)
 
void getKeyword (string &str)
 
void getLineID (LineID &line)
 
void skipTo (size_t p)
 
void skipAfter (const string &s)
 
bool lgEOL ()
 
void checkEOL ()
 
bool lgEOF () const
 
bool lgEODMarker () const
 
void checkEOD ()
 
long getpos ()
 
void setpos (long pos)
 
void rewind ()
 
NORETURN void errorAbort (const string &msg, FILE *io=ioQQQ)
 
void warning (const string &msg, FILE *io=ioQQQ)
 

Private Member Functions

void p_open (const string &name, eod_style es, access_scheme as)
 have we passed beyond the EOF? More...
 
void p_close ()
 
void p_newlineProcess ()
 
bool p_isComment () const
 
bool p_blankLine () const
 
size_t p_pos ()
 
void p_pos (size_t p)
 
void p_skipWS ()
 
bool p_isSeparator (char c)
 
void p_replaceSep ()
 
void p_showLocation (size_t p, FILE *io)
 
void p_getQuoteOptional (string &str)
 

Private Attributes

string p_filename
 
fstream p_io
 the name of the data file More...
 
eod_style p_es
 stream for reading data file More...
 
string p_line
 what are the allowed EOD markers? More...
 
size_t p_nr
 the current line being read More...
 
istringstream p_ls
 number of the line we are parsing More...
 
bool p_lgEOF
 stream for reading current line More...
 

Constructor & Destructor Documentation

DataParser::DataParser ( )
inline
DataParser::DataParser ( const string &  name,
eod_style  es,
access_scheme  as = AS_DEFAULT 
)
inline

References p_open().

Here is the call graph for this function:

Member Function Documentation

void DataParser::checkEOD ( )
inline

References errorAbort(), getline(), and lgEODMarker().

Referenced by GetStandardHeLines(), HelikeTransProbSetup(), iso_init_energies(), and MakeHCTData().

Here is the call graph for this function:

void DataParser::checkMagic ( long  i0,
long  i1 
)

References DEBUG_ENTRY, errorAbort(), and getToken().

Here is the call graph for this function:

void DataParser::checkMagic ( long  i0,
long  i1,
long  i2 
)

References DEBUG_ENTRY, errorAbort(), and getToken().

Here is the call graph for this function:

void DataParser::checkMagic ( long  i0,
long  i1,
long  i2,
long  i3 
)

References DEBUG_ENTRY, errorAbort(), and getToken().

Here is the call graph for this function:

void DataParser::close ( )
inline

References p_close().

Here is the call graph for this function:

void DataParser::getKeyword ( string &  str)
inline

References errorAbort(), and getKeywordOptional().

Referenced by ParseTable().

Here is the call graph for this function:

bool DataParser::getKeywordOptional ( string &  str)
inline

References caps(), and getTokenOptional().

Referenced by getKeyword(), getLineID(), and ParseTable().

Here is the call graph for this function:

long DataParser::getpos ( )
inline

References p_io.

Referenced by t_hydro_tbl::p_initn(), and t_hydro_tbl::p_initnl().

void DataParser::getQuote ( string &  str)
inline

References errorAbort(), and getQuoteOptional().

Referenced by getLineID().

Here is the call graph for this function:

bool DataParser::getQuoteOptional ( string &  str)
inline

References errorAbort(), p_getQuoteOptional(), and p_ls.

Referenced by atmdat_STOUT_readin(), and getQuote().

Here is the call graph for this function:

template<typename T >
void DataParser::getToken ( var[],
size_t  n 
)
inline

References getToken().

Here is the call graph for this function:

template<typename T >
bool DataParser::getTokenOptional ( T &  var)
inline
template<typename T >
size_t DataParser::getTokenOptional ( var[],
size_t  n 
)
inline

References getTokenOptional().

Here is the call graph for this function:

bool DataParser::isOpen ( ) const
inline

References p_io.

Referenced by cdGetLineList().

bool DataParser::lgEODMarker ( ) const

References DEBUG_ENTRY, ES_NONE, ES_STARS_AND_BLANKS, ES_STARS_ONLY, p_blankLine(), p_es, p_line, and TotalInsanity().

Referenced by atmdat_STOUT_readin(), cdGetLineList(), checkEOD(), and ParseTable().

Here is the call graph for this function:

bool DataParser::lgEOF ( ) const
inline

References p_lgEOF.

bool DataParser::lgEOL ( void  )
inline

References p_ls, and p_skipWS().

Referenced by checkEOL(), and iso_init_energies().

Here is the call graph for this function:

void DataParser::open ( const string &  name,
eod_style  es,
access_scheme  as = AS_DEFAULT 
)
inline

References p_close(), and p_open().

Referenced by atmdat_STOUT_readin(), database_readin(), iso_init_energies(), and MakeHCTData().

Here is the call graph for this function:

bool DataParser::p_blankLine ( ) const
inlineprivate

References p_line.

Referenced by lgEODMarker(), and p_isComment().

void DataParser::p_close ( )
private

References DEBUG_ENTRY, ES_INVALID, p_es, p_filename, p_io, p_lgEOF, p_line, p_ls, and p_nr.

Referenced by close(), and open().

void DataParser::p_getQuoteOptional ( string &  str)
private

References DEBUG_ENTRY, p_ls, and p_skipWS().

Referenced by getQuoteOptional().

Here is the call graph for this function:

bool DataParser::p_isComment ( ) const
inlineprivate

References ES_NONE, ES_STARS_AND_BLANKS, ES_STARS_ONLY, p_blankLine(), p_es, p_line, and TotalInsanity().

Referenced by getline().

Here is the call graph for this function:

bool DataParser::p_isSeparator ( char  c)
inlineprivate

Referenced by p_replaceSep().

void DataParser::p_newlineProcess ( )
private

References DEBUG_ENTRY, p_line, and p_ls.

Referenced by getline(), and setline().

void DataParser::p_open ( const string &  name,
eod_style  es,
access_scheme  as 
)
private

have we passed beyond the EOF?

References DEBUG_ENTRY, mode_r, open_data(), p_es, p_filename, p_io, p_lgEOF, and p_nr.

Referenced by DataParser(), and open().

Here is the call graph for this function:

size_t DataParser::p_pos ( )
inlineprivate

References p_line, and p_ls.

Referenced by errorAbort(), getLineID(), skipAfter(), skipTo(), and warning().

void DataParser::p_pos ( size_t  p)
inlineprivate

References p_line, and p_ls.

void DataParser::p_replaceSep ( )
inlineprivate

References p_isSeparator(), p_line, and p_ls.

Referenced by getLineID().

Here is the call graph for this function:

void DataParser::p_showLocation ( size_t  p,
FILE *  io 
)
private

References DEBUG_ENTRY, fprintf(), and p_line.

Referenced by errorAbort(), and warning().

Here is the call graph for this function:

void DataParser::p_skipWS ( )
inlineprivate

References p_ls.

Referenced by lgEOL(), and p_getQuoteOptional().

void DataParser::rewind ( )
inline

References p_io, p_lgEOF, p_line, p_ls, and p_nr.

void DataParser::setline ( const string &  line)
inline

References p_line, and p_newlineProcess().

Here is the call graph for this function:

void DataParser::setpos ( long  pos)
inline

References p_io.

Referenced by t_hydro_tbl::p_initn(), and t_hydro_tbl::p_initnl().

void DataParser::skipAfter ( const string &  s)
inline

References errorAbort(), p_line, p_pos(), and skipTo().

Here is the call graph for this function:

void DataParser::skipTo ( size_t  p)
inline

References errorAbort(), and p_pos().

Referenced by skipAfter().

Here is the call graph for this function:

void DataParser::warning ( const string &  msg,
FILE *  io = ioQQQ 
)

References DEBUG_ENTRY, fprintf(), ioQQQ, p_filename, p_ls, p_nr, p_pos(), and p_showLocation().

Referenced by getLineID(), and ParseTable().

Here is the call graph for this function:

Member Data Documentation

eod_style DataParser::p_es
private

stream for reading data file

Referenced by lgEODMarker(), p_close(), p_isComment(), and p_open().

string DataParser::p_filename
private

Referenced by errorAbort(), p_close(), p_open(), and warning().

fstream DataParser::p_io
private

the name of the data file

Referenced by getline(), getpos(), isOpen(), p_close(), p_open(), rewind(), and setpos().

bool DataParser::p_lgEOF
private

stream for reading current line

Referenced by getline(), lgEOF(), p_close(), p_open(), and rewind().

string DataParser::p_line
private
istringstream DataParser::p_ls
private
size_t DataParser::p_nr
private

the current line being read

Referenced by errorAbort(), getline(), p_close(), p_open(), rewind(), and warning().


The documentation for this class was generated from the following files: