//=======================================================================
Standard_Boolean TObj_Application::SaveDocument
- (const Handle(TDocStd_Document)& theSourceDoc,
- const TCollection_ExtendedString theTargetFile)
+ (const Handle(TDocStd_Document)& theSourceDoc,
+ const TCollection_ExtendedString& theTargetFile)
{
myIsError = Standard_False;
PCDM_StoreStatus aStatus = SaveAs (theSourceDoc, theTargetFile);
//=======================================================================
Standard_Boolean TObj_Application::LoadDocument
- (const TCollection_ExtendedString theSourceFile,
- Handle(TDocStd_Document)& theTargetDoc)
+ (const TCollection_ExtendedString& theSourceFile,
+ Handle(TDocStd_Document)& theTargetDoc)
{
myIsError = Standard_False;
PCDM_ReaderStatus aStatus = PCDM_RS_ReaderException;
#include <Message_Messenger.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
-
//!
//! This is a base class for OCAF based TObj models
//! with declared virtual methods
//!
-
class TObj_Application : public TDocStd_Application
{
public:
*/
//! Saving the OCAF document to a file
- virtual Standard_EXPORT Standard_Boolean SaveDocument
- (const Handle(TDocStd_Document)& theSourceDoc,
- const TCollection_ExtendedString theTargetFile);
+ Standard_EXPORT virtual Standard_Boolean SaveDocument
+ (const Handle(TDocStd_Document)& theSourceDoc,
+ const TCollection_ExtendedString& theTargetFile);
//! Loading the OCAF document from a file
- virtual Standard_EXPORT Standard_Boolean LoadDocument
- (const TCollection_ExtendedString theSourceFile,
- Handle(TDocStd_Document)& theTargetDoc);
+ Standard_EXPORT virtual Standard_Boolean LoadDocument
+ (const TCollection_ExtendedString& theSourceFile,
+ Handle(TDocStd_Document)& theTargetDoc);
//! Create the OCAF document from scratch
virtual Standard_EXPORT Standard_Boolean CreateNewDocument
DEFINE_STANDARD_HANDLE(TObj_Application,TDocStd_Application)
#endif
-
-#ifdef _MSC_VER
-#pragma once
-#endif
#include <Precision.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_GUID.hxx>
-#include <TCollection_ExtendedString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TDataStd_Integer.hxx>
#include <TDataStd_Real.hxx>
//purpose : Loads the model from the file
//=======================================================================
-Standard_Boolean TObj_Model::Load (const TCollection_ExtendedString theFile)
+Standard_Boolean TObj_Model::Load (const TCollection_ExtendedString& theFile)
{
// Return status
Standard_Boolean aStatus = Standard_True;
//purpose : Save the model to a file
//=======================================================================
-Standard_Boolean TObj_Model::SaveAs (const TCollection_ExtendedString theFile)
+Standard_Boolean TObj_Model::SaveAs (const TCollection_ExtendedString& theFile)
{
TObj_Assistant::ClearTypeMap();
// OCAF document
//purpose : Check whether the document contains the Ocaf data
//=======================================================================
-Standard_Boolean TObj_Model::checkDocumentEmpty (const TCollection_ExtendedString theFile)
+Standard_Boolean TObj_Model::checkDocumentEmpty (const TCollection_ExtendedString& theFile)
{
if (theFile.IsEmpty())
return Standard_True;
#ifndef TObj_Model_HeaderFile
#define TObj_Model_HeaderFile
+#include <Message_Messenger.hxx>
#include <TDF_Label.hxx>
#include <TObj_Partition.hxx>
-#include <Message_Messenger.hxx>
+#include <TCollection_ExtendedString.hxx>
class TObj_TNameContainer;
class TObj_Partition;
Standard_EXPORT ~TObj_Model ();
//! Check whether the document contains the OCAF data.
- Standard_EXPORT virtual Standard_Boolean
- checkDocumentEmpty(const TCollection_ExtendedString theFile);
+ Standard_EXPORT virtual Standard_Boolean checkDocumentEmpty(const TCollection_ExtendedString& theFile);
public:
/**
//! Load the OCAF model from a file. If the filename is empty or file does
//! not exists, it just initializes model by empty data.
- virtual Standard_EXPORT Standard_Boolean Load (const TCollection_ExtendedString theFile);
+ Standard_EXPORT virtual Standard_Boolean Load (const TCollection_ExtendedString& theFile);
//! Save the model to a file
- virtual Standard_EXPORT Standard_Boolean SaveAs (const TCollection_ExtendedString theFile);
+ Standard_EXPORT virtual Standard_Boolean SaveAs (const TCollection_ExtendedString& theFile);
//! Save the model to the same file
Standard_EXPORT Standard_Boolean Save ();