#include "UNV_Utilities.hxx"
using namespace std;
+using namespace UNV;
namespace{
typedef std::vector<size_t> TConnect;
}
UNV2417::Write(out_stream,aDataSet2417);
}*/
+
+ out_stream.flush();
+ out_stream.close();
+ if (!check_file(myFile))
+ EXCEPTION(runtime_error,"ERROR: Output file not good.");
}
catch(const std::exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.what());
#include <iostream>
#include <sstream>
+#include <fstream>
#include <string>
#include <stdexcept>
#include <cassert>
}
return atof (number.c_str());
}
+
+ /**
+ * @returns \p false when file is incorrect, \p true otherwise.
+ * Check file with name \p theFileName for correct terminate
+ * string, i.e. the next to the last line is equal to " -1",
+ */
+ inline bool check_file(const std::string theFileName)
+ {
+ std::ifstream in_stream(theFileName.c_str());
+ if (!in_stream)
+ return false;
+ std::string olds, news;
+ while (!in_stream.eof()){
+ olds = news;
+ std::getline(in_stream, news, '\n');
+ }
+ return (olds == " -1");
+ }
};