1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +03:00

0032352: Coding Rules - clean up code from compatibility hacks with pre-C++11 compilers

Removed usage of std::auto_ptr.
opencascade::std workarounds for VS2008 have been dropped, when possible.
OCCT_NO_RVALUE_REFERENCE workaround for VS2008 has been removed.
This commit is contained in:
kgv 2021-12-02 15:51:11 +03:00 committed by smoskvin
parent 30fa5f6713
commit 65acdce54c
64 changed files with 174 additions and 354 deletions

View File

@ -183,7 +183,7 @@ private:
private: private:
opencascade::std::shared_ptr<GeomPlate_BuildPlateSurface> myBuilder; std::shared_ptr<GeomPlate_BuildPlateSurface> myBuilder;
BRepFill_SequenceOfEdgeFaceAndOrder myBoundary; BRepFill_SequenceOfEdgeFaceAndOrder myBoundary;
BRepFill_SequenceOfEdgeFaceAndOrder myConstraints; BRepFill_SequenceOfEdgeFaceAndOrder myConstraints;
BRepFill_SequenceOfFaceAndOrder myFreeConstraints; BRepFill_SequenceOfFaceAndOrder myFreeConstraints;

View File

@ -712,7 +712,7 @@ Standard_Boolean BRepTools::Write (const TopoDS_Shape& theShape,
const Message_ProgressRange& theProgress) const Message_ProgressRange& theProgress)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (theFile, std::ios::out); std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (theFile, std::ios::out);
if (aStream.get() == NULL || !aStream->good()) if (aStream.get() == NULL || !aStream->good())
{ {
return Standard_False; return Standard_False;
@ -754,7 +754,7 @@ Standard_Boolean BRepTools::Read(TopoDS_Shape& Sh,
const Message_ProgressRange& theProgress) const Message_ProgressRange& theProgress)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (File, std::ios::in); std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (File, std::ios::in);
if (aStream.get() == NULL) if (aStream.get() == NULL)
{ {
return Standard_False; return Standard_False;

View File

@ -215,21 +215,21 @@ BVH_Tree<T, N, BVH_QuadTree>* BVH_Tree<T, N, BVH_BinaryTree>::CollapseToQuadTree
{ {
const std::pair<int, int> aNode = aQueue.front(); const std::pair<int, int> aNode = aQueue.front();
BVH::Array<T, N>::Append (aQBVH->myMinPointBuffer, BVH::Array<T, N>::Value (this->myMinPointBuffer, opencascade::std::get<0> (aNode))); BVH::Array<T, N>::Append (aQBVH->myMinPointBuffer, BVH::Array<T, N>::Value (this->myMinPointBuffer, std::get<0> (aNode)));
BVH::Array<T, N>::Append (aQBVH->myMaxPointBuffer, BVH::Array<T, N>::Value (this->myMaxPointBuffer, opencascade::std::get<0> (aNode))); BVH::Array<T, N>::Append (aQBVH->myMaxPointBuffer, BVH::Array<T, N>::Value (this->myMaxPointBuffer, std::get<0> (aNode)));
BVH_Vec4i aNodeInfo; BVH_Vec4i aNodeInfo;
if (this->IsOuter (opencascade::std::get<0> (aNode))) // is leaf node if (this->IsOuter (std::get<0> (aNode))) // is leaf node
{ {
aNodeInfo = BVH_Vec4i (1 /* leaf flag */, aNodeInfo = BVH_Vec4i (1 /* leaf flag */,
this->BegPrimitive (opencascade::std::get<0> (aNode)), this->EndPrimitive (opencascade::std::get<0> (aNode)), opencascade::std::get<1> (aNode) /* level */); this->BegPrimitive (std::get<0> (aNode)), this->EndPrimitive (std::get<0> (aNode)), std::get<1> (aNode) /* level */);
} }
else else
{ {
NCollection_Vector<int> aGrandChildNodes; NCollection_Vector<int> aGrandChildNodes;
const int aLftChild = Child<0> (opencascade::std::get<0> (aNode)); const int aLftChild = Child<0> (std::get<0> (aNode));
const int aRghChild = Child<1> (opencascade::std::get<0> (aNode)); const int aRghChild = Child<1> (std::get<0> (aNode));
if (this->IsOuter (aLftChild)) // is leaf node if (this->IsOuter (aLftChild)) // is leaf node
{ {
aGrandChildNodes.Append (aLftChild); aGrandChildNodes.Append (aLftChild);
@ -252,13 +252,13 @@ BVH_Tree<T, N, BVH_QuadTree>* BVH_Tree<T, N, BVH_BinaryTree>::CollapseToQuadTree
for (int aNodeIdx = 0; aNodeIdx < aGrandChildNodes.Size(); ++aNodeIdx) for (int aNodeIdx = 0; aNodeIdx < aGrandChildNodes.Size(); ++aNodeIdx)
{ {
aQueue.push_back (std::make_pair (aGrandChildNodes (aNodeIdx), opencascade::std::get<1> (aNode) + 1)); aQueue.push_back (std::make_pair (aGrandChildNodes (aNodeIdx), std::get<1> (aNode) + 1));
} }
aNodeInfo = BVH_Vec4i (0 /* inner flag */, aNodeInfo = BVH_Vec4i (0 /* inner flag */,
aNbNodes, aGrandChildNodes.Size() - 1, opencascade::std::get<1> (aNode) /* level */); aNbNodes, aGrandChildNodes.Size() - 1, std::get<1> (aNode) /* level */);
aQBVH->myDepth = Max (aQBVH->myDepth, opencascade::std::get<1> (aNode) + 1); aQBVH->myDepth = Max (aQBVH->myDepth, std::get<1> (aNode) + 1);
aNbNodes += aGrandChildNodes.Size(); aNbNodes += aGrandChildNodes.Size();
} }

View File

@ -275,14 +275,7 @@ namespace BVH
if (Size (theArray) == theCount) if (Size (theArray) == theCount)
{ {
#ifdef _STD_VECTOR_SHRINK #ifdef _STD_VECTOR_SHRINK
#if(defined(_MSC_VER) && (_MSC_VER < 1600))
BVH_ArrayNt aTmpArray(theArray);
theArray.swap(aTmpArray);
#else
theArray.shrink_to_fit(); theArray.shrink_to_fit();
#endif
#endif #endif
} }
else else

View File

@ -78,7 +78,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read
const Message_ProgressRange& theRange) const Message_ProgressRange& theRange)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFileStream = aFileSystem->OpenIStream (theFileName, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aFileStream = aFileSystem->OpenIStream (theFileName, std::ios::in | std::ios::binary);
if (aFileStream.get() != NULL && aFileStream->good()) if (aFileStream.get() != NULL && aFileStream->good())
{ {

View File

@ -75,7 +75,7 @@ void BinLDrivers_DocumentStorageDriver::Write
myFileName = theFileName; myFileName = theFileName;
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aFileStream = aFileSystem->OpenOStream (theFileName, std::ios::out | std::ios::binary); std::shared_ptr<std::ostream> aFileStream = aFileSystem->OpenOStream (theFileName, std::ios::out | std::ios::binary);
if (aFileStream.get() != NULL && aFileStream->good()) if (aFileStream.get() != NULL && aFileStream->good())
{ {

View File

@ -215,7 +215,7 @@ Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape,
const Message_ProgressRange& theRange) const Message_ProgressRange& theRange)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary); std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary);
aStream->precision (15); aStream->precision (15);
if (aStream.get() == NULL || !aStream->good()) if (aStream.get() == NULL || !aStream->good())
return Standard_False; return Standard_False;
@ -234,7 +234,7 @@ Standard_Boolean BinTools::Read (TopoDS_Shape& theShape, const Standard_CString
const Message_ProgressRange& theRange) const Message_ProgressRange& theRange)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (theFile, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (theFile, std::ios::in | std::ios::binary);
if (aStream.get() == NULL) if (aStream.get() == NULL)
{ {
return Standard_False; return Standard_False;

View File

@ -789,13 +789,8 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
radius = Max(dis, radiusspine); radius = Max(dis, radiusspine);
locfleche = radius*1.e-2; //graphic criterion locfleche = radius*1.e-2; //graphic criterion
#if (defined(_MSC_VER) && (_MSC_VER < 1600))
std::auto_ptr<BlendFunc_GenChamfer> pFunc;
std::auto_ptr<BlendFunc_GenChamfInv> pFInv;
#else
std::unique_ptr<BlendFunc_GenChamfer> pFunc; std::unique_ptr<BlendFunc_GenChamfer> pFunc;
std::unique_ptr<BlendFunc_GenChamfInv> pFInv; std::unique_ptr<BlendFunc_GenChamfInv> pFInv;
#endif
if (chsp->Mode() == ChFiDS_ClassicChamfer) if (chsp->Mode() == ChFiDS_ClassicChamfer)
{ {
pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide)); pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide));
@ -886,13 +881,8 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
radius = Max(radius, radiusspine); radius = Max(radius, radiusspine);
locfleche = radius*1.e-2; //graphic criterion locfleche = radius*1.e-2; //graphic criterion
#if (defined(_MSC_VER) && (_MSC_VER < 1600))
std::auto_ptr<BlendFunc_GenChamfer> pFunc;
std::auto_ptr<BlendFunc_GenChamfInv> pFInv;
#else
std::unique_ptr<BlendFunc_GenChamfer> pFunc; std::unique_ptr<BlendFunc_GenChamfer> pFunc;
std::unique_ptr<BlendFunc_GenChamfInv> pFInv; std::unique_ptr<BlendFunc_GenChamfInv> pFInv;
#endif
if (chsp->Mode() == ChFiDS_ClassicChamfer) if (chsp->Mode() == ChFiDS_ClassicChamfer)
{ {
pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide)); pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide));
@ -1202,11 +1192,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection
Standard_Real dis; Standard_Real dis;
chsp->GetDist(dis); chsp->GetDist(dis);
#if (defined(_MSC_VER) && (_MSC_VER < 1600))
std::auto_ptr<BlendFunc_GenChamfer> pFunc;
#else
std::unique_ptr<BlendFunc_GenChamfer> pFunc; std::unique_ptr<BlendFunc_GenChamfer> pFunc;
#endif
if (chsp->Mode() == ChFiDS_ClassicChamfer) if (chsp->Mode() == ChFiDS_ClassicChamfer)
{ {
pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide)); pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide));
@ -1274,11 +1260,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection
Standard_Real dis1, dis2; Standard_Real dis1, dis2;
chsp->Dists(dis1, dis2); chsp->Dists(dis1, dis2);
#if (defined(_MSC_VER) && (_MSC_VER < 1600))
std::auto_ptr<BlendFunc_GenChamfer> pFunc;
#else
std::unique_ptr<BlendFunc_GenChamfer> pFunc; std::unique_ptr<BlendFunc_GenChamfer> pFunc;
#endif
if (chsp->Mode() == ChFiDS_ClassicChamfer) if (chsp->Mode() == ChFiDS_ClassicChamfer)
{ {
pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide)); pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide));
@ -1493,13 +1475,8 @@ ChFi3d_ChBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& SeqData,
if (chsp->IsChamfer() == ChFiDS_Sym) { if (chsp->IsChamfer() == ChFiDS_Sym) {
#if (defined(_MSC_VER) && (_MSC_VER < 1600))
std::auto_ptr<BlendFunc_GenChamfer> pFunc;
std::auto_ptr<BlendFunc_GenChamfInv> pFInv;
#else
std::unique_ptr<BlendFunc_GenChamfer> pFunc; std::unique_ptr<BlendFunc_GenChamfer> pFunc;
std::unique_ptr<BlendFunc_GenChamfInv> pFInv; std::unique_ptr<BlendFunc_GenChamfInv> pFInv;
#endif
if (chsp->Mode() == ChFiDS_ClassicChamfer) if (chsp->Mode() == ChFiDS_ClassicChamfer)
{ {
pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide)); pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide));
@ -1527,13 +1504,8 @@ ChFi3d_ChBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& SeqData,
Standard_Real d1, d2; Standard_Real d1, d2;
chsp->Dists(d1,d2); chsp->Dists(d1,d2);
#if (defined(_MSC_VER) && (_MSC_VER < 1600))
std::auto_ptr<BlendFunc_GenChamfer> pFunc;
std::auto_ptr<BlendFunc_GenChamfInv> pFInv;
#else
std::unique_ptr<BlendFunc_GenChamfer> pFunc; std::unique_ptr<BlendFunc_GenChamfer> pFunc;
std::unique_ptr<BlendFunc_GenChamfInv> pFInv; std::unique_ptr<BlendFunc_GenChamfInv> pFInv;
#endif
if (chsp->Mode() == ChFiDS_ClassicChamfer) if (chsp->Mode() == ChFiDS_ClassicChamfer)
{ {
pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide)); pFunc.reset(new BRepBlend_Chamfer(S1,S2,HGuide));

