From: cas Date: Wed, 3 Nov 1999 18:05:01 +0000 (+0000) Subject: No comments X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=14fff6f8a6af22f4233d9b3ccfc030ffffde42b6;p=occt-wok.git No comments --- diff --git a/src/WOKStep/WOKStep_Compile.cxx b/src/WOKStep/WOKStep_Compile.cxx index ac33c6a..88d3f1e 100755 --- a/src/WOKStep/WOKStep_Compile.cxx +++ b/src/WOKStep/WOKStep_Compile.cxx @@ -52,6 +52,9 @@ #include +#include +#include + //======================================================================= //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(); diff --git a/src/WOKStep/WOKStep_ProcessStep.cxx b/src/WOKStep/WOKStep_ProcessStep.cxx index 649a4b6..bfe7181 100755 --- a/src/WOKStep/WOKStep_ProcessStep.cxx +++ b/src/WOKStep/WOKStep_ProcessStep.cxx @@ -57,6 +57,10 @@ #define CHECK_REMOTE 1 #endif // WNT +#ifdef LIN +# include +#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());