-- path <thePath> ; overwrites the file if it already exists.
returns StoreStatus from PCDM;
+ SaveAs (me : mutable; theDoc : Document from TDocStd;
+ thePath: ExtendedString from TCollection;
+ theStatusMessage: out ExtendedString from TCollection)
+ ---Purpose: Save the active document in the
+ -- path <thePath> ; overwrites the file if it already exists.
+ returns StoreStatus from PCDM;
+
+ SaveAs (me : mutable; theDoc : Document from TDocStd;
+ theOStream: in out OStream from Standard)
+ ---Purpose: Save the active document in the stream <theOStream>;
+ returns StoreStatus from PCDM;
+
+ SaveAs (me : mutable; theDoc : Document from TDocStd;
+ theOStream: in out OStream from Standard;
+ theStatusMessage: out ExtendedString from TCollection)
+ ---Purpose: Save the active document in the stream <theOStream>;
+ returns StoreStatus from PCDM;
+
SaveAs (me : mutable; theDoc : Document from TDocStd;
theDevice: IODevice from Storage)
---Purpose: Save the active document in the device <theDevice>;
-- overwrites the file if it already exists.
returns StoreStatus from PCDM is protected;
- SaveAs (me : mutable; theDoc : Document from TDocStd;
- theOStream: in out OStream from Standard)
- ---Purpose: Save the active document in the stream <theOStream>;
- returns StoreStatus from PCDM;
+ SaveAs (me : mutable; aDoc : Document from TDocStd;
+ aDev : IODevice from Storage;
+ theStatusMessage: out ExtendedString from TCollection)
+ ---Purpose: Save the active document in the file <name> in the
+ -- path <path>. overwrite the file if it
+ -- already exist.
+ returns StoreStatus from PCDM is protected;
Save (me : mutable; aDoc : Document from TDocStd)
---Purpose: Save aDoc active document.
-- was not retrieved in the applicative session by using Open.
returns StoreStatus from PCDM;
- SaveAs (me : mutable; aDoc : Document from TDocStd;
- aDev : IODevice from Storage;
- theStatusMessage: out ExtendedString from TCollection)
- ---Purpose: Save the active document in the file <name> in the
- -- path <path> . overwrite the file if it
- -- already exist.
- returns StoreStatus from PCDM;
-
Save (me : mutable; aDoc : Document from TDocStd;
theStatusMessage: out ExtendedString from TCollection)
---Purpose: Save the document overwriting the previous file
PCDM_StoreStatus TDocStd_Application::SaveAs(const Handle(TDocStd_Document)& theDoc,
const TCollection_ExtendedString& thePath)
{
- Handle(Storage_File) aDevice = new Storage_File(thePath);
- return SaveAs (theDoc, aDevice);
+ Handle(Storage_File) aDevice = new Storage_File( thePath );
+ return SaveAs( theDoc, aDevice );
}
//=======================================================================
//purpose :
//=======================================================================
-PCDM_StoreStatus TDocStd_Application::SaveAs(const Handle(TDocStd_Document)& D,
- const Handle(Storage_IODevice)& aDevice)
- {
- /*
- TDocStd_PathParser tool (path);
- TCollection_ExtendedString directory = tool.Trek();
- TCollection_ExtendedString file = tool.Name();
- file+=".";
- file+=tool.Extension();
- */
- D->Open(this);
- CDF_Store storer (D);
- if (!storer.SetDevice(aDevice))
- {
- TCollection_ExtendedString aMsg ("TDocStd_Application::SaveAs() - device ");
- aMsg += " not valid";
- if(!MessageDriver().IsNull())
- MessageDriver()->Write(aMsg.ToExtString());
- return storer.StoreStatus(); //CDF_SS_Failure;
- }
- // storer.SetName (file);
- try {
- OCC_CATCH_SIGNALS
- storer.Realize();
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) F = Standard_Failure::Caught();
- if (!F.IsNull() && !MessageDriver().IsNull()) {
- TCollection_ExtendedString aString (F->GetMessageString());
- MessageDriver()->Write(aString.ToExtString());
- }
- }
- if(storer.StoreStatus() == PCDM_SS_OK)
- D->SetSaved();
-#ifdef OCCT_DEBUG
- cout<<"TDocStd_Application::SaveAs(): The status = "<<storer.StoreStatus()<<endl;
-#endif
- return storer.StoreStatus();
+PCDM_StoreStatus TDocStd_Application::SaveAs(const Handle(TDocStd_Document)& theDoc,
+ const TCollection_ExtendedString& thePath,
+ TCollection_ExtendedString& theStatusMessage)
+{
+ Handle(Storage_File) aDevice = new Storage_File( thePath );
+ return SaveAs( theDoc, aDevice, theStatusMessage );
}
//=======================================================================
-//function : Save
+//function : SaveAs
//purpose :
//=======================================================================
-
PCDM_StoreStatus TDocStd_Application::SaveAs(const Handle(TDocStd_Document)& theDoc,
Standard_OStream& theOStream)
{
- Handle(Storage_OStream) aDevice = new Storage_OStream (theOStream);
- return SaveAs (theDoc, aDevice);
+ Handle(Storage_OStream) aDevice = new Storage_OStream( theOStream );
+ return SaveAs( theDoc, aDevice );
+}
+
+//=======================================================================
+//function : SaveAs
+//purpose :
+//=======================================================================
+
+PCDM_StoreStatus TDocStd_Application::SaveAs(const Handle(TDocStd_Document)& theDoc,
+ Standard_OStream& theOStream,
+ TCollection_ExtendedString& theStatusMessage)
+{
+ Handle(Storage_OStream) aDevice = new Storage_OStream( theOStream );
+ return SaveAs( theDoc, aDevice, theStatusMessage );
+}
+
+//=======================================================================
+//function : SaveAs
+//purpose :
+//=======================================================================
+
+PCDM_StoreStatus TDocStd_Application::SaveAs(const Handle(TDocStd_Document)& D,
+ const Handle(Storage_IODevice)& aDevice)
+{
+ TCollection_ExtendedString aStatusMessage;
+ return SaveAs( D, aDevice, aStatusMessage );
+}
+
+//=======================================================================
+//function : SaveAs
+//purpose :
+//=======================================================================
+
+PCDM_StoreStatus TDocStd_Application::SaveAs(const Handle(TDocStd_Document)& D,
+ const Handle(Storage_IODevice)& aDev,
+ TCollection_ExtendedString& theStatusMessage)
+{
+ PCDM_StoreStatus aStatus = PCDM_SS_Failure;
+ D->Open(this);
+ CDF_Store storer (D);
+ if (storer.SetDevice(aDev)) {
+ try {
+ OCC_CATCH_SIGNALS
+ storer.Realize();
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) F = Standard_Failure::Caught();
+ if (!F.IsNull() && !MessageDriver().IsNull()) {
+ TCollection_ExtendedString aString (F->GetMessageString());
+ MessageDriver()->Write(aString.ToExtString());
+ }
+ }
+ if(storer.StoreStatus() == PCDM_SS_OK)
+ D->SetSaved();
+ theStatusMessage = storer.AssociatedStatusText();
+ aStatus = storer.StoreStatus();
+ } else {
+ theStatusMessage =
+ TCollection_ExtendedString("TDocStd_Application::SaveAs: No valid device ");
+ aStatus = PCDM_SS_Failure;
+ }
+ return aStatus;
}
//=======================================================================
// }
-//=======================================================================
-//function : SaveAs
-//purpose :
-//=======================================================================
-
-PCDM_StoreStatus TDocStd_Application::SaveAs(const Handle(TDocStd_Document)& D,
- const Handle(Storage_IODevice)& aDev,
- TCollection_ExtendedString& theStatusMessage)
-{
- PCDM_StoreStatus aStatus = PCDM_SS_Failure;
- /*
- TDocStd_PathParser tool (path);
- TCollection_ExtendedString directory = tool.Trek();
- TCollection_ExtendedString file = tool.Name();
- file+=".";
- file+=tool.Extension();
- */
- D->Open(this);
- CDF_Store storer (D);
- if (storer.SetDevice(aDev)) {
- // storer.SetName (file);
- try {
- OCC_CATCH_SIGNALS
- storer.Realize();
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) F = Standard_Failure::Caught();
- if (!F.IsNull() && !MessageDriver().IsNull()) {
- TCollection_ExtendedString aString (F->GetMessageString());
- MessageDriver()->Write(aString.ToExtString());
- }
- }
- if(storer.StoreStatus() == PCDM_SS_OK)
- D->SetSaved();
- theStatusMessage = storer.AssociatedStatusText();
- aStatus = storer.StoreStatus();
- } else {
- theStatusMessage =
- TCollection_ExtendedString("TDocStd_Application::SaveAs: No valid device ");
- aStatus = PCDM_SS_Failure;
- }
- return aStatus;
-}
-
//=======================================================================
//function : Save
//purpose :