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