1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

0026937: Eliminate NO_CXX_EXCEPTION macro support

Macro NO_CXX_EXCEPTION was removed from code.
Method Raise() was replaced by explicit throw statement.
Method Standard_Failure::Caught() was replaced by normal C++mechanism of exception transfer.
Method Standard_Failure::Caught() is deprecated now.
Eliminated empty constructors.
Updated samples.
Eliminate empty method ChangeValue from NCollection_Map class.
Removed not operable methods from NCollection classes.
This commit is contained in:
ski
2017-02-02 16:35:21 +03:00
committed by apn
parent 0c63f2f8b9
commit 9775fa6110
1146 changed files with 4860 additions and 6183 deletions

View File

@@ -40,7 +40,7 @@ void TCollection_Array2::Allocate ()
// Modified by Sergey KHROMOV - Mon Feb 10 11:46:15 2003 End
myData = new Array2Item [Size];
if (!myData) Standard_OutOfMemory::Raise("Array2 : Allocation failed");
if (!myData) throw Standard_OutOfMemory("Array2 : Allocation failed");
}
// allocation of the indirection table (pointers on rows)

View File

@@ -67,7 +67,7 @@ TCollection_AsciiString::TCollection_AsciiString(const Standard_CString astring)
mystring[mylength] = '\0';
}
else {
Standard_NullObject::Raise("TCollection_AsciiString : parameter 'astring'");
throw Standard_NullObject("TCollection_AsciiString : parameter 'astring'");
}
}
@@ -84,7 +84,7 @@ TCollection_AsciiString::TCollection_AsciiString(const Standard_CString astring,
mystring [ mylength ] = '\0' ;
}
else {
Standard_NullObject::Raise("TCollection_AsciiString : parameter 'astring'");
throw Standard_NullObject("TCollection_AsciiString : parameter 'astring'");
}
}
@@ -308,7 +308,7 @@ void TCollection_AsciiString::AssignCat(const Standard_CString other)
}
}
else {
Standard_NullObject::Raise("TCollection_AsciiString::Operator += parameter other");
throw Standard_NullObject("TCollection_AsciiString::Operator += parameter other");
}
}
@@ -348,7 +348,7 @@ void TCollection_AsciiString::Center(const Standard_Integer Width ,
RightJustify(Width,Filler);
}
else if (Width < 0) {
Standard_NegativeValue::Raise();
throw Standard_NegativeValue();
}
}
@@ -441,8 +441,7 @@ Standard_Integer TCollection_AsciiString::FirstLocationInSet
if (mystring[i] == Set.mystring[j]) return i+1;
return 0;
}
Standard_OutOfRange::Raise();
return 0;
throw Standard_OutOfRange();
}
// ----------------------------------------------------------------------------
@@ -464,8 +463,7 @@ Standard_Integer TCollection_AsciiString::FirstLocationNotInSet
}
return 0;
}
Standard_OutOfRange::Raise();
return 0;
throw Standard_OutOfRange();
}
//----------------------------------------------------------------------------
@@ -474,10 +472,8 @@ Standard_Integer TCollection_AsciiString::FirstLocationNotInSet
void TCollection_AsciiString::Insert(const Standard_Integer where,
const Standard_Character what)
{
if (where > mylength + 1 ) Standard_OutOfRange::Raise
("TCollection_AsciiString::Insert : Parameter where is too big");
if (where < 1) Standard_OutOfRange::Raise
("TCollection_AsciiString::Insert : Parameter where is too small");
if (where > mylength + 1 ) throw Standard_OutOfRange("TCollection_AsciiString::Insert : Parameter where is too big");
if (where < 1) throw Standard_OutOfRange("TCollection_AsciiString::Insert : Parameter where is too small");
mystring = Reallocate (mystring, mylength + 2);
if (where != mylength +1) {
@@ -513,8 +509,8 @@ void TCollection_AsciiString::Insert(const Standard_Integer where,
}
}
else {
Standard_OutOfRange::Raise("TCollection_AsciiString::Insert : "
"Parameter where is invalid");
throw Standard_OutOfRange("TCollection_AsciiString::Insert : "
"Parameter where is invalid");
}
}
@@ -544,8 +540,8 @@ void TCollection_AsciiString::Insert(const Standard_Integer where,
}
}
else {
Standard_OutOfRange::Raise("TCollection_AsciiString::Insert : "
"Parameter where is too big");
throw Standard_OutOfRange("TCollection_AsciiString::Insert : "
"Parameter where is too big");
}
}
@@ -555,7 +551,7 @@ void TCollection_AsciiString::Insert(const Standard_Integer where,
void TCollection_AsciiString::InsertAfter(const Standard_Integer Index,
const TCollection_AsciiString& what)
{
if (Index < 0 || Index > mylength) Standard_OutOfRange::Raise();
if (Index < 0 || Index > mylength) throw Standard_OutOfRange();
Insert(Index+1,what);
}
@@ -565,7 +561,7 @@ void TCollection_AsciiString::InsertAfter(const Standard_Integer Index,
void TCollection_AsciiString::InsertBefore(const Standard_Integer Index,
const TCollection_AsciiString& what)
{
if (Index < 1 || Index > mylength) Standard_OutOfRange::Raise();
if (Index < 1 || Index > mylength) throw Standard_OutOfRange();
Insert(Index,what);
}
@@ -578,9 +574,8 @@ Standard_Boolean TCollection_AsciiString::IsEqual
if (other) {
return ( strncmp( other, mystring, mylength+1 ) == 0 );
}
Standard_NullObject::Raise("TCollection_AsciiString::Operator == "
throw Standard_NullObject("TCollection_AsciiString::Operator == "
"Parameter 'other'");
return Standard_False;
}
// ----------------------------------------------------------------------------
@@ -630,9 +625,8 @@ Standard_Boolean TCollection_AsciiString::IsDifferent
if (other) {
return ( strncmp( other, mystring, mylength+1 ) != 0 );
}
Standard_NullObject::Raise("TCollection_AsciiString::Operator != "
throw Standard_NullObject("TCollection_AsciiString::Operator != "
"Parameter 'other'");
return Standard_False;
}
// ----------------------------------------------------------------------------
@@ -655,9 +649,8 @@ Standard_Boolean TCollection_AsciiString::IsLess
if (other) {
return ( strncmp( mystring, other, mylength+1 ) < 0 );
}
Standard_NullObject::Raise("TCollection_AsciiString::Operator < "
"Parameter 'other'");
return Standard_False;
throw Standard_NullObject("TCollection_AsciiString::Operator < "
"Parameter 'other'");
}
// ----------------------------------------------------------------------------
@@ -678,9 +671,8 @@ Standard_Boolean TCollection_AsciiString::IsGreater
if (other) {
return ( strncmp( mystring, other, mylength+1 ) > 0 );
}
Standard_NullObject::Raise("TCollection_AsciiString::Operator > "
"Parameter 'other'");
return Standard_False;
throw Standard_NullObject("TCollection_AsciiString::Operator > "
"Parameter 'other'");
}
// ----------------------------------------------------------------------------
@@ -729,8 +721,7 @@ Standard_Integer TCollection_AsciiString::IntegerValue()const
Standard_Integer value = (Standard_Integer)strtol(mystring,&ptr,10);
if (ptr != mystring) return value;
Standard_NumericError::Raise("TCollection_AsciiString::IntegerValue");
return 0;
throw Standard_NumericError("TCollection_AsciiString::IntegerValue");
}
// ----------------------------------------------------------------------------
@@ -795,7 +786,7 @@ void TCollection_AsciiString::LeftJustify(const Standard_Integer Width,
mystring[mylength] = '\0';
}
else if (Width < 0) {
Standard_NegativeValue::Raise();
throw Standard_NegativeValue();
}
}
@@ -817,8 +808,7 @@ Standard_Integer TCollection_AsciiString::Location
}
return 0 ;
}
Standard_OutOfRange::Raise();
return 0 ;
throw Standard_OutOfRange();
}
//------------------------------------------------------------------------
@@ -850,8 +840,7 @@ Standard_Integer TCollection_AsciiString::Location
if (Find) return l+2;
else return 0;
}
Standard_OutOfRange::Raise();
return 0;
throw Standard_OutOfRange();
}
// ----------------------------------------------------------------------------
@@ -880,8 +869,7 @@ Standard_Real TCollection_AsciiString::RealValue()const
Standard_Real value = Strtod(mystring,&ptr);
if (ptr != mystring) return value;
Standard_NumericError::Raise("TCollection_AsciiString::RealValue");
return value;
throw Standard_NumericError("TCollection_AsciiString::RealValue");
}
// ----------------------------------------------------------------------------
@@ -979,9 +967,9 @@ void TCollection_AsciiString::Remove (const Standard_Integer where,
mystring[mylength] = '\0';
}
else {
Standard_OutOfRange::Raise("TCollection_AsciiString::Remove: "
"Too many characters to erase or invalid "
"starting value.");
throw Standard_OutOfRange("TCollection_AsciiString::Remove: "
"Too many characters to erase or invalid "
"starting value.");
}
}
@@ -1016,7 +1004,7 @@ void TCollection_AsciiString::RightJustify(const Standard_Integer Width,
mystring[mylength] = '\0';
}
else if (Width < 0) {
Standard_NegativeValue::Raise();
throw Standard_NegativeValue();
}
}
@@ -1115,8 +1103,8 @@ void TCollection_AsciiString::SetValue(const Standard_Integer where,
mystring[where-1] = what;
}
else {
Standard_OutOfRange::Raise("TCollection_AsciiString::SetValue : "
"parameter where");
throw Standard_OutOfRange("TCollection_AsciiString::SetValue : "
"parameter where");
}
}
@@ -1138,8 +1126,8 @@ void TCollection_AsciiString::SetValue(const Standard_Integer where,
mystring[mylength] = '\0';
}
else {
Standard_OutOfRange::Raise("TCollection_AsciiString::SetValue : "
"parameter where");
throw Standard_OutOfRange("TCollection_AsciiString::SetValue : "
"parameter where");
}
}
@@ -1162,8 +1150,8 @@ void TCollection_AsciiString::SetValue(const Standard_Integer where,
mystring[mylength] = '\0';
}
else {
Standard_OutOfRange::Raise("TCollection_AsciiString::SetValue : "
"parameter where");
throw Standard_OutOfRange("TCollection_AsciiString::SetValue : "
"parameter where");
}
}
@@ -1179,7 +1167,7 @@ void TCollection_AsciiString::Split(const Standard_Integer where,
Trunc(where);
return ;
}
Standard_OutOfRange::Raise("TCollection_AsciiString::Split index");
throw Standard_OutOfRange("TCollection_AsciiString::Split index");
return ;
}
@@ -1194,9 +1182,7 @@ TCollection_AsciiString TCollection_AsciiString::Split
Trunc(where);
return res;
}
Standard_OutOfRange::Raise("TCollection_AsciiString::Split index");
TCollection_AsciiString res;
return res;
throw Standard_OutOfRange("TCollection_AsciiString::Split index");
}
// ----------------------------------------------------------------------------
@@ -1209,7 +1195,7 @@ void TCollection_AsciiString::SubString(const Standard_Integer FromIndex,
{
if (ToIndex > mylength || FromIndex <= 0 || FromIndex > ToIndex )
Standard_OutOfRange::Raise();
throw Standard_OutOfRange();
Standard_Integer newlength = ToIndex-FromIndex+1;
res.mystring =Reallocate (res.mystring, newlength + 1);
strncpy( res.mystring, mystring + FromIndex - 1, newlength );
@@ -1237,8 +1223,8 @@ TCollection_AsciiString TCollection_AsciiString::Token
const Standard_Integer whichone) const
{
if (!separators)
Standard_NullObject::Raise("TCollection_AsciiString::Token : "
"parameter 'separators'");
throw Standard_NullObject("TCollection_AsciiString::Token : "
"parameter 'separators'");
Standard_Integer theOne ;
Standard_Integer StringIndex = 0 ;
@@ -1291,8 +1277,8 @@ TCollection_AsciiString TCollection_AsciiString::Token
void TCollection_AsciiString::Trunc(const Standard_Integer ahowmany)
{
if (ahowmany < 0 || ahowmany > mylength)
Standard_OutOfRange::Raise("TCollection_AsciiString::Trunc : "
"parameter 'ahowmany'");
throw Standard_OutOfRange("TCollection_AsciiString::Trunc : "
"parameter 'ahowmany'");
mylength = ahowmany;
mystring[mylength] = '\0';
}
@@ -1326,6 +1312,5 @@ Standard_Character TCollection_AsciiString::Value
if (where > 0 && where <= mylength) {
return mystring[where-1];
}
Standard_OutOfRange::Raise("TCollection_AsciiString::Value : parameter where");
return '\0';
throw Standard_OutOfRange("TCollection_AsciiString::Value : parameter where");
}

View File

@@ -113,7 +113,7 @@ inline TCollection_AsciiString TCollection_AsciiString::SubString(const Standard
const Standard_Integer ToIndex) const
{
if (ToIndex > mylength || FromIndex <= 0 || FromIndex > ToIndex ) Standard_OutOfRange::Raise();
if (ToIndex > mylength || FromIndex <= 0 || FromIndex > ToIndex ) throw Standard_OutOfRange();
return TCollection_AsciiString( &mystring [ FromIndex - 1 ] ,
ToIndex - FromIndex + 1 ) ;

View File

@@ -168,7 +168,7 @@ void TCollection_BaseSequence::PInsertAfter(const Standard_Integer Index, const
void TCollection_BaseSequence::PInsertAfter(const Standard_Integer Index, TCollection_BaseSequence& Other)
{
if (Index < 0 || Index > Size) Standard_OutOfRange::Raise();
if (Index < 0 || Index > Size) throw Standard_OutOfRange();
if (Other.Size == 0) return;
if (Index == 0)
PPrepend( Other );

View File

@@ -36,7 +36,7 @@ TCollection_DataMap::TCollection_DataMap(const TCollection_DataMap& Other) :
TCollection_BasicMap(Other.NbBuckets(),Standard_True)
{
if (!Other.IsEmpty())
Standard_DomainError::Raise("TCollection:Copy of DataMap");
throw Standard_DomainError("TCollection:Copy of DataMap");
}
//=======================================================================
@@ -201,8 +201,7 @@ const TheItem& TCollection_DataMap::Find(const TheKey& K) const
}
p = (TCollection_DataMapNode*) p->Next();
}
Standard_NoSuchObject::Raise("TCollection_DataMap::Find");
return p->Value();
throw Standard_NoSuchObject("TCollection_DataMap::Find");
}
//=======================================================================
//function : ChangeFind
@@ -219,8 +218,7 @@ TheItem& TCollection_DataMap::ChangeFind(const TheKey& K)
}
p = (TCollection_DataMapNode*) p->Next();
}
Standard_NoSuchObject::Raise("TCollection_DataMap::ChangeFind");
return p->Value();
throw Standard_NoSuchObject("TCollection_DataMap::ChangeFind");
}
//modified by NIZNHY-PKV Tue Jul 05 09:54:14 2011f
//=======================================================================

