mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
fixed problem with formatting size_t
git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@8680 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
f7f5d13515
commit
89ec1151d6
35
IPhreeqc.cpp
35
IPhreeqc.cpp
@ -13,12 +13,6 @@
|
|||||||
#include "phreeqcpp/SelectedOutput.h" // SelectedOutput
|
#include "phreeqcpp/SelectedOutput.h" // SelectedOutput
|
||||||
#include "dumper.h" // dumper
|
#include "dumper.h" // dumper
|
||||||
|
|
||||||
const char OUTPUT_FILENAME_FORMAT[] = "phreeqc.%d.out";
|
|
||||||
const char ERROR_FILENAME_FORMAT[] = "phreeqc.%d.err";
|
|
||||||
const char LOG_FILENAME_FORMAT[] = "phreeqc.%d.log";
|
|
||||||
const char PUNCH_FILENAME_FORMAT[] = "selected_%d.%d.out";
|
|
||||||
const char DUMP_FILENAME_FORMAT[] = "dump.%d.out";
|
|
||||||
|
|
||||||
// statics
|
// statics
|
||||||
std::map<size_t, IPhreeqc*> IPhreeqc::Instances;
|
std::map<size_t, IPhreeqc*> IPhreeqc::Instances;
|
||||||
size_t IPhreeqc::InstancesIndex = 0;
|
size_t IPhreeqc::InstancesIndex = 0;
|
||||||
@ -67,18 +61,12 @@ IPhreeqc::IPhreeqc(void)
|
|||||||
|
|
||||||
this->SelectedOutputFileOnMap[1] = false;
|
this->SelectedOutputFileOnMap[1] = false;
|
||||||
this->SelectedOutputFileNameMap[1] = this->sel_file_name(1);
|
this->SelectedOutputFileNameMap[1] = this->sel_file_name(1);
|
||||||
|
|
||||||
|
this->OutputFileName = create_file_name("phreeqc", "out");
|
||||||
|
this->ErrorFileName = create_file_name("phreeqc", "err");
|
||||||
|
this->LogFileName = create_file_name("phreeqc", "log");
|
||||||
|
|
||||||
::sprintf(buffer, OUTPUT_FILENAME_FORMAT, this->Index);
|
this->DumpFileName = create_file_name("dump", "out");
|
||||||
this->OutputFileName = buffer;
|
|
||||||
|
|
||||||
::sprintf(buffer, ERROR_FILENAME_FORMAT, this->Index);
|
|
||||||
this->ErrorFileName = buffer;
|
|
||||||
|
|
||||||
::sprintf(buffer, LOG_FILENAME_FORMAT, this->Index);
|
|
||||||
this->LogFileName = buffer;
|
|
||||||
|
|
||||||
::sprintf(buffer, DUMP_FILENAME_FORMAT, this->Index);
|
|
||||||
this->DumpFileName = buffer;
|
|
||||||
this->PhreeqcPtr->dump_info.Set_file_name(this->DumpFileName);
|
this->PhreeqcPtr->dump_info.Set_file_name(this->DumpFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1811,7 +1799,14 @@ bool IPhreeqc::output_open(const char *file_name, std::ios_base::openmode mode)
|
|||||||
|
|
||||||
std::string IPhreeqc::sel_file_name(int n_user)
|
std::string IPhreeqc::sel_file_name(int n_user)
|
||||||
{
|
{
|
||||||
char buffer[80];
|
std::ostringstream oss;
|
||||||
::sprintf(buffer, PUNCH_FILENAME_FORMAT, n_user, this->Index);
|
oss << "selected_" << n_user << "." << this->Index << ".out";
|
||||||
return std::string(buffer);
|
return oss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string IPhreeqc::create_file_name(const char *prefix, const char *suffix)
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << prefix << "." << this->Index << "." << suffix;
|
||||||
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user