mirror of
https://github.com/Unidata/netcdf-cxx4.git
synced 2024-11-21 03:13:46 +08:00
Changed nullptr to NULL for compilers not at C++11 yet
This commit is contained in:
parent
5f56562350
commit
e5ccb03f20
@ -7,24 +7,24 @@ using namespace netCDF::exceptions;
|
||||
|
||||
// Default object thrown if a netCDF exception is encountered.
|
||||
NcException::NcException(const string& exceptionNameIn,const string& complaintIn,const char* fileNameIn,int lineNumberIn)
|
||||
: what_msg(nullptr)
|
||||
: what_msg(NULL)
|
||||
{
|
||||
try{
|
||||
std::ostringstream oss;
|
||||
oss << lineNumberIn;
|
||||
what_msg = new std::string(exceptionNameIn+": "+complaintIn+"\nfile: "+fileNameIn+" line:"+oss.str());
|
||||
}catch(...){
|
||||
what_msg = nullptr;
|
||||
what_msg = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
NcException::NcException(const NcException& e) throw()
|
||||
: what_msg(nullptr)
|
||||
: what_msg(NULL)
|
||||
{
|
||||
try{
|
||||
what_msg = new std::string(*(e.what_msg));
|
||||
}catch(...){
|
||||
what_msg = nullptr;
|
||||
what_msg = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ NcException& NcException::operator=(const NcException& e) throw(){
|
||||
try{
|
||||
what_msg = new std::string(*(e.what_msg));
|
||||
}catch(...){
|
||||
what_msg = nullptr;
|
||||
what_msg = NULL;
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
@ -47,7 +47,7 @@ NcException::~NcException()throw() {
|
||||
|
||||
const char* NcException::what() const throw()
|
||||
{
|
||||
return what_msg==nullptr ? "" : what_msg->c_str();
|
||||
return what_msg==NULL ? "" : what_msg->c_str();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user