Bug Fix, working around copy oper^ator for ifstream.
This commit is contained in:
@@ -55,19 +55,19 @@ Stacked2D_FuncContainer calc_SDCS_Stacked() {
|
||||
}
|
||||
|
||||
|
||||
void BED_SDCS_calculator::export_SDCS_Edge (std::string exportPath) {
|
||||
void BED_SDCS_calculator::export_SDCS_Edge (std::string export_path) {
|
||||
Edge2D_FuncContainer BED_edge_SDCS = calc_SDCS_Edge();
|
||||
BED_edge_SDCS.exportToFile(exportPath);
|
||||
BED_edge_SDCS.exportToFile(export_path);
|
||||
}
|
||||
|
||||
void BED_SDCS_calculator::export_SDCS_Average (std::string exportPath) {
|
||||
void BED_SDCS_calculator::export_SDCS_Average (std::string export_path) {
|
||||
Average2D_FuncContainer BED_average_SDCS = calc_SDCS_Average();
|
||||
BED_average_SDCS.exportToFile(exportPath);
|
||||
BED_average_SDCS.exportToFile(export_path);
|
||||
}
|
||||
|
||||
void BED_SDCS_calculator::export_SDCS_Stacked (std::string exportPath) {
|
||||
void BED_SDCS_calculator::export_SDCS_Stacked (std::string export_path) {
|
||||
Stacked2D_FuncContainer BED_stacked_SDCS = calc_SDCS_Stacked();
|
||||
BED_stacked_SDCS.exportToFile(exportPath);
|
||||
BED_stacked_SDCS.exportToFile(export_path);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ public:
|
||||
static void set_defaultExportPath(std::string new_defaultExportPath);
|
||||
|
||||
|
||||
static void export_SDCS_Edge (std::string exportPath);
|
||||
static void export_SDCS_Average (std::string exportPath);
|
||||
static void export_SDCS_Stacked (std::string exportPath);
|
||||
static void export_SDCS_Edge (std::string export_path);
|
||||
static void export_SDCS_Average (std::string export_path);
|
||||
static void export_SDCS_Stacked (std::string export_path);
|
||||
|
||||
static void export_SDCS_Edge ();
|
||||
static void export_SDCS_Average ();
|
||||
|
||||
@@ -46,13 +46,13 @@ Average1D_FuncContainer BED_TCS_calculator::calc_TCS_Average() {
|
||||
return (BED_average_TCS);
|
||||
}
|
||||
|
||||
void BED_TCS_calculator::export_TCS_Edge (std::string exportPath) {
|
||||
void BED_TCS_calculator::export_TCS_Edge (std::string export_path) {
|
||||
Edge1D_FuncContainer BED_edge_TCS = calc_TCS_Edge();
|
||||
BED_edge_TCS.exportToFile(exportPath);
|
||||
BED_edge_TCS.exportToFile(export_path);
|
||||
}
|
||||
void BED_TCS_calculator::export_TCS_Average (std::string exportPath) {
|
||||
void BED_TCS_calculator::export_TCS_Average (std::string export_path) {
|
||||
Average1D_FuncContainer BED_average_TCS = calc_TCS_Average();
|
||||
BED_average_TCS.exportToFile(exportPath);
|
||||
BED_average_TCS.exportToFile(export_path);
|
||||
}
|
||||
|
||||
void BED_TCS_calculator::export_TCS_Edge () {
|
||||
|
||||
@@ -30,8 +30,8 @@ public:
|
||||
|
||||
static void set_defaultExportPath(std::string new_defaultExportPath);
|
||||
|
||||
static void export_TCS_Edge (std::string exportPath);
|
||||
static void export_TCS_Average (std::string exportPath);
|
||||
static void export_TCS_Edge (std::string export_path);
|
||||
static void export_TCS_Average (std::string export_path);
|
||||
|
||||
static void export_TCS_Edge ();
|
||||
static void export_TCS_Average ();
|
||||
|
||||
@@ -55,7 +55,6 @@ private:
|
||||
public:
|
||||
void importFromCSV(std::string load_path);
|
||||
private:
|
||||
std::ifstream createImportStream(const std::string &load_path) ;
|
||||
void addPointFromLine(const std::string &lineFromFile);
|
||||
|
||||
public:
|
||||
@@ -65,9 +64,8 @@ private:
|
||||
template <typename T> void rec_addPoint (std::map<double,T> *subMap, std::deque<double> pointIn);
|
||||
|
||||
public:
|
||||
void exportToCSV(std::string exportPath) ;
|
||||
void exportToCSV(std::string export_path) ;
|
||||
private:
|
||||
std::ofstream createExportStream(const std::string &exportPath) ;
|
||||
std::string getExportFileHeader() ;
|
||||
void rec_exportToCSV (const dim1Map &subMap, std::ofstream &exportStream, std::string preset = "") ;
|
||||
template <typename T> void rec_exportToCSV(const T &subMap, std::ofstream &exportStream, std::string preset = "") ;
|
||||
@@ -115,7 +113,13 @@ void Base_Container<T_Map>::inc_Count(std::map<double,T> *subMap, int *count) {
|
||||
|
||||
template <class T_Map>
|
||||
void Base_Container<T_Map>::importFromCSV(std::string load_path) {
|
||||
std::ifstream importStream = createImportStream(load_path);
|
||||
std::ifstream importStream(load_path);
|
||||
if (!importStream.good()) {
|
||||
std::stringstream ss;
|
||||
ss<<"Base_Container::readFromCSV: Could not open file. \n loadFilePath= "<<load_path<<"\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
|
||||
std::string lineFromFile;
|
||||
while (getline(importStream, lineFromFile)) {
|
||||
removeLeadingWhites(lineFromFile);
|
||||
@@ -128,16 +132,6 @@ void Base_Container<T_Map>::importFromCSV(std::string load_path) {
|
||||
importStream.close();
|
||||
}
|
||||
|
||||
template <class T_Map>
|
||||
std::ifstream Base_Container<T_Map>::createImportStream(const std::string &load_path) {
|
||||
std::ifstream importStream(load_path);
|
||||
if (!importStream.good()) {
|
||||
std::stringstream ss;
|
||||
ss<<"Base_Container::readFromCSV: Could not open file. \n loadFilePath= "<<load_path<<"\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
return(importStream);
|
||||
}
|
||||
|
||||
template <class T_Map>
|
||||
void Base_Container<T_Map>::addPointFromLine(const std::string &lineFromFile) {
|
||||
@@ -199,24 +193,20 @@ void Base_Container<T_Map>::rec_addPoint (std::map<double,T> *subMap, std::deque
|
||||
|
||||
|
||||
template <class T_Map>
|
||||
void Base_Container<T_Map>::exportToCSV(std::string exportPath) {
|
||||
void Base_Container<T_Map>::exportToCSV(std::string export_path) {
|
||||
checkEmpty();
|
||||
std::ofstream exportStream = createExportStream(exportPath);
|
||||
std::ofstream exportStream(export_path);
|
||||
if (!exportStream.good()) {
|
||||
std::stringstream ss;
|
||||
ss<<"Base_Container::exportToCSV: Could not open file.\nexportFilePath\t "<<export_path<<"\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
|
||||
exportStream<<getExportFileHeader();
|
||||
rec_exportToCSV(Map, exportStream, "");
|
||||
exportStream.close();
|
||||
}
|
||||
|
||||
template <class T_Map>
|
||||
std::ofstream Base_Container<T_Map>::createExportStream(const std::string &exportPath) {
|
||||
std::ofstream exportStream(exportPath);
|
||||
if (!exportStream.good()) {
|
||||
std::stringstream ss;
|
||||
ss<<"Base_Container::exportToCSV: Could not open file.\nexportFilePath\t "<<exportPath<<"\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
return(exportStream);
|
||||
}
|
||||
|
||||
template <class T_Map>
|
||||
std::string Base_Container<T_Map>::getExportFileHeader() {
|
||||
|
||||
Reference in New Issue
Block a user