1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +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

@@ -198,9 +198,9 @@ Storage_BaseDriver& FSD_BinaryFile::PutReference(const Standard_Integer aValue)
#if OCCT_BINARY_FILE_DO_INVERSE
Standard_Integer t = InverseInt (aValue);
if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) throw Storage_StreamWriteError();
#else
if (!fwrite(&aValue,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&aValue,sizeof(Standard_Integer),1,myStream)) throw Storage_StreamWriteError();
#endif
return *this;
}
@@ -212,7 +212,7 @@ Storage_BaseDriver& FSD_BinaryFile::PutReference(const Standard_Integer aValue)
Storage_BaseDriver& FSD_BinaryFile::PutCharacter(const Standard_Character aValue)
{
if (!fwrite(&aValue,sizeof(Standard_Character),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&aValue,sizeof(Standard_Character),1,myStream)) throw Storage_StreamWriteError();
return *this;
}
@@ -226,9 +226,9 @@ Storage_BaseDriver& FSD_BinaryFile::PutExtCharacter(const Standard_ExtCharacter
#if OCCT_BINARY_FILE_DO_INVERSE
Standard_ExtCharacter t = InverseExtChar (aValue);
if (!fwrite(&t,sizeof(Standard_ExtCharacter),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&t,sizeof(Standard_ExtCharacter),1,myStream)) throw Storage_StreamWriteError();
#else
if (!fwrite(&aValue,sizeof(Standard_ExtCharacter),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&aValue,sizeof(Standard_ExtCharacter),1,myStream)) throw Storage_StreamWriteError();
#endif
return *this;
}
@@ -243,9 +243,9 @@ Storage_BaseDriver& FSD_BinaryFile::PutInteger(const Standard_Integer aValue)
#if OCCT_BINARY_FILE_DO_INVERSE
Standard_Integer t = InverseInt (aValue);
if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) throw Storage_StreamWriteError();
#else
if (!fwrite(&aValue,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&aValue,sizeof(Standard_Integer),1,myStream)) throw Storage_StreamWriteError();
#endif
return *this;
@@ -270,7 +270,7 @@ Standard_Integer FSD_BinaryFile::PutInteger (Standard_OStream& theOStream,
theOStream.write ((char*)&t, sizeof(Standard_Integer));
if (theOStream.fail())
{
Storage_StreamWriteError::Raise();
throw Storage_StreamWriteError();
}
}
@@ -289,7 +289,7 @@ Storage_BaseDriver& FSD_BinaryFile::PutBoolean(const Standard_Boolean aValue)
#else
Standard_Integer t = aValue ? 1 : 0;
#endif
if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) throw Storage_StreamWriteError();
return *this;
}
@@ -303,9 +303,9 @@ Storage_BaseDriver& FSD_BinaryFile::PutReal(const Standard_Real aValue)
#if OCCT_BINARY_FILE_DO_INVERSE
Standard_Real t = InverseReal (aValue);
if (!fwrite(&t,sizeof(Standard_Real),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&t,sizeof(Standard_Real),1,myStream)) throw Storage_StreamWriteError();
#else
if (!fwrite(&aValue,sizeof(Standard_Real),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&aValue,sizeof(Standard_Real),1,myStream)) throw Storage_StreamWriteError();
#endif
return *this;
}
@@ -320,9 +320,9 @@ Storage_BaseDriver& FSD_BinaryFile::PutShortReal(const Standard_ShortReal aValue
#if OCCT_BINARY_FILE_DO_INVERSE
Standard_ShortReal t = InverseShortReal (aValue);
if (!fwrite(&t,sizeof(Standard_ShortReal),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&t,sizeof(Standard_ShortReal),1,myStream)) throw Storage_StreamWriteError();
#else
if (!fwrite(&aValue,sizeof(Standard_ShortReal),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(&aValue,sizeof(Standard_ShortReal),1,myStream)) throw Storage_StreamWriteError();
#endif
return *this;
}
@@ -335,7 +335,7 @@ Storage_BaseDriver& FSD_BinaryFile::PutShortReal(const Standard_ShortReal aValue
Storage_BaseDriver& FSD_BinaryFile::GetReference(Standard_Integer& aValue)
{
if (!fread(&aValue,sizeof(Standard_Integer),1,myStream))
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
aValue = InverseInt (aValue);
#endif
@@ -352,7 +352,7 @@ void FSD_BinaryFile::GetReference(Standard_IStream& theIStream, Standard_Integer
if (theIStream.gcount() != sizeof(Standard_Integer))
{
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
}
#if OCCT_BINARY_FILE_DO_INVERSE
@@ -368,7 +368,7 @@ void FSD_BinaryFile::GetReference(Standard_IStream& theIStream, Standard_Integer
Storage_BaseDriver& FSD_BinaryFile::GetCharacter(Standard_Character& aValue)
{
if (!fread(&aValue,sizeof(Standard_Character),1,myStream))
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
return *this;
}
@@ -380,7 +380,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetCharacter(Standard_Character& aValue)
Storage_BaseDriver& FSD_BinaryFile::GetExtCharacter(Standard_ExtCharacter& aValue)
{
if (!fread(&aValue,sizeof(Standard_ExtCharacter),1,myStream))
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
aValue = InverseExtChar (aValue);
#endif
@@ -395,7 +395,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetExtCharacter(Standard_ExtCharacter& aValu
Storage_BaseDriver& FSD_BinaryFile::GetInteger(Standard_Integer& aValue)
{
if (!fread(&aValue,sizeof(Standard_Integer),1,myStream))
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
aValue = InverseInt (aValue);
#endif
@@ -413,7 +413,7 @@ void FSD_BinaryFile::GetInteger (Standard_IStream& theIStream, Standard_Integer&
if (theIStream.gcount() != sizeof(Standard_Integer))
{
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
}
#if OCCT_BINARY_FILE_DO_INVERSE
@@ -430,7 +430,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetBoolean(Standard_Boolean& aValue)
{
Standard_Integer anInt = 0;
if (!fread(&anInt,sizeof(Standard_Integer),1,myStream))
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
anInt = InverseInt (anInt);
#endif
@@ -446,7 +446,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetBoolean(Standard_Boolean& aValue)
Storage_BaseDriver& FSD_BinaryFile::GetReal(Standard_Real& aValue)
{
if (!fread(&aValue,sizeof(Standard_Real),1,myStream))
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
aValue = InverseReal (aValue);
#endif
@@ -461,7 +461,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetReal(Standard_Real& aValue)
Storage_BaseDriver& FSD_BinaryFile::GetShortReal(Standard_ShortReal& aValue)
{
if (!fread(&aValue,sizeof(Standard_ShortReal),1,myStream))
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
aValue = InverseShortReal (aValue);
#endif
@@ -503,7 +503,7 @@ Storage_Error FSD_BinaryFile::BeginWriteInfoSection()
strlen(FSD_BinaryFile::MagicNumber()),
1,
myStream))
Storage_StreamWriteError::Raise();
throw Storage_StreamWriteError();
myHeader.binfo = ftell(myStream);
WriteHeader();
@@ -1427,7 +1427,7 @@ void FSD_BinaryFile::WriteString(const TCollection_AsciiString& aString)
PutInteger(size);
if (size > 0) {
if (!fwrite(aString.ToCString(),aString.Length(),1,myStream)) Storage_StreamWriteError::Raise();
if (!fwrite(aString.ToCString(),aString.Length(),1,myStream)) throw Storage_StreamWriteError();
}
}
@@ -1450,7 +1450,7 @@ Standard_Integer FSD_BinaryFile::WriteString (Standard_OStream& the
theOStream.write (theString.ToCString(), theString.Length());
if (theOStream.fail())
{
Storage_StreamWriteError::Raise();
throw Storage_StreamWriteError();
}
}
@@ -1469,7 +1469,7 @@ void FSD_BinaryFile::ReadString(TCollection_AsciiString& aString)
GetInteger(size);
if (size > 0) {
Standard_Character *c = (Standard_Character *)Standard::Allocate((size+1) * sizeof(Standard_Character));
if (!fread(c,size,1,myStream)) Storage_StreamWriteError::Raise();
if (!fread(c,size,1,myStream)) throw Storage_StreamWriteError();
c[size] = '\0';
aString = c;
Standard::Free(c);
@@ -1495,14 +1495,14 @@ void FSD_BinaryFile::ReadString (Standard_IStream& theIStream, TCollection_Ascii
if (!theIStream.good())
{
Storage_StreamReadError::Raise();
throw Storage_StreamReadError();
}
theIStream.read (c, size);
if (theIStream.gcount() != size)
{
Storage_StreamReadError::Raise();
throw Storage_StreamReadError();
}
c[size] = '\0';
@@ -1546,7 +1546,7 @@ void FSD_BinaryFile::WriteExtendedString(const TCollection_ExtendedString& aStri
anExtStr = aString.ToExtString();
#endif
if (!fwrite(anExtStr,sizeof(Standard_ExtCharacter)*aString.Length(),1,myStream))
Storage_StreamWriteError::Raise();
throw Storage_StreamWriteError();
}
}
@@ -1586,7 +1586,7 @@ Standard_Integer FSD_BinaryFile::WriteExtendedString (Standard_OStream&
theOStream.write((char*)anExtStr, sizeof(Standard_ExtCharacter)*theString.Length());
if (theOStream.fail())
{
Storage_StreamWriteError::Raise();
throw Storage_StreamWriteError();
}
}
@@ -1607,7 +1607,7 @@ void FSD_BinaryFile::ReadExtendedString(TCollection_ExtendedString& aString)
Standard_ExtCharacter *c = (Standard_ExtCharacter *)
Standard::Allocate((size+1) * sizeof(Standard_ExtCharacter));
if (!fread(c,size*sizeof(Standard_ExtCharacter),1,myStream))
Storage_StreamWriteError::Raise();
throw Storage_StreamWriteError();
c[size] = '\0';
#if OCCT_BINARY_FILE_DO_INVERSE
for (Standard_Integer i=0; i < size; i++)
@@ -1637,14 +1637,14 @@ void FSD_BinaryFile::ReadExtendedString (Standard_IStream& theIStream, TCollecti
if (!theIStream.good())
{
Storage_StreamReadError::Raise();
throw Storage_StreamReadError();
}
const std::streamsize aNbBytes = std::streamsize(sizeof(Standard_ExtCharacter) * size);
theIStream.read ((char *)c, aNbBytes);
if (theIStream.gcount() != aNbBytes)
{
Storage_StreamReadError::Raise();
throw Storage_StreamReadError();
}
c[size] = '\0';

View File

@@ -428,7 +428,7 @@ void FSD_CmpFile::SkipObject()
Storage_BaseDriver& FSD_CmpFile::PutReference(const Standard_Integer aValue)
{
myStream << aValue << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -443,7 +443,7 @@ Storage_BaseDriver& FSD_CmpFile::PutCharacter(const Standard_Character aValue)
i = aValue;
myStream << i << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -455,7 +455,7 @@ Storage_BaseDriver& FSD_CmpFile::PutCharacter(const Standard_Character aValue)
Storage_BaseDriver& FSD_CmpFile::PutExtCharacter(const Standard_ExtCharacter aValue)
{
myStream << (short )aValue << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -467,7 +467,7 @@ Storage_BaseDriver& FSD_CmpFile::PutExtCharacter(const Standard_ExtCharacter aVa
Storage_BaseDriver& FSD_CmpFile::PutInteger(const Standard_Integer aValue)
{
myStream << aValue << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -479,7 +479,7 @@ Storage_BaseDriver& FSD_CmpFile::PutInteger(const Standard_Integer aValue)
Storage_BaseDriver& FSD_CmpFile::PutBoolean(const Standard_Boolean aValue)
{
myStream << ((Standard_Integer)aValue) << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -491,7 +491,7 @@ Storage_BaseDriver& FSD_CmpFile::PutBoolean(const Standard_Boolean aValue)
Storage_BaseDriver& FSD_CmpFile::PutReal(const Standard_Real aValue)
{
myStream << ((Standard_Real)aValue) << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -503,7 +503,7 @@ Storage_BaseDriver& FSD_CmpFile::PutReal(const Standard_Real aValue)
Storage_BaseDriver& FSD_CmpFile::PutShortReal(const Standard_ShortReal aValue)
{
myStream << aValue << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -514,7 +514,7 @@ Storage_BaseDriver& FSD_CmpFile::PutShortReal(const Standard_ShortReal aValue)
Storage_BaseDriver& FSD_CmpFile::GetReference(Standard_Integer& aValue)
{
if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
@@ -531,7 +531,7 @@ Storage_BaseDriver& FSD_CmpFile::GetCharacter(Standard_Character& aValue)
// SGI : donne une erreur mais a une bonne valeur pour les caracteres ecrits
// signes (-80 fait ios::badbit, mais la variable i est initialisee)
//
if (i == 0) Storage_StreamTypeMismatchError::Raise();
if (i == 0) throw Storage_StreamTypeMismatchError();
myStream.clear(ios::goodbit);
}
aValue = (char)i;
@@ -547,7 +547,7 @@ Storage_BaseDriver& FSD_CmpFile::GetCharacter(Standard_Character& aValue)
Storage_BaseDriver& FSD_CmpFile::GetExtCharacter(Standard_ExtCharacter& aValue)
{
short aChar = 0;
if (!(myStream >> aChar)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aChar)) throw Storage_StreamTypeMismatchError();
aValue = aChar;
return *this;
}
@@ -559,7 +559,7 @@ Storage_BaseDriver& FSD_CmpFile::GetExtCharacter(Standard_ExtCharacter& aValue)
Storage_BaseDriver& FSD_CmpFile::GetInteger(Standard_Integer& aValue)
{
if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
@@ -571,7 +571,7 @@ Storage_BaseDriver& FSD_CmpFile::GetInteger(Standard_Integer& aValue)
Storage_BaseDriver& FSD_CmpFile::GetBoolean(Standard_Boolean& aValue)
{
if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
@@ -591,14 +591,14 @@ Storage_BaseDriver& FSD_CmpFile::GetReal(Standard_Real& aValue)
cerr << "%%%ERROR: read error of double at offset " << myStream.tellg() << endl;
cerr << "\t buffer is" << realbuffer<< endl;
#endif
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
}
if (!OSD::CStringToReal(realbuffer,aValue)) {
#ifdef OCCT_DEBUG
cerr << "%%%ERROR: read error of double at offset " << myStream.tellg() << endl;
cerr << "\t buffer is" << realbuffer<< endl;
#endif
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
}
return *this;
@@ -615,9 +615,9 @@ Storage_BaseDriver& FSD_CmpFile::GetShortReal(Standard_ShortReal& aValue)
Standard_Real r = 0.0;
realbuffer[0] = '\0';
if (!(myStream >> realbuffer)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> realbuffer)) throw Storage_StreamTypeMismatchError();
if (!OSD::CStringToReal(realbuffer,r))
Storage_StreamTypeMismatchError::Raise();
throw Storage_StreamTypeMismatchError();
aValue = (Standard_ShortReal)r;
@@ -645,7 +645,7 @@ Storage_Error FSD_CmpFile::BeginWriteInfoSection()
{
myStream << FSD_CmpFile::MagicNumber() << '\n';
myStream << "BEGIN_INFO_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -678,11 +678,11 @@ void FSD_CmpFile::WriteInfo(const Standard_Integer nbObj,
WriteExtendedLine(dataType);
myStream << userInfo.Length() << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
for (i = 1; i <= userInfo.Length(); i++) {
myStream << userInfo.Value(i).ToCString() << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
}
@@ -694,7 +694,7 @@ void FSD_CmpFile::WriteInfo(const Standard_Integer nbObj,
Storage_Error FSD_CmpFile::EndWriteInfoSection()
{
myStream << "END_INFO_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -736,7 +736,7 @@ void FSD_CmpFile::ReadInfo(Standard_Integer& nbObj,
TCollection_ExtendedString& dataType,
TColStd_SequenceOfAsciiString& userInfo)
{
if (!(myStream >> nbObj)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> nbObj)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
@@ -750,7 +750,7 @@ void FSD_CmpFile::ReadInfo(Standard_Integer& nbObj,
Standard_Integer i,len = 0;
if (!(myStream >> len)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> len)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
@@ -792,7 +792,7 @@ Storage_Error FSD_CmpFile::EndReadInfoSection()
Storage_Error FSD_CmpFile::BeginWriteCommentSection()
{
myStream << "BEGIN_COMMENT_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -807,11 +807,11 @@ void FSD_CmpFile::WriteComment(const TColStd_SequenceOfExtendedString& aCom)
aSize = aCom.Length();
myStream << aSize << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
for (i = 1; i <= aSize; i++) {
WriteExtendedLine(aCom.Value(i));
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
}
@@ -823,7 +823,7 @@ void FSD_CmpFile::WriteComment(const TColStd_SequenceOfExtendedString& aCom)
Storage_Error FSD_CmpFile::EndWriteCommentSection()
{
myStream << "END_COMMENT_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -847,7 +847,7 @@ void FSD_CmpFile::ReadComment(TColStd_SequenceOfExtendedString& aCom)
TCollection_ExtendedString line;
Standard_Integer len,i;
if (!(myStream >> len)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> len)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
@@ -876,7 +876,7 @@ Storage_Error FSD_CmpFile::EndReadCommentSection()
Storage_Error FSD_CmpFile::BeginWriteTypeSection()
{
myStream << "BEGIN_TYPE_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -888,7 +888,7 @@ Storage_Error FSD_CmpFile::BeginWriteTypeSection()
void FSD_CmpFile::SetTypeSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -900,7 +900,7 @@ void FSD_CmpFile::WriteTypeInformations(const Standard_Integer typeNum,
const TCollection_AsciiString& typeName)
{
myStream << typeNum << " " << typeName.ToCString() << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -911,7 +911,7 @@ void FSD_CmpFile::WriteTypeInformations(const Standard_Integer typeNum,
Storage_Error FSD_CmpFile::EndWriteTypeSection()
{
myStream << "END_TYPE_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -934,7 +934,7 @@ Standard_Integer FSD_CmpFile::TypeSectionSize()
{
Standard_Integer i;
if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
@@ -949,8 +949,8 @@ Standard_Integer FSD_CmpFile::TypeSectionSize()
void FSD_CmpFile::ReadTypeInformations(Standard_Integer& typeNum,
TCollection_AsciiString& typeName)
{
if (!(myStream >> typeNum)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> typeName)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> typeNum)) throw Storage_StreamTypeMismatchError();
if (!(myStream >> typeName)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
}
@@ -973,7 +973,7 @@ Storage_Error FSD_CmpFile::EndReadTypeSection()
Storage_Error FSD_CmpFile::BeginWriteRootSection()
{
myStream << "BEGIN_ROOT_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -985,7 +985,7 @@ Storage_Error FSD_CmpFile::BeginWriteRootSection()
void FSD_CmpFile::SetRootSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -996,7 +996,7 @@ void FSD_CmpFile::SetRootSectionSize(const Standard_Integer aSize)
void FSD_CmpFile::WriteRoot(const TCollection_AsciiString& rootName, const Standard_Integer aRef, const TCollection_AsciiString& rootType)
{
myStream << aRef << " " << rootName.ToCString() << " " << rootType.ToCString() << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1007,7 +1007,7 @@ void FSD_CmpFile::WriteRoot(const TCollection_AsciiString& rootName, const Stand
Storage_Error FSD_CmpFile::EndWriteRootSection()
{
myStream << "END_ROOT_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -1030,7 +1030,7 @@ Standard_Integer FSD_CmpFile::RootSectionSize()
{
Standard_Integer i;
if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
@@ -1044,7 +1044,7 @@ Standard_Integer FSD_CmpFile::RootSectionSize()
void FSD_CmpFile::ReadRoot(TCollection_AsciiString& rootName, Standard_Integer& aRef,TCollection_AsciiString& rootType)
{
if (!(myStream >> aRef)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aRef)) throw Storage_StreamTypeMismatchError();
ReadWord(rootName);
ReadWord(rootType);
}
@@ -1068,7 +1068,7 @@ Storage_Error FSD_CmpFile::EndReadRootSection()
Storage_Error FSD_CmpFile::BeginWriteRefSection()
{
myStream << "BEGIN_REF_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -1080,7 +1080,7 @@ Storage_Error FSD_CmpFile::BeginWriteRefSection()
void FSD_CmpFile::SetRefSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1092,7 +1092,7 @@ void FSD_CmpFile::WriteReferenceType(const Standard_Integer reference,
const Standard_Integer typeNum)
{
myStream << reference << " " << typeNum << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1103,7 +1103,7 @@ void FSD_CmpFile::WriteReferenceType(const Standard_Integer reference,
Storage_Error FSD_CmpFile::EndWriteRefSection()
{
myStream << "END_REF_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -1126,7 +1126,7 @@ Standard_Integer FSD_CmpFile::RefSectionSize()
{
Standard_Integer i;
if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
return i;
@@ -1140,8 +1140,8 @@ Standard_Integer FSD_CmpFile::RefSectionSize()
void FSD_CmpFile::ReadReferenceType(Standard_Integer& reference,
Standard_Integer& typeNum)
{
if (!(myStream >> reference)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> typeNum)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> reference)) throw Storage_StreamTypeMismatchError();
if (!(myStream >> typeNum)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
}
@@ -1164,7 +1164,7 @@ Storage_Error FSD_CmpFile::EndReadRefSection()
Storage_Error FSD_CmpFile::BeginWriteDataSection()
{
myStream << "BEGIN_DATA_SECTION";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -1177,7 +1177,7 @@ void FSD_CmpFile::WritePersistentObjectHeader(const Standard_Integer aRef,
const Standard_Integer aType)
{
myStream << "\n#" << aRef << "%" << aType << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1187,7 +1187,7 @@ void FSD_CmpFile::WritePersistentObjectHeader(const Standard_Integer aRef,
void FSD_CmpFile::BeginWritePersistentObjectData()
{
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1197,7 +1197,7 @@ void FSD_CmpFile::BeginWritePersistentObjectData()
void FSD_CmpFile::BeginWriteObjectData()
{
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1207,7 +1207,7 @@ void FSD_CmpFile::BeginWriteObjectData()
void FSD_CmpFile::EndWriteObjectData()
{
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1217,7 +1217,7 @@ void FSD_CmpFile::EndWriteObjectData()
void FSD_CmpFile::EndWritePersistentObjectData()
{
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1228,7 +1228,7 @@ void FSD_CmpFile::EndWritePersistentObjectData()
Storage_Error FSD_CmpFile::EndWriteDataSection()
{
myStream << "\nEND_DATA_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -1256,23 +1256,23 @@ void FSD_CmpFile::ReadPersistentObjectHeader(Standard_Integer& aRef,
while (c != '#') {
if (IsEnd() || (c != ' ') || (c == '\r')|| (c == '\n')) {
Storage_StreamFormatError::Raise();
throw Storage_StreamFormatError();
}
myStream.get(c);
}
if (!(myStream >> aRef)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aRef)) throw Storage_StreamTypeMismatchError();
myStream.get(c);
while (c != '%') {
if (IsEnd() || (c != ' ') || (c == '\r')|| (c == '\n')) {
Storage_StreamFormatError::Raise();
throw Storage_StreamFormatError();
}
myStream.get(c);
}
if (!(myStream >> aType)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aType)) throw Storage_StreamTypeMismatchError();
// cout << "REF:" << aRef << " TYPE:"<< aType << endl;
}
@@ -1318,7 +1318,7 @@ void FSD_CmpFile::EndReadPersistentObjectData()
myStream.get(c);
while (c != '\n' && (c != '\r')) {
if (IsEnd() || (c != ' ')) {
Storage_StreamFormatError::Raise();
throw Storage_StreamFormatError();
}
myStream.get(c);
}

View File

@@ -278,11 +278,11 @@ void FSD_File::ReadExtendedLine(TCollection_ExtendedString& buffer)
}
}
else {
Storage_StreamExtCharParityError::Raise();
throw Storage_StreamExtCharParityError();
}
}
else {
Storage_StreamExtCharParityError::Raise();
throw Storage_StreamExtCharParityError();
}
}
}
@@ -424,7 +424,7 @@ void FSD_File::SkipObject()
Storage_BaseDriver& FSD_File::PutReference(const Standard_Integer aValue)
{
myStream << aValue << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -439,7 +439,7 @@ Storage_BaseDriver& FSD_File::PutCharacter(const Standard_Character aValue)
i = aValue;
myStream << i << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -451,7 +451,7 @@ Storage_BaseDriver& FSD_File::PutCharacter(const Standard_Character aValue)
Storage_BaseDriver& FSD_File::PutExtCharacter(const Standard_ExtCharacter aValue)
{
myStream << (short )aValue << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -463,7 +463,7 @@ Storage_BaseDriver& FSD_File::PutExtCharacter(const Standard_ExtCharacter aValue
Storage_BaseDriver& FSD_File::PutInteger(const Standard_Integer aValue)
{
myStream << aValue << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -475,7 +475,7 @@ Storage_BaseDriver& FSD_File::PutInteger(const Standard_Integer aValue)
Storage_BaseDriver& FSD_File::PutBoolean(const Standard_Boolean aValue)
{
myStream << ((Standard_Integer)aValue) << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -487,7 +487,7 @@ Storage_BaseDriver& FSD_File::PutBoolean(const Standard_Boolean aValue)
Storage_BaseDriver& FSD_File::PutReal(const Standard_Real aValue)
{
myStream << ((Standard_Real)aValue) << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -499,7 +499,7 @@ Storage_BaseDriver& FSD_File::PutReal(const Standard_Real aValue)
Storage_BaseDriver& FSD_File::PutShortReal(const Standard_ShortReal aValue)
{
myStream << aValue << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
@@ -510,7 +510,7 @@ Storage_BaseDriver& FSD_File::PutShortReal(const Standard_ShortReal aValue)
Storage_BaseDriver& FSD_File::GetReference(Standard_Integer& aValue)
{
if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
@@ -527,7 +527,7 @@ Storage_BaseDriver& FSD_File::GetCharacter(Standard_Character& aValue)
// SGI : donne une erreur mais a une bonne valeur pour les caracteres ecrits
// signes (-80 fait ios::badbit, mais la variable i est initialisee)
//
if (i == 0) Storage_StreamTypeMismatchError::Raise();
if (i == 0) throw Storage_StreamTypeMismatchError();
myStream.clear(ios::goodbit); // .clear(0) is not portable
}
aValue = (char)i;
@@ -543,7 +543,7 @@ Storage_BaseDriver& FSD_File::GetCharacter(Standard_Character& aValue)
Storage_BaseDriver& FSD_File::GetExtCharacter(Standard_ExtCharacter& aValue)
{
short aChar = 0;
if (!(myStream >> aChar)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aChar)) throw Storage_StreamTypeMismatchError();
aValue = aChar;
return *this;
}
@@ -555,7 +555,7 @@ Storage_BaseDriver& FSD_File::GetExtCharacter(Standard_ExtCharacter& aValue)
Storage_BaseDriver& FSD_File::GetInteger(Standard_Integer& aValue)
{
if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
@@ -567,7 +567,7 @@ Storage_BaseDriver& FSD_File::GetInteger(Standard_Integer& aValue)
Storage_BaseDriver& FSD_File::GetBoolean(Standard_Boolean& aValue)
{
if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
@@ -583,12 +583,12 @@ Storage_BaseDriver& FSD_File::GetReal(Standard_Real& aValue)
char realbuffer[100];
realbuffer[0] = '\0';
if (!(myStream >> realbuffer)) Storage_StreamTypeMismatchError::Raise();
if (!OSD::CStringToReal(realbuffer,aValue)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> realbuffer)) throw Storage_StreamTypeMismatchError();
if (!OSD::CStringToReal(realbuffer,aValue)) throw Storage_StreamTypeMismatchError();
return *this;
#else
if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
#endif
@@ -606,14 +606,14 @@ Storage_BaseDriver& FSD_File::GetShortReal(Standard_ShortReal& aValue)
Standard_Real r = 0.0;
realbuffer[0] = '\0';
if (!(myStream >> realbuffer)) Storage_StreamTypeMismatchError::Raise();
if (!OSD::CStringToReal(realbuffer,r)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> realbuffer)) throw Storage_StreamTypeMismatchError();
if (!OSD::CStringToReal(realbuffer,r)) throw Storage_StreamTypeMismatchError();
aValue = r;
return *this;
#else
if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
#endif
}
@@ -639,7 +639,7 @@ Storage_Error FSD_File::BeginWriteInfoSection()
{
myStream << FSD_File::MagicNumber() << '\n';
myStream << "BEGIN_INFO_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -672,11 +672,11 @@ void FSD_File::WriteInfo(const Standard_Integer nbObj,
WriteExtendedLine(dataType);
myStream << userInfo.Length() << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
for (i = 1; i <= userInfo.Length(); i++) {
myStream << userInfo.Value(i).ToCString() << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
}
@@ -688,7 +688,7 @@ void FSD_File::WriteInfo(const Standard_Integer nbObj,
Storage_Error FSD_File::EndWriteInfoSection()
{
myStream << "END_INFO_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -730,7 +730,7 @@ void FSD_File::ReadInfo(Standard_Integer& nbObj,
TCollection_ExtendedString& dataType,
TColStd_SequenceOfAsciiString& userInfo)
{
if (!(myStream >> nbObj)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> nbObj)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
@@ -744,7 +744,7 @@ void FSD_File::ReadInfo(Standard_Integer& nbObj,
Standard_Integer i,len = 0;
if (!(myStream >> len)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> len)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
@@ -786,7 +786,7 @@ Storage_Error FSD_File::EndReadInfoSection()
Storage_Error FSD_File::BeginWriteCommentSection()
{
myStream << "BEGIN_COMMENT_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -801,11 +801,11 @@ void FSD_File::WriteComment(const TColStd_SequenceOfExtendedString& aCom)
aSize = aCom.Length();
myStream << aSize << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
for (i = 1; i <= aSize; i++) {
WriteExtendedLine(aCom.Value(i));
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
}
@@ -817,7 +817,7 @@ void FSD_File::WriteComment(const TColStd_SequenceOfExtendedString& aCom)
Storage_Error FSD_File::EndWriteCommentSection()
{
myStream << "END_COMMENT_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -841,7 +841,7 @@ void FSD_File::ReadComment(TColStd_SequenceOfExtendedString& aCom)
TCollection_ExtendedString line;
Standard_Integer len,i;
if (!(myStream >> len)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> len)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
@@ -870,7 +870,7 @@ Storage_Error FSD_File::EndReadCommentSection()
Storage_Error FSD_File::BeginWriteTypeSection()
{
myStream << "BEGIN_TYPE_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -882,7 +882,7 @@ Storage_Error FSD_File::BeginWriteTypeSection()
void FSD_File::SetTypeSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -894,7 +894,7 @@ void FSD_File::WriteTypeInformations(const Standard_Integer typeNum,
const TCollection_AsciiString& typeName)
{
myStream << typeNum << " " << typeName.ToCString() << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -905,7 +905,7 @@ void FSD_File::WriteTypeInformations(const Standard_Integer typeNum,
Storage_Error FSD_File::EndWriteTypeSection()
{
myStream << "END_TYPE_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -928,7 +928,7 @@ Standard_Integer FSD_File::TypeSectionSize()
{
Standard_Integer i;
if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
@@ -943,8 +943,8 @@ Standard_Integer FSD_File::TypeSectionSize()
void FSD_File::ReadTypeInformations(Standard_Integer& typeNum,
TCollection_AsciiString& typeName)
{
if (!(myStream >> typeNum)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> typeName)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> typeNum)) throw Storage_StreamTypeMismatchError();
if (!(myStream >> typeName)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
}
@@ -967,7 +967,7 @@ Storage_Error FSD_File::EndReadTypeSection()
Storage_Error FSD_File::BeginWriteRootSection()
{
myStream << "BEGIN_ROOT_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -979,7 +979,7 @@ Storage_Error FSD_File::BeginWriteRootSection()
void FSD_File::SetRootSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -990,7 +990,7 @@ void FSD_File::SetRootSectionSize(const Standard_Integer aSize)
void FSD_File::WriteRoot(const TCollection_AsciiString& rootName, const Standard_Integer aRef, const TCollection_AsciiString& rootType)
{
myStream << aRef << " " << rootName.ToCString() << " " << rootType.ToCString() << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1001,7 +1001,7 @@ void FSD_File::WriteRoot(const TCollection_AsciiString& rootName, const Standard
Storage_Error FSD_File::EndWriteRootSection()
{
myStream << "END_ROOT_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -1024,7 +1024,7 @@ Standard_Integer FSD_File::RootSectionSize()
{
Standard_Integer i;
if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
@@ -1038,7 +1038,7 @@ Standard_Integer FSD_File::RootSectionSize()
void FSD_File::ReadRoot(TCollection_AsciiString& rootName, Standard_Integer& aRef,TCollection_AsciiString& rootType)
{
if (!(myStream >> aRef)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aRef)) throw Storage_StreamTypeMismatchError();
ReadWord(rootName);
ReadWord(rootType);
}
@@ -1062,7 +1062,7 @@ Storage_Error FSD_File::EndReadRootSection()
Storage_Error FSD_File::BeginWriteRefSection()
{
myStream << "BEGIN_REF_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -1074,7 +1074,7 @@ Storage_Error FSD_File::BeginWriteRefSection()
void FSD_File::SetRefSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1086,7 +1086,7 @@ void FSD_File::WriteReferenceType(const Standard_Integer reference,
const Standard_Integer typeNum)
{
myStream << reference << " " << typeNum << "\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1097,7 +1097,7 @@ void FSD_File::WriteReferenceType(const Standard_Integer reference,
Storage_Error FSD_File::EndWriteRefSection()
{
myStream << "END_REF_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -1120,7 +1120,7 @@ Standard_Integer FSD_File::RefSectionSize()
{
Standard_Integer i;
if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
return i;
@@ -1134,8 +1134,8 @@ Standard_Integer FSD_File::RefSectionSize()
void FSD_File::ReadReferenceType(Standard_Integer& reference,
Standard_Integer& typeNum)
{
if (!(myStream >> reference)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> typeNum)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> reference)) throw Storage_StreamTypeMismatchError();
if (!(myStream >> typeNum)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
}
@@ -1158,7 +1158,7 @@ Storage_Error FSD_File::EndReadRefSection()
Storage_Error FSD_File::BeginWriteDataSection()
{
myStream << "BEGIN_DATA_SECTION";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -1171,7 +1171,7 @@ void FSD_File::WritePersistentObjectHeader(const Standard_Integer aRef,
const Standard_Integer aType)
{
myStream << "\n#" << aRef << "=%" << aType;
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1182,7 +1182,7 @@ void FSD_File::WritePersistentObjectHeader(const Standard_Integer aRef,
void FSD_File::BeginWritePersistentObjectData()
{
myStream << "( ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1193,7 +1193,7 @@ void FSD_File::BeginWritePersistentObjectData()
void FSD_File::BeginWriteObjectData()
{
myStream << "( ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1204,7 +1204,7 @@ void FSD_File::BeginWriteObjectData()
void FSD_File::EndWriteObjectData()
{
myStream << ") ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1215,7 +1215,7 @@ void FSD_File::EndWriteObjectData()
void FSD_File::EndWritePersistentObjectData()
{
myStream << ")";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
@@ -1226,7 +1226,7 @@ void FSD_File::EndWritePersistentObjectData()
Storage_Error FSD_File::EndWriteDataSection()
{
myStream << "\nEND_DATA_SECTION\n";
if (myStream.bad()) Storage_StreamWriteError::Raise();
if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
@@ -1254,19 +1254,19 @@ void FSD_File::ReadPersistentObjectHeader(Standard_Integer& aRef,
while (c != '#') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
Storage_StreamFormatError::Raise();
throw Storage_StreamFormatError();
}
myStream.get(c);
}
if (!(myStream >> aRef)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aRef)) throw Storage_StreamTypeMismatchError();
myStream.get(c);
while (c != '=') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
Storage_StreamFormatError::Raise();
throw Storage_StreamFormatError();
}
myStream.get(c);
}
@@ -1275,12 +1275,12 @@ void FSD_File::ReadPersistentObjectHeader(Standard_Integer& aRef,
while (c != '%') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
Storage_StreamFormatError::Raise();
throw Storage_StreamFormatError();
}
myStream.get(c);
}
if (!(myStream >> aType)) Storage_StreamTypeMismatchError::Raise();
if (!(myStream >> aType)) throw Storage_StreamTypeMismatchError();
// cout << "REF:" << aRef << " TYPE:"<< aType << endl;
}
@@ -1295,7 +1295,7 @@ void FSD_File::BeginReadPersistentObjectData()
myStream.get(c);
while (c != '(') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
Storage_StreamFormatError::Raise();
throw Storage_StreamFormatError();
}
myStream.get(c);
}
@@ -1315,7 +1315,7 @@ void FSD_File::BeginReadObjectData()
myStream.get(c);
while (c != '(') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
Storage_StreamFormatError::Raise();
throw Storage_StreamFormatError();
}
myStream.get(c);
}
@@ -1335,7 +1335,7 @@ void FSD_File::EndReadObjectData()
myStream.get(c);
while (c != ')') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
Storage_StreamFormatError::Raise();
throw Storage_StreamFormatError();
}
myStream.get(c);
}
@@ -1356,7 +1356,7 @@ void FSD_File::EndReadPersistentObjectData()
myStream.get(c);
while (c != ')') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
Storage_StreamFormatError::Raise();
throw Storage_StreamFormatError();
}
myStream.get(c);
}
@@ -1364,7 +1364,7 @@ void FSD_File::EndReadPersistentObjectData()
myStream.get(c);
while (c != '\n') {
if (IsEnd() || (c != ' ')) {
Storage_StreamFormatError::Raise();
throw Storage_StreamFormatError();
}
myStream.get(c);
}