From f5bcccafcbcefc208fffdbb62b5e47eeec051cb5 Mon Sep 17 00:00:00 2001 From: Scott R Charlton Date: Fri, 13 Sep 2013 05:52:16 +0000 Subject: [PATCH] updated for (Set)CurrentSelectedOutputUserNumber git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@8028 1feff8c3-07ed-0310-ac33-dd36852eb9cd --- doc/examples/Multi.cpp | 66 +++---- src/IPhreeqc.cpp | 58 ++++-- src/IPhreeqc.h | 384 ++++++++++++++++++++------------------- src/IPhreeqc.hpp | 110 +++++------ src/IPhreeqcLib.cpp | 8 +- unit/TestIPhreeqc.cpp | 32 +++- unit/TestIPhreeqcLib.cpp | 11 +- 7 files changed, 365 insertions(+), 304 deletions(-) diff --git a/doc/examples/Multi.cpp b/doc/examples/Multi.cpp index ed07077d..23708548 100644 --- a/doc/examples/Multi.cpp +++ b/doc/examples/Multi.cpp @@ -11,56 +11,44 @@ int main(void) return EXIT_FAILURE; } - iphreeqc.AccumulateLine("TITLE Example 2.--Temperature dependence of solubility"); - iphreeqc.AccumulateLine(" of gypsum and anhydrite "); - iphreeqc.AccumulateLine("SOLUTION 1 Pure water "); - iphreeqc.AccumulateLine(" pH 7.0 "); - iphreeqc.AccumulateLine(" temp 25.0 "); - iphreeqc.AccumulateLine("EQUILIBRIUM_PHASES 1 "); - iphreeqc.AccumulateLine(" Gypsum 0.0 1.0 "); - iphreeqc.AccumulateLine(" Anhydrite 0.0 1.0 "); - iphreeqc.AccumulateLine("REACTION_TEMPERATURE 1 "); - iphreeqc.AccumulateLine(" 25.0 75.0 in 51 steps "); - iphreeqc.AccumulateLine("SELECTED_OUTPUT 1 "); - iphreeqc.AccumulateLine(" -file state.sel "); - iphreeqc.AccumulateLine(" -temperature "); - iphreeqc.AccumulateLine("SELECTED_OUTPUT 2 "); - iphreeqc.AccumulateLine(" -file si.sel "); - iphreeqc.AccumulateLine(" -si anhydrite gypsum "); - iphreeqc.AccumulateLine("END "); + iphreeqc.SetCurrentSelectedOutputUserNumber(1); + iphreeqc.SetSelectedOutputStringOn(true); + iphreeqc.SetSelectedOutputFileOn(true); + iphreeqc.SetSelectedOutputFileName("state.sel"); + + iphreeqc.SetCurrentSelectedOutputUserNumber(2); + iphreeqc.SetSelectedOutputStringOn(true); + iphreeqc.SetSelectedOutputFileOn(true); + iphreeqc.SetSelectedOutputFileName("si.sel"); + + + iphreeqc.AccumulateLine("TITLE Temperature dependence of solubility"); + iphreeqc.AccumulateLine(" of gypsum and anhydrite "); + iphreeqc.AccumulateLine("SOLUTION 1 Pure water "); + iphreeqc.AccumulateLine(" pH 7.0 "); + iphreeqc.AccumulateLine(" temp 25.0 "); + iphreeqc.AccumulateLine("EQUILIBRIUM_PHASES 1 "); + iphreeqc.AccumulateLine(" Gypsum 0.0 1.0 "); + iphreeqc.AccumulateLine(" Anhydrite 0.0 1.0 "); + iphreeqc.AccumulateLine("REACTION_TEMPERATURE 1 "); + iphreeqc.AccumulateLine(" 25.0 75.0 in 51 steps "); + iphreeqc.AccumulateLine("SELECTED_OUTPUT 1 "); + iphreeqc.AccumulateLine(" -temperature "); + iphreeqc.AccumulateLine("SELECTED_OUTPUT 2 "); + iphreeqc.AccumulateLine(" -si anhydrite gypsum "); + iphreeqc.AccumulateLine("END "); if (iphreeqc.RunAccumulated() != 0) { std::cout << iphreeqc.GetErrorString() << std::endl; return EXIT_FAILURE; } - VAR v; - ::VarInit(&v); - int c = iphreeqc.GetSelectedOutputCount(); for (int k = 0; k < c; ++k) { int n = iphreeqc.GetNthSelectedOutputUserNumber(k); iphreeqc.SetCurrentSelectedOutputUserNumber(n); std::cout << "selected-output " << n << ":" << std::endl; - for (int i = 0; i < iphreeqc.GetSelectedOutputRowCount(); ++i) { - for (int j = 0; j < iphreeqc.GetSelectedOutputColumnCount(); ++j) { - if (iphreeqc.GetSelectedOutputValue(i, j, &v) == VR_OK) { - switch (v.type) { - case TT_LONG: - std::cout << v.lVal << " "; - break; - case TT_DOUBLE: - std::cout << v.dVal << " "; - break; - case TT_STRING: - std::cout << v.sVal << " "; - break; - } - } - ::VarClear(&v); - } - std::cout << std::endl; - } + std::cout << iphreeqc.GetSelectedOutputString() << std::endl; } return EXIT_SUCCESS; } diff --git a/src/IPhreeqc.cpp b/src/IPhreeqc.cpp index bd272336..32d2daee 100644 --- a/src/IPhreeqc.cpp +++ b/src/IPhreeqc.cpp @@ -29,7 +29,6 @@ IPhreeqc::IPhreeqc(void) : DatabaseLoaded(false) , ClearAccumulated(false) , UpdateComponents(true) -, SelectedOutputFileOn(false) , OutputFileOn(false) , LogFileOn(false) , ErrorFileOn(false) @@ -383,7 +382,7 @@ const char* IPhreeqc::GetSelectedOutputFileName(void)const bool IPhreeqc::GetSelectedOutputFileOn(void)const { - return this->SelectedOutputFileOn; + return this->get_sel_out_file_on(this->CurrentSelectedOutputUserNumber); } int IPhreeqc::GetSelectedOutputRowCount(void)const @@ -811,7 +810,7 @@ void IPhreeqc::SetBasicFortranCallback(double (*fcn)(double *x1, double *x2, cha VRESULT IPhreeqc::SetCurrentSelectedOutputUserNumber(int n) { - if (this->PhreeqcPtr->SelectedOutput_map.find(n) != this->PhreeqcPtr->SelectedOutput_map.end()) + if (0 <= n) { this->CurrentSelectedOutputUserNumber = n; return VR_OK; @@ -904,7 +903,11 @@ void IPhreeqc::SetSelectedOutputFileName(const char *filename) void IPhreeqc::SetSelectedOutputFileOn(bool bValue) { - this->SelectedOutputFileOn = bValue; +// COMMENT: {9/12/2013 6:40:50 PM} this->SelectedOutputFileOn = bValue; + if (0 <= this->CurrentSelectedOutputUserNumber) + { + this->SelectedOutputFileOnMap[this->CurrentSelectedOutputUserNumber] = bValue; + } } void IPhreeqc::SetSelectedOutputStringOn(bool bValue) @@ -934,6 +937,10 @@ void IPhreeqc::UnLoadDatabase(void) // clear selectedoutput // + this->CurrentSelectedOutputUserNumber = 1; + this->SelectedOutputFileOnMap.clear(); + this->SelectedOutputFileOnMap[1] = false; + std::map< int, CSelectedOutput* >::iterator itt = this->SelectedOutputMap.begin(); for (; itt != this->SelectedOutputMap.end(); ++itt) { @@ -1140,18 +1147,26 @@ void IPhreeqc::do_run(const char* sz_routine, std::istream* pis, PFN_PRERUN_CALL // TRUE ??? // // - if (!this->SelectedOutputFileOn) +// COMMENT: {9/12/2013 6:47:53 PM} if (!this->SelectedOutputFileOn) +// COMMENT: {9/12/2013 6:47:53 PM} { +// COMMENT: {9/12/2013 6:47:53 PM} std::map< int, SelectedOutput >::iterator it = this->PhreeqcPtr->SelectedOutput_map.begin(); +// COMMENT: {9/12/2013 6:47:53 PM} for (; it != this->PhreeqcPtr->SelectedOutput_map.end(); ++it) +// COMMENT: {9/12/2013 6:47:53 PM} { +// COMMENT: {9/12/2013 6:47:53 PM} ASSERT((*it).second.Get_punch_ostream() == 0); +// COMMENT: {9/12/2013 6:47:53 PM} } +// COMMENT: {9/12/2013 6:47:53 PM} } +// COMMENT: {9/12/2013 6:47:53 PM} else +// COMMENT: {9/12/2013 6:47:53 PM} { +// COMMENT: {9/12/2013 6:47:53 PM} ASSERT(TRUE); +// COMMENT: {9/12/2013 6:47:53 PM} } + std::map< int, SelectedOutput >::iterator ai = this->PhreeqcPtr->SelectedOutput_map.begin(); + for (; ai != this->PhreeqcPtr->SelectedOutput_map.end(); ++ai) { - std::map< int, SelectedOutput >::iterator it = this->PhreeqcPtr->SelectedOutput_map.begin(); - for (; it != this->PhreeqcPtr->SelectedOutput_map.end(); ++it) + if (!this->SelectedOutputFileOnMap[(*ai).first]) { - ASSERT((*it).second.Get_punch_ostream() == 0); + ASSERT((*ai).second.Get_punch_ostream() == 0); } } - else - { - ASSERT(TRUE); - } if (this->PhreeqcPtr->pr.punch == FALSE) { @@ -1167,7 +1182,8 @@ void IPhreeqc::do_run(const char* sz_routine, std::istream* pis, PFN_PRERUN_CALL std::map< int, SelectedOutput >::iterator it = this->PhreeqcPtr->SelectedOutput_map.begin(); for (; it != this->PhreeqcPtr->SelectedOutput_map.end(); ++it) { - if (this->SelectedOutputFileOn && !(*it).second.Get_punch_ostream()) +// COMMENT: {9/12/2013 6:42:03 PM} if (this->SelectedOutputFileOn && !(*it).second.Get_punch_ostream()) + if (this->SelectedOutputFileOnMap[(*it).first] && !(*it).second.Get_punch_ostream()) { // // LoadDatabase @@ -1209,7 +1225,8 @@ void IPhreeqc::do_run(const char* sz_routine, std::istream* pis, PFN_PRERUN_CALL std::map< int, SelectedOutput >::iterator it = this->PhreeqcPtr->SelectedOutput_map.begin(); for (; it != this->PhreeqcPtr->SelectedOutput_map.end(); ++it) { - if (this->SelectedOutputFileOn) +// COMMENT: {9/12/2013 6:53:23 PM} if (this->SelectedOutputFileOn) + if (this->SelectedOutputFileOnMap[(*it).first]) { ASSERT((*it).second.Get_punch_ostream()); } @@ -1651,6 +1668,17 @@ void IPhreeqc::fpunchf_end_row(const char *format) this->EndRow(); } +bool IPhreeqc::get_sel_out_file_on(int n)const +{ + // if not found in list SelectedOutputFileOn is false + std::map< int, bool >::const_iterator ci = this->SelectedOutputFileOnMap.find(n); + if (ci != this->SelectedOutputFileOnMap.end()) + { + return (*ci).second; + } + return false; +} + bool IPhreeqc::punch_open(const char *file_name, std::ios_base::openmode mode, int n_user) { if (this->PhreeqcPtr->SelectedOutput_map[n_user].Get_have_punch_name() && @@ -1662,7 +1690,7 @@ bool IPhreeqc::punch_open(const char *file_name, std::ios_base::openmode mode, i { this->SelectedOutputFileNameMap[n_user] = this->sel_file_name(n_user); } - if (this->SelectedOutputFileOn) + if (this->get_sel_out_file_on(n_user)) { ASSERT(!this->SelectedOutputFileNameMap[n_user].empty()); this->PhreeqcPtr->SelectedOutput_map[n_user].Set_file_name(this->SelectedOutputFileNameMap[n_user]); diff --git a/src/IPhreeqc.h b/src/IPhreeqc.h index 4d324131..7ccbb133 100644 --- a/src/IPhreeqc.h +++ b/src/IPhreeqc.h @@ -18,7 +18,7 @@ * @endhtmlonly */ -/*! \brief Enumeration used to return error codes. +/*! @brief Enumeration used to return error codes. */ typedef enum { IPQ_OK = 0, /*!< Success */ @@ -37,7 +37,7 @@ extern "C" { /** * Accumlulate line(s) for input to phreeqc. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param line The line(s) to add for input to phreeqc. * @retval IPQ_OK Success * @retval IPQ_OUTOFMEMORY Out of memory @@ -56,10 +56,10 @@ extern "C" { * @endhtmlonly * * @par C Example: - * \include AccumulateLine.c + * @include AccumulateLine.c * * @par Fortran90 Example: - * see \ref GetDumpStringLine_f90 "GetDumpStringLine" + * see @ref GetDumpStringLine_f90 "GetDumpStringLine" */ IPQ_DLL_EXPORT IPQ_RESULT AccumulateLine(int id, const char *line); @@ -67,9 +67,9 @@ extern "C" { /** * Appends the given error message and increments the error count. * Internally used to create an error condition. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param error_msg The error message to display. - * @return The current error count if successful; otherwise a negative value indicates an error occured (see \ref IPQ_RESULT). + * @return The current error count if successful; otherwise a negative value indicates an error occured (see @ref IPQ_RESULT). * @see GetErrorString, GetErrorStringLine, GetErrorStringLineCount, OutputErrorString * @par Fortran90 Interface: * @htmlonly @@ -90,9 +90,9 @@ extern "C" { /** * Appends the given warning message and increments the warning count. * Internally used to create a warning condition. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param warn_msg The warning message to display. - * @return The current warning count if successful; otherwise a negative value indicates an error occured (see \ref IPQ_RESULT). + * @return The current warning count if successful; otherwise a negative value indicates an error occured (see @ref IPQ_RESULT). * @see GetWarningString, GetWarningStringLine, GetWarningStringLineCount, OutputWarningString * @par Fortran90 Interface: * @htmlonly @@ -112,7 +112,7 @@ extern "C" { /** - * Clears the accumulated input buffer. Input buffer is accumulated from calls to \ref AccumulateLine. + * Clears the accumulated input buffer. Input buffer is accumulated from calls to @ref AccumulateLine. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. * @see AccumulateLine, OutputAccumulatedLines, RunAccumulated @@ -133,7 +133,7 @@ extern "C" { /** * Create a new IPhreeqc instance. - * @return A non-negative value if successful; otherwise a negative value indicates an error occured (see \ref IPQ_RESULT). + * @return A non-negative value if successful; otherwise a negative value indicates an error occured (see @ref IPQ_RESULT). * @see DestroyIPhreeqc * @par Fortran90 Interface: * @htmlonly @@ -146,20 +146,20 @@ extern "C" { * * @endhtmlonly * - * \anchor CreateIPhreeqc_c + * @anchor CreateIPhreeqc_c * @par C Example: - * \include CreateIPhreeqc.c + * @include CreateIPhreeqc.c * - * \anchor CreateIPhreeqc_f90 + * @anchor CreateIPhreeqc_f90 * @par Fortran90 Example: - * \include F90CreateIPhreeqc.f90 + * @include F90CreateIPhreeqc.f90 */ IPQ_DLL_EXPORT int CreateIPhreeqc(void); /** * Release an IPhreeqc instance from memory. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @retval IPQ_OK Success * @retval IPQ_BADINSTANCE The given id is invalid. * @see CreateIPhreeqc @@ -176,17 +176,17 @@ extern "C" { * @endhtmlonly * * @par C Example: - * see \ref CreateIPhreeqc_c "CreateIPhreeqc" + * see @ref CreateIPhreeqc_c "CreateIPhreeqc" * * @par Fortran90 Example: - * see \ref CreateIPhreeqc_f90 "CreateIPhreeqc" + * see @ref CreateIPhreeqc_f90 "CreateIPhreeqc" */ IPQ_DLL_EXPORT IPQ_RESULT DestroyIPhreeqc(int id); /** * Retrieves the given component. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param n The zero-based index of the component to retrieve. * @return A null terminated string containing the given component. * Returns an empty string if n is out of range. @@ -205,22 +205,22 @@ extern "C" { * * @endhtmlonly * - * \anchor GetComponent_c + * @anchor GetComponent_c * @par C Example: - * \include GetComponent.c + * @include GetComponent.c * - * \anchor GetComponent_f90 + * @anchor GetComponent_f90 * @par Fortran90 Example: - * \include F90GetComponent.f90 + * @include F90GetComponent.f90 */ IPQ_DLL_EXPORT const char* GetComponent(int id, int n); /** * Retrieves the number of components in the current component list. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The current count of components. - * A negative value indicates an error occured (see \ref IPQ_RESULT). + * A negative value indicates an error occured (see @ref IPQ_RESULT). * @see GetComponent * @par Fortran90 Interface: * @htmlonly @@ -235,17 +235,18 @@ extern "C" { * @endhtmlonly * * @par C Example: - * see \ref GetComponent_c "GetComponent" + * see @ref GetComponent_c "GetComponent" * * @par Fortran90 Example: - * see \ref GetComponent_f90 "GetComponent" + * see @ref GetComponent_f90 "GetComponent" */ IPQ_DLL_EXPORT int GetComponentCount(int id); /** - * Sets the currently active SELECTED_OUTPUT user number for use in subsequent calls to GetSelectedOutputXXX routines. - * The initial setting after calling \ref CreateIPhreeqc is 1. - * @param id The instance id returned from \ref CreateIPhreeqc. + * Retrieves the currently active SELECTED_OUTPUT user number for use in subsequent calls to GetSelectedOutputXXX routines. + * The initial setting after calling @ref CreateIPhreeqc is @ref IPQ_INVALIDARG. After the first RunXXX method call, the initial setting + * is the lowest defined user number. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The current active SELECTED_OUTPUT user number. * @see GetNthSelectedOutputUserNumber, GetSelectedOutputCount, SetCurrentSelectedOutputUserNumber * @par Fortran90 Interface: @@ -265,7 +266,7 @@ extern "C" { /** * Retrieves the name of the dump file. This file name is used if not specified within DUMP input. * The default value is dump.id.out. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return filename The name of the file to write DUMP output to. * @see GetDumpFileOn, GetDumpString, GetDumpStringOn, GetDumpStringLine, GetDumpStringLineCount, SetDumpFileName, SetDumpFileOn, SetDumpStringOn * @par Fortran90 Interface: @@ -285,7 +286,7 @@ extern "C" { /** * Retrieves the current value of the dump file switch. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return Non-zero if output is written to the DUMP (dump.id.out if unspecified) file, 0 (zero) otherwise. * @see GetDumpString, GetDumpStringLine, GetDumpStringLineCount, GetDumpStringOn, SetDumpFileOn, SetDumpStringOn * @par Fortran90 Interface: @@ -305,27 +306,27 @@ extern "C" { /** * Retrieves the string buffer containing DUMP output. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return A null terminated string containing DUMP output. - * @pre \ref SetDumpStringOn must have been set to true (non-zero) in order to receive DUMP output. + * @pre @ref SetDumpStringOn must have been set to true (non-zero) in order to receive DUMP output. * @see GetDumpFileOn, GetDumpStringLine, GetDumpStringLineCount, SetDumpFileOn, GetDumpStringOn, SetDumpStringOn * @par Fortran90 Interface: - * Not implemented. (see \ref GetDumpStringLineCount, \ref GetDumpStringLine) + * Not implemented. (see @ref GetDumpStringLineCount, @ref GetDumpStringLine) * - * \anchor GetDumpString_c + * @anchor GetDumpString_c * @par C Example: - * \include GetDumpString.c + * @include GetDumpString.c */ IPQ_DLL_EXPORT const char* GetDumpString(int id); /** * Retrieves the given dump line. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given line. * Returns an empty string if n is out of range. - * @pre \ref SetDumpStringOn must have been set to true (non-zero). + * @pre @ref SetDumpStringOn must have been set to true (non-zero). * @see GetDumpFileOn, GetDumpString, GetDumpStringLineCount, GetDumpStringOn, SetDumpFileOn, SetDumpStringOn * @par Fortran90 Interface: * @htmlonly @@ -341,18 +342,18 @@ extern "C" { * * @endhtmlonly * - * \anchor GetDumpStringLine_f90 + * @anchor GetDumpStringLine_f90 * @par Fortran90 Example: - * \include F90GetDumpStringLine.f90 + * @include F90GetDumpStringLine.f90 */ IPQ_DLL_EXPORT const char* GetDumpStringLine(int id, int n); /** * Retrieves the number of lines in the current dump string buffer. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The number of lines. - * @pre \ref SetDumpStringOn must have been set to true (non-zero). + * @pre @ref SetDumpStringOn must have been set to true (non-zero). * @see GetDumpFileOn, GetDumpString, GetDumpStringLine, GetDumpStringOn, SetDumpFileOn, SetDumpStringOn * @par Fortran90 Interface: * @htmlonly @@ -367,14 +368,14 @@ extern "C" { * @endhtmlonly * * @par Fortran90 Example: - * see \ref GetDumpStringLine_f90 "GetDumpStringLine" + * see @ref GetDumpStringLine_f90 "GetDumpStringLine" */ IPQ_DLL_EXPORT int GetDumpStringLineCount(int id); /** * Retrieves the current value of the dump string switch. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return Non-zero if output defined by the DUMP keyword is stored, 0 (zero) otherwise. * @see GetDumpFileOn, GetDumpString, GetDumpStringLine, GetDumpStringLineCount, SetDumpFileOn, SetDumpStringOn * @par Fortran90 Interface: @@ -394,7 +395,7 @@ extern "C" { /** * Retrieves the name of the error file. The default name is phreeqc.id.err. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return filename The name of the error file. * @see GetErrorFileOn, GetErrorString, GetErrorStringOn, GetErrorStringLine, GetErrorStringLineCount, SetErrorFileName, SetErrorFileOn, SetErrorStringOn * @par Fortran90 Interface: @@ -414,7 +415,7 @@ extern "C" { /** * Retrieves the current value of the error file switch. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return Non-zero if errors are written to the phreeqc.id.err file, 0 (zero) otherwise. * @see SetErrorFileOn * @par Fortran90 Interface: @@ -433,23 +434,23 @@ extern "C" { /** - * Retrieves the error messages from the last call to \ref RunAccumulated, \ref RunFile, \ref RunString, \ref LoadDatabase, or \ref LoadDatabaseString. - * @param id The instance id returned from \ref CreateIPhreeqc. + * Retrieves the error messages from the last call to @ref RunAccumulated, @ref RunFile, @ref RunString, @ref LoadDatabase, or @ref LoadDatabaseString. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return A null terminated string containing error messages. * @see GetErrorFileOn, GetErrorStringLine, GetErrorStringLineCount, OutputErrorString, SetErrorFileOn * @par Fortran90 Interface: - * Not implemented. (see \ref GetErrorStringLineCount, \ref GetErrorStringLine, \ref OutputErrorString) + * Not implemented. (see @ref GetErrorStringLineCount, @ref GetErrorStringLine, @ref OutputErrorString) * - * \anchor GetErrorString_c + * @anchor GetErrorString_c * @par C Example: - * \include GetErrorString.c + * @include GetErrorString.c */ IPQ_DLL_EXPORT const char* GetErrorString(int id); /** * Retrieves the given error line. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given line of the error string buffer. * @see GetErrorFileOn, GetErrorString, GetErrorStringLineCount, OutputErrorString, SetErrorFileOn @@ -467,16 +468,16 @@ extern "C" { * * @endhtmlonly * - * \anchor GetErrorStringLine_f90 + * @anchor GetErrorStringLine_f90 * @par Fortran90 Example: - * \include F90GetErrorStringLine.f90 + * @include F90GetErrorStringLine.f90 */ IPQ_DLL_EXPORT const char* GetErrorStringLine(int id, int n); /** * Retrieves the number of lines in the current error string buffer. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The number of lines. * @see GetErrorFileOn, GetErrorString, GetErrorStringLine, OutputErrorString, SetErrorFileOn * @par Fortran90 Interface: @@ -495,7 +496,7 @@ extern "C" { /** * Retrieves the current value of the error string switch. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return Non-zero if output is stored, 0 (zero) otherwise. * @see GetErrorFileOn, GetErrorString, GetErrorStringLine, GetErrorStringLineCount, SetErrorFileOn, SetErrorStringOn * @par Fortran90 Interface: @@ -514,7 +515,7 @@ extern "C" { /** * Retrieves the name of the log file. The default name is phreeqc.id.log. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return filename The name of the log file. * @see GetLogFileOn, GetLogString, GetLogStringOn, GetLogStringLine, GetLogStringLineCount, SetLogFileName, SetLogFileOn, SetLogStringOn * @par Fortran90 Interface: @@ -534,7 +535,7 @@ extern "C" { /** * Retrieves the current value of the log file switch. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return Non-zero if log messages are written to the phreeqc.id.log file, 0 (zero) otherwise. * @remarks Logging must be enabled through the use of the KNOBS -logfile option in order to receive any log messages. * @see SetLogFileOn @@ -555,28 +556,28 @@ extern "C" { /** * Retrieves the string buffer containing log output. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return A null terminated string containing log output. * @remarks Logging must be enabled through the use of the KNOBS -logfile option in order to receive any log messages. - * @pre \ref SetLogStringOn must have been set to true (non-zero) in order to receive log output. + * @pre @ref SetLogStringOn must have been set to true (non-zero) in order to receive log output. * @see GetLogFileOn, GetLogStringLine, GetLogStringLineCount, SetLogFileOn, GetLogStringOn, SetLogStringOn * @par Fortran90 Interface: - * Not implemented. (see \ref GetLogStringLineCount, \ref GetLogStringLine) + * Not implemented. (see @ref GetLogStringLineCount, @ref GetLogStringLine) * - * \anchor GetLogString_c + * @anchor GetLogString_c * @par C Example: - * \include GetLogString.c + * @include GetLogString.c */ IPQ_DLL_EXPORT const char* GetLogString(int id); /** * Retrieves the given log line. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given line. * Returns an empty string if n is out of range. - * @pre \ref SetLogStringOn must have been set to true (non-zero). + * @pre @ref SetLogStringOn must have been set to true (non-zero). * @see GetLogFileOn, GetLogString, GetLogStringLineCount, GetLogStringOn, SetLogFileOn, SetLogStringOn * @par Fortran90 Interface: * @htmlonly @@ -592,17 +593,17 @@ extern "C" { * * @endhtmlonly * - * \anchor GetLogStringLine_f90 + * @anchor GetLogStringLine_f90 * @par Fortran90 Example: - * \include F90GetLogStringLine.f90 + * @include F90GetLogStringLine.f90 */ IPQ_DLL_EXPORT const char* GetLogStringLine(int id, int n); /** * Retrieves the number of lines in the current log string buffer. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The number of lines. - * @pre \ref SetLogStringOn must have been set to true (non-zero). + * @pre @ref SetLogStringOn must have been set to true (non-zero). * @see GetLogFileOn, GetLogString, GetLogStringLine, GetLogStringOn, SetLogFileOn, SetLogStringOn * @par Fortran90 Interface: * @htmlonly @@ -617,14 +618,14 @@ extern "C" { * @endhtmlonly * * @par Fortran90 Example: - * see \ref GetLogStringLine_f90 "GetLogStringLine" + * see @ref GetLogStringLine_f90 "GetLogStringLine" */ IPQ_DLL_EXPORT int GetLogStringLineCount(int id); /** * Retrieves the current value of the log string switch. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return Non-zero if output is stored, 0 (zero) otherwise. * @see GetLogFileOn, GetLogString, GetLogStringLine, GetLogStringLineCount, SetLogFileOn, SetLogStringOn * @par Fortran90 Interface: @@ -644,9 +645,10 @@ extern "C" { /** * Retrieves the nth user number of the currently defined SELECTED_OUTPUT keyword blocks. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The nth defined user number; a negative value indicates an error occured. * @see GetCurrentSelectedOutputUserNumber, GetSelectedOutputCount, SetCurrentSelectedOutputUserNumber + * @pre @ref RunAccumulated/@ref RunFile/@ref RunString must have been called and returned 0 (zero) errors. * @par Fortran90 Interface: * @htmlonly * (Note: N is one-based for the Fortran interface.) @@ -665,7 +667,7 @@ extern "C" { /** * Retrieves the name of the output file. The default name is phreeqc.id.out. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return filename The name of the output file. * @see GetOutputFileOn, GetOutputString, GetOutputStringOn, GetOutputStringLine, GetOutputStringLineCount, SetOutputFileName, SetOutputFileOn, SetOutputStringOn * @par Fortran90 Interface: @@ -685,7 +687,7 @@ extern "C" { /** * Retrieves the current value of the output file switch. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return Non-zero if output is written to the phreeqc.id.out file, 0 (zero) otherwise. * @see SetOutputFileOn * @par Fortran90 Interface: @@ -704,26 +706,26 @@ extern "C" { /** * Retrieves the string buffer containing phreeqc output. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return A null terminated string containing phreeqc output. - * @pre \ref SetOutputStringOn must have been set to true (non-zero) in order to receive phreeqc output. + * @pre @ref SetOutputStringOn must have been set to true (non-zero) in order to receive phreeqc output. * @see GetOutputFileOn, GetOutputStringLine, GetOutputStringLineCount, SetOutputFileOn, GetOutputStringOn, SetOutputStringOn * @par Fortran90 Interface: - * Not implemented. (see \ref GetOutputStringLineCount, \ref GetOutputStringLine) + * Not implemented. (see @ref GetOutputStringLineCount, @ref GetOutputStringLine) * - * \anchor GetOutputString_c + * @anchor GetOutputString_c * @par C Example: - * \include GetOutputString.c + * @include GetOutputString.c */ IPQ_DLL_EXPORT const char* GetOutputString(int id); /** * Retrieves the given output line. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given line. * Returns an empty string if n is out of range. - * @pre \ref SetOutputStringOn must have been set to true (non-zero). + * @pre @ref SetOutputStringOn must have been set to true (non-zero). * @see GetOutputFileOn, GetOutputString, GetOutputStringLineCount, GetOutputStringOn, SetOutputFileOn, SetOutputStringOn * @par Fortran90 Interface: * @htmlonly @@ -739,17 +741,17 @@ extern "C" { * * @endhtmlonly * - * \anchor GetOutputStringLine_f90 + * @anchor GetOutputStringLine_f90 * @par Fortran90 Example: - * \include F90GetOutputStringLine.f90 + * @include F90GetOutputStringLine.f90 */ IPQ_DLL_EXPORT const char* GetOutputStringLine(int id, int n); /** * Retrieves the number of lines in the current output string buffer. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The number of lines. - * @pre \ref SetOutputStringOn must have been set to true (non-zero). + * @pre @ref SetOutputStringOn must have been set to true (non-zero). * @see GetOutputFileOn, GetOutputString, GetOutputStringLine, GetOutputStringOn, SetOutputFileOn, SetOutputStringOn * @par Fortran90 Interface: * @htmlonly @@ -764,13 +766,13 @@ extern "C" { * @endhtmlonly * * @par Fortran90 Example: - * see \ref GetOutputStringLine_f90 "GetOutputStringLine" + * see @ref GetOutputStringLine_f90 "GetOutputStringLine" */ IPQ_DLL_EXPORT int GetOutputStringLineCount(int id); /** * Retrieves the current value of the output string switch. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return Non-zero if output is stored, 0 (zero) otherwise. * @see GetOutputFileOn, GetOutputString, GetOutputStringLine, GetOutputStringLineCount, SetOutputFileOn, SetOutputStringOn * @par Fortran90 Interface: @@ -790,7 +792,7 @@ extern "C" { /** * Retrieves the number of columns in the selected-output buffer. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The number of columns. * @see GetSelectedOutputFileOn, GetSelectedOutputRowCount, GetSelectedOutputValue, SetSelectedOutputFileOn * @par Fortran90 Interface: @@ -809,9 +811,10 @@ extern "C" { /** * Retrieves the count of SELECTED_OUTPUT blocks that are currently defined. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The number of SELECTED_OUTPUT blocks. * @see GetCurrentSelectedOutputUserNumber, GetNthSelectedOutputUserNumber, SetCurrentSelectedOutputUserNumber + * @pre @ref RunAccumulated/@ref RunFile/@ref RunString must have been called and returned 0 (zero) errors. * @par Fortran90 Interface: * @htmlonly * @@ -830,7 +833,7 @@ extern "C" { /** * Retrieves the name of the selected output file. This file name is used if not specified within SELECTED_OUTPUT input. * The default value is selected_n.id.out. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return filename The name of the file to write SELECTED_OUTPUT output to. * @see GetSelectedOutputFileOn, GetSelectedOutputString, GetSelectedOutputStringOn, GetSelectedOutputStringLine, GetSelectedOutputStringLineCount, SetSelectedOutputFileName, SetSelectedOutputFileOn, SetSelectedOutputStringOn * @par Fortran90 Interface: @@ -850,7 +853,7 @@ extern "C" { /** * Retrieves the selected-output file switch. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return Non-zero if output is written to the selected-output (selected_n.id.out if unspecified) file, 0 (zero) otherwise. * @see GetSelectedOutputColumnCount, GetSelectedOutputRowCount, GetSelectedOutputValue, SetSelectedOutputFileOn * @par Fortran90 Interface: @@ -870,27 +873,27 @@ extern "C" { /** * Retrieves the string buffer containing SELECTED_OUTPUT. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return A null terminated string containing SELECTED_OUTPUT. - * @pre \ref SetSelectedOutputStringOn must have been set to true (non-zero) in order to receive SELECTED_OUTPUT. + * @pre @ref SetSelectedOutputStringOn must have been set to true (non-zero) in order to receive SELECTED_OUTPUT. * @see GetSelectedOutputFileOn, GetSelectedOutputStringLine, GetSelectedOutputStringLineCount, SetSelectedOutputFileOn, GetSelectedOutputStringOn, SetSelectedOutputStringOn * @par Fortran90 Interface: - * Not implemented. (see \ref GetSelectedOutputStringLineCount, \ref GetSelectedOutputStringLine) + * Not implemented. (see @ref GetSelectedOutputStringLineCount, @ref GetSelectedOutputStringLine) * - * \anchor GetSelectedOutputString_c + * @anchor GetSelectedOutputString_c * @par C Example: - * \include GetSelectedOutputString.c + * @include GetSelectedOutputString.c */ IPQ_DLL_EXPORT const char* GetSelectedOutputString(int id); /** * Retrieves the given selected output line. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given line. * Returns an empty string if n is out of range. - * @pre \ref SetSelectedOutputStringOn must have been set to true (non-zero). + * @pre @ref SetSelectedOutputStringOn must have been set to true (non-zero). * @see GetSelectedOutputFileOn, GetSelectedOutputString, GetSelectedOutputStringLineCount, GetSelectedOutputStringOn, SetSelectedOutputFileOn, SetSelectedOutputStringOn * @par Fortran90 Interface: * @htmlonly @@ -906,18 +909,18 @@ extern "C" { * * @endhtmlonly * - * \anchor GetSelectedOutputStringLine_f90 + * @anchor GetSelectedOutputStringLine_f90 * @par Fortran90 Example: - * \include F90GetSelectedOutputStringLine.f90 + * @include F90GetSelectedOutputStringLine.f90 */ IPQ_DLL_EXPORT const char* GetSelectedOutputStringLine(int id, int n); /** * Retrieves the number of lines in the current selected output string buffer. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The number of lines. - * @pre \ref SetSelectedOutputStringOn must have been set to true (non-zero). + * @pre @ref SetSelectedOutputStringOn must have been set to true (non-zero). * @see GetSelectedOutputFileOn, GetSelectedOutputString, GetSelectedOutputStringLine, GetSelectedOutputStringOn, SetSelectedOutputFileOn, SetSelectedOutputStringOn * @par Fortran90 Interface: * @htmlonly @@ -932,14 +935,14 @@ extern "C" { * @endhtmlonly * * @par Fortran90 Example: - * see \ref GetSelectedOutputStringLine_f90 "GetSelectedOutputStringLine" + * see @ref GetSelectedOutputStringLine_f90 "GetSelectedOutputStringLine" */ IPQ_DLL_EXPORT int GetSelectedOutputStringLineCount(int id); /** * Retrieves the current value of the selected output string switch. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return Non-zero if output defined by the SELECTED_OUTPUT keyword is stored, 0 (zero) otherwise. * @see GetSelectedOutputFileOn, GetSelectedOutputString, GetSelectedOutputStringLine, GetSelectedOutputStringLineCount, SetSelectedOutputFileOn, SetSelectedOutputStringOn * @par Fortran90 Interface: @@ -959,7 +962,7 @@ extern "C" { /** * Retrieves the number of rows in the selected-output buffer. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The number of rows. * @see GetSelectedOutputFileOn, GetSelectedOutputColumnCount, GetSelectedOutputValue, SetSelectedOutputFileOn * @par Fortran90 Interface: @@ -978,11 +981,11 @@ extern "C" { /** - * Returns the \c VAR associated with the specified row and column. - * @param id The instance id returned from \ref CreateIPhreeqc. + * Returns the @c VAR associated with the specified row and column. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param row The row index. * @param col The column index. - * @param pVAR Pointer to the \c VAR to receive the requested data. + * @param pVAR Pointer to the @c VAR to receive the requested data. * @retval IPQ_OK Success. * @retval IPQ_INVALIDROW The given row is out of range. * @retval IPQ_INVALIDCOL The given column is out of range. @@ -1147,31 +1150,31 @@ Headings * * * @endhtmlonly - * @param ID The instance id returned from \ref CreateIPhreeqc. + * @param ID The instance id returned from @ref CreateIPhreeqc. * @param ROW The row index. * @param COL The column index. - * @param VTYPE Returns the variable type. See \ref VAR_TYPE. - * @param DVALUE Returns the numeric value when (VTYPE=\ref TT_DOUBLE) or (VTYPE=\ref TT_LONG). - * @param SVALUE Returns the string variable when (VTYPE=\ref TT_STRING). When (VTYPE=\ref TT_DOUBLE) or (VTYPE=\ref TT_LONG) this variable is filled with a string equivalent of DVALUE. - * \anchor GetSelectedOutputValue_c + * @param VTYPE Returns the variable type. See @ref VAR_TYPE. + * @param DVALUE Returns the numeric value when (VTYPE=@ref TT_DOUBLE) or (VTYPE=@ref TT_LONG). + * @param SVALUE Returns the string variable when (VTYPE=@ref TT_STRING). When (VTYPE=@ref TT_DOUBLE) or (VTYPE=@ref TT_LONG) this variable is filled with a string equivalent of DVALUE. + * @anchor GetSelectedOutputValue_c * @par C Example: - * \include GetSelectedOutputValue.c + * @include GetSelectedOutputValue.c * - * \anchor F90GetSelectedOutputValue_f90 + * @anchor F90GetSelectedOutputValue_f90 * @par Fortran90 Example: - * \include F90GetSelectedOutputValue.f90 + * @include F90GetSelectedOutputValue.f90 */ IPQ_DLL_EXPORT IPQ_RESULT GetSelectedOutputValue(int id, int row, int col, VAR* pVAR); /** * Returns the associated data with the specified row and column. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param row The row index. * @param col The column index. - * @param vtype Receives the variable type. See \ref VAR_TYPE. - * @param dvalue Receives the numeric value when (VTYPE=\ref TT_DOUBLE) or (VTYPE=\ref TT_LONG). - * @param svalue Receives the string variable when (VTYPE=\ref TT_STRING). When (VTYPE=\ref TT_DOUBLE) or (VTYPE=\ref TT_LONG) this variable is filled with a string equivalent of DVALUE. + * @param vtype Receives the variable type. See @ref VAR_TYPE. + * @param dvalue Receives the numeric value when (VTYPE=@ref TT_DOUBLE) or (VTYPE=@ref TT_LONG). + * @param svalue Receives the string variable when (VTYPE=@ref TT_STRING). When (VTYPE=@ref TT_DOUBLE) or (VTYPE=@ref TT_LONG) this variable is filled with a string equivalent of DVALUE. * @param svalue_length The length of the svalue buffer. * @retval IPQ_OK Success. * @retval IPQ_INVALIDROW The given row is out of range. @@ -1319,28 +1322,28 @@ Headings * @endhtmlonly - * \anchor GetSelectedOutputValue2_c + * @anchor GetSelectedOutputValue2_c * @par C Example: - * \include GetSelectedOutputValue2.c + * @include GetSelectedOutputValue2.c */ IPQ_DLL_EXPORT IPQ_RESULT GetSelectedOutputValue2(int id, int row, int col, int *vtype, double* dvalue, char* svalue, unsigned int svalue_length); /** - * Retrieves the warning messages from the last call to \ref RunAccumulated, \ref RunFile, \ref RunString, \ref LoadDatabase, or \ref LoadDatabaseString. - * @param id The instance id returned from \ref CreateIPhreeqc. + * Retrieves the warning messages from the last call to @ref RunAccumulated, @ref RunFile, @ref RunString, @ref LoadDatabase, or @ref LoadDatabaseString. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return A null terminated string containing warning messages. * @see GetWarningStringLine, GetWarningStringLineCount, OutputWarningString * @par Fortran90 Interface: - * Not implemented. (see \ref GetWarningStringLineCount, \ref GetWarningStringLine, \ref OutputWarningString) + * Not implemented. (see @ref GetWarningStringLineCount, @ref GetWarningStringLine, @ref OutputWarningString) */ IPQ_DLL_EXPORT const char* GetWarningString(int id); /** * Retrieves the given warning line. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given warning line message. * @see GetWarningString, GetWarningStringLineCount, OutputWarningString @@ -1363,7 +1366,7 @@ Headings /** * Retrieves the number of lines in the current warning string buffer. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The number of lines. * @see GetWarningString, GetWarningStringLine, OutputWarningString * @par Fortran90 Interface: @@ -1383,7 +1386,7 @@ Headings /** * Load the specified database file into phreeqc. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param filename The name of the phreeqc database to load. * The full path (or relative path with respect to the working directory) * must be given if the file is not in the current working directory. @@ -1405,17 +1408,17 @@ Headings * @endhtmlonly * * @par C Example: - * see \ref CreateIPhreeqc_c "CreateIPhreeqc" + * see @ref CreateIPhreeqc_c "CreateIPhreeqc" * * @par Fortran90 Example: - * see \ref CreateIPhreeqc_f90 "CreateIPhreeqc" + * see @ref CreateIPhreeqc_f90 "CreateIPhreeqc" */ IPQ_DLL_EXPORT int LoadDatabase(int id, const char* filename); /** * Load the specified string as a database into phreeqc. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param input String containing data to be used as the phreeqc database. * @return The number of errors encountered. * @see LoadDatabase @@ -1438,8 +1441,8 @@ Headings /** - * Output the accumulated input buffer to stdout. This input buffer can be run with a call to \ref RunAccumulated. - * @param id The instance id returned from \ref CreateIPhreeqc. + * Output the accumulated input buffer to stdout. This input buffer can be run with a call to @ref RunAccumulated. + * @param id The instance id returned from @ref CreateIPhreeqc. * @see AccumulateLine, ClearAccumulatedLines, RunAccumulated * @par Fortran90 Interface: * @htmlonly @@ -1453,14 +1456,14 @@ Headings * @endhtmlonly * * @par Fortran90 Example: - * see \ref GetDumpStringLine_f90 "GetDumpStringLine" + * see @ref GetDumpStringLine_f90 "GetDumpStringLine" */ IPQ_DLL_EXPORT void OutputAccumulatedLines(int id); /** * Output the error messages normally stored in the phreeqc.id.err file to stdout. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @see GetErrorFileOn, GetErrorStringLine, GetErrorStringLineCount, SetErrorFileOn * @par Fortran90 Interface: * @htmlonly @@ -1474,17 +1477,17 @@ Headings * @endhtmlonly * * @par C Example: - * see \ref GetComponent_c "GetComponent" + * see @ref GetComponent_c "GetComponent" * * @par Fortran90 Example: - * see \ref GetDumpStringLine_f90 "GetDumpStringLine" + * see @ref GetDumpStringLine_f90 "GetDumpStringLine" */ IPQ_DLL_EXPORT void OutputErrorString(int id); /** * Output the warning messages to stdout. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @see GetWarningString, GetWarningStringLine, GetWarningStringLineCount * @par Fortran90 Interface: * @htmlonly @@ -1501,13 +1504,13 @@ Headings /** - * Runs the input buffer as defined by calls to \ref AccumulateLine. - * @param id The instance id returned from \ref CreateIPhreeqc. + * Runs the input buffer as defined by calls to @ref AccumulateLine. + * @param id The instance id returned from @ref CreateIPhreeqc. * @return The number of errors encountered. * @see AccumulateLine, ClearAccumulatedLines, OutputAccumulatedLines, RunFile, RunString * @remarks - * The accumulated input is cleared at the next call to \ref AccumulateLine. - * @pre \ref LoadDatabase/\ref LoadDatabaseString must have been called and returned 0 (zero) errors. + * The accumulated input is cleared at the next call to @ref AccumulateLine. + * @pre @ref LoadDatabase/@ref LoadDatabaseString must have been called and returned 0 (zero) errors. * @par Fortran90 Interface: * @htmlonly * @@ -1521,18 +1524,18 @@ Headings * @endhtmlonly * * @par Fortran90 Example: - * see \ref GetDumpStringLine_f90 "GetDumpStringLine" + * see @ref GetDumpStringLine_f90 "GetDumpStringLine" */ IPQ_DLL_EXPORT int RunAccumulated(int id); /** * Runs the specified phreeqc input file. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param filename The name of the phreeqc input file to run. * @return The number of errors encountered during the run. * @see RunAccumulated, RunString - * @pre \ref LoadDatabase/\ref LoadDatabaseString must have been called and returned 0 (zero) errors. + * @pre @ref LoadDatabase/@ref LoadDatabaseString must have been called and returned 0 (zero) errors. * @par Fortran90 Interface: * @htmlonly * @@ -1547,21 +1550,21 @@ Headings * @endhtmlonly * * @par C Example: - * see \ref CreateIPhreeqc_c "CreateIPhreeqc" + * see @ref CreateIPhreeqc_c "CreateIPhreeqc" * * @par Fortran90 Example: - * see \ref CreateIPhreeqc_f90 "CreateIPhreeqc" + * see @ref CreateIPhreeqc_f90 "CreateIPhreeqc" */ IPQ_DLL_EXPORT int RunFile(int id, const char* filename); /** * Runs the specified string as input to phreeqc. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param input String containing phreeqc input. * @return The number of errors encountered during the run. * @see RunAccumulated, RunFile - * @pre \ref LoadDatabase/\ref LoadDatabaseString must have been called and returned 0 (zero) errors. + * @pre @ref LoadDatabase/@ref LoadDatabaseString must have been called and returned 0 (zero) errors. * @par Fortran90 Interface: * @htmlonly * @@ -1576,7 +1579,7 @@ Headings * @endhtmlonly * * @par C Example: - * see \ref GetDumpString_c "GetDumpString" + * see @ref GetDumpString_c "GetDumpString" * */ IPQ_DLL_EXPORT int RunString(int id, const char* input); @@ -1634,14 +1637,16 @@ Headings /** - * Sets the currently active SELECTED_OUTPUT user number for use in subsequent calls to GetSelectedOutputXXX routines. - * The initial setting after calling \ref CreateIPhreeqc is 1. - * @param id The instance id returned from \ref CreateIPhreeqc. + * Sets the currently active SELECTED_OUTPUT user number for use in subsequent calls to (GetSelectedOutputColumnCount/GetSelectedOutputFileName/) routines. + * The initial setting after calling @ref CreateIPhreeqc is IPQ_INVALIDARG. After the first (@ref RunAccumulated/@ref + * RunFile/@ref RunString) method call, the initial setting is the lowest defined user number. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param n The user number as specified in the SELECTED_OUTPUT block. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. * @retval IPQ_INVALIDARG The given user number is invalid. * @see GetSelectedOutputColumnCount, GetSelectedOutputFileName, GetSelectedOutputRowCount, GetSelectedOutputString, GetSelectedOutputStringLine, GetSelectedOutputStringLineCount, GetSelectedOutputValue + * @pre @ref RunAccumulated/@ref RunFile/@ref RunString must have been called and returned 0 (zero) errors. * @par Fortran90 Interface: * @htmlonly * @@ -1660,7 +1665,7 @@ Headings /** * Sets the name of the dump file. This file name is used if not specified within DUMP input. * The default value is dump.id.out. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param filename The name of the file to write DUMP output to. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. @@ -1683,8 +1688,8 @@ Headings /** * Sets the dump file switch on or off. This switch controls whether or not phreeqc writes to the dump file. - * The initial setting after calling \ref CreateIPhreeqc is off. - * @param id The instance id returned from \ref CreateIPhreeqc. + * The initial setting after calling @ref CreateIPhreeqc is off. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param dump_on If non-zero, turns on output to the DUMP (dump.id.out if unspecified) file; * if zero, turns off output to the DUMP file. * @retval IPQ_OK Success. @@ -1709,8 +1714,8 @@ Headings /** * Sets the dump string switch on or off. This switch controls whether or not the data normally sent * to the dump file are stored in a buffer for retrieval. The initial setting after calling - * \ref CreateIPhreeqc is off. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @ref CreateIPhreeqc is off. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param dump_string_on If non-zero, captures the output defined by the DUMP keyword into a string buffer; * if zero, output defined by the DUMP keyword is not captured to a string buffer. * @retval IPQ_OK Success. @@ -1730,16 +1735,16 @@ Headings * @endhtmlonly * * @par C Example: - * see \ref GetDumpString_c "GetDumpString" + * see @ref GetDumpString_c "GetDumpString" * * @par Fortran90 Example: - * see \ref GetDumpStringLine_f90 "GetDumpStringLine" + * see @ref GetDumpStringLine_f90 "GetDumpStringLine" */ IPQ_DLL_EXPORT IPQ_RESULT SetDumpStringOn(int id, int dump_string_on); /** * Sets the name of the error file. The default value is phreeqc.id.err. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param filename The name of the error file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. @@ -1762,8 +1767,8 @@ Headings /** * Sets the error file switch on or off. This switch controls whether or not * error messages are written to the phreeqc.id.err file. The initial setting after calling - * \ref CreateIPhreeqc is off. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @ref CreateIPhreeqc is off. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param error_on If non-zero, writes errors to the error file; if zero, no errors are written to the error file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. @@ -1786,8 +1791,8 @@ Headings /** * Sets the error string switch on or off. This switch controls whether or not the data normally sent * to the error file are stored in a buffer for retrieval. The initial setting after calling - * \ref CreateIPhreeqc is on. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @ref CreateIPhreeqc is on. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param error_string_on If non-zero, captures the error output into a string buffer; * if zero, error output is not captured to a string buffer. * @retval IPQ_OK Success. @@ -1807,16 +1812,16 @@ Headings * @endhtmlonly * * @par C Example: - * see \ref GetErrorString_c "GetErrorString" + * see @ref GetErrorString_c "GetErrorString" * * @par Fortran90 Example: - * see \ref GetErrorStringLine_f90 "GetErrorStringLine" + * see @ref GetErrorStringLine_f90 "GetErrorStringLine" */ IPQ_DLL_EXPORT IPQ_RESULT SetErrorStringOn(int id, int error_string_on); /** * Sets the name of the log file. The default value is phreeqc.id.log. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param filename The name of the log file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. @@ -1839,8 +1844,8 @@ Headings /** * Sets the log file switch on or off. This switch controls whether or not phreeqc * writes log messages to the phreeqc.id.log file. The initial setting after calling - * \ref CreateIPhreeqc is off. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @ref CreateIPhreeqc is off. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param log_on If non-zero, log messages are written to the log file; if zero, no log messages are written to the log file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. @@ -1865,8 +1870,8 @@ Headings /** * Sets the log string switch on or off. This switch controls whether or not the data normally sent * to the log file are stored in a buffer for retrieval. The initial setting after calling - * \ref CreateIPhreeqc is off. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @ref CreateIPhreeqc is off. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param log_string_on If non-zero, captures the log output into a string buffer; * if zero, log output is not captured to a string buffer. * @retval IPQ_OK Success. @@ -1886,10 +1891,10 @@ Headings * @endhtmlonly * * @par C Example: - * see \ref GetLogString_c "GetLogString" + * see @ref GetLogString_c "GetLogString" * * @par Fortran90 Example: - * see \ref GetLogStringLine_f90 "GetLogStringLine" + * see @ref GetLogStringLine_f90 "GetLogStringLine" */ IPQ_DLL_EXPORT IPQ_RESULT SetLogStringOn(int id, int log_string_on); @@ -1897,7 +1902,7 @@ Headings /** * Sets the name of the output file. This file name is used if not specified within DUMP input. * The default value is phreeqc.id.out. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param filename The name of the phreeqc output file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. @@ -1920,8 +1925,8 @@ Headings /** * Sets the output file switch on or off. This switch controls whether or not phreeqc * writes to the phreeqc.id.out file. This is the output normally generated - * when phreeqc is run. The initial setting after calling \ref CreateIPhreeqc is off. - * @param id The instance id returned from \ref CreateIPhreeqc. + * when phreeqc is run. The initial setting after calling @ref CreateIPhreeqc is off. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param output_on If non-zero, writes output to the output file; if zero, no output is written to the output file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. @@ -1944,8 +1949,8 @@ Headings /** * Sets the output string switch on or off. This switch controls whether or not the data normally sent * to the output file are stored in a buffer for retrieval. The initial setting after calling - * \ref CreateIPhreeqc is off. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @ref CreateIPhreeqc is off. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param output_string_on If non-zero, captures the phreeqc output into a string buffer; * if zero, phreeqc output is not captured to a string buffer. * @retval IPQ_OK Success. @@ -1965,10 +1970,10 @@ Headings * @endhtmlonly * * @par C Example: - * see \ref GetOutputString_c "GetOutputString" + * see @ref GetOutputString_c "GetOutputString" * * @par Fortran90 Example: - * see \ref GetOutputStringLine_f90 "GetOutputStringLine" + * see @ref GetOutputStringLine_f90 "GetOutputStringLine" */ IPQ_DLL_EXPORT IPQ_RESULT SetOutputStringOn(int id, int output_string_on); @@ -1976,7 +1981,7 @@ Headings /** * Sets the name of the selected output file. This file name is used if not specified within SELECTED_OUTPUT input. * The default value is selected_n.id.out. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param filename The name of the file to write SELECTED_OUTPUT output to. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. @@ -1999,12 +2004,13 @@ Headings /** * Sets the selected-output file switch on or off. This switch controls whether or not phreeqc writes output to - * the SELECTED_OUTPUT (selected_n.id.out if unspecified) file. The initial setting after calling \ref CreateIPhreeqc is off. - * @param id The instance id returned from \ref CreateIPhreeqc. + * the currently selected SELECTED_OUTPUT file (see @ref SetCurrentSelectedOutputUserNumber). The initial + * setting after calling @ref CreateIPhreeqc is off. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param sel_on If non-zero, writes output to the selected-output file; if zero, no output is written to the selected-output file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. - * @see GetSelectedOutputFileOn, GetSelectedOutputColumnCount, GetSelectedOutputRowCount, GetSelectedOutputValue + * @see GetSelectedOutputFileOn, GetSelectedOutputColumnCount, GetSelectedOutputRowCount, GetSelectedOutputValue, SetCurrentSelectedOutputUserNumber * @par Fortran90 Interface: * @htmlonly * @@ -2023,8 +2029,8 @@ Headings /** * Sets the selected output string switch on or off. This switch controls whether or not the data normally sent * to the selected output file are stored in a buffer for retrieval. The initial setting after calling - * \ref CreateIPhreeqc is off. - * @param id The instance id returned from \ref CreateIPhreeqc. + * @ref CreateIPhreeqc is off. + * @param id The instance id returned from @ref CreateIPhreeqc. * @param dump_string_on If non-zero, captures the output defined by the SELECTED_OUTPUT keyword into a string buffer; * if zero, output defined by the SELECTED_OUTPUT keyword is not captured to a string buffer. * @retval IPQ_OK Success. @@ -2044,10 +2050,10 @@ Headings * @endhtmlonly * * @par C Example: - * see \ref GetSelectedOutputString_c "GetSelectedOutputString" + * see @ref GetSelectedOutputString_c "GetSelectedOutputString" * * @par Fortran90 Example: - * see \ref GetSelectedOutputStringLine_f90 "GetSelectedOutputStringLine" + * see @ref GetSelectedOutputStringLine_f90 "GetSelectedOutputStringLine" */ IPQ_DLL_EXPORT IPQ_RESULT SetSelectedOutputStringOn(int id, int dump_string_on); diff --git a/src/IPhreeqc.hpp b/src/IPhreeqc.hpp index bd5183e7..a12038e6 100644 --- a/src/IPhreeqc.hpp +++ b/src/IPhreeqc.hpp @@ -47,9 +47,9 @@ class IPQ_DLL_EXPORT IPhreeqc : public PHRQ_io public: /** * Constructor. - * \anchor IPhreeqc_cpp + * @anchor IPhreeqc_cpp * @par Example: - * \include IPhreeqc.cpp + * @include IPhreeqc.cpp */ IPhreeqc(void); @@ -88,14 +88,14 @@ public: size_t AddWarning(const char* warning_msg); /** - * Clears the accumulated input buffer. Input buffer is accumulated from calls to \ref AccumulateLine. + * Clears the accumulated input buffer. Input buffer is accumulated from calls to @ref AccumulateLine. * @see AccumulateLine, GetAccumulatedLines, OutputAccumulatedLines, RunAccumulated */ void ClearAccumulatedLines(void); /** * Retrieve the accumulated input string. The accumulated input string can be run - * with \ref RunAccumulated. + * with @ref RunAccumulated. * @return The accumulated input string. * @see AccumulateLine, ClearAccumulatedLines, OutputAccumulatedLines, RunAccumulated */ @@ -126,7 +126,7 @@ public: /** * Retrieves the name of the dump file. This file name is used if not specified within DUMP input. - * The default value is dump.id.out, where id is obtained from \ref GetId. + * The default value is dump.id.out, where id is obtained from @ref GetId. * @return filename The name of the file to write DUMP output to. * @see GetDumpFileOn, GetDumpString, GetDumpStringOn, GetDumpStringLine, GetDumpStringLineCount, SetDumpFileName, SetDumpFileOn, SetDumpStringOn */ @@ -134,7 +134,7 @@ public: /** * Retrieves the current value of the dump file switch. - * @retval true Output is written to the DUMP (dump.id.out if unspecified, where id is obtained from \ref GetId) file. + * @retval true Output is written to the DUMP (dump.id.out if unspecified, where id is obtained from @ref GetId) file. * @retval false No output is written. * @see GetDumpStringLine, GetDumpStringLineCount, GetDumpStringOn, GetDumpString, SetDumpFileOn, SetDumpStringOn */ @@ -143,8 +143,8 @@ public: /** * Retrieves the string buffer containing DUMP output. * @return A null terminated string containing DUMP output. - * @pre - * \ref SetDumpStringOn must have been set to true in order to receive DUMP output. + * @pre + * @ref SetDumpStringOn must have been set to true in order to receive DUMP output. * @see GetDumpStringLine, GetDumpFileOn, GetDumpStringLineCount, GetDumpStringOn, SetDumpFileOn, SetDumpStringOn */ const char* GetDumpString(void)const; @@ -154,7 +154,7 @@ public: * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given line. * Returns an empty string if n is out of range. - * @pre \ref SetDumpStringOn must have been set to true. + * @pre @ref SetDumpStringOn must have been set to true. * @see GetDumpFileOn, GetDumpString, GetDumpStringLineCount, GetDumpStringOn, SetDumpFileOn, SetDumpStringOn */ const char* GetDumpStringLine(int n); @@ -162,7 +162,7 @@ public: /** * Retrieves the number of lines in the current dump string buffer. * @return The number of lines. - * @pre \ref SetDumpStringOn must have been set to true. + * @pre @ref SetDumpStringOn must have been set to true. * @see GetDumpFileOn, GetDumpString, GetDumpStringLine, GetDumpStringOn, SetDumpFileOn, SetDumpStringOn */ int GetDumpStringLineCount(void)const; @@ -176,7 +176,7 @@ public: bool GetDumpStringOn(void)const; /** - * Retrieves the name of the error file. The default value is phreeqc.id.err, where id is obtained from \ref GetId. + * Retrieves the name of the error file. The default value is phreeqc.id.err, where id is obtained from @ref GetId. * @return filename The name of the file to write to. * @see GetErrorFileOn, GetErrorString, GetErrorStringOn, GetErrorStringLine, GetErrorStringLineCount, SetErrorFileName, SetErrorFileOn, SetErrorStringOn */ @@ -184,14 +184,14 @@ public: /** * Retrieves the current value of the error file switch. - * @retval true Errors are written to the phreeqc.id.err (where id is obtained from \ref GetId) file. + * @retval true Errors are written to the phreeqc.id.err (where id is obtained from @ref GetId) file. * @retval false No errors are written. * @see SetErrorFileOn */ bool GetErrorFileOn(void)const; /** - * Retrieves the error messages from the last call to \ref RunAccumulated, \ref RunFile, \ref RunString, \ref LoadDatabase, or \ref LoadDatabaseString. + * Retrieves the error messages from the last call to @ref RunAccumulated, @ref RunFile, @ref RunString, @ref LoadDatabase, or @ref LoadDatabaseString. * @return A null terminated string containing error messages. * @see GetErrorStringLine, GetErrorStringLineCount, GetErrorFileOn, OutputErrorString, SetErrorFileOn */ @@ -228,7 +228,7 @@ public: int GetId(void)const; /** - * Retrieves the name of the log file. The default value is phreeqc.id.log, where id is obtained from \ref GetId. + * Retrieves the name of the log file. The default value is phreeqc.id.log, where id is obtained from @ref GetId. * @return filename The name of the file to write to. * @see GetLogFileOn, GetLogString, GetLogStringOn, GetLogStringLine, GetLogStringLineCount, SetLogFileName, SetLogFileOn, SetLogStringOn */ @@ -236,7 +236,7 @@ public: /** * Retrieves the current value of the log file switch. - * @retval true Log messages are written to the phreeqc.id.log (where id is obtained from \ref GetId) file. + * @retval true Log messages are written to the phreeqc.id.log (where id is obtained from @ref GetId) file. * @retval false No log messages are written. * @remarks * Logging must be enabled through the use of the KNOBS -logfile option in order to receive any log messages. @@ -248,7 +248,7 @@ public: * Retrieves the string buffer containing phreeqc log output. * @return A null terminated string containing log output. * @pre - * \ref SetLogStringOn must have been set to true and enabled through the use of the KNOBS -logfile option in order to receive any log messages. + * @ref SetLogStringOn must have been set to true and enabled through the use of the KNOBS -logfile option in order to receive any log messages. * @see GetLogStringLine, GetLogFileOn, GetLogStringLineCount, GetLogStringOn, SetLogFileOn, SetLogStringOn */ const char* GetLogString(void)const; @@ -258,7 +258,7 @@ public: * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given line. * Returns an empty string if n is out of range. - * @pre \ref SetLogStringOn must have been set to true and enabled through the use of the KNOBS -logfile option in order to receive any log messages. + * @pre @ref SetLogStringOn must have been set to true and enabled through the use of the KNOBS -logfile option in order to receive any log messages. * @see GetLogFileOn, GetLogString, GetLogStringLineCount, GetLogStringOn, SetLogFileOn, SetLogStringOn */ const char* GetLogStringLine(int n)const; @@ -266,7 +266,7 @@ public: /** * Retrieves the number of lines in the current log string buffer. * @return The number of lines. - * @pre \ref SetLogStringOn must have been set to true and enabled through the use of the KNOBS -logfile option in order to receive any log messages. + * @pre @ref SetLogStringOn must have been set to true and enabled through the use of the KNOBS -logfile option in order to receive any log messages. * @see GetLogFileOn, GetLogString, GetLogStringLine, GetLogStringOn, SetLogFileOn, SetLogStringOn */ int GetLogStringLineCount(void)const; @@ -288,7 +288,7 @@ public: int GetNthSelectedOutputUserNumber(int n)const; /** - * Retrieves the name of the output file. The default value is phreeqc.id.out, where id is obtained from \ref GetId. + * Retrieves the name of the output file. The default value is phreeqc.id.out, where id is obtained from @ref GetId. * @return filename The name of the file to write phreeqc output to. * @see GetOutputFileOn, GetOutputString, GetOutputStringOn, GetOutputStringLine, GetOutputStringLineCount, SetOutputFileName, SetOutputFileOn, SetOutputStringOn */ @@ -296,7 +296,7 @@ public: /** * Retrieves the current value of the output file switch. - * @retval true Output is written to the phreeqc.id.out (where id is obtained from \ref GetId) file. + * @retval true Output is written to the phreeqc.id.out (where id is obtained from @ref GetId) file. * @retval false No output is written. * @see GetOutputFileOn, GetOutputString, GetOutputStringOn, GetOutputStringLine, GetOutputStringLineCount, SetOutputFileName, SetOutputFileOn, SetOutputStringOn */ @@ -306,7 +306,7 @@ public: * Retrieves the string buffer containing phreeqc output. * @return A null terminated string containing phreeqc output. * @pre - * \ref SetOutputStringOn must have been set to true in order to receive output. + * @ref SetOutputStringOn must have been set to true in order to receive output. * @see GetOutputStringLine, GetOutputFileOn, GetOutputStringLineCount, GetOutputStringOn, SetOutputFileOn, SetOutputStringOn */ const char* GetOutputString(void)const; @@ -316,7 +316,7 @@ public: * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given line. * Returns an empty string if n is out of range. - * @pre \ref SetOutputStringOn must have been set to true. + * @pre @ref SetOutputStringOn must have been set to true. * @see GetOutputFileOn, GetOutputString, GetOutputStringLineCount, GetOutputStringOn, SetOutputFileOn, SetOutputStringOn */ const char* GetOutputStringLine(int n)const; @@ -324,7 +324,7 @@ public: /** * Retrieves the number of lines in the current output string buffer. * @return The number of lines. - * @pre \ref SetOutputStringOn must have been set to true. + * @pre @ref SetOutputStringOn must have been set to true. * @see GetOutputFileOn, GetOutputString, GetOutputStringLine, GetOutputStringOn, SetOutputFileOn, SetOutputStringOn */ int GetOutputStringLineCount(void)const; @@ -353,7 +353,7 @@ public: /** * Retrieves the name of the selected output file. This file name is used if not specified within SELECTED_OUTPUT input. - * The default value is selected_n.id.out, where id is obtained from \ref GetId. + * The default value is selected_n.id.out, where id is obtained from @ref GetId. * @return filename The name of the file to write to. * @see GetCurrentSelectedOutputUserNumber, GetSelectedOutputFileOn, GetSelectedOutputString, GetSelectedOutputStringOn, GetSelectedOutputStringLine, GetSelectedOutputStringLineCount, SetCurrentSelectedOutputUserNumber, SetSelectedOutputFileName, SetSelectedOutputFileOn, SetSelectedOutputStringOn */ @@ -361,7 +361,7 @@ public: /** * Retrieves the selected-output file switch. - * @retval true Output is written to the selected-output (selected_n.id.out if unspecified, where id is obtained from \ref GetId) file. + * @retval true Output is written to the selected-output (selected_n.id.out if unspecified, where id is obtained from @ref GetId) file. * @retval false No output is written. * @see GetSelectedOutputValue, GetSelectedOutputColumnCount, GetSelectedOutputRowCount, SetSelectedOutputFileOn */ @@ -375,10 +375,10 @@ public: int GetSelectedOutputRowCount(void)const; /** - * Retrieves the string buffer containing SELECTED_OUTPUT. + * Retrieves the string buffer containing SELECTED_OUTPUT for the currently selected user number(see @ref SetCurrentSelectedOutputUserNumber). * @return A null terminated string containing SELECTED_OUTPUT. * @pre - * \ref SetSelectedOutputStringOn must have been set to true in order to receive SELECTED_OUTPUT. + * @ref SetSelectedOutputStringOn must have been set to true in order to receive SELECTED_OUTPUT. * @see GetCurrentSelectedOutputUserNumber, GetSelectedOutputStringLine, GetSelectedOutputFileOn, GetSelectedOutputStringLineCount, GetSelectedOutputStringOn, GetSelectedOutputString, SetCurrentSelectedOutputUserNumber, SetSelectedOutputFileOn, SetSelectedOutputStringOn */ const char* GetSelectedOutputString(void)const; @@ -388,7 +388,7 @@ public: * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given line. * Returns an empty string if n is out of range. - * @pre \ref SetSelectedOutputStringOn must have been set to true. + * @pre @ref SetSelectedOutputStringOn must have been set to true. * @see GetCurrentSelectedOutputUserNumber, GetSelectedOutputFileOn, GetSelectedOutputString, GetSelectedOutputStringLineCount, GetSelectedOutputStringOn, SetCurrentSelectedOutputUserNumber, SetSelectedOutputFileOn, SetSelectedOutputStringOn */ const char* GetSelectedOutputStringLine(int n); @@ -396,7 +396,7 @@ public: /** * Retrieves the number of lines in the current selected output string buffer. * @return The number of lines. - * @pre \ref SetSelectedOutputStringOn must have been set to true. + * @pre @ref SetSelectedOutputStringOn must have been set to true. * @see GetCurrentSelectedOutputUserNumber, GetSelectedOutputFileOn, GetSelectedOutputString, GetSelectedOutputStringLine, GetSelectedOutputStringOn, SetCurrentSelectedOutputUserNumber, SetSelectedOutputFileOn, SetSelectedOutputStringOn */ int GetSelectedOutputStringLineCount(void)const; @@ -410,10 +410,10 @@ public: bool GetSelectedOutputStringOn(void)const; /** - * Returns the \c VAR associated with the specified row and column. + * Returns the @c VAR associated with the specified row and column. * @param row The row index. * @param col The column index. - * @param pVAR Pointer to the \c VAR to receive the requested data. + * @param pVAR Pointer to the @c VAR to receive the requested data. * @retval VR_OK Success. * @retval VR_INVALIDROW The given row is out of range. * @retval VR_INVALIDCOL The given column is out of range. @@ -567,9 +567,9 @@ public: * Returns the associated data with the specified row and column. * @param row The row index. * @param col The column index. - * @param vtype Receives the variable type. See \ref VAR_TYPE. - * @param dvalue Receives the numeric value when (VTYPE=\ref TT_DOUBLE) or (VTYPE=\ref TT_LONG). - * @param svalue Receives the string variable when (VTYPE=\ref TT_STRING). When (VTYPE=\ref TT_DOUBLE) or (VTYPE=\ref TT_LONG) this variable is filled with a string equivalent of DVALUE. + * @param vtype Receives the variable type. See @ref VAR_TYPE. + * @param dvalue Receives the numeric value when (VTYPE=@ref TT_DOUBLE) or (VTYPE=@ref TT_LONG). + * @param svalue Receives the string variable when (VTYPE=@ref TT_STRING). When (VTYPE=@ref TT_DOUBLE) or (VTYPE=@ref TT_LONG) this variable is filled with a string equivalent of DVALUE. * @param svalue_length The length of the svalue buffer. * @retval IPQ_OK Success. * @retval IPQ_INVALIDROW The given row is out of range. @@ -580,12 +580,12 @@ public: * @remarks * Row 0 contains the column headings to the selected_ouput. * @par Examples: - * See \ref GetSelectedOutputValue. + * See @ref GetSelectedOutputValue. */ VRESULT GetSelectedOutputValue2(int row, int col, int *vtype, double* dvalue, char* svalue, unsigned int svalue_length); /** - * Retrieves the warning messages from the last call to \ref RunAccumulated, \ref RunFile, \ref RunString, \ref LoadDatabase, or \ref LoadDatabaseString. + * Retrieves the warning messages from the last call to @ref RunAccumulated, @ref RunFile, @ref RunString, @ref LoadDatabase, or @ref LoadDatabaseString. * @return A null terminated string containing warning messages. * @see GetWarningStringLine, GetWarningStringLineCount, OutputWarningString */ @@ -636,13 +636,13 @@ public: int LoadDatabaseString(const char* input); /** - * Output the accumulated input buffer to stdout. The input buffer can be run with a call to \ref RunAccumulated. + * Output the accumulated input buffer to stdout. The input buffer can be run with a call to @ref RunAccumulated. * @see AccumulateLine, ClearAccumulatedLines, RunAccumulated */ void OutputAccumulatedLines(void); /** - * Output the error messages normally stored in the phreeqc.id.err (where id is obtained from \ref GetId) + * Output the error messages normally stored in the phreeqc.id.err (where id is obtained from @ref GetId) * file to stdout. * @see GetErrorStringLine, GetErrorStringLineCount, GetErrorFileOn, SetErrorFileOn */ @@ -655,13 +655,13 @@ public: void OutputWarningString(void); /** - * Runs the input buffer as defined by calls to \ref AccumulateLine. + * Runs the input buffer as defined by calls to @ref AccumulateLine. * @return The number of errors encountered. * @see AccumulateLine, ClearAccumulatedLines, OutputAccumulatedLines, RunFile, RunString * @remarks - * The accumulated input is cleared at the next call to \ref AccumulateLine. + * The accumulated input is cleared at the next call to @ref AccumulateLine. * @pre - * \ref LoadDatabase/\ref LoadDatabaseString must have been called and returned 0 (zero) errors. + * @ref LoadDatabase/@ref LoadDatabaseString must have been called and returned 0 (zero) errors. */ int RunAccumulated(void); @@ -671,7 +671,7 @@ public: * @return The number of errors encountered during the run. * @see RunAccumulated, RunString * @pre - * \ref LoadDatabase/\ref LoadDatabaseString must have been called and returned 0 (zero) errors. + * @ref LoadDatabase/@ref LoadDatabaseString must have been called and returned 0 (zero) errors. */ int RunFile(const char* filename); @@ -681,7 +681,7 @@ public: * @return The number of errors encountered during the run. * @see RunAccumulated, RunFile * @pre - * \ref LoadDatabase/\ref LoadDatabaseString must have been called and returned 0 (zero) errors. + * @ref LoadDatabase/@ref LoadDatabaseString must have been called and returned 0 (zero) errors. */ int RunString(const char* input); @@ -718,7 +718,7 @@ public: /** * Sets the name of the dump file. This file name is used if not specified within DUMP input. - * The default value is dump.id.out, where id is obtained from \ref GetId. + * The default value is dump.id.out, where id is obtained from @ref GetId. * @param filename The name of the file to write DUMP output to. * @see GetDumpFileName, GetDumpFileOn, GetDumpString, GetDumpStringOn, GetDumpStringLine, GetDumpStringLineCount, SetDumpStringOn */ @@ -726,7 +726,7 @@ public: /** * Sets the dump file switch on or off. This switch controls whether or not phreeqc writes to the DUMP (dump.id.out - * if unspecified, where id is obtained from \ref GetId) file. + * if unspecified, where id is obtained from @ref GetId) file. * The initial setting is false. * @param bValue If true, turns on output to the DUMP file; * if false, turns off output to the DUMP file. @@ -744,7 +744,7 @@ public: void SetDumpStringOn(bool bValue); /** - * Sets the name of the error file. The default value is phreeqc.id.err, where id is obtained from \ref GetId. + * Sets the name of the error file. The default value is phreeqc.id.err, where id is obtained from @ref GetId. * @param filename The name of the file to write error output to. * @see GetErrorFileName, GetErrorFileOn, GetErrorString, GetErrorStringOn, GetErrorStringLine, GetErrorStringLineCount, SetErrorFileOn, SetErrorStringOn */ @@ -752,7 +752,7 @@ public: /** * Sets the error file switch on or off. This switch controls whether or not - * error messages are written to the phreeqc.id.err (where id is obtained from \ref GetId) file. + * error messages are written to the phreeqc.id.err (where id is obtained from @ref GetId) file. * The initial setting is false. * @param bValue If true, writes errors to the error file; if false, no errors are written to the error file. * @see GetErrorStringLine, GetErrorStringLineCount, GetErrorFileOn, OutputErrorString @@ -768,7 +768,7 @@ public: void SetErrorStringOn(bool bValue); /** - * Sets the name of the log file. The default value is phreeqc.id.log, where id is obtained from \ref GetId. + * Sets the name of the log file. The default value is phreeqc.id.log, where id is obtained from @ref GetId. * @param filename The name of the file to write log output to. * @see GetLogFileName, GetLogFileOn, GetLogString, GetLogStringOn, GetLogStringLine, GetLogStringLineCount, SetLogFileOn, SetLogStringOn */ @@ -776,7 +776,7 @@ public: /** * Sets the log file switch on or off. This switch controls whether or not phreeqc - * writes log messages to the phreeqc.id.log (where id is obtained from \ref GetId) file. The initial setting is false. + * writes log messages to the phreeqc.id.log (where id is obtained from @ref GetId) file. The initial setting is false. * @param bValue If true, turns on output to the log file; if false, no log messages are written to the log file. * @remarks * Logging must be enabled through the use of the KNOBS -logfile option in order to receive any log messages. @@ -793,7 +793,7 @@ public: void SetLogStringOn(bool bValue); /** - * Sets the name of the output file. The default value is phreeqc.id.out, where id is obtained from \ref GetId. + * Sets the name of the output file. The default value is phreeqc.id.out, where id is obtained from @ref GetId. * @param filename The name of the file to write phreeqc output to. * @see GetOutputFileName, GetOutputFileOn, GetOutputString, GetOutputStringOn, GetOutputStringLine, GetOutputStringLineCount, SetOutputFileOn, SetOutputStringOn */ @@ -801,7 +801,7 @@ public: /** * Sets the output file switch on or off. This switch controls whether or not phreeqc - * writes to the phreeqc.id.out file (where id is obtained from \ref GetId). This is the output that is normally generated + * writes to the phreeqc.id.out file (where id is obtained from @ref GetId). This is the output that is normally generated * when phreeqc is run. The initial setting is false. * @param bValue If true, writes output to the output file; if false, no output is written to the output file. * @see GetOutputFileOn @@ -818,7 +818,7 @@ public: /** * Sets the name of the selected output file. This file name is used if not specified within SELECTED_OUTPUT input. - * The default value is selected_n.id.out, where id is obtained from \ref GetId. + * The default value is selected_n.id.out, where id is obtained from @ref GetId. * @param filename The name of the file to write SELECTED_OUTPUT output to. * @see GetSelectedOutputFileName, GetSelectedOutputFileOn, GetSelectedOutputString, GetSelectedOutputStringOn, GetSelectedOutputStringLine, GetSelectedOutputStringLineCount, SetSelectedOutputStringOn */ @@ -826,7 +826,7 @@ public: /** * Sets the selected-output file switch on or off. This switch controls whether or not phreeqc writes output to - * the SELECTED_OUTPUT (selected_n.id.out if unspecified, where id is obtained from \ref GetId) file. + * the SELECTED_OUTPUT (selected_n.id.out if unspecified, where id is obtained from @ref GetId) file. * The initial setting is false. * @param bValue If true, writes output to the selected-output file; if false, no output is written to the selected-output file. * @see GetSelectedOutputColumnCount, GetSelectedOutputFileOn, GetSelectedOutputRowCount, GetSelectedOutputValue @@ -873,6 +873,7 @@ protected: void update_errors(void); + bool get_sel_out_file_on(int n)const; std::string sel_file_name(int n_user); protected: @@ -884,7 +885,8 @@ protected: bool DatabaseLoaded; bool ClearAccumulated; bool UpdateComponents; - bool SelectedOutputFileOn; + std::map< int, bool > SelectedOutputFileOnMap; + bool OutputFileOn; bool LogFileOn; diff --git a/src/IPhreeqcLib.cpp b/src/IPhreeqcLib.cpp index fa77c7f7..3eef6fab 100644 --- a/src/IPhreeqcLib.cpp +++ b/src/IPhreeqcLib.cpp @@ -112,7 +112,13 @@ GetCurrentSelectedOutputUserNumber(int id) IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - return IPhreeqcPtr->GetCurrentSelectedOutputUserNumber(); + int n = IPhreeqcPtr->GetCurrentSelectedOutputUserNumber(); + switch (n) + { + case VR_INVALIDARG: + return IPQ_INVALIDARG; + } + return n; } return IPQ_BADINSTANCE; } diff --git a/unit/TestIPhreeqc.cpp b/unit/TestIPhreeqc.cpp index 6222b7c3..427e4693 100644 --- a/unit/TestIPhreeqc.cpp +++ b/unit/TestIPhreeqc.cpp @@ -3440,6 +3440,11 @@ void TestIPhreeqc::TestRunFileMultiPunchOn(void) IPhreeqc obj; CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("../database/phreeqc.dat")); + obj.SetCurrentSelectedOutputUserNumber(1); + obj.SetSelectedOutputFileOn(true); + obj.SetCurrentSelectedOutputUserNumber(2); + obj.SetSelectedOutputFileOn(true); + obj.SetCurrentSelectedOutputUserNumber(3); obj.SetSelectedOutputFileOn(true); CPPUNIT_ASSERT_EQUAL(0, obj.RunFile("multi_punch")); @@ -3491,8 +3496,16 @@ void TestIPhreeqc::TestRunFileMultiPunchSet(void) IPhreeqc obj; CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("../database/phreeqc.dat")); + + obj.SetCurrentSelectedOutputUserNumber(1); obj.SetSelectedOutputFileOn(true); + obj.SetCurrentSelectedOutputUserNumber(2); + obj.SetSelectedOutputFileOn(true); + obj.SetCurrentSelectedOutputUserNumber(3); + obj.SetSelectedOutputFileOn(true); + obj.SetSelectedOutputFileName(called.GetName().c_str()); + CPPUNIT_ASSERT_EQUAL(0, obj.RunFile("multi_punch")); CPPUNIT_ASSERT( called.VerifyMissing() ); @@ -3519,7 +3532,14 @@ void TestIPhreeqc::TestRunFileMultiPunchNoSet(void) CPPUNIT_ASSERT( unset3.RemoveExisting() ); CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("../database/phreeqc.dat")); + + obj.SetCurrentSelectedOutputUserNumber(1); obj.SetSelectedOutputFileOn(true); + obj.SetCurrentSelectedOutputUserNumber(2); + obj.SetSelectedOutputFileOn(true); + obj.SetCurrentSelectedOutputUserNumber(3); + obj.SetSelectedOutputFileOn(true); + obj.SetSelectedOutputFileName(set.GetName().c_str()); CPPUNIT_ASSERT_EQUAL(0, obj.RunFile("multi_punch_no_set")); @@ -3930,7 +3950,7 @@ void TestIPhreeqc::TestMultiPunchCSelectedOutput(void) CPPUNIT_ASSERT_EQUAL(VR_INVALIDCOL, obj.GetSelectedOutputValue( 0, c, &var)); CPPUNIT_ASSERT_EQUAL(TT_ERROR, var.type); CPPUNIT_ASSERT_EQUAL(VR_INVALIDCOL, var.vresult); CPPUNIT_ASSERT_EQUAL(VR_INVALIDARG, obj.SetCurrentSelectedOutputUserNumber(-1)); - CPPUNIT_ASSERT_EQUAL(VR_INVALIDARG, obj.SetCurrentSelectedOutputUserNumber(0)); + CPPUNIT_ASSERT_EQUAL(VR_OK, obj.SetCurrentSelectedOutputUserNumber(0)); } void TestIPhreeqc::TestGetSelectedOutputCount(void) @@ -3990,6 +4010,12 @@ void TestIPhreeqc::TestGetCurrentSelectedOutputUserNumber(void) // edge cases CPPUNIT_ASSERT_EQUAL(VR_INVALIDARG, obj.SetCurrentSelectedOutputUserNumber(-1)); CPPUNIT_ASSERT_EQUAL(3, obj.GetCurrentSelectedOutputUserNumber()); - CPPUNIT_ASSERT_EQUAL(VR_INVALIDARG, obj.SetCurrentSelectedOutputUserNumber(0)); - CPPUNIT_ASSERT_EQUAL(3, obj.GetCurrentSelectedOutputUserNumber()); + CPPUNIT_ASSERT_EQUAL(VR_OK, obj.SetCurrentSelectedOutputUserNumber(0)); + CPPUNIT_ASSERT_EQUAL(0, obj.GetCurrentSelectedOutputUserNumber()); + + // unload database + CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("../database/phreeqc.dat")); + CPPUNIT_ASSERT_EQUAL(1, obj.GetCurrentSelectedOutputUserNumber()); + CPPUNIT_ASSERT_EQUAL(0, obj.GetSelectedOutputCount()); + } diff --git a/unit/TestIPhreeqcLib.cpp b/unit/TestIPhreeqcLib.cpp index 5d4287e3..4cca28fc 100644 --- a/unit/TestIPhreeqcLib.cpp +++ b/unit/TestIPhreeqcLib.cpp @@ -4287,7 +4287,8 @@ void TestIPhreeqcLib::TestMultiPunchCSelectedOutput(void) CPPUNIT_ASSERT_EQUAL(IPQ_INVALIDCOL, ::GetSelectedOutputValue(id, 0, c, &var)); CPPUNIT_ASSERT_EQUAL(TT_ERROR, var.type); CPPUNIT_ASSERT_EQUAL(VR_INVALIDCOL, var.vresult); CPPUNIT_ASSERT_EQUAL(IPQ_INVALIDARG, ::SetCurrentSelectedOutputUserNumber(id, -1)); - CPPUNIT_ASSERT_EQUAL(IPQ_INVALIDARG, ::SetCurrentSelectedOutputUserNumber(id, 0)); + CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::SetCurrentSelectedOutputUserNumber(id, 0)); + CPPUNIT_ASSERT_EQUAL(0, ::GetCurrentSelectedOutputUserNumber(id)); } void TestIPhreeqcLib::TestGetSelectedOutputCount(void) @@ -4348,6 +4349,10 @@ void TestIPhreeqcLib::TestGetCurrentSelectedOutputUserNumber(void) // edge cases CPPUNIT_ASSERT_EQUAL(IPQ_INVALIDARG, ::SetCurrentSelectedOutputUserNumber(id, -1)); CPPUNIT_ASSERT_EQUAL(3, ::GetCurrentSelectedOutputUserNumber(id)); - CPPUNIT_ASSERT_EQUAL(IPQ_INVALIDARG, ::SetCurrentSelectedOutputUserNumber(id, 0)); - CPPUNIT_ASSERT_EQUAL(3, ::GetCurrentSelectedOutputUserNumber(id)); + CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::SetCurrentSelectedOutputUserNumber(id, 0)); + CPPUNIT_ASSERT_EQUAL(0, ::GetCurrentSelectedOutputUserNumber(id)); + + // unload database + CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase(id, "../database/phreeqc.dat")); + CPPUNIT_ASSERT_EQUAL(1, ::GetCurrentSelectedOutputUserNumber(id)); }