View File

@@ -39,7 +39,7 @@ TCollection_DoubleMap::TCollection_DoubleMap
TCollection_BasicMap(Other.NbBuckets(),Standard_False)
{
if (Other.Extent() != 0)
Standard_DomainError::Raise("TCollection:Copy of DoubleMap");
throw Standard_DomainError("TCollection:Copy of DoubleMap");
}
//=======================================================================
@@ -139,13 +139,13 @@ void TCollection_DoubleMap::Bind(const TheKey1& K1, const TheKey2& K2)
p = data1[k1];
while (p) {
if (Hasher1::IsEqual(p->Key1(),K1))
Standard_MultiplyDefined::Raise("DoubleMap:Bind");
throw Standard_MultiplyDefined("DoubleMap:Bind");
p = (TCollection_DoubleMapNode*) p->Next();
}
p = data2[k2];
while (p) {
if (Hasher2::IsEqual(p->Key2(),K2))
Standard_MultiplyDefined::Raise("DoubleMap:Bind");
throw Standard_MultiplyDefined("DoubleMap:Bind");
p = (TCollection_DoubleMapNode*)p->Next2();
}
p = new TCollection_DoubleMapNode(K1,K2,data1[k1],data2[k2]);
@@ -238,7 +238,7 @@ const TheKey2& TCollection_DoubleMap::Find1(const TheKey1& K1) const
if (Hasher1::IsEqual(p1->Key1(),K1)) return p1->Key2();
p1 = (TCollection_DoubleMapNode*) p1->Next();
}
Standard_NoSuchObject::Raise("TCollection_DoubleMap::Find1");
throw Standard_NoSuchObject("TCollection_DoubleMap::Find1");
return p1->Key2();
}
@@ -258,7 +258,7 @@ const TheKey1& TCollection_DoubleMap::Find2(const TheKey2& K2) const
if (Hasher2::IsEqual(p2->Key2(),K2)) return p2->Key1();
p2 = (TCollection_DoubleMapNode*)p2->Next2();
}
Standard_NoSuchObject::Raise("TCollection_DoubleMap::Find2");
throw Standard_NoSuchObject("TCollection_DoubleMap::Find2");
return p2->Key1();
}

