mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-15 16:18:22 +01:00
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:
parent
650e24ed1b
commit
714570975e
32
IPhreeqc.cpp
32
IPhreeqc.cpp
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user