1#include <ncException.h>
23NcException::NcException(
const char* complaint,
const char* fileName,
int lineNumber)
28 std::ostringstream oss;
30 what_msg =
new std::string(complaint?complaint:
"");
31 what_msg->append(
"\nfile: ");
32 what_msg->append(fileName);
33 what_msg->append(
" line:");
34 what_msg->append(oss.str());
40NcException::NcException(
int errorCode,
const char* complaint,
const char* fileName,
int lineNumber)
45 std::ostringstream oss;
47 what_msg =
new std::string(complaint?complaint:
"");
48 what_msg->append(
"\nfile: ");
49 what_msg->append(fileName);
50 what_msg->append(
" line:");
51 what_msg->append(oss.str());
57NcException::NcException(
const NcException& e)
throw()
62 what_msg =
new std::string(*(e.what_msg));
73 what_msg =
new std::string(*(e.what_msg));
81NcException::~NcException()throw() {
86const char* NcException::what()
const throw()
88 return what_msg==NULL ?
"" : what_msg->c_str();
91int NcException::errorCode()
const throw() {
97NcBadId::NcBadId(
const char* complaint,
const char* file,
int line) :
102NcNFile::NcNFile(
const char* complaint,
const char* file,
int line) :
106NcExist::NcExist(
const char* complaint,
const char* file,
int line) :
110NcInvalidArg::NcInvalidArg(
const char* complaint,
const char* file,
int line) :
114NcInvalidWrite::NcInvalidWrite(
const char* complaint,
const char* file,
int line) :
118NcNotInDefineMode::NcNotInDefineMode(
const char* complaint,
const char* file,
int line) :
119 NcException(NC_ENOTINDEFINE,complaint,file,line) { }
122NcInDefineMode::NcInDefineMode(
const char* complaint,
const char* file,
int line) :
126NcInvalidCoords::NcInvalidCoords(
const char* complaint,
const char* file,
int line) :
127 NcException(NC_EINVALCOORDS,complaint,file,line) { }
130NcMaxDims::NcMaxDims(
const char* complaint,
const char* file,
int line) :
134NcNameInUse::NcNameInUse(
const char* complaint,
const char* file,
int line) :
138NcNotAtt::NcNotAtt(
const char* complaint,
const char* file,
int line) :
142NcMaxAtts::NcMaxAtts(
const char* complaint,
const char* file,
int line) :
146NcBadType::NcBadType(
const char* complaint,
const char* file,
int line) :
150NcBadDim::NcBadDim(
const char* complaint,
const char* file,
int line) :
154NcUnlimPos::NcUnlimPos(
const char* complaint,
const char* file,
int line) :
158NcMaxVars::NcMaxVars(
const char* complaint,
const char* file,
int line) :
162NcNotVar::NcNotVar(
const char* complaint,
const char* file,
int line) :
166NcGlobal::NcGlobal(
const char* complaint,
const char* file,
int line) :
170NcNotNCF::NcNotNCF(
const char* complaint,
const char* file,
int line) :
174NcSts::NcSts(
const char* complaint,
const char* file,
int line) :
178NcMaxName::NcMaxName(
const char* complaint,
const char* file,
int line) :
182NcUnlimit::NcUnlimit(
const char* complaint,
const char* file,
int line) :
186NcNoRecVars::NcNoRecVars(
const char* complaint,
const char* file,
int line) :
190NcChar::NcChar(
const char* complaint,
const char* file,
int line) :
194NcEdge::NcEdge(
const char* complaint,
const char* file,
int line) :
198NcStride::NcStride(
const char* complaint,
const char* file,
int line) :
202NcBadName::NcBadName(
const char* complaint,
const char* file,
int line) :
206NcRange::NcRange(
const char* complaint,
const char* file,
int line) :
210NcNoMem::NcNoMem(
const char* complaint,
const char* file,
int line) :
214NcVarSize::NcVarSize(
const char* complaint,
const char* file,
int line) :
218NcDimSize::NcDimSize(
const char* complaint,
const char* file,
int line) :
222NcTrunc::NcTrunc(
const char* complaint,
const char* file,
int line) :
226NcHdfErr::NcHdfErr(
const char* complaint,
const char* file,
int line) :
230NcCantRead::NcCantRead(
const char* complaint,
const char* file,
int line) :
234NcCantWrite::NcCantWrite(
const char* complaint,
const char* file,
int line) :
238NcCantCreate::NcCantCreate(
const char* complaint,
const char* file,
int line) :
239 NcException(NC_ECANTCREATE,complaint,file,line) { }
242NcFileMeta::NcFileMeta(
const char* complaint,
const char* file,
int line) :
246NcDimMeta::NcDimMeta(
const char* complaint,
const char* file,
int line) :
250NcAttMeta::NcAttMeta(
const char* complaint,
const char* file,
int line) :
254NcVarMeta::NcVarMeta(
const char* complaint,
const char* file,
int line) :
258NcNoCompound::NcNoCompound(
const char* complaint,
const char* file,
int line) :
259 NcException(NC_ENOCOMPOUND,complaint,file,line) { }
262NcAttExists::NcAttExists(
const char* complaint,
const char* file,
int line) :
266NcNotNc4::NcNotNc4(
const char* complaint,
const char* file,
int line) :
270NcStrictNc3::NcStrictNc3(
const char* complaint,
const char* file,
int line) :
274NcBadGroupId::NcBadGroupId(
const char* complaint,
const char* file,
int line) :
278NcBadTypeId::NcBadTypeId(
const char* complaint,
const char* file,
int line) :
282NcBadFieldId::NcBadFieldId(
const char* complaint,
const char* file,
int line) :
286NcUnknownName::NcUnknownName(
const char* complaint,
const char* file,
int line) :
290NcEnoGrp::NcEnoGrp(
const char* complaint,
const char* file,
int line) :
294NcNullGrp::NcNullGrp(
const char* complaint,
const char* file,
int line) :
298NcNullDim::NcNullDim(
const char* complaint,
const char* file,
int line) :
302NcNullType::NcNullType(
const char* complaint,
const char* file,
int line) :
306NcElateDef::NcElateDef(
const char* complaint,
const char* file,
int line) :
Base object is thrown if a netCDF exception is encountered.