move stdexcept to base, convert InterleavedAccessor.cpp to exceptions
parent
99d478f87e
commit
5181aa0e6d
|
@ -9,7 +9,6 @@
|
|||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include "InterleavedBase.h"
|
||||
#include <stdint.h>
|
||||
#include "gdal_priv.h"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
|
|
@ -75,8 +75,7 @@ GDALAccessor::openFile (string filename, string accessMode, GDALDataset ** fd)
|
|||
string errMsg = "Cannot open the file " + filename + " in "
|
||||
+ accessMode + " mode.";
|
||||
throw runtime_error(errMsg);
|
||||
// ERR_MESSAGE
|
||||
// ;
|
||||
// ERR_MESSAGE;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -112,8 +112,8 @@ void InterleavedAccessor::openFile(string filename, string accessMode, fstream
|
|||
fd.open(filename.c_str(), ios_base::in);
|
||||
if(fd.fail())
|
||||
{
|
||||
cout << "Error. Cannot open the file " << filename << " in " << accessMode << " mode." <<endl;
|
||||
ERR_MESSAGE;
|
||||
string errMsg = "Cannot open the file " + filename + " in " + accessMode + " mode.";
|
||||
throw runtime_error(errMsg);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -139,13 +139,13 @@ void InterleavedAccessor::openFile(string filename, string accessMode, fstream
|
|||
}
|
||||
else
|
||||
{
|
||||
cout << "Error. Unrecognized open mode " << accessMode << " for file " << filename << endl;
|
||||
ERR_MESSAGE;
|
||||
string errMsg = "Unrecognized open mode " + accessMode + " for file " + filename;
|
||||
throw runtime_error(errMsg);
|
||||
}
|
||||
if(!fd.good())
|
||||
{
|
||||
cout << "Cannot open file " << filename << endl;
|
||||
ERR_MESSAGE;
|
||||
string errMsg = "Cannot open file " + filename;
|
||||
throw runtime_error(errMsg);
|
||||
}
|
||||
}
|
||||
void InterleavedAccessor::getStream(char * dataLine, int & numEl)
|
||||
|
|
Loading…
Reference in New Issue