View File

@@ -108,7 +108,7 @@ TCollection_ExtendedString::TCollection_ExtendedString
{
if (theString == NULL)
{
Standard_NullObject::Raise ("TCollection_ExtendedString : null parameter ");
throw Standard_NullObject("TCollection_ExtendedString : null parameter ");
}
if (isMultiByte)
@@ -140,7 +140,7 @@ TCollection_ExtendedString::TCollection_ExtendedString (const Standard_ExtString
{
if (theString == NULL)
{
Standard_NullObject::Raise("TCollection_ExtendedString : null parameter ");
throw Standard_NullObject("TCollection_ExtendedString : null parameter ");
}
for (mylength = 0; theString[mylength] != '\0'; ++mylength) {}
@@ -159,7 +159,7 @@ TCollection_ExtendedString::TCollection_ExtendedString (const Standard_WideChar*
{
if (theStringUtf == NULL)
{
Standard_NullObject::Raise ("TCollection_ExtendedString : null parameter ");
throw Standard_NullObject("TCollection_ExtendedString : null parameter ");
}
mystring = fromWideString<sizeof(Standard_WideChar)> (theStringUtf, mylength);
@@ -389,11 +389,11 @@ void TCollection_ExtendedString::Insert(const Standard_Integer where,
const Standard_ExtCharacter what)
{
if (where > mylength + 1 )
Standard_OutOfRange::Raise("TCollection_ExtendedString::Insert : "
"Parameter where is too big");
throw Standard_OutOfRange("TCollection_ExtendedString::Insert : "
"Parameter where is too big");
if (where < 0)
Standard_OutOfRange::Raise("TCollection_ExtendedString::Insert : "
"Parameter where is negative");
throw Standard_OutOfRange("TCollection_ExtendedString::Insert : "
"Parameter where is negative");
if (mystring != NULL)
{
@@ -441,8 +441,8 @@ void TCollection_ExtendedString::Insert(const Standard_Integer where,
}
}
else {
Standard_OutOfRange::Raise("TCollection_ExtendedString::Insert : "
"Parameter where is too big");
throw Standard_OutOfRange("TCollection_ExtendedString::Insert : "
"Parameter where is too big");
}
}
@@ -617,9 +617,9 @@ void TCollection_ExtendedString::Remove (const Standard_Integer where,
mystring[mylength] = '\0';
}
else
Standard_OutOfRange::Raise("TCollection_ExtendedString::Remove: "
"Too many characters to erase or "
"invalid starting value.");
throw Standard_OutOfRange("TCollection_ExtendedString::Remove: "
"Too many characters to erase or "
"invalid starting value.");
}
// ----------------------------------------------------------------------------
@@ -678,7 +678,7 @@ void TCollection_ExtendedString::SetValue(const Standard_Integer where,
mystring[where-1] = what;
}
else {
Standard_OutOfRange::Raise("TCollection_ExtendedString::SetValue : parameter where");
throw Standard_OutOfRange("TCollection_ExtendedString::SetValue : parameter where");
}
}
@@ -707,8 +707,8 @@ void TCollection_ExtendedString::SetValue
mystring[mylength] = '\0';
}
else
Standard_OutOfRange::Raise("TCollection_ExtendedString::SetValue : "
"parameter where");
throw Standard_OutOfRange("TCollection_ExtendedString::SetValue : "
"parameter where");
}
// ----------------------------------------------------------------------------
@@ -722,9 +722,7 @@ TCollection_ExtendedString TCollection_ExtendedString::Split
Trunc(where);
return res;
}
Standard_OutOfRange::Raise("TCollection_ExtendedString::Split index");
TCollection_ExtendedString res;
return res;
throw Standard_OutOfRange("TCollection_ExtendedString::Split index");
}
// ----------------------------------------------------------------------------
@@ -736,8 +734,8 @@ TCollection_ExtendedString TCollection_ExtendedString::Token
{
TCollection_ExtendedString res;
if (!separators)
Standard_NullObject::Raise("TCollection_ExtendedString::Token : "
"parameter 'separators'");
throw Standard_NullObject("TCollection_ExtendedString::Token : "
"parameter 'separators'");
int i,j,k,l;
Standard_PExtCharacter buftmp = allocateExtChars (mylength);
@@ -819,8 +817,8 @@ Standard_ExtString TCollection_ExtendedString::ToExtString() const
void TCollection_ExtendedString::Trunc(const Standard_Integer ahowmany)
{
if (ahowmany < 0 || ahowmany > mylength)
Standard_OutOfRange::Raise("TCollection_ExtendedString::Trunc : "
"parameter 'ahowmany'");
throw Standard_OutOfRange("TCollection_ExtendedString::Trunc : "
"parameter 'ahowmany'");
mylength = ahowmany;
mystring[mylength] = '\0';
}
@@ -835,9 +833,8 @@ Standard_ExtCharacter TCollection_ExtendedString::Value
if(mystring) return mystring[where-1];
else return 0;
}
Standard_OutOfRange::Raise("TCollection_ExtendedString::Value : "
"parameter where");
return 0;
throw Standard_OutOfRange("TCollection_ExtendedString::Value : "
"parameter where");
}

