move stdexcept to base, convert InterleavedAccessor.cpp to exceptions

LT1AB
scott 2021-07-07 12:46:25 -05:00
parent 99d478f87e
commit 5181aa0e6d
4 changed files with 8 additions and 9 deletions

View File

@ -9,7 +9,6 @@
#endif
#include <iostream>
#include <stdexcept>
#include "InterleavedBase.h"
#include <stdint.h>
#include "gdal_priv.h"

View File

@ -10,6 +10,7 @@
#include <stdlib.h>
#include <string>
#include <stdexcept>
using namespace std;

View File

@ -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

View File

@ -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)