View File

@ -1580,7 +1580,7 @@ static Standard_Integer readbrep (Draw_Interpretor& theDI,
{ {
// probe file header to recognize format // probe file header to recognize format
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (aFileName, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (aFileName, std::ios::in | std::ios::binary);
if (aFile.get() == NULL) if (aFile.get() == NULL)
{ {
theDI << "Error: cannot read the file '" << aFileName << "'"; theDI << "Error: cannot read the file '" << aFileName << "'";

View File

@ -180,7 +180,7 @@ static Standard_Integer DDocStd_Open (Draw_Interpretor& di,
if (anUseStream) if (anUseStream)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFileStream = aFileSystem->OpenIStream (path, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aFileStream = aFileSystem->OpenIStream (path, std::ios::in | std::ios::binary);
theStatus = A->Open (*aFileStream, D, aFilter, aProgress->Start()); theStatus = A->Open (*aFileStream, D, aFilter, aProgress->Start());
} }
@ -298,7 +298,7 @@ static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
if (anUseStream) if (anUseStream)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aFileStream = aFileSystem->OpenOStream (path, std::ios::out | std::ios::binary); std::shared_ptr<std::ostream> aFileStream = aFileSystem->OpenOStream (path, std::ios::out | std::ios::binary);
theStatus = A->SaveAs (D, *aFileStream, aProgress->Start()); theStatus = A->SaveAs (D, *aFileStream, aProgress->Start());
} }
else else

View File

@ -92,7 +92,7 @@ static Standard_Integer save (Draw_Interpretor& theDI,
const char* aName = theArgVec[2]; const char* aName = theArgVec[2];
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (aName, std::ios::out); std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (aName, std::ios::out);
aStream->precision (15); aStream->precision (15);
if (aStream.get() == NULL || !aStream->good()) if (aStream.get() == NULL || !aStream->good())
{ {
@ -145,7 +145,7 @@ static Standard_Integer restore (Draw_Interpretor& theDI,
const char* aVarName = theArgVec[2]; const char* aVarName = theArgVec[2];
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (aFileName, std::ios::in); std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (aFileName, std::ios::in);
if (aStream.get() == NULL) if (aStream.get() == NULL)
{ {
theDI << "Error: cannot open file for reading: '" << aFileName << "'"; theDI << "Error: cannot open file for reading: '" << aFileName << "'";

View File

@ -254,7 +254,7 @@ Standard_Boolean IGESControl_Writer::Write
(const Standard_CString file, const Standard_Boolean fnes) (const Standard_CString file, const Standard_Boolean fnes)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (file, std::ios::out); std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (file, std::ios::out);
if (aStream.get() == NULL) if (aStream.get() == NULL)
{ {
return Standard_False; return Standard_False;

View File

@ -102,7 +102,7 @@ static Handle(IGESData_FileProtocol) IGESProto;
if (igesmod.IsNull() || prot.IsNull()) return Standard_False; if (igesmod.IsNull() || prot.IsNull()) return Standard_False;
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out); std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out);
if (aStream.get() == NULL) if (aStream.get() == NULL)
{ {
ctx.CCheck(0)->AddFail("IGES File could not be created"); ctx.CCheck(0)->AddFail("IGES File could not be created");

View File

@ -68,7 +68,7 @@ Handle(Image_CompressedPixMap) Image_DDSParser::Load (const Handle(Image_Support
const int64_t theFileOffset) const int64_t theFileOffset)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (theFile, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (theFile, std::ios::in | std::ios::binary);
char aHeader[128] = {}; char aHeader[128] = {};
if (aFile.get() == NULL || !aFile->good()) if (aFile.get() == NULL || !aFile->good())
{ {

View File

@ -186,7 +186,7 @@ Handle(Image_PixMap) Image_Texture::loadImageOffset (const TCollection_AsciiStri
} }
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (thePath, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (thePath, std::ios::in | std::ios::binary);
if (aFile.get() == NULL) if (aFile.get() == NULL)
{ {
Message::SendFail (TCollection_AsciiString ("Error: Image file '") + thePath + "' cannot be opened"); Message::SendFail (TCollection_AsciiString ("Error: Image file '") + thePath + "' cannot be opened");
@ -252,7 +252,7 @@ TCollection_AsciiString Image_Texture::ProbeImageFileFormat() const
else else
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFileIn = aFileSystem->OpenIStream (myImagePath, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aFileIn = aFileSystem->OpenIStream (myImagePath, std::ios::in | std::ios::binary);
if (aFileIn.get() == NULL) if (aFileIn.get() == NULL)
{ {
Message::SendFail (TCollection_AsciiString ("Error: Unable to open file '") + myImagePath + "'"); Message::SendFail (TCollection_AsciiString ("Error: Unable to open file '") + myImagePath + "'");
@ -316,7 +316,7 @@ TCollection_AsciiString Image_Texture::ProbeImageFileFormat() const
Standard_Boolean Image_Texture::WriteImage (const TCollection_AsciiString& theFile) Standard_Boolean Image_Texture::WriteImage (const TCollection_AsciiString& theFile)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aFileOut = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary | std::ios::trunc); std::shared_ptr<std::ostream> aFileOut = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary | std::ios::trunc);
if (aFileOut.get() == NULL) if (aFileOut.get() == NULL)
{ {
Message::SendFail (TCollection_AsciiString ("Error: Unable to create file '") + theFile + "'"); Message::SendFail (TCollection_AsciiString ("Error: Unable to create file '") + theFile + "'");
@ -357,7 +357,7 @@ Standard_Boolean Image_Texture::WriteImage (std::ostream& theStream,
} }
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFileIn = aFileSystem->OpenIStream (myImagePath, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aFileIn = aFileSystem->OpenIStream (myImagePath, std::ios::in | std::ios::binary);
if (aFileIn.get() == NULL) if (aFileIn.get() == NULL)
{ {
Message::SendFail (TCollection_AsciiString ("Error: Unable to open file ") + myImagePath + "!"); Message::SendFail (TCollection_AsciiString ("Error: Unable to open file ") + myImagePath + "!");

View File

@ -359,11 +359,7 @@ void BoundedArc (const TheArc& A,
Standard_Boolean IsIntCSdone = Standard_False; Standard_Boolean IsIntCSdone = Standard_False;
TColStd_SequenceOfReal Params; TColStd_SequenceOfReal Params;
#if (defined(_MSC_VER) && (_MSC_VER < 1600))
std::auto_ptr<math_FunctionAllRoots> pSol;
#else
std::unique_ptr<math_FunctionAllRoots> pSol; std::unique_ptr<math_FunctionAllRoots> pSol;
#endif
math_FunctionSample Echant(Pdeb,Pfin,NbEchant); math_FunctionSample Echant(Pdeb,Pfin,NbEchant);

View File

@ -823,19 +823,20 @@ TopAbs_State IntTools_FClass2d::TestOnRestriction
} }
} //for (;;) } //for (;;)
} }
//======================================================================= //=======================================================================
//function : Destroy //function : ~IntTools_FClass2d
//purpose : //purpose :
//======================================================================= //=======================================================================
void IntTools_FClass2d::Destroy() IntTools_FClass2d::~IntTools_FClass2d()
{ {
Standard_Integer nbtabclass = TabClass.Length(); Standard_Integer nbtabclass = TabClass.Length();
for(Standard_Integer d=1; d<=nbtabclass;d++) { for (Standard_Integer d = 1; d <= nbtabclass; d++)
if(TabClass(d)) { {
if (TabClass(d))
{
delete ((CSLib_Class2d *)TabClass(d)); delete ((CSLib_Class2d *)TabClass(d));
TabClass(d)=NULL; TabClass(d)=NULL;
} }
} }
} }

View File

@ -40,40 +40,28 @@ public:
DEFINE_STANDARD_ALLOC DEFINE_STANDARD_ALLOC
//! Empty constructor //! Empty constructor
Standard_EXPORT IntTools_FClass2d(); Standard_EXPORT IntTools_FClass2d();
//! Initializes algorithm by the face F //! Initializes algorithm by the face F
//! and tolerance Tol //! and tolerance Tol
Standard_EXPORT IntTools_FClass2d(const TopoDS_Face& F, const Standard_Real Tol); Standard_EXPORT IntTools_FClass2d(const TopoDS_Face& F, const Standard_Real Tol);
//! Initializes algorithm by the face F //! Initializes algorithm by the face F
//! and tolerance Tol //! and tolerance Tol
Standard_EXPORT void Init (const TopoDS_Face& F, const Standard_Real Tol); Standard_EXPORT void Init (const TopoDS_Face& F, const Standard_Real Tol);
//! Returns state of infinite 2d point relatively to (0, 0) //! Returns state of infinite 2d point relatively to (0, 0)
Standard_EXPORT TopAbs_State PerformInfinitePoint() const; Standard_EXPORT TopAbs_State PerformInfinitePoint() const;
//! Returns state of the 2d point Puv. //! Returns state of the 2d point Puv.
//! If RecadreOnPeriodic is true (defalut value), //! If RecadreOnPeriodic is true (default value),
//! for the periodic surface 2d point, adjusted to period, is //! for the periodic surface 2d point, adjusted to period, is
//! classified. //! classified.
Standard_EXPORT TopAbs_State Perform (const gp_Pnt2d& Puv, const Standard_Boolean RecadreOnPeriodic = Standard_True) const; Standard_EXPORT TopAbs_State Perform (const gp_Pnt2d& Puv, const Standard_Boolean RecadreOnPeriodic = Standard_True) const;
//! Destructor //! Destructor
Standard_EXPORT void Destroy(); Standard_EXPORT ~IntTools_FClass2d();
~IntTools_FClass2d()
{
Destroy();
}
//! Test a point with +- an offset (Tol) and returns //! Test a point with +- an offset (Tol) and returns
//! On if some points are OUT an some are IN //! On if some points are OUT an some are IN
@ -82,19 +70,8 @@ public:
Standard_EXPORT Standard_Boolean IsHole() const; Standard_EXPORT Standard_Boolean IsHole() const;
protected:
private: private:
BRepTopAdaptor_SeqOfPtr TabClass; BRepTopAdaptor_SeqOfPtr TabClass;
TColStd_SequenceOfInteger TabOrien; TColStd_SequenceOfInteger TabOrien;
Standard_Real Toluv; Standard_Real Toluv;
@ -109,22 +86,8 @@ private:
Standard_Real Vmax; Standard_Real Vmax;
Standard_Boolean myIsHole; Standard_Boolean myIsHole;
#ifdef _MSC_VER
#if _MSC_VER < 1600
mutable std::auto_ptr<BRepClass_FaceExplorer> myFExplorer;
#else
mutable std::unique_ptr<BRepClass_FaceExplorer> myFExplorer; mutable std::unique_ptr<BRepClass_FaceExplorer> myFExplorer;
#endif
#else
mutable std::unique_ptr<BRepClass_FaceExplorer> myFExplorer;
#endif
}; };
#endif // _IntTools_FClass2d_HeaderFile #endif // _IntTools_FClass2d_HeaderFile

View File

@ -148,7 +148,7 @@ Standard_Boolean LDOMParser::parse (std::istream& anInput,
Standard_Boolean LDOMParser::parse (const char * const aFileName) Standard_Boolean LDOMParser::parse (const char * const aFileName)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFileStream = aFileSystem->OpenIStream (aFileName, std::ios::in); std::shared_ptr<std::istream> aFileStream = aFileSystem->OpenIStream (aFileName, std::ios::in);
if (aFileStream.get() != NULL && aFileStream->good()) if (aFileStream.get() != NULL && aFileStream->good())
{ {

View File

@ -64,14 +64,12 @@ public:
} }
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move constructor //! Move constructor
NCollection_AliasedArray (NCollection_AliasedArray&& theOther) NCollection_AliasedArray (NCollection_AliasedArray&& theOther)
: myData (theOther.myData), myStride (theOther.myStride), mySize (theOther.mySize), myDeletable (theOther.myDeletable) : myData (theOther.myData), myStride (theOther.myStride), mySize (theOther.mySize), myDeletable (theOther.myDeletable)
{ {
theOther.myDeletable = false; theOther.myDeletable = false;
} }
#endif
//! Constructor wrapping pre-allocated C-array of values without copying them. //! Constructor wrapping pre-allocated C-array of values without copying them.
template<typename Type_t> template<typename Type_t>
@ -155,13 +153,11 @@ public:
return Assign (theOther); return Assign (theOther);
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move assignment operator; @sa Move() //! Move assignment operator; @sa Move()
NCollection_AliasedArray& operator= (NCollection_AliasedArray&& theOther) NCollection_AliasedArray& operator= (NCollection_AliasedArray&& theOther)
{ {
return Move (theOther); return Move (theOther);
} }
#endif
//! Resizes the array to specified bounds. //! Resizes the array to specified bounds.
//! No re-allocation will be done if length of array does not change, //! No re-allocation will be done if length of array does not change,

View File

@ -176,7 +176,6 @@ public:
Assign (theOther); Assign (theOther);
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move constructor //! Move constructor
NCollection_Array1 (NCollection_Array1&& theOther) NCollection_Array1 (NCollection_Array1&& theOther)
: myLowerBound (theOther.myLowerBound), : myLowerBound (theOther.myLowerBound),
@ -186,7 +185,6 @@ public:
{ {
theOther.myDeletable = false; theOther.myDeletable = false;
} }
#endif
//! C array-based constructor. //! C array-based constructor.
//! //!
@ -311,13 +309,11 @@ public:
return Assign (theOther); return Assign (theOther);
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move assignment operator; @sa Move() //! Move assignment operator; @sa Move()
NCollection_Array1& operator= (NCollection_Array1&& theOther) NCollection_Array1& operator= (NCollection_Array1&& theOther)
{ {
return Move (theOther); return Move (theOther);
} }
#endif
//! @return first element //! @return first element
const TheItemType& First() const const TheItemType& First() const

View File

@ -126,7 +126,6 @@ public:
*this = theOther; *this = theOther;
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move constructor //! Move constructor
NCollection_Array2 (NCollection_Array2&& theOther) NCollection_Array2 (NCollection_Array2&& theOther)
: myLowerRow (theOther.myLowerRow), : myLowerRow (theOther.myLowerRow),
@ -141,7 +140,6 @@ public:
theOther.myData = NULL; theOther.myData = NULL;
theOther.myDeletable = false; theOther.myDeletable = false;
} }
#endif
//! C array-based constructor //! C array-based constructor
NCollection_Array2(const TheItemType& theBegin, NCollection_Array2(const TheItemType& theBegin,
@ -256,13 +254,11 @@ public:
return Assign (theOther); return Assign (theOther);
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move assignment operator; @sa Move() //! Move assignment operator; @sa Move()
NCollection_Array2& operator= (NCollection_Array2&& theOther) NCollection_Array2& operator= (NCollection_Array2&& theOther)
{ {
return Move (theOther); return Move (theOther);
} }
#endif
//! Constant value access //! Constant value access
const TheItemType& Value (const Standard_Integer theRow, const TheItemType& Value (const Standard_Integer theRow,

View File

@ -28,8 +28,8 @@
template<class Category, class BaseIterator, class ItemType, bool IsConstant> template<class Category, class BaseIterator, class ItemType, bool IsConstant>
class NCollection_StlIterator : class NCollection_StlIterator :
public std::iterator<Category, ItemType, ptrdiff_t, public std::iterator<Category, ItemType, ptrdiff_t,
typename opencascade::std::conditional<IsConstant, const ItemType*, ItemType*>::type, typename std::conditional<IsConstant, const ItemType*, ItemType*>::type,
typename opencascade::std::conditional<IsConstant, const ItemType&, ItemType&>::type> typename std::conditional<IsConstant, const ItemType&, ItemType&>::type>
{ {
public: public:
@ -71,13 +71,13 @@ protected: //! @name methods related to forward STL iterator
// an appropriate method based on template arguments (at instantiation time). // an appropriate method based on template arguments (at instantiation time).
template<bool Condition> template<bool Condition>
typename opencascade::std::enable_if<!Condition, ItemType&>::type Reference() const typename std::enable_if<!Condition, ItemType&>::type Reference() const
{ {
return myIterator.ChangeValue(); return myIterator.ChangeValue();
} }
template<bool Condition> template<bool Condition>
typename opencascade::std::enable_if<Condition, const ItemType&>::type Reference() const typename std::enable_if<Condition, const ItemType&>::type Reference() const
{ {
return myIterator.Value(); return myIterator.Value();
} }

View File

@ -128,10 +128,10 @@ template <class TheObjType, class TheBndType> class NCollection_UBTreeFiller
private: private:
// ---------- PRIVATE FIELDS ---------- // ---------- PRIVATE FIELDS ----------
UBTree& myTree; UBTree& myTree;
NCollection_Vector<ObjBnd> mySeqPtr; NCollection_Vector<ObjBnd> mySeqPtr;
opencascade::std::mt19937 myRandGen; //!< random number generator std::mt19937 myRandGen; //!< random number generator
Standard_Boolean myIsFullRandom; Standard_Boolean myIsFullRandom;
}; };
//======================================================================= //=======================================================================

View File

@ -185,9 +185,9 @@ private:
//! Standard_Utf16Char on Windows and to Standard_Utf32Char on Linux. //! Standard_Utf16Char on Windows and to Standard_Utf32Char on Linux.
template <typename TypeChar> template <typename TypeChar>
class CharTypeChooser : class CharTypeChooser :
public opencascade::std::conditional< sizeof(TypeChar) == 1, Standard_Utf8Char, public std::conditional< sizeof(TypeChar) == 1, Standard_Utf8Char,
typename opencascade::std::conditional< sizeof(TypeChar) == 2, Standard_Utf16Char, typename std::conditional< sizeof(TypeChar) == 2, Standard_Utf16Char,
typename opencascade::std::conditional< sizeof(TypeChar) == 4, Standard_Utf32Char, void >::type >::type > typename std::conditional< sizeof(TypeChar) == 4, Standard_Utf32Char, void >::type >::type >
{ {
}; };

View File

@ -80,10 +80,8 @@ public:
//! @param theCopy string to copy. //! @param theCopy string to copy.
NCollection_UtfString (const NCollection_UtfString& theCopy); NCollection_UtfString (const NCollection_UtfString& theCopy);
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move constructor //! Move constructor
NCollection_UtfString (NCollection_UtfString&& theOther); NCollection_UtfString (NCollection_UtfString&& theOther);
#endif
//! Copy constructor from UTF-8 string. //! Copy constructor from UTF-8 string.
//! @param theCopyUtf8 UTF-8 string to copy //! @param theCopyUtf8 UTF-8 string to copy
@ -209,10 +207,8 @@ public: //! @name assign operators
//! Copy from another string. //! Copy from another string.
const NCollection_UtfString& operator= (const NCollection_UtfString& theOther) { return Assign (theOther); } const NCollection_UtfString& operator= (const NCollection_UtfString& theOther) { return Assign (theOther); }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move assignment operator. //! Move assignment operator.
NCollection_UtfString& operator= (NCollection_UtfString&& theOther) { Swap (theOther); return *this; } NCollection_UtfString& operator= (NCollection_UtfString&& theOther) { Swap (theOther); return *this; }
#endif
//! Copy from UTF-8 NULL-terminated string. //! Copy from UTF-8 NULL-terminated string.
const NCollection_UtfString& operator= (const char* theStringUtf8); const NCollection_UtfString& operator= (const char* theStringUtf8);

View File

@ -90,7 +90,6 @@ NCollection_UtfString<Type>::NCollection_UtfString (const NCollection_UtfString&
strCopy ((Standard_Byte* )myString, (const Standard_Byte* )theCopy.myString, mySize); strCopy ((Standard_Byte* )myString, (const Standard_Byte* )theCopy.myString, mySize);
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
// ======================================================================= // =======================================================================
// function : NCollection_UtfString // function : NCollection_UtfString
// purpose : // purpose :
@ -105,7 +104,6 @@ NCollection_UtfString<Type>::NCollection_UtfString (NCollection_UtfString&& theO
theOther.mySize = 0; theOther.mySize = 0;
theOther.myLength = 0; theOther.myLength = 0;
} }
#endif
// ======================================================================= // =======================================================================
// function : NCollection_UtfString // function : NCollection_UtfString

View File

@ -39,7 +39,7 @@ Standard_Boolean OSD_CachedFileSystem::IsSupportedPath (const TCollection_AsciiS
// function : IsOpenIStream // function : IsOpenIStream
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean OSD_CachedFileSystem::IsOpenIStream (const opencascade::std::shared_ptr<std::istream>& theStream) const Standard_Boolean OSD_CachedFileSystem::IsOpenIStream (const std::shared_ptr<std::istream>& theStream) const
{ {
return myLinkedFS->IsOpenIStream (theStream); return myLinkedFS->IsOpenIStream (theStream);
} }
@ -48,7 +48,7 @@ Standard_Boolean OSD_CachedFileSystem::IsOpenIStream (const opencascade::std::sh
// function : IsOpenOStream // function : IsOpenOStream
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean OSD_CachedFileSystem::IsOpenOStream (const opencascade::std::shared_ptr<std::ostream>& theStream) const Standard_Boolean OSD_CachedFileSystem::IsOpenOStream (const std::shared_ptr<std::ostream>& theStream) const
{ {
return myLinkedFS->IsOpenOStream (theStream); return myLinkedFS->IsOpenOStream (theStream);
} }
@ -57,10 +57,10 @@ Standard_Boolean OSD_CachedFileSystem::IsOpenOStream (const opencascade::std::sh
// function : OpenIStream // function : OpenIStream
// purpose : // purpose :
//======================================================================= //=======================================================================
opencascade::std::shared_ptr<std::istream> OSD_CachedFileSystem::OpenIStream (const TCollection_AsciiString& theUrl, std::shared_ptr<std::istream> OSD_CachedFileSystem::OpenIStream (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theParams, const std::ios_base::openmode theParams,
const int64_t theOffset, const int64_t theOffset,
const opencascade::std::shared_ptr<std::istream>& /*theOldStream*/) const std::shared_ptr<std::istream>& /*theOldStream*/)
{ {
if (myStream.Url != theUrl) if (myStream.Url != theUrl)
{ {
@ -75,8 +75,8 @@ opencascade::std::shared_ptr<std::istream> OSD_CachedFileSystem::OpenIStream (co
// function : OpenOStream // function : OpenOStream
// purpose : // purpose :
//======================================================================= //=======================================================================
opencascade::std::shared_ptr<std::ostream> OSD_CachedFileSystem::OpenOStream (const TCollection_AsciiString& theUrl, std::shared_ptr<std::ostream> OSD_CachedFileSystem::OpenOStream (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode) const std::ios_base::openmode theMode)
{ {
return myLinkedFS->OpenOStream (theUrl, theMode); return myLinkedFS->OpenOStream (theUrl, theMode);
} }
@ -85,10 +85,10 @@ opencascade::std::shared_ptr<std::ostream> OSD_CachedFileSystem::OpenOStream (co
// function : OpenStreamBuffer // function : OpenStreamBuffer
// purpose : // purpose :
//======================================================================= //=======================================================================
opencascade::std::shared_ptr<std::streambuf> OSD_CachedFileSystem::OpenStreamBuffer (const TCollection_AsciiString& theUrl, std::shared_ptr<std::streambuf> OSD_CachedFileSystem::OpenStreamBuffer (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode, const std::ios_base::openmode theMode,
const int64_t theOffset, const int64_t theOffset,
int64_t* theOutBufSize) int64_t* theOutBufSize)
{ {
if ((theMode & std::ios::out) == std::ios::out) if ((theMode & std::ios::out) == std::ios::out)
{ {

View File

@ -38,24 +38,24 @@ public:
Standard_EXPORT virtual Standard_Boolean IsSupportedPath (const TCollection_AsciiString& theUrl) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean IsSupportedPath (const TCollection_AsciiString& theUrl) const Standard_OVERRIDE;
//! Returns TRUE if current input stream is opened for reading operations. //! Returns TRUE if current input stream is opened for reading operations.
Standard_EXPORT virtual Standard_Boolean IsOpenIStream (const opencascade::std::shared_ptr<std::istream>& theStream) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean IsOpenIStream (const std::shared_ptr<std::istream>& theStream) const Standard_OVERRIDE;
//! Returns TRUE if current output stream is opened for writing operations. //! Returns TRUE if current output stream is opened for writing operations.
Standard_EXPORT virtual Standard_Boolean IsOpenOStream (const opencascade::std::shared_ptr<std::ostream>& theStream) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean IsOpenOStream (const std::shared_ptr<std::ostream>& theStream) const Standard_OVERRIDE;
//! Opens stream for specified file URL for reading operations or returns previously created stream pointing to the same URL. //! Opens stream for specified file URL for reading operations or returns previously created stream pointing to the same URL.
Standard_EXPORT virtual opencascade::std::shared_ptr<std::istream> OpenIStream Standard_EXPORT virtual std::shared_ptr<std::istream> OpenIStream
(const TCollection_AsciiString& theUrl, (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theParams, const std::ios_base::openmode theParams,
const int64_t theOffset, const int64_t theOffset,
const opencascade::std::shared_ptr<std::istream>& theOldStream) Standard_OVERRIDE; const std::shared_ptr<std::istream>& theOldStream) Standard_OVERRIDE;
//! Opens stream for specified file URL for writing operations (std::ostream) by calling parent's method. //! Opens stream for specified file URL for writing operations (std::ostream) by calling parent's method.
Standard_EXPORT virtual opencascade::std::shared_ptr<std::ostream> OpenOStream (const TCollection_AsciiString& theUrl, Standard_EXPORT virtual std::shared_ptr<std::ostream> OpenOStream (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode) Standard_OVERRIDE; const std::ios_base::openmode theMode) Standard_OVERRIDE;
//! Opens stream buffer for specified file URL. //! Opens stream buffer for specified file URL.
Standard_EXPORT virtual opencascade::std::shared_ptr<std::streambuf> OpenStreamBuffer Standard_EXPORT virtual std::shared_ptr<std::streambuf> OpenStreamBuffer
(const TCollection_AsciiString& theUrl, (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode, const std::ios_base::openmode theMode,
const int64_t theOffset = 0, const int64_t theOffset = 0,
@ -66,9 +66,9 @@ protected:
// Auxiliary structure to save shared stream with path to it. // Auxiliary structure to save shared stream with path to it.
struct OSD_CachedStream struct OSD_CachedStream
{ {
TCollection_AsciiString Url; TCollection_AsciiString Url;
opencascade::std::shared_ptr<std::istream> Stream; std::shared_ptr<std::istream> Stream;
opencascade::std::shared_ptr<std::streambuf> StreamBuf; std::shared_ptr<std::streambuf> StreamBuf;
void Reset() void Reset()
{ {

View File

@ -78,15 +78,15 @@ void OSD_FileSystem::RemoveDefaultProtocol (const Handle(OSD_FileSystem)& theFil
// function : openIStream // function : openIStream
// purpose : // purpose :
//======================================================================= //=======================================================================
opencascade::std::shared_ptr<std::istream> OSD_FileSystem::OpenIStream (const TCollection_AsciiString& theUrl, std::shared_ptr<std::istream> OSD_FileSystem::OpenIStream (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode, const std::ios_base::openmode theMode,
const int64_t theOffset, const int64_t theOffset,
const opencascade::std::shared_ptr<std::istream>& theOldStream) const std::shared_ptr<std::istream>& theOldStream)
{ {
Standard_ASSERT_RAISE (theOffset >= -1, "Incorrect negative stream position during stream opening"); Standard_ASSERT_RAISE (theOffset >= -1, "Incorrect negative stream position during stream opening");
opencascade::std::shared_ptr<std::istream> aNewStream; std::shared_ptr<std::istream> aNewStream;
opencascade::std::shared_ptr<OSD_IStreamBuffer> anOldStream = opencascade::std::dynamic_pointer_cast<OSD_IStreamBuffer> (theOldStream); std::shared_ptr<OSD_IStreamBuffer> anOldStream = std::dynamic_pointer_cast<OSD_IStreamBuffer> (theOldStream);
if (anOldStream.get() != NULL if (anOldStream.get() != NULL
&& theUrl.IsEqual (anOldStream->Url().c_str()) && theUrl.IsEqual (anOldStream->Url().c_str())
&& IsOpenIStream (anOldStream)) && IsOpenIStream (anOldStream))
@ -104,10 +104,10 @@ opencascade::std::shared_ptr<std::istream> OSD_FileSystem::OpenIStream (const TC
} }
if (aNewStream.get() == NULL) if (aNewStream.get() == NULL)
{ {
opencascade::std::shared_ptr<std::streambuf> aFileBuf = OpenStreamBuffer (theUrl, theMode | std::ios_base::in); std::shared_ptr<std::streambuf> aFileBuf = OpenStreamBuffer (theUrl, theMode | std::ios_base::in);
if (aFileBuf.get() == NULL) if (aFileBuf.get() == NULL)
{ {
return opencascade::std::shared_ptr<std::istream>(); return std::shared_ptr<std::istream>();
} }
aNewStream.reset (new OSD_IStreamBuffer (theUrl.ToCString(), aFileBuf)); aNewStream.reset (new OSD_IStreamBuffer (theUrl.ToCString(), aFileBuf));
@ -123,14 +123,14 @@ opencascade::std::shared_ptr<std::istream> OSD_FileSystem::OpenIStream (const TC
// function : OpenOStream // function : OpenOStream
// purpose : // purpose :
//======================================================================= //=======================================================================
opencascade::std::shared_ptr<std::ostream> OSD_FileSystem::OpenOStream (const TCollection_AsciiString& theUrl, std::shared_ptr<std::ostream> OSD_FileSystem::OpenOStream (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode) const std::ios_base::openmode theMode)
{ {
opencascade::std::shared_ptr<std::ostream> aNewStream; std::shared_ptr<std::ostream> aNewStream;
opencascade::std::shared_ptr<std::streambuf> aFileBuf = OpenStreamBuffer (theUrl, theMode | std::ios_base::out); std::shared_ptr<std::streambuf> aFileBuf = OpenStreamBuffer (theUrl, theMode | std::ios_base::out);
if (aFileBuf.get() == NULL) if (aFileBuf.get() == NULL)
{ {
return opencascade::std::shared_ptr<std::ostream>(); return std::shared_ptr<std::ostream>();
} }
aNewStream.reset(new OSD_OStreamBuffer (theUrl.ToCString(), aFileBuf)); aNewStream.reset(new OSD_OStreamBuffer (theUrl.ToCString(), aFileBuf));

View File

@ -42,10 +42,10 @@ public:
virtual Standard_Boolean IsSupportedPath (const TCollection_AsciiString& theUrl) const = 0; virtual Standard_Boolean IsSupportedPath (const TCollection_AsciiString& theUrl) const = 0;
//! Returns TRUE if current input stream is opened for reading operations. //! Returns TRUE if current input stream is opened for reading operations.
virtual Standard_Boolean IsOpenIStream (const opencascade::std::shared_ptr<std::istream>& theStream) const = 0; virtual Standard_Boolean IsOpenIStream (const std::shared_ptr<std::istream>& theStream) const = 0;
//! Returns TRUE if current output stream is opened for writing operations. //! Returns TRUE if current output stream is opened for writing operations.
virtual Standard_Boolean IsOpenOStream(const opencascade::std::shared_ptr<std::ostream>& theStream) const = 0; virtual Standard_Boolean IsOpenOStream(const std::shared_ptr<std::ostream>& theStream) const = 0;
//! Opens stream for specified file URL for reading operations (std::istream). //! Opens stream for specified file URL for reading operations (std::istream).
//! Default implementation create a stream from file buffer returned by OSD_FileSystem::OpenFileBuffer(). //! Default implementation create a stream from file buffer returned by OSD_FileSystem::OpenFileBuffer().
@ -55,19 +55,19 @@ public:
//! -1 would keep seek position undefined (in case of re-using theOldStream) //! -1 would keep seek position undefined (in case of re-using theOldStream)
//! @param theOldStream [in] a pointer to existing stream pointing to theUrl to be reused (without re-opening) //! @param theOldStream [in] a pointer to existing stream pointing to theUrl to be reused (without re-opening)
//! @return pointer to newly created opened stream, to theOldStream if it can be reused or NULL in case of failure. //! @return pointer to newly created opened stream, to theOldStream if it can be reused or NULL in case of failure.
Standard_EXPORT virtual opencascade::std::shared_ptr<std::istream> OpenIStream Standard_EXPORT virtual std::shared_ptr<std::istream> OpenIStream
(const TCollection_AsciiString& theUrl, (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode, const std::ios_base::openmode theMode,
const int64_t theOffset = 0, const int64_t theOffset = 0,
const opencascade::std::shared_ptr<std::istream>& theOldStream = opencascade::std::shared_ptr<std::istream>()); const std::shared_ptr<std::istream>& theOldStream = std::shared_ptr<std::istream>());
//! Opens stream for specified file URL for writing operations (std::ostream). //! Opens stream for specified file URL for writing operations (std::ostream).
//! Default implementation create a stream from file buffer returned by OSD_FileSystem::OpenFileBuffer(). //! Default implementation create a stream from file buffer returned by OSD_FileSystem::OpenFileBuffer().
//! @param theUrl [in] path to open //! @param theUrl [in] path to open
//! @param theMode [in] flags describing the requested output mode for the stream (std::ios_base::out will be implicitly added) //! @param theMode [in] flags describing the requested output mode for the stream (std::ios_base::out will be implicitly added)
//! @return pointer to newly created opened stream or NULL in case of failure. //! @return pointer to newly created opened stream or NULL in case of failure.
Standard_EXPORT virtual opencascade::std::shared_ptr<std::ostream> OpenOStream (const TCollection_AsciiString& theUrl, Standard_EXPORT virtual std::shared_ptr<std::ostream> OpenOStream (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode); const std::ios_base::openmode theMode);
//! Opens stream buffer for specified file URL. //! Opens stream buffer for specified file URL.
//! @param theUrl [in] path to open //! @param theUrl [in] path to open
@ -75,10 +75,10 @@ public:
//! @param theOffset [in] expected stream position from the beginning of the buffer (beginning of the stream buffer by default) //! @param theOffset [in] expected stream position from the beginning of the buffer (beginning of the stream buffer by default)
//! @param theOutBufSize [out] total buffer size (only if buffer is opened for read) //! @param theOutBufSize [out] total buffer size (only if buffer is opened for read)
//! @return pointer to newly created opened stream buffer or NULL in case of failure. //! @return pointer to newly created opened stream buffer or NULL in case of failure.
virtual opencascade::std::shared_ptr<std::streambuf> OpenStreamBuffer (const TCollection_AsciiString& theUrl, virtual std::shared_ptr<std::streambuf> OpenStreamBuffer (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode, const std::ios_base::openmode theMode,
const int64_t theOffset = 0, const int64_t theOffset = 0,
int64_t* theOutBufSize = NULL) = 0; int64_t* theOutBufSize = NULL) = 0;
//! Constructor. //! Constructor.
Standard_EXPORT OSD_FileSystem(); Standard_EXPORT OSD_FileSystem();

View File

@ -61,9 +61,9 @@ Standard_Boolean OSD_FileSystemSelector::IsSupportedPath (const TCollection_Asci
// function : IsOpenIStream // function : IsOpenIStream
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean OSD_FileSystemSelector::IsOpenIStream (const opencascade::std::shared_ptr<std::istream>& theStream) const Standard_Boolean OSD_FileSystemSelector::IsOpenIStream (const std::shared_ptr<std::istream>& theStream) const
{ {
opencascade::std::shared_ptr<OSD_IStreamBuffer> aFileStream = opencascade::std::dynamic_pointer_cast<OSD_IStreamBuffer> (theStream); std::shared_ptr<OSD_IStreamBuffer> aFileStream = std::dynamic_pointer_cast<OSD_IStreamBuffer> (theStream);
if (aFileStream.get() == NULL) if (aFileStream.get() == NULL)
{ {
return false; return false;
@ -86,9 +86,9 @@ Standard_Boolean OSD_FileSystemSelector::IsOpenIStream (const opencascade::std::
// function : IsOpenOStream // function : IsOpenOStream
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean OSD_FileSystemSelector::IsOpenOStream (const opencascade::std::shared_ptr<std::ostream>& theStream) const Standard_Boolean OSD_FileSystemSelector::IsOpenOStream (const std::shared_ptr<std::ostream>& theStream) const
{ {
opencascade::std::shared_ptr<OSD_OStreamBuffer> aFileStream = opencascade::std::dynamic_pointer_cast<OSD_OStreamBuffer> (theStream); std::shared_ptr<OSD_OStreamBuffer> aFileStream = std::dynamic_pointer_cast<OSD_OStreamBuffer> (theStream);
if (aFileStream.get() == NULL) if (aFileStream.get() == NULL)
{ {
return false; return false;
@ -111,68 +111,68 @@ Standard_Boolean OSD_FileSystemSelector::IsOpenOStream (const opencascade::std::
// function : OpenIStream // function : OpenIStream
// purpose : // purpose :
//======================================================================= //=======================================================================
opencascade::std::shared_ptr<std::istream> OSD_FileSystemSelector::OpenIStream (const TCollection_AsciiString& theUrl, std::shared_ptr<std::istream> OSD_FileSystemSelector::OpenIStream (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode, const std::ios_base::openmode theMode,
const int64_t theOffset, const int64_t theOffset,
const opencascade::std::shared_ptr<std::istream>& theOldStream) const std::shared_ptr<std::istream>& theOldStream)
{ {
for (NCollection_List<Handle(OSD_FileSystem)>::Iterator aProtIter (myProtocols); aProtIter.More(); aProtIter.Next()) for (NCollection_List<Handle(OSD_FileSystem)>::Iterator aProtIter (myProtocols); aProtIter.More(); aProtIter.Next())
{ {
const Handle(OSD_FileSystem)& aFileSystem = aProtIter.Value(); const Handle(OSD_FileSystem)& aFileSystem = aProtIter.Value();
if (aFileSystem->IsSupportedPath (theUrl)) if (aFileSystem->IsSupportedPath (theUrl))
{ {
opencascade::std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (theUrl, theMode, theOffset, theOldStream); std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (theUrl, theMode, theOffset, theOldStream);
if (aStream.get() != NULL) if (aStream.get() != NULL)
{ {
return aStream; return aStream;
} }
} }
} }
return opencascade::std::shared_ptr<std::istream>(); return std::shared_ptr<std::istream>();
} }
//======================================================================= //=======================================================================
// function : OpenOStream // function : OpenOStream
// purpose : // purpose :
//======================================================================= //=======================================================================
opencascade::std::shared_ptr<std::ostream> OSD_FileSystemSelector::OpenOStream (const TCollection_AsciiString& theUrl, std::shared_ptr<std::ostream> OSD_FileSystemSelector::OpenOStream (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode) const std::ios_base::openmode theMode)
{ {
for (NCollection_List<Handle(OSD_FileSystem)>::Iterator aProtIter (myProtocols); aProtIter.More(); aProtIter.Next()) for (NCollection_List<Handle(OSD_FileSystem)>::Iterator aProtIter (myProtocols); aProtIter.More(); aProtIter.Next())
{ {
const Handle(OSD_FileSystem)& aFileSystem = aProtIter.Value(); const Handle(OSD_FileSystem)& aFileSystem = aProtIter.Value();
if (aFileSystem->IsSupportedPath (theUrl)) if (aFileSystem->IsSupportedPath (theUrl))
{ {
opencascade::std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (theUrl, theMode); std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (theUrl, theMode);
if (aStream.get() != NULL) if (aStream.get() != NULL)
{ {
return aStream; return aStream;
} }
} }
} }
return opencascade::std::shared_ptr<std::ostream>(); return std::shared_ptr<std::ostream>();
} }
//======================================================================= //=======================================================================
// function : OpenStreamBuffer // function : OpenStreamBuffer
// purpose : // purpose :
//======================================================================= //=======================================================================
opencascade::std::shared_ptr<std::streambuf> OSD_FileSystemSelector::OpenStreamBuffer (const TCollection_AsciiString& theUrl, std::shared_ptr<std::streambuf> OSD_FileSystemSelector::OpenStreamBuffer (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode, const std::ios_base::openmode theMode,
const int64_t theOffset, const int64_t theOffset,
int64_t* theOutBufSize) int64_t* theOutBufSize)
{ {
for (NCollection_List<Handle(OSD_FileSystem)>::Iterator aProtIter (myProtocols); aProtIter.More(); aProtIter.Next()) for (NCollection_List<Handle(OSD_FileSystem)>::Iterator aProtIter (myProtocols); aProtIter.More(); aProtIter.Next())
{ {
const Handle(OSD_FileSystem)& aFileSystem = aProtIter.Value(); const Handle(OSD_FileSystem)& aFileSystem = aProtIter.Value();
if (aFileSystem->IsSupportedPath (theUrl)) if (aFileSystem->IsSupportedPath (theUrl))
{ {
opencascade::std::shared_ptr<std::streambuf> aBuf = aFileSystem->OpenStreamBuffer (theUrl, theMode, theOffset, theOutBufSize); std::shared_ptr<std::streambuf> aBuf = aFileSystem->OpenStreamBuffer (theUrl, theMode, theOffset, theOutBufSize);
if (aBuf.get() != NULL) if (aBuf.get() != NULL)
{ {
return aBuf; return aBuf;
} }
} }
} }
return opencascade::std::shared_ptr<std::streambuf>(); return std::shared_ptr<std::streambuf>();
} }

View File

@ -41,24 +41,24 @@ public:
Standard_EXPORT virtual bool IsSupportedPath (const TCollection_AsciiString& theUrl) const Standard_OVERRIDE; Standard_EXPORT virtual bool IsSupportedPath (const TCollection_AsciiString& theUrl) const Standard_OVERRIDE;
//! Returns TRUE if current input stream is opened for reading operations. //! Returns TRUE if current input stream is opened for reading operations.
Standard_EXPORT virtual Standard_Boolean IsOpenIStream (const opencascade::std::shared_ptr<std::istream>& theStream) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean IsOpenIStream (const std::shared_ptr<std::istream>& theStream) const Standard_OVERRIDE;
//! Returns TRUE if current output stream is opened for writing operations. //! Returns TRUE if current output stream is opened for writing operations.
Standard_EXPORT virtual Standard_Boolean IsOpenOStream (const opencascade::std::shared_ptr<std::ostream>& theStream) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean IsOpenOStream (const std::shared_ptr<std::ostream>& theStream) const Standard_OVERRIDE;
//! Opens input stream using one of registered protocols. //! Opens input stream using one of registered protocols.
Standard_EXPORT virtual opencascade::std::shared_ptr<std::istream> OpenIStream Standard_EXPORT virtual std::shared_ptr<std::istream> OpenIStream
(const TCollection_AsciiString& theUrl, (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode, const std::ios_base::openmode theMode,
const int64_t theOffset = 0, const int64_t theOffset = 0,
const opencascade::std::shared_ptr<std::istream>& theOldStream = opencascade::std::shared_ptr<std::istream>()) Standard_OVERRIDE; const std::shared_ptr<std::istream>& theOldStream = std::shared_ptr<std::istream>()) Standard_OVERRIDE;
//! Opens output stream using one of registered protocols. //! Opens output stream using one of registered protocols.
Standard_EXPORT virtual opencascade::std::shared_ptr<std::ostream> OpenOStream (const TCollection_AsciiString& theUrl, Standard_EXPORT virtual std::shared_ptr<std::ostream> OpenOStream (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode) Standard_OVERRIDE; const std::ios_base::openmode theMode) Standard_OVERRIDE;
//! Opens stream buffer using one of registered protocols. //! Opens stream buffer using one of registered protocols.
Standard_EXPORT virtual opencascade::std::shared_ptr<std::streambuf> OpenStreamBuffer Standard_EXPORT virtual std::shared_ptr<std::streambuf> OpenStreamBuffer
(const TCollection_AsciiString& theUrl, (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode, const std::ios_base::openmode theMode,
const int64_t theOffset = 0, const int64_t theOffset = 0,

View File

@ -31,9 +31,9 @@ Standard_Boolean OSD_LocalFileSystem::IsSupportedPath (const TCollection_AsciiSt
// function : IsOpenIStream // function : IsOpenIStream
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean OSD_LocalFileSystem::IsOpenIStream (const opencascade::std::shared_ptr<std::istream>& theStream) const Standard_Boolean OSD_LocalFileSystem::IsOpenIStream (const std::shared_ptr<std::istream>& theStream) const
{ {
opencascade::std::shared_ptr<OSD_IStreamBuffer> aFileStream = opencascade::std::dynamic_pointer_cast<OSD_IStreamBuffer> (theStream); std::shared_ptr<OSD_IStreamBuffer> aFileStream = std::dynamic_pointer_cast<OSD_IStreamBuffer> (theStream);
if (aFileStream.get() == NULL) if (aFileStream.get() == NULL)
{ {
return false; return false;
@ -46,9 +46,9 @@ Standard_Boolean OSD_LocalFileSystem::IsOpenIStream (const opencascade::std::sha
// function : IsOpenOStream // function : IsOpenOStream
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean OSD_LocalFileSystem::IsOpenOStream (const opencascade::std::shared_ptr<std::ostream>& theStream) const Standard_Boolean OSD_LocalFileSystem::IsOpenOStream (const std::shared_ptr<std::ostream>& theStream) const
{ {
opencascade::std::shared_ptr<OSD_OStreamBuffer> aFileStream = opencascade::std::dynamic_pointer_cast<OSD_OStreamBuffer> (theStream); std::shared_ptr<OSD_OStreamBuffer> aFileStream = std::dynamic_pointer_cast<OSD_OStreamBuffer> (theStream);
if (aFileStream.get() == NULL) if (aFileStream.get() == NULL)
{ {
return false; return false;
@ -61,16 +61,16 @@ Standard_Boolean OSD_LocalFileSystem::IsOpenOStream (const opencascade::std::sha
// function : OpenStreamBuffer // function : OpenStreamBuffer
// purpose : // purpose :
//======================================================================= //=======================================================================
opencascade::std::shared_ptr<std::streambuf> OSD_LocalFileSystem::OpenStreamBuffer (const TCollection_AsciiString& theUrl, std::shared_ptr<std::streambuf> OSD_LocalFileSystem::OpenStreamBuffer (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode, const std::ios_base::openmode theMode,
const int64_t theOffset, const int64_t theOffset,
int64_t* theOutBufSize) int64_t* theOutBufSize)
{ {
Standard_ASSERT_RAISE (theOffset >= 0, "Incorrect negative stream position during stream buffer opening"); Standard_ASSERT_RAISE (theOffset >= 0, "Incorrect negative stream position during stream buffer opening");
opencascade::std::shared_ptr<std::filebuf> aNewBuf(new std::filebuf()); std::shared_ptr<std::filebuf> aNewBuf(new std::filebuf());
if (!OSD_OpenStream (*aNewBuf, TCollection_ExtendedString(theUrl), theMode)) if (!OSD_OpenStream (*aNewBuf, TCollection_ExtendedString(theUrl), theMode))
{ {
return opencascade::std::shared_ptr<std::streambuf>(); return std::shared_ptr<std::streambuf>();
} }
// if buffer is opened for read, find the file size // if buffer is opened for read, find the file size
if (theOutBufSize && ((theMode & std::ios::in) != 0)) if (theOutBufSize && ((theMode & std::ios::in) != 0))
@ -79,13 +79,13 @@ opencascade::std::shared_ptr<std::streambuf> OSD_LocalFileSystem::OpenStreamBuff
if (aNewBuf->pubseekoff ((std::streamoff )theOffset, std::ios_base::beg, std::ios_base::in) < 0) if (aNewBuf->pubseekoff ((std::streamoff )theOffset, std::ios_base::beg, std::ios_base::in) < 0)
{ {
*theOutBufSize = 0; *theOutBufSize = 0;
return opencascade::std::shared_ptr<std::streambuf>(); return std::shared_ptr<std::streambuf>();
} }
} }
else if (theOffset > 0 && aNewBuf->pubseekoff ((std::streamoff )theOffset, std::ios_base::beg, else if (theOffset > 0 && aNewBuf->pubseekoff ((std::streamoff )theOffset, std::ios_base::beg,
(theMode & std::ios::in) != 0 ? std::ios_base::in : std::ios_base::out) < 0) (theMode & std::ios::in) != 0 ? std::ios_base::in : std::ios_base::out) < 0)
{ {
return opencascade::std::shared_ptr<std::streambuf>(); return std::shared_ptr<std::streambuf>();
} }
return aNewBuf; return aNewBuf;
} }

View File

@ -29,13 +29,13 @@ public:
Standard_EXPORT virtual Standard_Boolean IsSupportedPath (const TCollection_AsciiString& theUrl) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean IsSupportedPath (const TCollection_AsciiString& theUrl) const Standard_OVERRIDE;
//! Returns TRUE if current input stream is opened for reading operations. //! Returns TRUE if current input stream is opened for reading operations.
Standard_EXPORT virtual Standard_Boolean IsOpenIStream (const opencascade::std::shared_ptr<std::istream>& theStream) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean IsOpenIStream (const std::shared_ptr<std::istream>& theStream) const Standard_OVERRIDE;
//! Returns TRUE if current output stream is opened for writing operations. //! Returns TRUE if current output stream is opened for writing operations.
Standard_EXPORT virtual Standard_Boolean IsOpenOStream (const opencascade::std::shared_ptr<std::ostream>& theStream) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean IsOpenOStream (const std::shared_ptr<std::ostream>& theStream) const Standard_OVERRIDE;
//! Opens stream buffer for specified file URL. //! Opens stream buffer for specified file URL.
Standard_EXPORT virtual opencascade::std::shared_ptr<std::streambuf> OpenStreamBuffer Standard_EXPORT virtual std::shared_ptr<std::streambuf> OpenStreamBuffer
(const TCollection_AsciiString& theUrl, (const TCollection_AsciiString& theUrl,
const std::ios_base::openmode theMode, const std::ios_base::openmode theMode,
const int64_t theOffset = 0, const int64_t theOffset = 0,

View File

@ -179,11 +179,7 @@ protected:
} }
private: private:
#if (defined(_MSC_VER) && (_MSC_VER < 1600))
std::auto_ptr<IteratorInterface> myPtr;
#else
std::unique_ptr<IteratorInterface> myPtr; std::unique_ptr<IteratorInterface> myPtr;
#endif
}; };
//! Interface class representing functor object. //! Interface class representing functor object.

View File

@ -29,7 +29,7 @@ public:
//! Main constructor. //! Main constructor.
OSD_StreamBuffer (const std::string& theUrl, OSD_StreamBuffer (const std::string& theUrl,
const opencascade::std::shared_ptr<std::streambuf>& theBuffer) const std::shared_ptr<std::streambuf>& theBuffer)
: T (theBuffer.get()), myUrl (theUrl), myBuffer (theBuffer) {} : T (theBuffer.get()), myUrl (theUrl), myBuffer (theBuffer) {}
//! Return an opened URL. //! Return an opened URL.
@ -37,8 +37,8 @@ public:
protected: protected:
std::string myUrl; std::string myUrl;
opencascade::std::shared_ptr<std::streambuf> myBuffer; std::shared_ptr<std::streambuf> myBuffer;
}; };
typedef OSD_StreamBuffer<std::istream> OSD_IStreamBuffer; typedef OSD_StreamBuffer<std::istream> OSD_IStreamBuffer;

View File

@ -84,7 +84,6 @@ public:
//! Assignment operator; @sa Assign() //! Assignment operator; @sa Assign()
Poly_ArrayOfNodes& operator= (const Poly_ArrayOfNodes& theOther) { return Assign (theOther); } Poly_ArrayOfNodes& operator= (const Poly_ArrayOfNodes& theOther) { return Assign (theOther); }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move constructor //! Move constructor
Poly_ArrayOfNodes (Poly_ArrayOfNodes&& theOther) Poly_ArrayOfNodes (Poly_ArrayOfNodes&& theOther)
: NCollection_AliasedArray (std::move (theOther)) : NCollection_AliasedArray (std::move (theOther))
@ -97,7 +96,6 @@ public:
{ {
return Move (theOther); return Move (theOther);
} }
#endif
public: public:

View File

@ -84,7 +84,6 @@ public:
//! Assignment operator; @sa Assign() //! Assignment operator; @sa Assign()
Poly_ArrayOfUVNodes& operator= (const Poly_ArrayOfUVNodes& theOther) { return Assign (theOther); } Poly_ArrayOfUVNodes& operator= (const Poly_ArrayOfUVNodes& theOther) { return Assign (theOther); }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move constructor //! Move constructor
Poly_ArrayOfUVNodes (Poly_ArrayOfUVNodes&& theOther) Poly_ArrayOfUVNodes (Poly_ArrayOfUVNodes&& theOther)
: NCollection_AliasedArray (std::move (theOther)) : NCollection_AliasedArray (std::move (theOther))
@ -97,7 +96,6 @@ public:
{ {
return Move (theOther); return Move (theOther);
} }
#endif
public: public:

View File

@ -460,7 +460,7 @@ static Standard_Integer OCC30182 (Draw_Interpretor& , Standard_Integer theNbArgs
else else
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (anImgPath, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (anImgPath, std::ios::in | std::ios::binary);
if (aFile.get() == NULL) if (aFile.get() == NULL)
{ {
std::cout << "Syntax error: image file '" << anImgPath << "' cannot be found\n"; std::cout << "Syntax error: image file '" << anImgPath << "' cannot be found\n";

View File

@ -2758,7 +2758,7 @@ static Standard_Integer OCC29935(Draw_Interpretor& ,
// Generate data; // Generate data;
Standard_Integer aSize = Draw::Atoi (theArgv[1]); Standard_Integer aSize = Draw::Atoi (theArgv[1]);
opencascade::std::mt19937 aGen (42); std::mt19937 aGen (42);
NCollection_Array2<double> aMat1 (0, aSize - 1, 0, aSize - 1); NCollection_Array2<double> aMat1 (0, aSize - 1, 0, aSize - 1);
NCollection_Array2<double> aMat2 (0, aSize - 1, 0, aSize - 1); NCollection_Array2<double> aMat2 (0, aSize - 1, 0, aSize - 1);
NCollection_Array2<double> aMatResRef(0, aSize - 1, 0, aSize - 1); NCollection_Array2<double> aMatResRef(0, aSize - 1, 0, aSize - 1);

View File

@ -2408,7 +2408,7 @@ static Standard_Integer OCC28887 (Draw_Interpretor&, Standard_Integer theNbArgs,
Handle(NCollection_Buffer) aBuffer; Handle(NCollection_Buffer) aBuffer;
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (aFilePath, std::ios::binary | std::ios::in); std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (aFilePath, std::ios::binary | std::ios::in);
if (aFile.get() == NULL) if (aFile.get() == NULL)
{ {
std::cout << "Error: input file '" << aFilePath << "' cannot be read\n"; std::cout << "Error: input file '" << aFilePath << "' cannot be read\n";

View File

@ -463,7 +463,7 @@ static Standard_Integer QAHandleInc (Draw_Interpretor& theDI,
} }
Handle(Standard_Transient) aHandle = new Standard_Transient(); Handle(Standard_Transient) aHandle = new Standard_Transient();
opencascade::std::shared_ptr<Standard_Transient> aSharePtr (new Standard_Transient()); std::shared_ptr<Standard_Transient> aSharePtr (new Standard_Transient());
theDI << "Time of creating and destroying " << aNbIters << " smart pointers to the same object, per item, ns:"; theDI << "Time of creating and destroying " << aNbIters << " smart pointers to the same object, per item, ns:";
{ {
{ {
@ -479,7 +479,7 @@ static Standard_Integer QAHandleInc (Draw_Interpretor& theDI,
{ {
QATimer aTimer (theDI, "\nC++ shared_ptr: ", QATimer::ns, aNbIters); QATimer aTimer (theDI, "\nC++ shared_ptr: ", QATimer::ns, aNbIters);
{ {
std::vector< opencascade::std::shared_ptr<Standard_Transient> > aSharePointers (aNbIters); std::vector< std::shared_ptr<Standard_Transient> > aSharePointers (aNbIters);
for (Standard_Integer anIter = 0; anIter < aNbIters; ++anIter) for (Standard_Integer anIter = 0; anIter < aNbIters; ++anIter)
{ {
aSharePointers[anIter] = aSharePtr; aSharePointers[anIter] = aSharePtr;

View File

@ -191,7 +191,7 @@ Standard_Boolean RWGltf_CafReader::performMesh (const TCollection_AsciiString& t
aPSentry.Show(); aPSentry.Show();
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (theFile, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (theFile, std::ios::in | std::ios::binary);
if (aFile.get() == NULL || !aFile->good()) if (aFile.get() == NULL || !aFile->good())
{ {
Message::SendFail (TCollection_AsciiString ("File '") + theFile + "' is not found"); Message::SendFail (TCollection_AsciiString ("File '") + theFile + "' is not found");

View File

@ -400,7 +400,7 @@ bool RWGltf_CafWriter::writeBinData (const Handle(TDocStd_Document)& theDocument
myBinDataLen64 = 0; myBinDataLen64 = 0;
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aBinFile = aFileSystem->OpenOStream (myBinFileNameFull, std::ios::out | std::ios::binary); std::shared_ptr<std::ostream> aBinFile = aFileSystem->OpenOStream (myBinFileNameFull, std::ios::out | std::ios::binary);
if (aBinFile.get() == NULL if (aBinFile.get() == NULL
|| !aBinFile->good()) || !aBinFile->good())
{ {
@ -707,7 +707,7 @@ bool RWGltf_CafWriter::writeJson (const Handle(TDocStd_Document)& theDocument,
const TCollection_AsciiString aFileNameGltf = myFile; const TCollection_AsciiString aFileNameGltf = myFile;
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aGltfContentFile = aFileSystem->OpenOStream (aFileNameGltf, std::ios::out | std::ios::binary); std::shared_ptr<std::ostream> aGltfContentFile = aFileSystem->OpenOStream (aFileNameGltf, std::ios::out | std::ios::binary);
if (aGltfContentFile.get() == NULL if (aGltfContentFile.get() == NULL
|| !aGltfContentFile->good()) || !aGltfContentFile->good())
{ {
@ -827,7 +827,7 @@ bool RWGltf_CafWriter::writeJson (const Handle(TDocStd_Document)& theDocument,
if (aFullLen64 < std::numeric_limits<uint32_t>::max()) if (aFullLen64 < std::numeric_limits<uint32_t>::max())
{ {
{ {
opencascade::std::shared_ptr<std::istream> aBinFile = aFileSystem->OpenIStream (myBinFileNameFull, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aBinFile = aFileSystem->OpenIStream (myBinFileNameFull, std::ios::in | std::ios::binary);
if (aBinFile.get() == NULL || !aBinFile->good()) if (aBinFile.get() == NULL || !aBinFile->good())
{ {
Message::SendFail (TCollection_AsciiString ("File '") + myBinFileNameFull + "' cannot be opened"); Message::SendFail (TCollection_AsciiString ("File '") + myBinFileNameFull + "' cannot be opened");

View File

@ -360,8 +360,7 @@ protected:
RWMesh_CoordinateSystemConverter myCSTrsf; //!< transformation from OCCT to glTF coordinate system RWMesh_CoordinateSystemConverter myCSTrsf; //!< transformation from OCCT to glTF coordinate system
XCAFPrs_Style myDefaultStyle; //!< default material definition to be used for nodes with only color defined XCAFPrs_Style myDefaultStyle; //!< default material definition to be used for nodes with only color defined
opencascade::std::shared_ptr<RWGltf_GltfOStreamWriter> std::shared_ptr<RWGltf_GltfOStreamWriter> myWriter; //!< JSON writer
myWriter; //!< JSON writer
Handle(RWGltf_GltfMaterialMap) myMaterialMap; //!< map of defined materials Handle(RWGltf_GltfMaterialMap) myMaterialMap; //!< map of defined materials
RWGltf_GltfBufferView myBuffViewPos; //!< current buffer view with nodes positions RWGltf_GltfBufferView myBuffViewPos; //!< current buffer view with nodes positions
RWGltf_GltfBufferView myBuffViewNorm; //!< current buffer view with nodes normals RWGltf_GltfBufferView myBuffViewNorm; //!< current buffer view with nodes normals

View File

@ -154,7 +154,7 @@ bool RWGltf_TriangulationReader::readFileData (const Handle(RWGltf_GltfLatePrimi
const Handle(OSD_FileSystem)& theFileSystem) const const Handle(OSD_FileSystem)& theFileSystem) const
{ {
const Handle(OSD_FileSystem)& aFileSystem = !theFileSystem.IsNull() ? theFileSystem : OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = !theFileSystem.IsNull() ? theFileSystem : OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aSharedStream = aFileSystem->OpenIStream std::shared_ptr<std::istream> aSharedStream = aFileSystem->OpenIStream
(theGltfData.StreamUri, std::ios::in | std::ios::binary, theGltfData.StreamOffset); (theGltfData.StreamUri, std::ios::in | std::ios::binary, theGltfData.StreamOffset);
if (aSharedStream.get() == NULL) if (aSharedStream.get() == NULL)
{ {
@ -215,7 +215,7 @@ bool RWGltf_TriangulationReader::readDracoBuffer (const Handle(RWGltf_GltfLatePr
{ {
const TCollection_AsciiString& aName = theSourceGltfMesh->Id(); const TCollection_AsciiString& aName = theSourceGltfMesh->Id();
const Handle(OSD_FileSystem)& aFileSystem = !theFileSystem.IsNull() ? theFileSystem : OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = !theFileSystem.IsNull() ? theFileSystem : OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aSharedStream = aFileSystem->OpenIStream (theGltfData.StreamUri, std::ios::in | std::ios::binary, theGltfData.StreamOffset); std::shared_ptr<std::istream> aSharedStream = aFileSystem->OpenIStream (theGltfData.StreamUri, std::ios::in | std::ios::binary, theGltfData.StreamOffset);
if (aSharedStream.get() == NULL) if (aSharedStream.get() == NULL)
{ {
reportError (TCollection_AsciiString("Buffer '") + aName + "' refers to invalid file '" + theGltfData.StreamUri + "'."); reportError (TCollection_AsciiString("Buffer '") + aName + "' refers to invalid file '" + theGltfData.StreamUri + "'.");

View File

@ -157,7 +157,7 @@ Handle(Poly_Triangulation) RWStl::ReadBinary (const OSD_Path& theFile,
theFile.SystemName (aPath); theFile.SystemName (aPath);
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (aPath, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (aPath, std::ios::in | std::ios::binary);
if (aStream.get() == NULL) if (aStream.get() == NULL)
{ {
return Handle(Poly_Triangulation)(); return Handle(Poly_Triangulation)();

View File

@ -140,7 +140,7 @@ Standard_Boolean RWStl_Reader::Read (const char* theFile,
const Message_ProgressRange& theProgress) const Message_ProgressRange& theProgress)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (theFile, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aStream = aFileSystem->OpenIStream (theFile, std::ios::in | std::ios::binary);
if (aStream.get() == NULL) if (aStream.get() == NULL)
{ {
Message::SendFail (TCollection_AsciiString("Error: file '") + theFile + "' is not found"); Message::SendFail (TCollection_AsciiString("Error: file '") + theFile + "' is not found");

View File

@ -70,13 +70,11 @@ namespace opencascade {
BeginScope(); BeginScope();
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move constructor //! Move constructor
handle (handle&& theHandle) : entity(theHandle.entity) handle (handle&& theHandle) : entity(theHandle.entity)
{ {
theHandle.entity = 0; theHandle.entity = 0;
} }
#endif
//! Destructor //! Destructor
~handle () ~handle ()
@ -113,14 +111,12 @@ namespace opencascade {
return *this; return *this;
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move operator //! Move operator
handle& operator= (handle&& theHandle) handle& operator= (handle&& theHandle)
{ {
std::swap (this->entity, theHandle.entity); std::swap (this->entity, theHandle.entity);
return *this; return *this;
} }
#endif
//! STL-like cast to pointer to referred object (note non-const). //! STL-like cast to pointer to referred object (note non-const).
//! @sa std::shared_ptr::get() //! @sa std::shared_ptr::get()
@ -307,7 +303,6 @@ namespace opencascade {
BeginScope(); BeginScope();
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Generalized move constructor //! Generalized move constructor
template <class T2> template <class T2>
handle (handle<T2>&& theHandle, typename std::enable_if <is_base_but_not_same <T, T2>::value>::type* = nullptr) handle (handle<T2>&& theHandle, typename std::enable_if <is_base_but_not_same <T, T2>::value>::type* = nullptr)
@ -315,7 +310,6 @@ namespace opencascade {
{ {
theHandle.entity = 0; theHandle.entity = 0;
} }
#endif
//! Generalized assignment operator. //! Generalized assignment operator.
template <class T2> template <class T2>
@ -327,7 +321,6 @@ namespace opencascade {
return *this; return *this;
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Generalized move operator //! Generalized move operator
template <class T2> template <class T2>
handle& operator= (handle<T2>&& theHandle) handle& operator= (handle<T2>&& theHandle)
@ -337,7 +330,6 @@ namespace opencascade {
std::swap (this->entity, theHandle.entity); std::swap (this->entity, theHandle.entity);
return *this; return *this;
} }
#endif
#else #else

View File

@ -20,13 +20,17 @@
#ifndef _Standard_Macro_HeaderFile #ifndef _Standard_Macro_HeaderFile
# define _Standard_Macro_HeaderFile # define _Standard_Macro_HeaderFile
#if defined(_MSC_VER) && (_MSC_VER < 1600)
#error C++11 compatible compiler is required (Visual Studio 2010 or newer)
#endif
//! @def Standard_OVERRIDE //! @def Standard_OVERRIDE
//! Should be used in declarations of virtual methods overridden in the //! Should be used in declarations of virtual methods overridden in the
//! derived classes, to cause compilation error in the case if that virtual //! derived classes, to cause compilation error in the case if that virtual
//! function disappears or changes its signature in the base class. //! function disappears or changes its signature in the base class.
//! //!
//! Expands to C++11 keyword "override" on compilers that are known to //! Expands to C++11 keyword "override" on compilers that are known to
//! suppot it; empty in other cases. //! support it; empty in other cases.
#if defined(__cplusplus) && (__cplusplus >= 201100L) #if defined(__cplusplus) && (__cplusplus >= 201100L)
// part of C++11 standard // part of C++11 standard
#define Standard_OVERRIDE override #define Standard_OVERRIDE override
@ -183,13 +187,6 @@
#define Standard_ENABLE_DEPRECATION_WARNINGS #define Standard_ENABLE_DEPRECATION_WARNINGS
#endif #endif
//! @def OCCT_NO_RVALUE_REFERENCE
//! Disables methods and constructors that use rvalue references
//! (C++11 move semantics) not supported by obsolete compilers.
#if (defined(_MSC_VER) && (_MSC_VER < 1600))
#define OCCT_NO_RVALUE_REFERENCE
#endif
# ifdef _WIN32 # ifdef _WIN32
// We must be careful including windows.h: it is really poisonous stuff! // We must be careful including windows.h: it is really poisonous stuff!

View File

@ -33,37 +33,6 @@ namespace opencascade
// import all available standard stuff from std namespace // import all available standard stuff from std namespace
using namespace ::std; using namespace ::std;
// for old MSVC compiler, some standard templates are defined in std::tr1 namespace,
// and some missing ones are implemented here
#if (defined(_MSC_VER) && (_MSC_VER < 1600))
using namespace ::std::tr1;
// C++11 template class enable_if
template <bool Test, class Type = void>
struct enable_if
{ // type is undefined for assumed !_Test
};
template <class _Type>
struct enable_if<true, _Type>
{ // type is _Type for _Test
typedef _Type type;
};
template <bool Condition, typename TypeTrue, typename TypeFalse>
struct conditional
{
typedef TypeTrue type;
};
template <typename TypeTrue, typename TypeFalse>
struct conditional<false, TypeTrue, TypeFalse>
{
typedef TypeFalse type;
};
#endif
} // namespace std } // namespace std
//! Trait yielding true if class T1 is base of T2 but not the same //! Trait yielding true if class T1 is base of T2 but not the same

View File

@ -63,11 +63,6 @@ namespace opencascade
static_assert(opencascade::has_type<Base, direct_base_classes>::type::value, "OCCT RTTI definition is incorrect: " #Base " is not direct base class of " #Class); \ static_assert(opencascade::has_type<Base, direct_base_classes>::type::value, "OCCT RTTI definition is incorrect: " #Base " is not direct base class of " #Class); \
static_assert(&get_type_name == &Class::get_type_name, "OCCT RTTI definition is misplaced: current class is not " #Class); static_assert(&get_type_name == &Class::get_type_name, "OCCT RTTI definition is misplaced: current class is not " #Class);
#elif (defined(_MSC_VER) && (_MSC_VER < 1600))
// VC9 does not support static_assert and decltype at all
#define OCCT_CHECK_BASE_CLASS(Class,Base)
#elif (defined(_MSC_VER) && (_MSC_VER >= 1900)) #elif (defined(_MSC_VER) && (_MSC_VER >= 1900))
// VC14+ allow using address of member functions in static checks, // VC14+ allow using address of member functions in static checks,

View File

@ -18,21 +18,7 @@
#include <cstddef> #include <cstddef>
#include <ctime> #include <ctime>
// VC9 does not have stdint.h #include <stdint.h>
#if(defined(_MSC_VER) && (_MSC_VER < 1600))
// old MSVC - hasn't stdint header
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef signed __int64 int64_t;
#else
#include <stdint.h>
#endif
#if(defined(_MSC_VER) && (_MSC_VER < 1800)) #if(defined(_MSC_VER) && (_MSC_VER < 1800))
// only Visual Studio 2013 (vc12) provides <cinttypes> header // only Visual Studio 2013 (vc12) provides <cinttypes> header

View File

@ -99,7 +99,7 @@ Standard_Boolean StepSelect_WorkLibrary::WriteFile
if (stepmodel.IsNull() || stepro.IsNull()) return Standard_False; if (stepmodel.IsNull() || stepro.IsNull()) return Standard_False;
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out | std::ios::trunc); std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out | std::ios::trunc);
if (aStream.get() == NULL) { if (aStream.get() == NULL) {
ctx.CCheck(0)->AddFail("Step File could not be created"); ctx.CCheck(0)->AddFail("Step File could not be created");

View File

@ -76,7 +76,6 @@ public:
//! Initializes a AsciiString with another AsciiString. //! Initializes a AsciiString with another AsciiString.
Standard_EXPORT TCollection_AsciiString(const TCollection_AsciiString& astring); Standard_EXPORT TCollection_AsciiString(const TCollection_AsciiString& astring);
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move constructor //! Move constructor
TCollection_AsciiString (TCollection_AsciiString&& theOther) TCollection_AsciiString (TCollection_AsciiString&& theOther)
: mystring (theOther.mystring), : mystring (theOther.mystring),
@ -85,7 +84,6 @@ public:
theOther.mystring = NULL; theOther.mystring = NULL;
theOther.mylength = 0; theOther.mylength = 0;
} }
#endif
//! Initializes a AsciiString with copy of another AsciiString //! Initializes a AsciiString with copy of another AsciiString
//! concatenated with the message character. //! concatenated with the message character.
@ -280,10 +278,8 @@ void operator = (const TCollection_AsciiString& fromwhere)
//! Exchange the data of two strings (without reallocating memory). //! Exchange the data of two strings (without reallocating memory).
Standard_EXPORT void Swap (TCollection_AsciiString& theOther); Standard_EXPORT void Swap (TCollection_AsciiString& theOther);
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move assignment operator //! Move assignment operator
TCollection_AsciiString& operator= (TCollection_AsciiString&& theOther) { Swap (theOther); return *this; } TCollection_AsciiString& operator= (TCollection_AsciiString&& theOther) { Swap (theOther); return *this; }
#endif
//! Frees memory allocated by AsciiString. //! Frees memory allocated by AsciiString.
Standard_EXPORT ~TCollection_AsciiString(); Standard_EXPORT ~TCollection_AsciiString();

View File

@ -97,7 +97,6 @@ public:
//! Initializes a ExtendedString with another ExtendedString. //! Initializes a ExtendedString with another ExtendedString.
Standard_EXPORT TCollection_ExtendedString(const TCollection_ExtendedString& astring); Standard_EXPORT TCollection_ExtendedString(const TCollection_ExtendedString& astring);
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move constructor //! Move constructor
TCollection_ExtendedString (TCollection_ExtendedString&& theOther) TCollection_ExtendedString (TCollection_ExtendedString&& theOther)
: mystring (theOther.mystring), : mystring (theOther.mystring),
@ -106,7 +105,6 @@ public:
theOther.mystring = NULL; theOther.mystring = NULL;
theOther.mylength = 0; theOther.mylength = 0;
} }
#endif
//! Creation by converting an Ascii string to an extended //! Creation by converting an Ascii string to an extended
//! string. The string is treated as having UTF-8 coding. //! string. The string is treated as having UTF-8 coding.
@ -154,10 +152,8 @@ void operator = (const TCollection_ExtendedString& fromwhere)
//! Exchange the data of two strings (without reallocating memory). //! Exchange the data of two strings (without reallocating memory).
Standard_EXPORT void Swap (TCollection_ExtendedString& theOther); Standard_EXPORT void Swap (TCollection_ExtendedString& theOther);
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move assignment operator //! Move assignment operator
TCollection_ExtendedString& operator= (TCollection_ExtendedString&& theOther) { Swap (theOther); return *this; } TCollection_ExtendedString& operator= (TCollection_ExtendedString&& theOther) { Swap (theOther); return *this; }
#endif
//! Frees memory allocated by ExtendedString. //! Frees memory allocated by ExtendedString.
Standard_EXPORT ~TCollection_ExtendedString(); Standard_EXPORT ~TCollection_ExtendedString();

View File

@ -208,7 +208,7 @@ static Standard_Integer saveModel (Draw_Interpretor& di, Standard_Integer argc,
if (anUseStream) if (anUseStream)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aFileStream = aFileSystem->OpenOStream (argv[2], std::ios::out | std::ios::binary); std::shared_ptr<std::ostream> aFileStream = aFileSystem->OpenOStream (argv[2], std::ios::out | std::ios::binary);
isSaved = aModel->SaveAs (*aFileStream); isSaved = aModel->SaveAs (*aFileStream);
} }
else else
@ -252,7 +252,7 @@ static Standard_Integer loadModel (Draw_Interpretor& di, Standard_Integer argc,
if (anUseStream) if (anUseStream)
{ {
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFileStream = aFileSystem->OpenIStream (aPath, std::ios::in | std::ios::binary); std::shared_ptr<std::istream> aFileStream = aFileSystem->OpenIStream (aPath, std::ios::in | std::ios::binary);
isLoaded = aModel->Load (*aFileStream); isLoaded = aModel->Load (*aFileStream);
} }
else else

View File

@ -69,8 +69,6 @@ public:
return Assign(Other); return Assign(Other);
} }
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Move constructor //! Move constructor
TopLoc_SListOfItemLocation (TopLoc_SListOfItemLocation&& theOther) TopLoc_SListOfItemLocation (TopLoc_SListOfItemLocation&& theOther)
: myNode(std::move (theOther.myNode)) : myNode(std::move (theOther.myNode))
@ -84,8 +82,6 @@ public:
return *this; return *this;
} }
#endif
//! Returne true if this list is empty //! Returne true if this list is empty
Standard_Boolean IsEmpty() const Standard_Boolean IsEmpty() const
{ {

View File

@ -48,8 +48,6 @@ public:
//! Creates a NULL Shape referring to nothing. //! Creates a NULL Shape referring to nothing.
TopoDS_Shape() : myOrient (TopAbs_EXTERNAL) {} TopoDS_Shape() : myOrient (TopAbs_EXTERNAL) {}
#ifndef OCCT_NO_RVALUE_REFERENCE
//! Generalized move constructor, accepting also sub-classes //! Generalized move constructor, accepting also sub-classes
//! (TopoDS_Shape hierarchy declares only fake sub-classes with no extra fields). //! (TopoDS_Shape hierarchy declares only fake sub-classes with no extra fields).
template<class T2> template<class T2>
@ -71,8 +69,6 @@ public:
return *this; return *this;
} }
#endif
//! Returns true if this shape is null. In other words, it //! Returns true if this shape is null. In other words, it
//! references no underlying shape with the potential to //! references no underlying shape with the potential to
//! be given a location and an orientation. //! be given a location and an orientation.

View File

@ -638,7 +638,7 @@ static Standard_Integer VListMaterials (Draw_Interpretor& theDI,
}; };
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aMatFile, anObjFile, aHtmlFile; std::shared_ptr<std::ostream> aMatFile, anObjFile, aHtmlFile;
if (aDumpFile.EndsWith (".obj") if (aDumpFile.EndsWith (".obj")
|| aDumpFile.EndsWith (".mtl")) || aDumpFile.EndsWith (".mtl"))
{ {
@ -894,7 +894,7 @@ static Standard_Integer VListColors (Draw_Interpretor& theDI,
} }
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aHtmlFile; std::shared_ptr<std::ostream> aHtmlFile;
TCollection_AsciiString aFileNameBase, aFolder; TCollection_AsciiString aFileNameBase, aFolder;
if (aDumpFile.EndsWith (".htm") if (aDumpFile.EndsWith (".htm")
|| aDumpFile.EndsWith (".html")) || aDumpFile.EndsWith (".html"))
@ -1088,7 +1088,7 @@ static Standard_Integer VGenEnvLUT (Draw_Interpretor&,
} }
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aFile = aFileSystem->OpenOStream (aFilePath, std::ios::out | std::ios::trunc); std::shared_ptr<std::ostream> aFile = aFileSystem->OpenOStream (aFilePath, std::ios::out | std::ios::trunc);
if (aFile.get() == NULL || !aFile->good()) if (aFile.get() == NULL || !aFile->good())
{ {

View File

@ -226,7 +226,7 @@ Standard_Boolean VrmlAPI_Writer::write_v1(const TopoDS_Shape& aShape,const Stand
OSD_Path thePath(aFile); OSD_Path thePath(aFile);
TCollection_AsciiString theFile;thePath.SystemName(theFile); TCollection_AsciiString theFile;thePath.SystemName(theFile);
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> anOutFile = aFileSystem->OpenOStream (theFile, std::ios::out); std::shared_ptr<std::ostream> anOutFile = aFileSystem->OpenOStream (theFile, std::ios::out);
if (anOutFile.get() == NULL) if (anOutFile.get() == NULL)
{ {
return Standard_False; return Standard_False;
@ -370,7 +370,7 @@ Standard_Boolean VrmlAPI_Writer::write_v2(const TopoDS_Shape& aShape,const Stand
aConv.Convert(anExtFace, anExtEdge); aConv.Convert(anExtFace, anExtEdge);
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> anOutStream = aFileSystem->OpenOStream (aFile, std::ios::out); std::shared_ptr<std::ostream> anOutStream = aFileSystem->OpenOStream (aFile, std::ios::out);
if (anOutStream.get() != NULL) if (anOutStream.get() != NULL)
{ {
*anOutStream << aScene; *anOutStream << aScene;
@ -395,7 +395,7 @@ Standard_Boolean VrmlAPI_Writer::WriteDoc(
aConv.ConvertDocument(theDoc); aConv.ConvertDocument(theDoc);
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> anOutStream = aFileSystem->OpenOStream (theFile, std::ios::out); std::shared_ptr<std::ostream> anOutStream = aFileSystem->OpenOStream (theFile, std::ios::out);
if (anOutStream.get() != NULL) if (anOutStream.get() != NULL)
{ {
*anOutStream << aScene; *anOutStream << aScene;

View File

@ -176,7 +176,7 @@ void XmlLDrivers_DocumentRetrievalDriver::Read
myFileName = theFileName; myFileName = theFileName;
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFileStream = aFileSystem->OpenIStream (myFileName, std::ios::in); std::shared_ptr<std::istream> aFileStream = aFileSystem->OpenIStream (myFileName, std::ios::in);
if (aFileStream.get() != NULL && aFileStream->good()) if (aFileStream.get() != NULL && aFileStream->good())
{ {

View File

@ -99,8 +99,7 @@ void XmlLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)&
myFileName = theFileName; myFileName = theFileName;
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::ostream> aFileStream = aFileSystem->OpenOStream (theFileName, std::ios::out); std::shared_ptr<std::ostream> aFileStream = aFileSystem->OpenOStream (theFileName, std::ios::out);
if (aFileStream.get() != NULL && aFileStream->good()) if (aFileStream.get() != NULL && aFileStream->good())
{ {
Write (theDocument, *aFileStream, theRange); Write (theDocument, *aFileStream, theRange);