Changed all check of input_error to get_input_errors for phreeqc.

Started removing PHREEQC_PTR and P_INSTANCE. Redid all read_raw.

Breaks some echoing or printing of output. Need to check why.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@5646 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2011-09-23 22:33:19 +00:00
parent 0cf22bd932
commit b7729cf254
39 changed files with 182 additions and 199 deletions

View File

@ -480,7 +480,7 @@ ChartObject::OpenCSVFile(std::string file_name)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(P_INSTANCE_COMMA f_csv, oss_out, oss_err, this->Get_io());
CParser parser(f_csv, oss_out, oss_err, this->Get_io());
parser.set_echo_file(CParser::EO_NONE);
/* Get lines */

View File

@ -335,7 +335,7 @@ cxxExchComp::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxExchComp::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxExchComp::read_raw(CParser & parser, bool check)
{
std::string str;
@ -488,7 +488,7 @@ cxxExchComp::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
break;
case 8: // totals
if (this->totals.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->totals.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();
@ -501,7 +501,7 @@ cxxExchComp::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
break;
case 9: // formula_totals
if (this->formula_totals.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->formula_totals.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();

View File

@ -26,7 +26,7 @@ class cxxExchComp: public PHRQ_base
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check=true);
void read_raw(CParser & parser, bool check=true);
const std::string &get_formula() const
{

View File

@ -294,7 +294,7 @@ cxxExchange::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxExchange::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxExchange::read_raw(CParser & parser, bool check)
{
static std::vector < std::string > vopts;
if (vopts.empty())
@ -389,21 +389,21 @@ cxxExchange::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
#endif
parser.set_accumulate(true);
ec.read_raw(P_INSTANCE_COMMA parser, false);
ec.read_raw(parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
CParser reread(is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
if (this->exchComps.find(ec.get_formula()) != this->exchComps.end())
{
cxxExchComp & comp = this->exchComps.find(ec.get_formula())->second;
comp.read_raw(P_INSTANCE_COMMA reread, false);
comp.read_raw(reread, false);
}
else
{
cxxExchComp ec1(this->Get_io());
ec1.read_raw(P_INSTANCE_COMMA reread, false);
ec1.read_raw(reread, false);
std::string str(ec1.get_formula());
this->exchComps[str] = ec1;
}

View File

@ -28,7 +28,7 @@ public:
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check = true);
void read_raw(CParser & parser, bool check = true);
bool get_related_phases(void);

View File

@ -261,7 +261,7 @@ cxxGasPhase::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxGasPhase::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxGasPhase::read_raw(CParser & parser, bool check)
{
int i;
@ -363,7 +363,7 @@ cxxGasPhase::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
break;
case 3: // component
if (this->gasPhaseComps.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->gasPhaseComps.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();

View File

@ -35,7 +35,7 @@ class cxxGasPhase:public cxxNumKeyword
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check = true);
void read_raw(CParser & parser, bool check = true);
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);

View File

@ -208,7 +208,7 @@ cxxKineticsComp::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxKineticsComp::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxKineticsComp::read_raw(CParser & parser, bool check)
{
std::string str;
double d;
@ -324,7 +324,7 @@ cxxKineticsComp::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
case 5: // namecoef
if (this->namecoef.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->namecoef.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();

View File

@ -23,7 +23,7 @@ public:
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check = true);
void read_raw(CParser & parser, bool check = true);
const std::string &get_rate_name() const
{

View File

@ -357,12 +357,12 @@ cxxNameDouble::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
}
CParser::STATUS_TYPE cxxNameDouble::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser,
CParser::STATUS_TYPE cxxNameDouble::read_raw(CParser & parser,
std::istream::pos_type & pos)
{
std::string token;
char *
ctoken;
//char *
// ctoken;
double
d;
@ -379,8 +379,9 @@ CParser::STATUS_TYPE cxxNameDouble::read_raw(PHREEQC_PTR_ARG_COMMA CParser & par
{
return CParser::PARSER_ERROR;
}
ctoken = P_INSTANCE_POINTER string_hsave(token.c_str());
(*this)[ctoken] = d;
//ctoken = P_INSTANCE_POINTER string_hsave(token.c_str());
//(*this)[ctoken] = d;
(*this)[token.c_str()] = d;
return CParser::PARSER_OK;
}

View File

@ -53,7 +53,7 @@ class cxxNameDouble:public
dump_raw(std::ostream & s_oss, unsigned int indent) const;
CParser::STATUS_TYPE
read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, std::istream::pos_type & pos);
read_raw(CParser & parser, std::istream::pos_type & pos);
void
add_extensive(const cxxNameDouble & old, double factor);

View File

@ -5,14 +5,14 @@ PHRQ_base::
PHRQ_base(void)
{
this->io = NULL;
error_count = 0;
base_error_count = 0;
}
PHRQ_base::
PHRQ_base(PHRQ_io * p_io)
{
this->io = p_io;
error_count = 0;
base_error_count = 0;
}
PHRQ_base::
@ -23,18 +23,18 @@ PHRQ_base::
void PHRQ_base::
error_msg(const std::string & stdstr, int stop)
{
this->error_count++;
this->base_error_count++;
if (this->io)
{
//this->io->phreeqc_handler(ACTION_OUTPUT, OUTPUT_ERROR, stdstr, stop, "", args);
this->io->output_string(PHRQ_io::OUTPUT_ERROR, stdstr);
this->io->phreeqc_handler(PHRQ_io::ACTION_OUTPUT, PHRQ_io::OUTPUT_ERROR, stdstr.c_str(), stop!=0, "", NULL);
//this->io->output_string(PHRQ_io::OUTPUT_ERROR, stdstr);
}
else
{
std::cerr << stdstr << std::endl;
std::cout << stdstr << std::endl;
}
if (stop == 0)
if (stop != 0)
{
throw "PHRQ_base error message";
}
@ -45,8 +45,8 @@ warning_msg(const std::string & stdstr)
{
if (this->io)
{
//this->io->phreeqc_handler(ACTION_OUTPUT, OUTPUT_WARNING, stdstr, stop, "", args);
this->io->output_string(PHRQ_io::OUTPUT_WARNING, stdstr);
this->io->phreeqc_handler(PHRQ_io::ACTION_OUTPUT, PHRQ_io::OUTPUT_WARNING, stdstr.c_str(), false, "", NULL);
//this->io->output_string(PHRQ_io::OUTPUT_WARNING, stdstr);
}
else
{
@ -61,8 +61,8 @@ output_msg(const std::string & stdstr)
bool stop = false;
if (this->io)
{
//this->io->phreeqc_handler(PHRQ_io::ACTION_OUTPUT, PHRQ_io::OUTPUT_MESSAGE, stdstr, stop, "");
this->io->output_string(PHRQ_io::OUTPUT_MESSAGE, stdstr);
this->io->phreeqc_handler(PHRQ_io::ACTION_OUTPUT, PHRQ_io::OUTPUT_MESSAGE, stdstr.c_str(), stop!=0, "", NULL);
//this->io->output_string(PHRQ_io::OUTPUT_MESSAGE, stdstr);
}
else
{

View File

@ -26,18 +26,18 @@ public:
{
return this->io;
}
void Set_error_count(int i)
void Set_base_error_count(int i)
{
this->error_count = i;
this->base_error_count = i;
}
int Get_error_count(void)
int Get_base_error_count(void)
{
return this->error_count;
return this->base_error_count;
}
// data
private:
PHRQ_io * io;
int error_count;
int base_error_count;
};
#endif /* _PHRQBASE_H */

View File

@ -17,7 +17,7 @@ PHRQ_io(void)
punch_file = NULL; /* OUTPUT_PUNCH */
error_file = NULL; /* OUTPUT_ERROR */
dump_file = NULL; /* OUTPUT_DUMP */
int error_count = 0;
io_error_count = 0;
output_file_on = true;
log_file_on = false;
@ -137,12 +137,13 @@ output_handler(const int type, const char *err_str, const bool stop,
const char *format, va_list args)
/* ---------------------------------------------------------------------- */
{
int flush = 1;
int flush = 0;
switch (type)
{
case OUTPUT_ERROR:
io_error_count++;
if (error_file != NULL && error_file_on)
{
fprintf(error_file, "ERROR: %s\n", err_str);
@ -304,7 +305,7 @@ output_string(const int type, std::string str)
{
case OUTPUT_ERROR:
this->error_count++;
//this->io_error_count++;
if (error_file != NULL && error_file_on)
{
fprintf(error_file, "%s", str.c_str());

View File

@ -53,13 +53,13 @@ typedef enum
int close_output_files(void);
static int istream_getc(void *cookie);
void output_string(const int type, std::string str);
void Set_error_count(int i)
void Set_io_error_count(int i)
{
this->error_count = i;
this->io_error_count = i;
}
int Get_error_count(void)
int Get_io_error_count(void)
{
return this->error_count;
return this->io_error_count;
}
void Set_input_file(FILE * in)
{
@ -146,7 +146,7 @@ private:
FILE *punch_file; /* OUTPUT_PUNCH */
FILE *error_file; /* OUTPUT_ERROR */
FILE *dump_file; /* OUTPUT_DUMP */
int error_count;
int io_error_count;
bool output_file_on;
bool log_file_on;

View File

@ -168,7 +168,7 @@ cxxPPassemblage::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxPPassemblage::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxPPassemblage::read_raw(CParser & parser, bool check)
{
static std::vector < std::string > vopts;
if (vopts.empty())
@ -221,7 +221,7 @@ cxxPPassemblage::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
break;
case 0: // eltList
if (this->eltList.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->eltList.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();
@ -268,7 +268,7 @@ cxxPPassemblage::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
ec.read_raw(parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
CParser reread(is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
if (this->ppAssemblageComps.find(ec.get_name()) != this->ppAssemblageComps.end())

View File

@ -27,7 +27,7 @@ class cxxPPassemblage:public cxxNumKeyword
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check = true);
void read_raw(CParser & parser, bool check = true);
const cxxNameDouble & get_totals() const
{

View File

@ -25,7 +25,7 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CParser::CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, PHRQ_io *io):
CParser::CParser(std::istream & input, PHRQ_io *io):
PHRQ_base(io),
m_input_stream(input),
m_output_stream(std::cout),
@ -38,12 +38,9 @@ m_next_keyword(KT_NONE)
echo_file = EO_ALL;
echo_stream = EO_NONE;
accumulate = false;
#if defined(PHREEQC_CLASS)
this->p_instance = p_instance1;
#endif
}
CParser::CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, std::ostream & output, PHRQ_io *io)
CParser::CParser(std::istream & input, std::ostream & output, PHRQ_io *io)
:
PHRQ_base(io),
m_input_stream(input),
@ -57,12 +54,9 @@ m_next_keyword(KT_NONE)
echo_file = EO_ALL;
echo_stream = EO_NONE;
accumulate = false;
#if defined(PHREEQC_CLASS)
this->p_instance = p_instance1;
#endif
}
CParser::CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, std::ostream & output, std::ostream & error, PHRQ_io *io)
CParser::CParser(std::istream & input, std::ostream & output, std::ostream & error, PHRQ_io *io)
:
PHRQ_base(io),
m_input_stream(input),
@ -76,9 +70,6 @@ m_next_keyword(KT_NONE)
echo_file = EO_ALL;
echo_stream = EO_NONE;
accumulate = false;
#if defined(PHREEQC_CLASS)
this->p_instance = p_instance1;
#endif
}
CParser::~CParser()
@ -142,7 +133,8 @@ CParser::LINE_TYPE CParser::check_line(const std::string & str,
std::ostringstream msg;
msg << "\t" << m_line_save << "\n";
//PHREEQC_COOKIE output_msg(PHREEQC_NAME_SPACE OUTPUT_MESSAGE, "%s", msg.str().c_str());
this->Get_io()->output_string(PHRQ_io::OUTPUT_MESSAGE, msg.str());
this->Get_io()->output_handler(PHRQ_io::OUTPUT_MESSAGE, msg.str().c_str(), false, "", NULL);
//this->Get_io()->output_string(PHRQ_io::OUTPUT_MESSAGE, msg.str());
}
break;
case EO_KEYWORDS:
@ -151,7 +143,8 @@ CParser::LINE_TYPE CParser::check_line(const std::string & str,
std::ostringstream msg;
msg << "\t" << m_line_save << "\n";
//PHREEQC_COOKIE output_msg(PHREEQC_NAME_SPACE OUTPUT_MESSAGE, "%s", msg.str().c_str());
this->Get_io()->output_string(PHRQ_io::OUTPUT_MESSAGE, msg.str());
this->Get_io()->output_handler(PHRQ_io::OUTPUT_MESSAGE, msg.str().c_str(), false, "", NULL);
//this->Get_io()->output_string(PHRQ_io::OUTPUT_MESSAGE, msg.str());
}
break;
@ -161,7 +154,8 @@ CParser::LINE_TYPE CParser::check_line(const std::string & str,
std::ostringstream msg;
msg << "\t" << m_line_save << "\n";
//PHREEQC_COOKIE output_msg(PHREEQC_NAME_SPACE OUTPUT_MESSAGE, "%s", msg.str().c_str());
this->Get_io()->output_string(PHRQ_io::OUTPUT_MESSAGE, msg.str());
this->Get_io()->output_handler(PHRQ_io::OUTPUT_MESSAGE, msg.str().c_str(),false,"",NULL);
//this->Get_io()->output_string(PHRQ_io::OUTPUT_MESSAGE, msg.str());
}
break;
}
@ -174,7 +168,7 @@ CParser::LINE_TYPE CParser::check_line(const std::string & str,
std::ostringstream msg;
msg << "Unexpected eof while reading " << str <<
"\nExecution terminated.\n";
error_msg(msg, OT_STOP);
error_msg(msg.str().c_str(), OT_STOP);
}
// Check keyword
@ -183,7 +177,7 @@ CParser::LINE_TYPE CParser::check_line(const std::string & str,
std::ostringstream msg;
msg << "Expected data for " << str <<
", but got a keyword ending data block.";
error_msg(msg, OT_CONTINUE);
error_msg(msg.str().c_str(), OT_CONTINUE);
incr_input_error();
}
m_line_type = i;
@ -517,7 +511,7 @@ CParser::STATUS_TYPE CParser::check_units(std::string & tot_units,
{
std::ostringstream err;
err << "Unknown unit, " << tot_units;
error_msg(err, OT_CONTINUE);
error_msg(err.str().c_str(), OT_CONTINUE);
}
return PARSER_ERROR;
}
@ -578,7 +572,7 @@ CParser::STATUS_TYPE CParser::check_units(std::string & tot_units,
std::ostringstream err;
err << "Units for master species, " << tot_units <<
", are not compatible with default units, " << str << ".";
error_msg(err, OT_CONTINUE);
error_msg(err.str().c_str(), OT_CONTINUE);
}
return PARSER_ERROR;
}
@ -913,7 +907,7 @@ CParser::get_option(const std::vector < std::string > &opt_list,
int
CParser::error_msg(const char *err_str, ONERROR_TYPE ot)
{
ERROR_MESSAGE_QUALIFIER error_msg(err_str, (int) ot);
PHRQ_base::error_msg(err_str, (int) ot);
m_error_stream << "ERROR: " << err_str << "\n";
m_error_stream.flush();
@ -1023,7 +1017,7 @@ CParser::STATUS_TYPE CParser::parse_couple(std::string & token)
std::ostringstream err_msg;
err_msg << "Element name must be followed by " <<
"parentheses in redox couple, " << token << ".";
error_msg(err_msg, OT_CONTINUE);
error_msg(err_msg.str().c_str(), OT_CONTINUE);
incr_input_error();
return PARSER_ERROR;
}
@ -1039,7 +1033,7 @@ CParser::STATUS_TYPE CParser::parse_couple(std::string & token)
std::ostringstream err_msg;
err_msg << "End of line or " "/"
" encountered before end of parentheses, " << token << ".";
error_msg(err_msg, OT_CONTINUE);
error_msg(err_msg.str().c_str(), OT_CONTINUE);
return PARSER_ERROR;
}
paren1.insert(paren1.end(), *ptr); // element.push_back(c);
@ -1057,7 +1051,7 @@ CParser::STATUS_TYPE CParser::parse_couple(std::string & token)
std::ostringstream err_msg;
err_msg << " " "/" " must follow parentheses " <<
"ending first half of redox couple, " << token << ".";
error_msg(err_msg, OT_CONTINUE);
error_msg(err_msg.str().c_str(), OT_CONTINUE);
return PARSER_ERROR;
}
++ptr;
@ -1068,7 +1062,7 @@ CParser::STATUS_TYPE CParser::parse_couple(std::string & token)
std::ostringstream err_msg;
err_msg << "Redox couple must be two redox states " <<
"of the same element, " << token << ".";
error_msg(err_msg, OT_CONTINUE);
error_msg(err_msg.str().c_str(), OT_CONTINUE);
return PARSER_ERROR;
}
if (*ptr != '(')
@ -1076,7 +1070,7 @@ CParser::STATUS_TYPE CParser::parse_couple(std::string & token)
std::ostringstream err_msg;
err_msg << "Element name must be followed by "
"parentheses in redox couple, " << token << ".";
error_msg(err_msg, OT_CONTINUE);
error_msg(err_msg.str().c_str(), OT_CONTINUE);
incr_input_error();
return PARSER_ERROR;
}
@ -1091,7 +1085,7 @@ CParser::STATUS_TYPE CParser::parse_couple(std::string & token)
std::ostringstream err_msg;
err_msg << "End of line or " "/"
" encountered before end of parentheses, " << token << ".";
error_msg(err_msg, OT_CONTINUE);
error_msg(err_msg.str().c_str(), OT_CONTINUE);
return PARSER_ERROR;
}
paren2.insert(paren2.end(), *ptr); // element.push_back(c);
@ -1115,7 +1109,7 @@ CParser::STATUS_TYPE CParser::parse_couple(std::string & token)
std::ostringstream err_msg;
err_msg << "Both parts of redox couple are the same, " <<
token << ".";
error_msg(err_msg, OT_CONTINUE);
error_msg(err_msg.str().c_str(), OT_CONTINUE);
return PARSER_ERROR;
}
return PARSER_OK;
@ -1369,7 +1363,6 @@ CParser::getOptionFromLastLine(const std::vector < std::string > &opt_list,
int CParser::
incr_input_error()
{
++ ERROR_MESSAGE_QUALIFIER input_error;
return ++m_input_error;
}

View File

@ -8,25 +8,14 @@
#include <ostream> // std::ostream
#include <istream> // std::istream
#include "Phreeqc_class.h"
#if defined (PHREEQC_CLASS)
class Phreeqc;
#define PHREEQC_NAME_SPACE Phreeqc::
#define PHREEQC_COOKIE this->p_instance->
#define ERROR_MESSAGE_QUALIFIER this->p_instance->
#else
#define PHREEQC_NAME_SPACE ::
#define PHREEQC_COOKIE
#define ERROR_MESSAGE_QUALIFIER ::
extern int input_error;
#endif
#include "PHRQ_base.h"
class CParser: public PHRQ_base
{
public:
CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, PHRQ_io *io=NULL);
CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, std::ostream & output, PHRQ_io *io=NULL);
CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, std::ostream & output,
CParser(std::istream & input, PHRQ_io *io=NULL);
CParser(std::istream & input, std::ostream & output, PHRQ_io *io=NULL);
CParser(std::istream & input, std::ostream & output,
std::ostream & error, PHRQ_io *io=NULL);
virtual ~ CParser();
@ -321,9 +310,7 @@ class CParser: public PHRQ_base
ECHO_OPTION echo_file;
std::string accumulated;
bool accumulate;
#if defined(PHREEQC_CLASS)
Phreeqc * p_instance;
#endif
};
// Global functions

View File

@ -1374,6 +1374,7 @@ int string_trim_right(char *str);
int string_trim_left(char *str);
CLASS_STATIC LDBLE under(LDBLE xval);
void zero_double(LDBLE * target, int n);
int get_input_errors(void);
#ifdef PHREEQ98
void AddToCEntry(char *a, int l, int i);

View File

@ -222,7 +222,7 @@ cxxReaction::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxReaction::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, const bool check)
cxxReaction::read_raw(CParser & parser, const bool check)
{
int j;
@ -298,7 +298,7 @@ cxxReaction::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, const bool check)
break;
case 1: // reactant_list
if (this->reactantList.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->reactantList.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();
@ -310,7 +310,7 @@ cxxReaction::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, const bool check)
break;
case 2: // element_list
if (this->elementList.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->elementList.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();

View File

@ -24,7 +24,7 @@ class cxxReaction:public cxxNumKeyword
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check);
void read_raw(CParser & parser, bool check);
cxxNameDouble &get_elementList(void)
{
return this->elementList;

View File

@ -94,7 +94,7 @@ read_solution_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -111,7 +111,7 @@ read_solution_raw(void)
cxxSolution sol(&phrq_io);
sol.read_raw(PHREEQC_THIS_COMMA parser);
sol.read_raw(parser);
struct solution *soln_ptr = sol.cxxSolution2solution(PHREEQC_THIS);
int n;
@ -187,7 +187,7 @@ read_exchange_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -203,7 +203,7 @@ read_exchange_raw(void)
parser.get_option(vopts, next_char);
cxxExchange ex(&phrq_io);
ex.read_raw(PHREEQC_THIS_COMMA parser);
ex.read_raw(parser);
struct exchange *exchange_ptr = ex.cxxExchange2exchange(PHREEQC_THIS);
int n;
@ -281,7 +281,7 @@ read_surface_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -297,7 +297,7 @@ read_surface_raw(void)
parser.get_option(vopts, next_char);
cxxSurface ex(&phrq_io);
ex.read_raw(PHREEQC_THIS_COMMA parser);
ex.read_raw(parser);
struct surface *surface_ptr = ex.cxxSurface2surface(PHREEQC_THIS);
int n;
@ -376,7 +376,7 @@ read_equilibrium_phases_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -392,7 +392,7 @@ read_equilibrium_phases_raw(void)
parser.get_option(vopts, next_char);
cxxPPassemblage ex(&phrq_io);
ex.read_raw(PHREEQC_THIS_COMMA parser);
ex.read_raw(parser);
struct pp_assemblage *pp_assemblage_ptr = ex.cxxPPassemblage2pp_assemblage(PHREEQC_THIS);
int n;
@ -472,7 +472,7 @@ read_kinetics_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -488,7 +488,7 @@ read_kinetics_raw(void)
parser.get_option(vopts, next_char);
cxxKinetics ex(&phrq_io);
ex.read_raw(PHREEQC_THIS_COMMA parser);
ex.read_raw(parser);
struct kinetics *kinetics_ptr = ex.cxxKinetics2kinetics(PHREEQC_THIS);
int n;
@ -567,7 +567,7 @@ read_solid_solutions_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -583,7 +583,7 @@ read_solid_solutions_raw(void)
parser.get_option(vopts, next_char);
cxxSSassemblage ex;
ex.read_raw(PHREEQC_THIS_COMMA parser);
ex.read_raw(parser);
struct s_s_assemblage *s_s_assemblage_ptr = ex.cxxSSassemblage2s_s_assemblage(PHREEQC_THIS);
int n;
@ -664,7 +664,7 @@ read_gas_phase_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -680,7 +680,7 @@ read_gas_phase_raw(void)
parser.get_option(vopts, next_char);
cxxGasPhase ex(&phrq_io);
ex.read_raw(PHREEQC_THIS_COMMA parser);
ex.read_raw(parser);
struct gas_phase *gas_phase_ptr = ex.cxxGasPhase2gas_phase(PHREEQC_THIS);
int n;
@ -758,7 +758,7 @@ read_reaction_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -774,7 +774,7 @@ read_reaction_raw(void)
parser.get_option(vopts, next_char);
cxxReaction ex;
ex.read_raw(PHREEQC_THIS_COMMA parser, true);
ex.read_raw(parser, true);
struct irrev *irrev_ptr = ex.cxxReaction2irrev(PHREEQC_THIS);
int n;
@ -853,7 +853,7 @@ read_mix_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -948,7 +948,7 @@ read_temperature_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
@ -1025,7 +1025,7 @@ read_dump(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1077,7 +1077,7 @@ read_delete(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1129,7 +1129,7 @@ read_run_cells(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1230,7 +1230,7 @@ read_solution_modify(void)
}
cxxSolution sol(solution[n]);
sol.read_raw(PHREEQC_THIS_COMMA parser, false);
sol.read_raw(parser, false);
struct solution *soln_ptr = sol.cxxSolution2solution(PHREEQC_THIS);
@ -1292,7 +1292,7 @@ read_solution_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1324,7 +1324,7 @@ read_solution_modify(void)
// Clear activities so we can know what was read
sol.clear_master_activity();
sol.read_raw(PHREEQC_THIS_COMMA parser, false);
sol.read_raw(parser, false);
cxxSolution orig(solution[n], &phrq_io );
@ -1390,7 +1390,7 @@ read_equilibrium_phases_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1418,7 +1418,7 @@ read_equilibrium_phases_modify(void)
// read entity
cxxPPassemblage entity(&(pp_assemblage[n]), &phrq_io);
entity.read_raw(PHREEQC_THIS_COMMA parser, false);
entity.read_raw(parser, false);
// save entity
struct pp_assemblage *entity_ptr = entity.cxxPPassemblage2pp_assemblage(PHREEQC_THIS);
@ -1483,7 +1483,7 @@ read_exchange_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1511,7 +1511,7 @@ read_exchange_modify(void)
// read entity
cxxExchange entity(&(exchange[n]), &phrq_io);
entity.read_raw(PHREEQC_THIS_COMMA parser, false);
entity.read_raw(parser, false);
// save entity
struct exchange *entity_ptr = entity.cxxExchange2exchange(PHREEQC_THIS);
@ -1591,7 +1591,7 @@ read_surface_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1619,7 +1619,7 @@ read_surface_modify(void)
// read entity
cxxSurface entity(&(surface[n]), &phrq_io);
entity.read_raw(PHREEQC_THIS_COMMA parser, false);
entity.read_raw(parser, false);
// save entity
struct surface *entity_ptr = entity.cxxSurface2surface(PHREEQC_THIS);
@ -1680,7 +1680,7 @@ read_solid_solutions_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1708,7 +1708,7 @@ read_solid_solutions_modify(void)
// read entity
cxxSSassemblage entity(&(s_s_assemblage[n]));
entity.read_raw(PHREEQC_THIS_COMMA parser, false);
entity.read_raw(parser, false);
// save entity
struct s_s_assemblage *entity_ptr = entity.cxxSSassemblage2s_s_assemblage(PHREEQC_THIS);
@ -1768,7 +1768,7 @@ read_gas_phase_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1796,7 +1796,7 @@ read_gas_phase_modify(void)
// read entity
cxxGasPhase entity(&(gas_phase[n]), &phrq_io);
entity.read_raw(PHREEQC_THIS_COMMA parser, false);
entity.read_raw(parser, false);
// save entity
struct gas_phase *entity_ptr = entity.cxxGasPhase2gas_phase(PHREEQC_THIS);
gas_phase_free(&(gas_phase[n]));
@ -1856,7 +1856,7 @@ read_kinetics_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out; // ??
std::ostringstream oss_err; // ??
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1884,7 +1884,7 @@ read_kinetics_modify(void)
// read entity
cxxKinetics entity(&(kinetics[n]), &phrq_io);
entity.read_raw(PHREEQC_THIS_COMMA parser, false);
entity.read_raw(parser, false);
// save entity
struct kinetics *entity_ptr = entity.cxxKinetics2kinetics(PHREEQC_THIS);
@ -1944,7 +1944,7 @@ read_reaction_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1972,7 +1972,7 @@ read_reaction_modify(void)
// read entity
cxxReaction entity(&(irrev[n]));
entity.read_raw(PHREEQC_THIS_COMMA parser, false);
entity.read_raw(parser, false);
// save entity
struct irrev *entity_ptr = entity.cxxReaction2irrev(PHREEQC_THIS);
irrev_free(&(irrev[n]));
@ -2968,7 +2968,7 @@ read_user_graph_handler(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &phrq_io);
CParser parser(iss_in, oss_out, oss_err, &phrq_io);
//For testing, need to read line to get started
std::vector < std::string > vopts;

View File

@ -158,7 +158,7 @@ cxxSSassemblage::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxSSassemblage::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxSSassemblage::read_raw(CParser & parser, bool check)
{
static std::vector < std::string > vopts;
if (vopts.empty())
@ -240,21 +240,21 @@ cxxSSassemblage::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
#endif
parser.set_accumulate(true);
ec.read_raw(P_INSTANCE_COMMA parser, false);
ec.read_raw(parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
CParser reread(is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
if (this->ssAssemblageSSs.find(ec.get_name()) != this->ssAssemblageSSs.end())
{
cxxSSassemblageSS & ec1 = this->ssAssemblageSSs.find(ec.get_name())->second;
ec1.read_raw(P_INSTANCE_COMMA reread, false);
ec1.read_raw(reread, false);
}
else
{
cxxSSassemblageSS ec1(this->Get_io());
ec1.read_raw(P_INSTANCE_COMMA reread, false);
ec1.read_raw(reread, false);
std::string str(ec1.get_name());
this->ssAssemblageSSs[str] = ec1;
}

View File

@ -34,7 +34,7 @@ public:
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check = true);
void read_raw(CParser & parser, bool check = true);
std::map <std::string, cxxSSassemblageSS > & get_ssAssemblageSSs()
{
return this->ssAssemblageSSs;

View File

@ -230,7 +230,7 @@ cxxSSassemblageSS::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxSSassemblageSS::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxSSassemblageSS::read_raw(CParser & parser, bool check)
{
std::string str;
@ -346,7 +346,7 @@ cxxSSassemblageSS::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
break;
case 4: // components
if (this->comps.read_raw(P_INSTANCE_COMMA parser, next_char) != CParser::PARSER_OK)
if (this->comps.read_raw(parser, next_char) != CParser::PARSER_OK)
{
parser.incr_input_error();
parser.error_msg("Expected phase name and moles for comps.",

View File

@ -40,7 +40,7 @@ class cxxSSassemblageSS: public PHRQ_base
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check = true);
void read_raw(CParser & parser, bool check = true);
const std::string &get_name() const
{

View File

@ -561,7 +561,7 @@ cxxSolution::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxSolution::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxSolution::read_raw(CParser & parser, bool check)
{
static std::vector < std::string > vopts;
if (vopts.empty())
@ -633,7 +633,7 @@ cxxSolution::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
continue;
case 0: // totals
//if (this->totals.read_raw(P_INSTANCE_COMMA parser, next_char) !=
//if (this->totals.read_raw(parser, next_char) !=
// CParser::PARSER_OK)
//{
// parser.incr_input_error();
@ -643,7 +643,7 @@ cxxSolution::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
//}
{
cxxNameDouble temp_totals;
if (temp_totals.read_raw(P_INSTANCE_COMMA parser, next_char) != CParser::PARSER_OK)
if (temp_totals.read_raw(parser, next_char) != CParser::PARSER_OK)
{
parser.incr_input_error();
parser.
@ -659,7 +659,7 @@ cxxSolution::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
break;
case 1: // activities
if (this->master_activity.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->master_activity.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();
@ -672,7 +672,7 @@ cxxSolution::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
break;
case 2: // gammas
if (this->species_gamma.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->species_gamma.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();

View File

@ -157,7 +157,7 @@ class cxxSolution:public cxxNumKeyword
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check = true);
void read_raw(CParser & parser, bool check = true);
void multiply(double extensive);
void modify_activities(PHREEQC_PTR_ARG_COMMA const cxxSolution & original);
#ifdef ORCHESTRA

View File

@ -701,7 +701,7 @@ cxxStorageBin::dump_raw(std::ostream & s_oss, int n, unsigned int indent)
}
void
cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
cxxStorageBin::read_raw(CParser & parser)
{
CParser::LINE_TYPE i;
while ((i =
@ -735,7 +735,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_SOLUTION_RAW:
{
cxxSolution entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
Solutions[entity.get_n_user()] = entity;
}
break;
@ -743,7 +743,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_EXCHANGE_RAW:
{
cxxExchange entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
Exchangers[entity.get_n_user()] = entity;
}
break;
@ -751,7 +751,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_GASPHASE_RAW:
{
cxxGasPhase entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
GasPhases[entity.get_n_user()] = entity;
}
break;
@ -759,7 +759,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_KINETICS_RAW:
{
cxxKinetics entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
Kinetics[entity.get_n_user()] = entity;
}
break;
@ -767,7 +767,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_PPASSEMBLAGE_RAW:
{
cxxPPassemblage entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
PPassemblages[entity.get_n_user()] = entity;
}
break;
@ -775,7 +775,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_SSASSEMBLAGE_RAW:
{
cxxSSassemblage entity;
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
SSassemblages[entity.get_n_user()] = entity;
}
break;
@ -783,7 +783,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_SURFACE_RAW:
{
cxxSurface entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
Surfaces[entity.get_n_user()] = entity;
}
break;
@ -799,7 +799,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_REACTION_RAW:
{
cxxReaction entity;
entity.read_raw(P_INSTANCE_COMMA parser, true);
entity.read_raw(parser, true);
Reactions[entity.get_n_user()] = entity;
}
break;
@ -813,7 +813,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
}
int
cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
cxxStorageBin::read_raw_keyword(CParser & parser)
{
CParser::LINE_TYPE i;
int entity_number = -999;
@ -846,7 +846,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_SOLUTION_RAW:
{
cxxSolution entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
Solutions[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
}
@ -855,7 +855,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_EXCHANGE_RAW:
{
cxxExchange entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
Exchangers[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
}
@ -864,7 +864,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_GASPHASE_RAW:
{
cxxGasPhase entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
GasPhases[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
}
@ -873,7 +873,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_KINETICS_RAW:
{
cxxKinetics entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
Kinetics[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
}
@ -882,7 +882,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_PPASSEMBLAGE_RAW:
{
cxxPPassemblage entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
PPassemblages[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
}
@ -891,7 +891,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_SSASSEMBLAGE_RAW:
{
cxxSSassemblage entity;
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
SSassemblages[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
}
@ -900,7 +900,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_SURFACE_RAW:
{
cxxSurface entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
entity.read_raw(parser);
Surfaces[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
}
@ -918,7 +918,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_REACTION_RAW:
{
cxxReaction entity;
entity.read_raw(P_INSTANCE_COMMA parser, true);
entity.read_raw(parser, true);
Reactions[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
}

View File

@ -87,8 +87,8 @@ class cxxStorageBin: public PHRQ_base
void dump_raw(std::ostream & s_oss, int i, unsigned int indent);
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser);
int read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser);
void read_raw(CParser & parser);
int read_raw_keyword(CParser & parser);
void add(struct system *sys_ptr);

View File

@ -363,7 +363,7 @@ cxxSurface::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxSurface::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxSurface::read_raw(CParser & parser, bool check)
{
static std::vector < std::string > vopts;
int i = 0;
@ -539,21 +539,21 @@ cxxSurface::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
#endif
parser.set_accumulate(true);
ec.read_raw(P_INSTANCE_COMMA parser, false);
ec.read_raw(parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
CParser reread(is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
if (this->surfaceComps.find(ec.get_formula()) != this->surfaceComps.end())
{
cxxSurfaceComp & comp = this->surfaceComps.find(ec.get_formula())->second;
comp.read_raw(P_INSTANCE_COMMA reread, false);
comp.read_raw(reread, false);
}
else
{
cxxSurfaceComp ec1(this->Get_io());
ec1.read_raw(P_INSTANCE_COMMA reread, false);
ec1.read_raw(reread, false);
std::string str(ec1.get_formula());
this->surfaceComps[str] = ec1;
}
@ -592,21 +592,21 @@ cxxSurface::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
#endif
parser.set_accumulate(true);
ec.read_raw(P_INSTANCE_COMMA parser, false);
ec.read_raw(parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
CParser reread(is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
if (this->surfaceCharges.find(ec.get_name()) != this->surfaceCharges.end())
{
cxxSurfaceCharge & comp = this->surfaceCharges.find(ec.get_name())->second;
comp.read_raw(P_INSTANCE_COMMA reread, false);
comp.read_raw(reread, false);
}
else
{
cxxSurfaceCharge ec1(this->Get_io());
ec1.read_raw(P_INSTANCE_COMMA reread, false);
ec1.read_raw(reread, false);
std::string str(ec1.get_name());
this->surfaceCharges[str] = ec1;
}

View File

@ -34,7 +34,7 @@ class cxxSurface:public cxxNumKeyword
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check = true);
void read_raw(CParser & parser, bool check = true);
bool get_related_phases(void);

View File

@ -206,7 +206,7 @@ cxxSurfaceCharge::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxSurfaceCharge::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxSurfaceCharge::read_raw(CParser & parser, bool check)
{
std::string str;
@ -340,7 +340,7 @@ cxxSurfaceCharge::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
case 6: // diffuse_layer_totals
if (this->diffuse_layer_totals.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->diffuse_layer_totals.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();

View File

@ -29,7 +29,7 @@ public:
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check = true);
void read_raw(CParser & parser, bool check = true);
const std::string &get_name() const
{

View File

@ -249,7 +249,7 @@ cxxSurfaceComp::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxSurfaceComp::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxSurfaceComp::read_raw(CParser & parser, bool check)
{
std::string str;
@ -406,7 +406,7 @@ cxxSurfaceComp::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
break;
case 8: // totals
if (this->totals.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->totals.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();
@ -430,7 +430,7 @@ cxxSurfaceComp::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
break;
case 10: // formula_totals
if (this->formula_totals.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->formula_totals.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();

View File

@ -30,7 +30,7 @@ public:
static struct surface_comp *cxxSurfaceComp2surface_comp(PHREEQC_PTR_ARG_COMMA std::map < std::string, cxxSurfaceComp > &el);
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check = true);
void read_raw(CParser & parser, bool check = true);
const cxxNameDouble & get_totals() const;
void add(PHREEQC_PTR_ARG_COMMA const cxxSurfaceComp & comp, double extensive);
void multiply(double extensive);

View File

@ -288,7 +288,7 @@ cxxKinetics::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxKinetics::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
cxxKinetics::read_raw(CParser & parser, bool check)
{
double d;
@ -437,10 +437,10 @@ cxxKinetics::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
#endif
parser.set_accumulate(true);
ec.read_raw(P_INSTANCE_COMMA parser, false);
ec.read_raw(parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
CParser reread(is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
@ -456,12 +456,12 @@ cxxKinetics::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
if (found)
{
kit->read_raw(P_INSTANCE_COMMA reread, false);
kit->read_raw(reread, false);
}
else
{
cxxKineticsComp ec1(this->Get_io());
ec1.read_raw(P_INSTANCE_COMMA reread, false);
ec1.read_raw(reread, false);
std::string str(ec1.get_rate_name());
this->kineticsComps.push_back(ec1);
}
@ -469,12 +469,12 @@ cxxKinetics::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
if (this->kineticsComps.find(ec.get_rate_name()) != this->kineticsComps.end())
{
cxxKineticsComp & comp = this->kineticsComps.find(ec.get_rate_name())->second;
comp.read_raw(P_INSTANCE_COMMA reread, false);
comp.read_raw(reread, false);
}
else
{
cxxKineticsComp ec1;
ec1.read_raw(P_INSTANCE_COMMA reread, false);
ec1.read_raw(reread, false);
std::string str(ec1.get_rate_name());
this->kineticsComps[str] = ec1;
}
@ -484,7 +484,7 @@ cxxKinetics::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
break;
case 5: // totals
if (this->totals.read_raw(P_INSTANCE_COMMA parser, next_char) !=
if (this->totals.read_raw(parser, next_char) !=
CParser::PARSER_OK)
{
parser.incr_input_error();

View File

@ -30,7 +30,7 @@ class cxxKinetics:public cxxNumKeyword
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check = true);
void read_raw(CParser & parser, bool check = true);
bool get_related_phases(void);