View File

@@ -125,7 +125,7 @@ void TCollection_HAsciiString::Center
(const Standard_Integer Width ,
const Standard_Character Filler)
{
if (Width < 0) Standard_NegativeValue::Raise();
if (Width < 0) throw Standard_NegativeValue();
myString.Center(Width,Filler);
}
@@ -158,7 +158,7 @@ Standard_Integer TCollection_HAsciiString::FirstLocationInSet
{
if (Length() == 0 || Set->Length() == 0) return 0;
if (ToIndex > Length() || FromIndex <= 0 || FromIndex > ToIndex )
Standard_OutOfRange::Raise();
throw Standard_OutOfRange();
return (myString.FirstLocationInSet(Set->String(),FromIndex,ToIndex));
}
@@ -172,7 +172,7 @@ Standard_Integer TCollection_HAsciiString::FirstLocationNotInSet
{
if (Length() == 0 || Set->Length() == 0) return 0;
if (ToIndex > Length() || FromIndex <= 0 || FromIndex > ToIndex )
Standard_OutOfRange::Raise();
throw Standard_OutOfRange();
return (myString.FirstLocationNotInSet(Set->String(),FromIndex,ToIndex));
}
@@ -211,7 +211,7 @@ void TCollection_HAsciiString::InsertAfter
{
Standard_Integer size1 = Length();
#ifndef NOBOUNDCHECK
if (Index < 0 || Index > size1) Standard_OutOfRange::Raise();
if (Index < 0 || Index > size1) throw Standard_OutOfRange();
#endif
myString.InsertAfter(Index,S->String());
}
@@ -224,7 +224,7 @@ void TCollection_HAsciiString::InsertBefore
{
Standard_Integer size1 = Length();
#ifndef NOBOUNDCHECK
if (Index < 1 || Index > size1) Standard_OutOfRange::Raise();
if (Index < 1 || Index > size1) throw Standard_OutOfRange();
#endif
myString.InsertBefore(Index,S->String());
}
@@ -294,7 +294,7 @@ Standard_Boolean TCollection_HAsciiString::IsAscii() const
Standard_Boolean TCollection_HAsciiString::IsDifferent
(const Handle(TCollection_HAsciiString)& S) const
{
if(S.IsNull()) Standard_NullObject::Raise("TCollection_HAsciiString::IsDifferent");
if(S.IsNull()) throw Standard_NullObject("TCollection_HAsciiString::IsDifferent");
if(S->Length() != myString.Length() ) return Standard_True;
return ( strncmp( myString.ToCString(), S->ToCString(), myString.Length() ) != 0 );
}
@@ -305,7 +305,7 @@ Standard_Boolean TCollection_HAsciiString::IsDifferent
Standard_Boolean TCollection_HAsciiString::IsSameString
(const Handle(TCollection_HAsciiString)& S) const
{
if(S.IsNull()) Standard_NullObject::Raise("TCollection_HAsciiString::IsSameString");
if(S.IsNull()) throw Standard_NullObject("TCollection_HAsciiString::IsSameString");
if ( myString.Length() == S->Length() )
return ( strncmp( myString.ToCString(), S->ToCString(), myString.Length() ) == 0 );
else
@@ -319,7 +319,7 @@ Standard_Boolean TCollection_HAsciiString::IsSameString
(const Handle(TCollection_HAsciiString)& S ,
const Standard_Boolean CaseSensitive) const
{
if(S.IsNull()) Standard_NullObject::Raise("TCollection_HAsciiString::IsSameString");
if(S.IsNull()) throw Standard_NullObject("TCollection_HAsciiString::IsSameString");
return TCollection_AsciiString::IsSameString (myString, S->myString, CaseSensitive);
}
@@ -337,7 +337,7 @@ void TCollection_HAsciiString::LeftAdjust ()
void TCollection_HAsciiString::LeftJustify
(const Standard_Integer Width, const Standard_Character Filler)
{
if (Width < 0) Standard_NegativeValue::Raise();
if (Width < 0) throw Standard_NegativeValue();
myString.LeftJustify(Width,Filler);
}
@@ -349,7 +349,7 @@ Standard_Integer TCollection_HAsciiString::Location
const Standard_Integer FromIndex, const Standard_Integer ToIndex) const
{
if (ToIndex > Length() || FromIndex <= 0 || FromIndex > ToIndex )
Standard_OutOfRange::Raise();
throw Standard_OutOfRange();
return myString.Location(N,C,FromIndex,ToIndex);
}
@@ -362,7 +362,7 @@ Standard_Integer TCollection_HAsciiString::Location
{
if (Length() == 0 || S->Length() == 0) return 0;
if (ToIndex > Length() || FromIndex <= 0 || FromIndex > ToIndex )
Standard_OutOfRange::Raise();
throw Standard_OutOfRange();
return myString.Location(S->String(),FromIndex,ToIndex);
}
@@ -440,7 +440,7 @@ void TCollection_HAsciiString::RightAdjust ()
void TCollection_HAsciiString::RightJustify
(const Standard_Integer Width, const Standard_Character Filler)
{
if (Width < 0) Standard_NegativeValue::Raise();
if (Width < 0) throw Standard_NegativeValue();
myString.RightJustify(Width,Filler);
}

