]> OCCT Git - occt-wok.git/commitdiff
No comments
authorcas <cas@opencascade.com>
Wed, 3 Nov 1999 18:05:01 +0000 (18:05 +0000)
committercas <cas@opencascade.com>
Wed, 3 Nov 1999 18:05:01 +0000 (18:05 +0000)
src/WOKStep/WOKStep_Compile.cxx
src/WOKStep/WOKStep_ProcessStep.cxx

index ac33c6a05b30e63c4a7a85acc41d7fa3ad915da4..88d3f1e389ae152586ac2318f2b1ad7b93d066e3 100755 (executable)
@@ -52,6 +52,9 @@
 
 #include <WOKStep_Compile.ixx>
 
+#include <OSD_Protection.hxx>
+#include <OSD_File.hxx>
+
 //=======================================================================
 //function : WOKStep_Compile
 //purpose  : 
@@ -183,6 +186,12 @@ void WOKStep_Compile::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execli
   ashell->Lock();
 
   myiterator.Init(ashell, OutputDir(), incdirs, dbdirs);
+#ifndef WNT
+  static Handle( TCollection_HAsciiString ) NL = new TCollection_HAsciiString ( "\n" );
+#else
+  static Handle( TCollection_HAsciiString ) NL = new TCollection_HAsciiString ( "\r\n" );
+#endif  // WNT
+  Handle( TCollection_HAsciiString ) str = new TCollection_HAsciiString ();
 
   for(j=1; j<=execlist->Length(); j++)
     {
@@ -219,6 +228,43 @@ _TEST_BREAK();
              }
          }
 
+          if (  !myiterator.CmdLine ().IsNull ()  ) {
+
+           Standard_Integer                   i, j;
+           Handle( TCollection_HAsciiString ) s = new TCollection_HAsciiString (
+                                                       myiterator.CmdLine ()
+                                                      );
+
+           char const* ptr = s -> ToCString ();
+
+           for ( i = 0, j = -1; i < s -> Length (); ++i, ++ptr )
+
+            if (  ( *ptr == '\r' && i && *( ptr - 1 ) != '\\' ) ||
+                  ( *ptr == '\n' && i && *( ptr - 1 ) != '\\' ) ||
+                  *ptr == '>'                                   ||
+                  *ptr == ';'
+            ) {
+
+             j = i;
+             break;
+
+            }  // end if
+
+           if ( j != -1 ) {
+
+            s = s -> SubString ( 1, j );
+
+            if (  !s.IsNull () && !s -> IsEmpty ()  ) {
+
+             str -> AssignCat ( s  );
+             str -> AssignCat ( NL );
+           
+            }  // end if
+
+           }  // end if
+          
+          }  // end if
+
          TreatOutput(infile,myiterator.Produces()); 
 
          succeeds->Append(infile);
@@ -252,6 +298,46 @@ _TEST_BREAK();
               << "-----------------------------------------------------------------" << endm;
     }
 
+ if (  !str -> IsEmpty ()  ) {
+
+  Handle( TCollection_HAsciiString ) s = new TCollection_HAsciiString (  Unit () -> Name ()  );
+  s -> AssignCat ( ".comp" );
+  Handle( WOKernel_File ) stadm = new WOKernel_File (
+                                       s, Unit (), Unit () ->
+                                                    GetFileType ( "stadmfile" )
+                                      );
+
+  stadm -> GetPath ();
+
+  OSD_Path p (  stadm -> Path () -> Name () -> ToCString ()  );
+  OSD_File f ( p );
+
+  f.Build (
+   OSD_WriteOnly, OSD_Protection ( OSD_RWXD, OSD_RWXD, OSD_R, OSD_R )
+  );
+
+  if (  !f.Failed ()  ) {
+
+   f.Write (  str -> String (), str -> Length ()  );
+
+   if (  f.Failed ()  ) {
+
+    TCollection_AsciiString s;
+
+    p.SystemName ( s );
+
+    ErrorMsg << "WOKStep_Compile :: Execute"
+             << "could not create '" << new TCollection_HAsciiString ( s )
+             << "'" << endm;
+
+   }  // end if
+
+   f.Close ();
+
+  }  // end if
+
+ }  // end if
+
   if(fails->Length() && succeeds->Length())
     {
       SetIncomplete();
index 649a4b6272ce515a12d455cefe67f8410fe3185a..bfe71812c53c73cedc11770c1222a5839a3ee7e4 100755 (executable)
 #define CHECK_REMOTE 1
 #endif // WNT
 
+#ifdef LIN
+# include <iomanip.h>
+#endif  // LIN
+
 //=======================================================================
 //function : WOKStep_ProcessStep
 //purpose  : 
@@ -308,10 +312,39 @@ void WOKStep_ProcessStep::TreatOutput(const Handle(WOKMake_InputFile)& infile, c
              Handle(WOKMake_OutputFile) outfile;
              // je calcule le path de destination du file
              aoutfile->GetPath();
-             
+//-> EUG4YAN
+              TCollection_AsciiString s;
+              OSD_Path p (  outent -> Path () -> Name () -> ToCString ()  );
+//<- EUG4YAN
              // je l'y deplace
              outent->Path()->MoveTo(aoutfile->Path());
+//-> EUG4YAN
+              if ( extens == WOKUtils_ObjectFile ) {
+
+               p.SetExtension ( ".d" );
+               p.SystemName   ( s );
+
+               Handle( WOKUtils_Path ) pp = new WOKUtils_Path (
+                                                 new TCollection_HAsciiString ( s )
+                                                );
+
+               if (  pp -> Exists ()  ) {
+
+                OSD_Path p (  aoutfile -> Path () -> Name () -> ToCString ()  );
+
+                p.SetExtension ( ".d" );
+                p.SystemName ( s );
+
+                Handle( WOKUtils_Path ) pd = new WOKUtils_Path (
+                                                  new TCollection_HAsciiString ( s )
+                                                 );
+
+                pp -> MoveTo ( pd );
+
+               }  // end if
 
+              }  // end if
+//<- EUG4YAN
              if(!istemplate)
                {
                  outfile = new WOKMake_OutputFile(aoutfile->LocatorName(), aoutfile, outent, aoutfile->Path());