]> OCCT Git - occt-wok.git/commitdiff
No comments
authorcas <cas@opencascade.com>
Fri, 9 Jun 2000 14:13:48 +0000 (14:13 +0000)
committercas <cas@opencascade.com>
Fri, 9 Jun 2000 14:13:48 +0000 (14:13 +0000)
src/WOKernel/WOKernel_BaseEntity.lxx
src/WOKernel/WOKernel_Entity.lxx
src/WOKernel/WOKernel_File.lxx
src/WOKernel/WOKernel_FileType.cxx
src/WOKernel/WOKernel_FileType.lxx

index ccc131cb15697a49e3ce8f30e125fc79f4a4dee8..f6350d0b36b3a073ae13666c28ec7c96acba6567 100755 (executable)
@@ -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;
 }
index 6e38220474eddca7610322d39bd305281a3cba98..d32a98aa853f6d5bd5703d8156abd0267dee2255 100755 (executable)
@@ -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;
 }
index c74985dcdb1072de7b8b0f8253e4c0086aa55184..9dcc6a2ecdca32c165318a4273424be03e9eb5b2 100755 (executable)
@@ -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();
 }
index d781a149caa8b9ed0ee0fc7a36245861696db6ea..a7200a58f00c990633366a8aebb0dc3c2be8f16e 100755 (executable)
@@ -11,6 +11,7 @@
 #include <EDL_API.hxx>
 #include <EDL_Template.hxx>
 #include <EDL_HSequenceOfVariable.hxx>
+#include <EDL_Variable.hxx>
 
 #include <WOKTools_Messages.hxx>
 
@@ -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
index 48256be0dbb76539a5abf5405beb017d4fb6b194..5d6007f908a8cc19e4d5643fc03eda579d05e563 100755 (executable)
@@ -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;
 }