moved list_components from class_main.cpp to Phreeqc.cpp

git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/branches/class@4173 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
Scott R Charlton 2010-03-18 23:57:42 +00:00
parent 650e24ed1b
commit 714570975e
2 changed files with 34 additions and 0 deletions

View File

@ -180,6 +180,32 @@ GetErrorLine(int n)
return IPhreeqc::LibraryInstance()->GetErrorLine(n);
}
int
GetComponentCount(void)
{
return (int)IPhreeqc::LibraryInstance()->ListComponents().size();
}
const char*
GetComponent(int n)
{
static const char empty[] = "";
static std::string comp;
std::list< std::string > comps = IPhreeqc::LibraryInstance()->ListComponents();
if (n < 0 || n >= (int)comps.size())
{
return empty;
}
std::list< std::string >::iterator it = comps.begin();
for(int i = 0; i < n; ++i)
{
++it;
}
comp = (*it);
return comp.c_str();
}
IPhreeqc::IPhreeqc(void)
: Phreeqc()
, ErrorReporter(0)
@ -1787,3 +1813,9 @@ void IPhreeqc::update_errors(void)
this->ErrorLines.push_back(line);
}
}
std::list< std::string > IPhreeqc::ListComponents(void)
{
std::list< std::string > comps;
this->list_components(comps);
return comps;
}

View File

@ -35,6 +35,8 @@ public:
int GetErrorLineCount(void)const;
const char* GetErrorLine(int n);
std::list< std::string > ListComponents(void);
VRESULT AccumulateLine(const char *line);
void SetDumpOn(bool bValue);