//function : Name
//purpose :
//=======================================================================
-const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::Name() const
+inline const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::Name() const
{
return myname;
}
//function : FullName
//purpose :
//=======================================================================
-const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::FullName() const
+inline const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::FullName() const
{
return myfullname;
}
//function : UserPathName
//purpose :
//=======================================================================
-const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::UserPathName() const
+inline const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::UserPathName() const
{
return myfullname;
}
//function : Nesting
//purpose :
//=======================================================================
-const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::Nesting() const
+inline const Handle(TCollection_HAsciiString)& WOKernel_BaseEntity::Nesting() const
{
return mynestingentity;
}
//function : Session
//purpose :
//=======================================================================
-Handle(WOKernel_Session) WOKernel_BaseEntity::Session() const
+inline Handle(WOKernel_Session) WOKernel_BaseEntity::Session() const
{
return mysession;
}
#include <EDL_API.hxx>
#include <EDL_Template.hxx>
#include <EDL_HSequenceOfVariable.hxx>
+#include <EDL_Variable.hxx>
#include <WOKTools_Messages.hxx>
//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
//function : Name
//purpose :
//=======================================================================
-const Handle(TCollection_HAsciiString)& WOKernel_FileType::Name() const
+inline const Handle(TCollection_HAsciiString)& WOKernel_FileType::Name() const
{
return myname;
}
//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;
}