WSL/SLF GitLab Repository

Commit e5b18035 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

More fixes for Visual C++. It could now work!

parent b4833e45
......@@ -155,32 +155,32 @@ void Date::setTimeZone(const double& in_timezone, const bool& in_dst) {
/**
* @brief Set date by elements.
* All values are checked for plausibility.
* @param _year in 4 digits
* @param _month please keep in mind that first month of the year is 1 (ie: not 0!)
* @param _day please keep in mind that first day of the month is 1 (ie: not 0!)
* @param _hour
* @param _minute
* @param _timezone timezone as an offset to GMT (in hours, optional)
* @param _dst is it DST? (default: no)
* @param i_year in 4 digits
* @param i_month please keep in mind that first month of the year is 1 (ie: not 0!)
* @param i_day please keep in mind that first day of the month is 1 (ie: not 0!)
* @param i_hour
* @param i_minute
* @param i_timezone timezone as an offset to GMT (in hours, optional)
* @param i_dst is it DST? (default: no)
*/
void Date::setDate(const int& _year, const int& _month, const int& _day, const int& _hour, const int& _minute, const double& _timezone, const bool& _dst)
void Date::setDate(const int& i_year, const int& i_month, const int& i_day, const int& i_hour, const int& i_minute, const double& i_timezone, const bool& i_dst)
{
plausibilityCheck(_year, _month, _day, _hour, _minute);
plausibilityCheck(i_year, i_month, i_day, i_hour, i_minute);
undef = false;
setTimeZone(_timezone, _dst);
setTimeZone(i_timezone, i_dst);
if(timezone==0 && dst==false) {
//data is GMT and no DST
//setting values and computing GMT julian date
gmt_year = _year;
gmt_month = _month;
gmt_day = _day;
gmt_hour = _hour;
gmt_minute = _minute;
gmt_year = i_year;
gmt_month = i_month;
gmt_day = i_day;
gmt_hour = i_hour;
gmt_minute = i_minute;
gmt_julian = calculateJulianDate(gmt_year, gmt_month, gmt_day, gmt_hour, gmt_minute);
} else {
//computing local julian date
const double local_julian = calculateJulianDate(_year, _month, _day, _hour, _minute);
const double local_julian = calculateJulianDate(i_year, i_month, i_day, i_hour, i_minute);
//converting local julian date to GMT julian date
gmt_julian = localToGMT(local_julian);
//updating values to GMT
......@@ -219,12 +219,12 @@ void Date::setDate(const time_t& _time, const bool& _dst) {
/**
* @brief Set date from a modified julian date (MJD).
* @param julian_in julian date to set
* @param _timezone timezone as an offset to GMT (in hours, optional)
* @param _dst is it DST? (default: no)
* @param i_timezone timezone as an offset to GMT (in hours, optional)
* @param i_dst is it DST? (default: no)
*/
void Date::setModifiedJulianDate(const double& julian_in, const double& _timezone, const bool& _dst) {
const double _julian = julian_in + MJD_offset;
setDate(_julian, _timezone, _dst);
void Date::setModifiedJulianDate(const double& julian_in, const double& i_timezone, const bool& i_dst) {
const double tmp_julian = julian_in + MJD_offset;
setDate(tmp_julian, i_timezone, i_dst);
}
/**
......@@ -240,25 +240,25 @@ void Date::setUnixDate(const time_t& in_time, const bool& in_dst) {
/**
* @brief Set date from an Excel date.
* @param excel_in Excel date to set
* @param _timezone timezone as an offset to GMT (in hours, optional)
* @param _dst is it DST? (default: no)
* @param i_timezone timezone as an offset to GMT (in hours, optional)
* @param i_dst is it DST? (default: no)
*/
void Date::setExcelDate(const double excel_in, const double& _timezone, const bool& _dst) {
void Date::setExcelDate(const double excel_in, const double& i_timezone, const bool& i_dst) {
//TODO: handle date < 1900-01-00 and date before 1900-03-01
//see http://www.mathworks.com/help/toolbox/finance/x2mdate.html
const double _julian = excel_in + Excel_offset;
setDate(_julian, _timezone, _dst);
const double tmp_julian = excel_in + Excel_offset;
setDate(tmp_julian, i_timezone, i_dst);
}
/**
* @brief Set date from an Matlab date.
* @param matlab_in Matlab date to set
* @param _timezone timezone as an offset to GMT (in hours, optional)
* @param _dst is it DST? (default: no)
* @param i_timezone timezone as an offset to GMT (in hours, optional)
* @param i_dst is it DST? (default: no)
*/
void Date::setMatlabDate(const double matlab_in, const double& _timezone, const bool& _dst) {
const double _julian = matlab_in + Matlab_offset;
setDate(_julian, _timezone, _dst);
void Date::setMatlabDate(const double matlab_in, const double& i_timezone, const bool& i_dst) {
const double tmp_julian = matlab_in + Matlab_offset;
setDate(tmp_julian, i_timezone, i_dst);
}
......
......@@ -120,7 +120,7 @@ IOHandler::~IOHandler(){
IOHandler::~IOHandler() throw(){
#endif
// Get rid of the objects
std::map<std::string, IOPlugin::IOPlugin>::iterator mapit;
std::map<std::string, IOPlugin>::iterator mapit;
for (mapit = mapPlugins.begin(); mapit!=mapPlugins.end(); mapit++){
deletePlugin((mapit->second).dynLibrary, (mapit->second).io);
}
......@@ -183,7 +183,7 @@ IOInterface* IOHandler::getPlugin(const std::string& cfgkey, const std::string&
std::string op_src="";
cfg.getValue(cfgkey, cfgsection, op_src);
std::map<std::string, IOPlugin::IOPlugin>::iterator mapit = mapPlugins.find(op_src);
std::map<std::string, IOPlugin>::iterator mapit = mapPlugins.find(op_src);
if (mapit == mapPlugins.end())
throw IOException("Can not find plugin " + op_src + " as requested in file " + cfg.getSourceName() + ". Has its developer declared it in IOHandler::registerPlugins?", AT);
......@@ -300,7 +300,7 @@ std::string IOHandler::toString() const
os << "<mapPlugins>\n";
os << setw(10) << "Keyword" << " = " << IOPlugin::header << "\n";
std::map<std::string, IOPlugin::IOPlugin>::const_iterator it1;
std::map<std::string, IOPlugin>::const_iterator it1;
for (it1=mapPlugins.begin(); it1 != mapPlugins.end(); it1++){
os << setw(10) << it1->first << " = " << it1->second;
}
......
......@@ -75,7 +75,7 @@ class IOHandler : public IOInterface {
IOInterface *getPlugin(const std::string& cfgkey, const std::string& cfgsection="GENERAL");
Config cfg;
std::map<std::string, IOPlugin::IOPlugin> mapPlugins;
std::map<std::string, IOPlugin> mapPlugins;
A3DIO fileio;
};
......
......@@ -31,7 +31,7 @@ using namespace mio; //HACK for POPC
namespace mio {
typedef std::map<std::string, IOPlugin::IOPlugin>::iterator PLUGIN_ITERATOR; //HACK for POPC
typedef std::map<std::string, IOPlugin>::iterator PLUGIN_ITERATOR; //HACK for POPC
//This one line above does absolutely nothing, but if removed, popc does not compile the file....
/**
......@@ -76,7 +76,7 @@ parclass IOHandler {
IOInterface *getPlugin(const std::string& cfgkey, const std::string& cfgsection="GENERAL");
Config cfg;
std::map<std::string, IOPlugin::IOPlugin> mapPlugins;
std::map<std::string, IOPlugin> mapPlugins;
A3DIO fileio;
};
......
......@@ -28,7 +28,7 @@ using namespace mio; //HACK for POPC
namespace mio {
typedef std::map<std::string, IOPlugin::IOPlugin>::iterator PLUGIN_ITERATOR; //HACK for POPC
typedef std::map<std::string, IOPlugin>::iterator PLUGIN_ITERATOR; //HACK for POPC
//This one line above does absolutely nothing, but if removed, popc does not compile the file....
......
......@@ -159,8 +159,7 @@ bool IOUtils::validFileName(const std::string& filename)
#ifdef _WIN32
bool IOUtils::fileExists(const std::string& filename)
{
CString CSfilename(filename.c_str());
return ( GetFileAttributes( CSfilename ) != INVALID_FILE_ATTRIBUTES );
return ( GetFileAttributes( filename ) != INVALID_FILE_ATTRIBUTES );
}
void IOUtils::readDirectory(const std::string& path, std::list<std::string>& dirlist, const std::string& pattern)
......@@ -174,7 +173,7 @@ void IOUtils::readDirectory(const std::string& path, std::list<std::string>& dir
throw FileAccessException("Error opening directory " + path, AT);
}
hFind = FindFirstFile((LPCSTR)(path+"\\"+pattern), &ffd);
hFind = FindFirstFile(path+"\\"+pattern, &ffd);
if (INVALID_HANDLE_VALUE == hFind) {
throw FileAccessException("Error opening directory " + path, AT);
}
......
......@@ -81,7 +81,7 @@ class Fit1D {
const std::vector<double>& Y; //Y of input data set to fit
std::vector<double> Lambda; //parameters of the fit
std::map<std::string, RegModel::RegModel> mapRegs;
std::map<std::string, RegModel> mapRegs;
void registerRegressions();
void initLambda();
......
......@@ -60,10 +60,10 @@ class ProcessingBlock {
friend std::ostream& operator<<(std::ostream& os, const ProcessingBlock& data);
protected:
std::string block_name;
ProcessingBlock(const std::string& name); ///< protected constructor only to be called by children
ProcessingProperties properties;
std::string block_name;
};
class BlockFactory {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment