version 1.77, 2006/01/30 16:16:52
|
version 1.78, 2006/10/30 13:02:53
|
|
|
_rep->message.append(MessageLoader::getMessage(msgParms)); | _rep->message.append(MessageLoader::getMessage(msgParms)); |
} | } |
| |
|
|
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
// | // |
// CIMException | // CIMException |
|
|
_rep = tmp; | _rep = tmp; |
} | } |
| |
|
|
|
// l10n - note - use this when you have an exception |
|
// an untranslated detail message and an attached CIM_Error |
|
// The pegasus message associated with code will be translated. |
|
CIMException::CIMException( |
|
CIMStatusCode code, |
|
const String& message, |
|
const CIMInstance& instance) |
|
: Exception() |
|
{ |
|
CIMExceptionRep * tmp = new CIMExceptionRep (); |
|
tmp->message = message; |
|
tmp->code = code; |
|
tmp->file = ""; |
|
tmp->errors.append(instance); |
|
tmp->line = 0; |
|
tmp->contentLanguages.clear(); |
|
tmp->cimMessage = String::EMPTY; |
|
_rep = tmp; |
|
} |
|
|
|
// l10n - note - use this when you have an exception |
|
// an untranslated detail message and an attached CIM_Error |
|
// array |
|
// The pegasus message associated with code will be translated. |
|
CIMException::CIMException( |
|
CIMStatusCode code, |
|
const String& message, |
|
const Array<CIMInstance>& instances) |
|
: Exception() |
|
{ |
|
CIMExceptionRep * tmp = new CIMExceptionRep (); |
|
tmp->message = message; |
|
tmp->code = code; |
|
tmp->file = ""; |
|
tmp->errors.appendArray(instances); |
|
tmp->line = 0; |
|
tmp->contentLanguages.clear(); |
|
tmp->cimMessage = String::EMPTY; |
|
_rep = tmp; |
|
} |
// l10n - note use this when you have an exception with a translated | // l10n - note use this when you have an exception with a translated |
// detail message | // detail message |
// l10n | // l10n |
|
|
_rep = tmp; | _rep = tmp; |
} | } |
| |
|
CIMException::CIMException( |
|
CIMStatusCode code, |
|
const MessageLoaderParms& msgParms, |
|
const CIMInstance& instance) |
|
: Exception() |
|
{ |
|
CIMExceptionRep * tmp = new CIMExceptionRep (); |
|
tmp->message = MessageLoader::getMessage( |
|
const_cast<MessageLoaderParms &>(msgParms)); |
|
// Must be after MessageLoader::getMessage call |
|
tmp->contentLanguages = msgParms.contentlanguages; |
|
tmp->cimMessage = String::EMPTY; |
|
tmp->errors.append(instance); |
|
tmp->code = code; |
|
tmp->file = ""; |
|
tmp->line = 0; |
|
_rep = tmp; |
|
} |
|
|
|
CIMException::CIMException( |
|
CIMStatusCode code, |
|
const MessageLoaderParms& msgParms, |
|
const Array<CIMInstance>& instances) |
|
: Exception() |
|
{ |
|
CIMExceptionRep * tmp = new CIMExceptionRep (); |
|
tmp->message = MessageLoader::getMessage( |
|
const_cast<MessageLoaderParms &>(msgParms)); |
|
// Must be after MessageLoader::getMessage call |
|
tmp->contentLanguages = msgParms.contentlanguages; |
|
tmp->cimMessage = String::EMPTY; |
|
tmp->errors.appendArray(instances); |
|
tmp->code = code; |
|
tmp->file = ""; |
|
tmp->line = 0; |
|
_rep = tmp; |
|
} |
CIMException::CIMException(const CIMException & cimException) | CIMException::CIMException(const CIMException & cimException) |
: Exception() | : Exception() |
{ | { |
|
|
tmp->code = rep->code; | tmp->code = rep->code; |
tmp->file = rep->file; | tmp->file = rep->file; |
tmp->line = rep->line; | tmp->line = rep->line; |
|
tmp->errors = rep->errors; |
_rep = tmp; | _rep = tmp; |
} | } |
| |
|
|
left->code = right->code; | left->code = right->code; |
left->file = right->file; | left->file = right->file; |
left->line = right->line; | left->line = right->line; |
|
left->errors = right->errors; |
} | } |
return *this; | return *this; |
} | } |
|
|
{ | { |
} | } |
| |
|
Uint32 CIMException::getErrorCount() const |
|
{ |
|
return reinterpret_cast<CIMExceptionRep*>(_rep)->errors.size(); |
|
} |
|
/************** |
|
CIMInstance CIMException::getError(Uint32 index) |
|
{ |
|
return reinterpret_cast<CIMExceptionRep*>(_rep)->errors[index]; |
|
} |
|
***************/ |
|
|
|
CIMConstInstance CIMException::getError(Uint32 index) const |
|
{ |
|
return reinterpret_cast<CIMExceptionRep*>(_rep)->errors[index]; |
|
} |
|
|
|
void CIMException::addError(const CIMInstance& instance) |
|
{ |
|
return reinterpret_cast<CIMExceptionRep*>(_rep)->errors.append(instance); |
|
} |
|
|
CIMStatusCode CIMException::getCode() const | CIMStatusCode CIMException::getCode() const |
{ | { |
CIMExceptionRep* rep; | CIMExceptionRep* rep; |