From 6d2f4ef8975deadda87f36230def005a84343b12 Mon Sep 17 00:00:00 2001 From: cas Date: Fri, 9 Jun 2000 14:13:48 +0000 Subject: [PATCH] No comments --- src/WOKernel/WOKernel_BaseEntity.lxx | 10 +-- src/WOKernel/WOKernel_Entity.lxx | 2 +- src/WOKernel/WOKernel_File.lxx | 6 +- src/WOKernel/WOKernel_FileType.cxx | 122 ++++++++++++++++++--------- src/WOKernel/WOKernel_FileType.lxx | 18 ++-- 5 files changed, 100 insertions(+), 58 deletions(-) diff --git a/src/WOKernel/WOKernel_BaseEntity.lxx b/src/WOKernel/WOKernel_BaseEntity.lxx index ccc131c..f6350d0 100755 --- a/src/WOKernel/WOKernel_BaseEntity.lxx +++ b/src/WOKernel/WOKernel_BaseEntity.lxx @@ -8,7 +8,7 @@ //function : Name //purpose : //======================================================================= -const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::Name() const +inline const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::Name() const { return myname; } @@ -18,7 +18,7 @@ const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::Name() const //function : FullName //purpose : //======================================================================= -const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::FullName() const +inline const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::FullName() const { return myfullname; } @@ -28,7 +28,7 @@ const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::FullName() const //function : UserPathName //purpose : //======================================================================= -const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::UserPathName() const +inline const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::UserPathName() const { return myfullname; } @@ -38,7 +38,7 @@ const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::UserPathName() cons //function : Nesting //purpose : //======================================================================= -const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::Nesting() const +inline const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::Nesting() const { return mynestingentity; } @@ -48,7 +48,7 @@ const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::Nesting() const //function : Session //purpose : //======================================================================= -Handle(WOKernel_Session) WOKernel_BaseEntity::Session() const +inline Handle(WOKernel_Session) WOKernel_BaseEntity::Session() const { return mysession; } diff --git a/src/WOKernel/WOKernel_Entity.lxx b/src/WOKernel/WOKernel_Entity.lxx index 6e38220..d32a98a 100755 --- a/src/WOKernel/WOKernel_Entity.lxx +++ b/src/WOKernel/WOKernel_Entity.lxx @@ -19,7 +19,7 @@ inline WOKUtils_Param& WOKernel_Entity::ChangeParams() //function : IsOpened //purpose : is the entity opened ? //======================================================================= -Standard_Boolean WOKernel_Entity::IsOpened() const +inline Standard_Boolean WOKernel_Entity::IsOpened() const { return myopenstatus; } diff --git a/src/WOKernel/WOKernel_File.lxx b/src/WOKernel/WOKernel_File.lxx index c74985d..9dcc6a2 100755 --- a/src/WOKernel/WOKernel_File.lxx +++ b/src/WOKernel/WOKernel_File.lxx @@ -11,7 +11,7 @@ //function : Path //purpose : //======================================================================= -const Handle(WOKUtils_Path)& WOKernel_File::Path() const +inline const Handle(WOKUtils_Path)& WOKernel_File::Path() const { return mypath; } @@ -21,7 +21,7 @@ const Handle(WOKUtils_Path)& WOKernel_File::Path() const //function : Type //purpose : //======================================================================= -const Handle(WOKernel_FileType)& WOKernel_File::Type() const +inline const Handle(WOKernel_FileType)& WOKernel_File::Type() const { return mytype; } @@ -30,7 +30,7 @@ const Handle(WOKernel_FileType)& WOKernel_File::Type() const //function : TypeName //purpose : //======================================================================= -const Handle(TCollection_HAsciiString)& WOKernel_File::TypeName() const +inline const Handle(TCollection_HAsciiString)& WOKernel_File::TypeName() const { return mytype->Name(); } diff --git a/src/WOKernel/WOKernel_FileType.cxx b/src/WOKernel/WOKernel_FileType.cxx index d781a14..a7200a5 100755 --- a/src/WOKernel/WOKernel_FileType.cxx +++ b/src/WOKernel/WOKernel_FileType.cxx @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -52,52 +53,93 @@ WOKernel_FileType::WOKernel_FileType(const Handle(TCollection_HAsciiString)& ana //function : ComputePath //purpose : //======================================================================= -Handle(TCollection_HAsciiString) WOKernel_FileType::ComputePath(const WOKUtils_Param& params, - const Handle(TCollection_HAsciiString)& afilename) -{ - Handle(TCollection_HAsciiString) result; - Handle(EDL_HSequenceOfVariable) vars = new EDL_HSequenceOfVariable; +Handle( TCollection_HAsciiString ) + WOKernel_FileType :: ComputePath ( + const WOKUtils_Param& params, + const Handle( TCollection_HAsciiString )& afilename + ) { - if(IsFileDependent() && !afilename.IsNull()) - params.Set((Standard_CString) FILEVAR, afilename->ToCString()); + static Handle( TCollection_HAsciiString ) javafile = + new TCollection_HAsciiString ( "javafile" ); - Handle(TColStd_HSequenceOfHAsciiString) needed = mytemplate.GetVariableList(); + Standard_Boolean fJava = Standard_False; + Standard_CString s; + Handle( TCollection_HAsciiString ) result; + Handle( EDL_HSequenceOfVariable ) vars = new EDL_HSequenceOfVariable (); - for(Standard_Integer i=1; i<=needed->Length(); i++) - { - const Standard_CString name = needed->Value(i)->ToCString(); - if(params.myapi->IsDefined(name)) - { - vars->Append(params.myapi->GetVariable(name)); - } - else - { - ErrorMsg << "WOKernel_FileType::ComputePath" - << "Needed argument " << name << " for type " << Name() << " is not setted" << endm; - return result; - } - } + if ( IsFileDependent () && !afilename.IsNull () ) - mytemplate.Eval(vars); + params.Set ( ( Standard_CString )FILEVAR, afilename -> ToCString () ); - Handle(TColStd_HSequenceOfAsciiString) resseq = mytemplate.GetEval(); + Handle( TColStd_HSequenceOfHAsciiString ) needed = mytemplate.GetVariableList (); - if(resseq.IsNull()) - { - ErrorMsg << "WOKernel_FileType::ComputePath" - << "Type " << Name() << " could not be evaluated" << endm; - } - else - { - if(resseq->Length() != 1) - { - WarningMsg << "WOKernel_FileType::ComputePath" - << "Type " << Name() << " evaluates to more than one line : ignoring others" << endm; - } - result=new TCollection_HAsciiString(resseq->Value(1)); - } - return result; -} + for ( Standard_Integer i = 1; i <= needed -> Length (); ++i ) { + + const Standard_CString name = needed -> Value ( i ) -> ToCString (); + + if ( params.myapi -> IsDefined ( name ) ) { + + if ( myname -> IsSameString ( javafile ) && + !strcmp ( name, ENTITYVAR ) + ) { + + EDL_Variable v = params.myapi -> GetVariable ( name ); + Standard_CString p = s = v.GetValue (); + + while ( *p ) { if ( *p == '.' ) *p = '/'; ++p; } + + vars -> Append ( v ); + fJava = Standard_True; + + } else vars -> Append ( params.myapi -> GetVariable ( name ) ); + + } else { + + ErrorMsg << "WOKernel_FileType::ComputePath" + << "Needed argument " + << name + << " for type " + << Name () + << " is not setted" + << endm; + + return result; + + } // end else + + } // end for + + mytemplate.Eval ( vars ); + + Handle( TColStd_HSequenceOfAsciiString ) resseq = mytemplate.GetEval (); + + if ( resseq.IsNull () ) + + ErrorMsg << "WOKernel_FileType::ComputePath" + << "Type " + << Name () + << " could not be evaluated" + << endm; + + else { + + if ( resseq -> Length () != 1 ) + + WarningMsg << "WOKernel_FileType::ComputePath" + << "Type " + << Name () + << " evaluates to more than one line : ignoring others" + << endm; + + result = new TCollection_HAsciiString ( resseq -> Value ( 1 ) ); + + } // end else + + if ( fJava ) while ( *s ) { if ( *s == '/' ) *s = '.'; ++s; } + + return result; + +} // WOKernel_FileType :: ComputePath //======================================================================= //function : GetDefinition diff --git a/src/WOKernel/WOKernel_FileType.lxx b/src/WOKernel/WOKernel_FileType.lxx index 48256be..5d6007f 100755 --- a/src/WOKernel/WOKernel_FileType.lxx +++ b/src/WOKernel/WOKernel_FileType.lxx @@ -8,7 +8,7 @@ //function : Name //purpose : //======================================================================= -const Handle(TCollection_HAsciiString)& WOKernel_FileType::Name() const +inline const Handle(TCollection_HAsciiString)& WOKernel_FileType::Name() const { return myname; } @@ -17,43 +17,43 @@ const Handle(TCollection_HAsciiString)& WOKernel_FileType::Name() const //function : Template //purpose : gives the format for workbench path solver //======================================================================= -const EDL_Template& WOKernel_FileType::Template() const +inline const EDL_Template& WOKernel_FileType::Template() const { return mytemplate; } -Standard_Boolean WOKernel_FileType::IsStationDependent() const +inline Standard_Boolean WOKernel_FileType::IsStationDependent() const { return mystationdep; } -Standard_Boolean WOKernel_FileType::IsDBMSDependent() const +inline Standard_Boolean WOKernel_FileType::IsDBMSDependent() const { return mydbmsdep; } -Standard_Boolean WOKernel_FileType::IsEntityDependent() const +inline Standard_Boolean WOKernel_FileType::IsEntityDependent() const { return myentitydep; } -Standard_Boolean WOKernel_FileType::IsNestingDependent() const +inline Standard_Boolean WOKernel_FileType::IsNestingDependent() const { return mynestingdep; } -Standard_Boolean WOKernel_FileType::IsFileDependent() const +inline Standard_Boolean WOKernel_FileType::IsFileDependent() const { return myfiledep; } -Standard_Boolean WOKernel_FileType::IsDirectory() const +inline Standard_Boolean WOKernel_FileType::IsDirectory() const { return myisrep; } -Standard_Boolean WOKernel_FileType::IsFile() const +inline Standard_Boolean WOKernel_FileType::IsFile() const { return !myisrep; } -- 2.39.5