mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-08 18:40:55 +03:00
0028039: Coding rules, TObj - pass file name by reference
This commit is contained in:
parent
9c189bd8dc
commit
be70005cb5
@ -80,8 +80,8 @@ Standard_CString TObj_Application::ResourcesName()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean TObj_Application::SaveDocument
|
Standard_Boolean TObj_Application::SaveDocument
|
||||||
(const Handle(TDocStd_Document)& theSourceDoc,
|
(const Handle(TDocStd_Document)& theSourceDoc,
|
||||||
const TCollection_ExtendedString theTargetFile)
|
const TCollection_ExtendedString& theTargetFile)
|
||||||
{
|
{
|
||||||
myIsError = Standard_False;
|
myIsError = Standard_False;
|
||||||
PCDM_StoreStatus aStatus = SaveAs (theSourceDoc, theTargetFile);
|
PCDM_StoreStatus aStatus = SaveAs (theSourceDoc, theTargetFile);
|
||||||
@ -125,8 +125,8 @@ Standard_Boolean TObj_Application::SaveDocument
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean TObj_Application::LoadDocument
|
Standard_Boolean TObj_Application::LoadDocument
|
||||||
(const TCollection_ExtendedString theSourceFile,
|
(const TCollection_ExtendedString& theSourceFile,
|
||||||
Handle(TDocStd_Document)& theTargetDoc)
|
Handle(TDocStd_Document)& theTargetDoc)
|
||||||
{
|
{
|
||||||
myIsError = Standard_False;
|
myIsError = Standard_False;
|
||||||
PCDM_ReaderStatus aStatus = PCDM_RS_ReaderException;
|
PCDM_ReaderStatus aStatus = PCDM_RS_ReaderException;
|
||||||
|
@ -24,12 +24,10 @@
|
|||||||
#include <Message_Messenger.hxx>
|
#include <Message_Messenger.hxx>
|
||||||
#include <TColStd_SequenceOfExtendedString.hxx>
|
#include <TColStd_SequenceOfExtendedString.hxx>
|
||||||
|
|
||||||
|
|
||||||
//!
|
//!
|
||||||
//! This is a base class for OCAF based TObj models
|
//! This is a base class for OCAF based TObj models
|
||||||
//! with declared virtual methods
|
//! with declared virtual methods
|
||||||
//!
|
//!
|
||||||
|
|
||||||
class TObj_Application : public TDocStd_Application
|
class TObj_Application : public TDocStd_Application
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -45,14 +43,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//! Saving the OCAF document to a file
|
//! Saving the OCAF document to a file
|
||||||
virtual Standard_EXPORT Standard_Boolean SaveDocument
|
Standard_EXPORT virtual Standard_Boolean SaveDocument
|
||||||
(const Handle(TDocStd_Document)& theSourceDoc,
|
(const Handle(TDocStd_Document)& theSourceDoc,
|
||||||
const TCollection_ExtendedString theTargetFile);
|
const TCollection_ExtendedString& theTargetFile);
|
||||||
|
|
||||||
//! Loading the OCAF document from a file
|
//! Loading the OCAF document from a file
|
||||||
virtual Standard_EXPORT Standard_Boolean LoadDocument
|
Standard_EXPORT virtual Standard_Boolean LoadDocument
|
||||||
(const TCollection_ExtendedString theSourceFile,
|
(const TCollection_ExtendedString& theSourceFile,
|
||||||
Handle(TDocStd_Document)& theTargetDoc);
|
Handle(TDocStd_Document)& theTargetDoc);
|
||||||
|
|
||||||
//! Create the OCAF document from scratch
|
//! Create the OCAF document from scratch
|
||||||
virtual Standard_EXPORT Standard_Boolean CreateNewDocument
|
virtual Standard_EXPORT Standard_Boolean CreateNewDocument
|
||||||
@ -117,7 +115,3 @@ public:
|
|||||||
DEFINE_STANDARD_HANDLE(TObj_Application,TDocStd_Application)
|
DEFINE_STANDARD_HANDLE(TObj_Application,TDocStd_Application)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma once
|
|
||||||
#endif
|
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
#include <Standard_GUID.hxx>
|
#include <Standard_GUID.hxx>
|
||||||
#include <TCollection_ExtendedString.hxx>
|
|
||||||
#include <TCollection_HAsciiString.hxx>
|
#include <TCollection_HAsciiString.hxx>
|
||||||
#include <TDataStd_Integer.hxx>
|
#include <TDataStd_Integer.hxx>
|
||||||
#include <TDataStd_Real.hxx>
|
#include <TDataStd_Real.hxx>
|
||||||
@ -108,7 +107,7 @@ void TObj_Model::CloseDocument (const Handle(TDocStd_Document)& theDoc)
|
|||||||
//purpose : Loads the model from the file
|
//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
|
// Return status
|
||||||
Standard_Boolean aStatus = Standard_True;
|
Standard_Boolean aStatus = Standard_True;
|
||||||
@ -257,7 +256,7 @@ Standard_Boolean TObj_Model::Save ()
|
|||||||
//purpose : Save the model to a file
|
//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();
|
TObj_Assistant::ClearTypeMap();
|
||||||
// OCAF document
|
// OCAF document
|
||||||
@ -744,7 +743,7 @@ void TObj_Model::SetModified (const Standard_Boolean theModified)
|
|||||||
//purpose : Check whether the document contains the Ocaf data
|
//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())
|
if (theFile.IsEmpty())
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
|
@ -18,9 +18,10 @@
|
|||||||
#ifndef TObj_Model_HeaderFile
|
#ifndef TObj_Model_HeaderFile
|
||||||
#define TObj_Model_HeaderFile
|
#define TObj_Model_HeaderFile
|
||||||
|
|
||||||
|
#include <Message_Messenger.hxx>
|
||||||
#include <TDF_Label.hxx>
|
#include <TDF_Label.hxx>
|
||||||
#include <TObj_Partition.hxx>
|
#include <TObj_Partition.hxx>
|
||||||
#include <Message_Messenger.hxx>
|
#include <TCollection_ExtendedString.hxx>
|
||||||
|
|
||||||
class TObj_TNameContainer;
|
class TObj_TNameContainer;
|
||||||
class TObj_Partition;
|
class TObj_Partition;
|
||||||
@ -64,8 +65,7 @@ class TObj_Model : public MMgt_TShared
|
|||||||
Standard_EXPORT ~TObj_Model ();
|
Standard_EXPORT ~TObj_Model ();
|
||||||
|
|
||||||
//! Check whether the document contains the OCAF data.
|
//! Check whether the document contains the OCAF data.
|
||||||
Standard_EXPORT virtual Standard_Boolean
|
Standard_EXPORT virtual Standard_Boolean checkDocumentEmpty(const TCollection_ExtendedString& theFile);
|
||||||
checkDocumentEmpty(const TCollection_ExtendedString theFile);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@ -86,10 +86,10 @@ class TObj_Model : public MMgt_TShared
|
|||||||
|
|
||||||
//! Load the OCAF model from a file. If the filename is empty or file does
|
//! Load the OCAF model from a file. If the filename is empty or file does
|
||||||
//! not exists, it just initializes model by empty data.
|
//! 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
|
//! 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
|
//! Save the model to the same file
|
||||||
Standard_EXPORT Standard_Boolean Save ();
|
Standard_EXPORT Standard_Boolean Save ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user