View File

@@ -41,7 +41,7 @@ TCollection_IndexedDataMap::TCollection_IndexedDataMap
TCollection_BasicMap(Other.NbBuckets(),Standard_False)
{
if (Other.Extent() != 0)
Standard_DomainError::Raise("TCollection:Copy of non empty IndexedDataMap");
throw Standard_DomainError("TCollection:Copy of non empty IndexedDataMap");
}
//=======================================================================
@@ -177,8 +177,8 @@ void TCollection_IndexedDataMap::Substitute(const Standard_Integer I,
while (p) {
if (Hasher::IsEqual(p->Key1(),K1)) {
if (p->Key2() != I)
Standard_DomainError::Raise("IndexedDataMap::Substitute : "
"Attempt to substitute existing key");
throw Standard_DomainError("IndexedDataMap::Substitute : "
"Attempt to substitute existing key");
p->Key1() = K1;
p->Value() = T;
return;
@@ -271,7 +271,7 @@ const TheKey& TCollection_IndexedDataMap::FindKey(const Standard_Integer K2) con
if (p2->Key2() == K2) return p2->Key1();
p2 = (TCollection_IndexedDataMapNode*)p2->Next2();
}
Standard_OutOfRange::Raise("IndexedDataMap : missing index !!!");
throw Standard_OutOfRange("IndexedDataMap : missing index !!!");
return p2->Key1();
}
@@ -292,7 +292,7 @@ const TheItem& TCollection_IndexedDataMap::FindFromIndex
if (p2->Key2() == K2) return p2->Value();
p2 = (TCollection_IndexedDataMapNode*)p2->Next2();
}
Standard_OutOfRange::Raise("IndexedDataMap : missing index !!!");
throw Standard_OutOfRange("IndexedDataMap : missing index !!!");
return p2->Value();
}
@@ -312,7 +312,7 @@ TheItem& TCollection_IndexedDataMap::ChangeFromIndex(const Standard_Integer K2)
if (p2->Key2() == K2) return p2->Value();
p2 = (TCollection_IndexedDataMapNode*)p2->Next2();
}
Standard_OutOfRange::Raise("IndexedDataMap : missing index !!!");
throw Standard_OutOfRange("IndexedDataMap : missing index !!!");
return p2->Value();
}
@@ -366,7 +366,7 @@ const TheItem& TCollection_IndexedDataMap::FindFromKey(const TheKey& K1) const
if (Hasher::IsEqual(p1->Key1(),K1)) return p1->Value();
p1 = (TCollection_IndexedDataMapNode*) p1->Next();
}
Standard_OutOfRange::Raise("TCollection_IndexedDataMap::FindFromKey");
throw Standard_OutOfRange("TCollection_IndexedDataMap::FindFromKey");
return p1->Value();
}
//=======================================================================
@@ -384,7 +384,7 @@ TheItem& TCollection_IndexedDataMap::ChangeFromKey(const TheKey& K1)
if (Hasher::IsEqual(p1->Key1(),K1)) return p1->Value();
p1 = (TCollection_IndexedDataMapNode*)p1->Next();
}
Standard_OutOfRange::Raise("TCollection_IndexedDataMap::ChangeFromKey");
throw Standard_OutOfRange("TCollection_IndexedDataMap::ChangeFromKey");
return p1->Value();
}
//modified by NIZNHY-PKV Tue Jul 05 08:37:03 2011f

View File

@@ -179,8 +179,8 @@ void TCollection_IndexedMap::Substitute(const Standard_Integer I,
while (p) {
if (Hasher::IsEqual(p->Key1(),K1)) {
if (p->Key2() != I)
Standard_DomainError::Raise("IndexedMap::Substitute : "
"Attempt to substitute existing key");
throw Standard_DomainError("IndexedMap::Substitute : "
"Attempt to substitute existing key");
p->Key1() = K1;
return;
}
@@ -289,7 +289,7 @@ const TheKey& TCollection_IndexedMap::FindKey(const Standard_Integer K2) const
if (p2->Key2() == K2) return p2->Key1();
p2 = (TCollection_IndexedMapNode*)p2->Next2();
}
Standard_OutOfRange::Raise("IndexedMap : missing index !!!");
throw Standard_OutOfRange("IndexedMap : missing index !!!");
return p2->Key1();
}