diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-01-27 14:36:32 +0100 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-01-27 14:36:32 +0100 |
commit | be2b37ca457581401bda98d729570ac1af021f28 (patch) | |
tree | 7d9ef0ad34f8682905185162617648dd7b118b1f /soldep | |
parent | cfb0815ece0230646667cc6db5d10d1a6e41b0e8 (diff) | |
parent | 3db6881b28e9fb08cdfe1f4cac8c8251b123b05e (diff) |
CWS-TOOLING: integrate CWS bserver50
Diffstat (limited to 'soldep')
-rw-r--r-- | soldep/bootstrp/prj.cxx | 131 | ||||
-rw-r--r-- | soldep/inc/soldep/prj.hxx | 14 |
2 files changed, 132 insertions, 13 deletions
diff --git a/soldep/bootstrp/prj.cxx b/soldep/bootstrp/prj.cxx index f81e03c5a7a3..5e93c1142673 100644 --- a/soldep/bootstrp/prj.cxx +++ b/soldep/bootstrp/prj.cxx @@ -216,6 +216,7 @@ CommandData::CommandData() nOSType = 0; nCommand = 0; pDepList = 0; + pCommandList = 0; } /*****************************************************************************/ @@ -234,6 +235,18 @@ CommandData::~CommandData() pDepList = NULL; } + if ( pCommandList ) + { + ByteString *pString = pCommandList->First(); + while ( pString ) + { + delete pString; + pString = pCommandList->Next(); + } + delete pCommandList; + + pCommandList = NULL; + } } /*****************************************************************************/ @@ -296,6 +309,15 @@ ByteString CommandData::GetCommandTypeString() } /*****************************************************************************/ +void CommandData::AddCommand(ByteString* pCommand) +/*****************************************************************************/ +{ + if (!pCommandList) + pCommandList = new SByteStringList(); + pCommandList->Insert(pCommand, LIST_APPEND); +} + +/*****************************************************************************/ CommandData& CommandData::operator>> ( SvStream& rStream ) /*****************************************************************************/ { @@ -325,6 +347,14 @@ CommandData& CommandData::operator>> ( SvStream& rStream ) else rStream << sal_False; + if (pCommandList) + { + rStream << sal_True; + *pCommandList >> rStream; + } + else + rStream << sal_False; + return *this; } @@ -361,7 +391,26 @@ CommandData& CommandData::operator<< ( SvStream& rStream ) *pDepList << rStream; } else + { + if (pDepList) DELETEZ (pDepList); + } + + BOOL bCommandList; + rStream >> bCommandList; + if (pCommandList) + pCommandList->CleanUp(); + if (bCommandList) + { + if (!pCommandList) + pCommandList = new SByteStringList(); + *pCommandList << rStream; + } + else + { + if (pCommandList) + DELETEZ (pCommandList); + } return *this; } @@ -751,11 +800,12 @@ CommandData* Prj::GetDirectoryList ( USHORT nWhatOS, USHORT nCommand ) CommandData* Prj::GetDirectoryData( ByteString aLogFileName ) /*****************************************************************************/ { + PrjList* pPrjList = GetCommandDataList (); CommandData *pData = NULL; - ULONG nCount_l = Count(); + ULONG nCount_l = pPrjList->Count(); for ( ULONG i=0; i<nCount_l; i++ ) { - pData = GetObject(i); + pData = pPrjList->GetObject(i); if ( pData->GetLogFile() == aLogFileName ) return pData; } @@ -775,7 +825,9 @@ Prj::Prj() : bHardDependencies( FALSE ), bFixedDependencies( FALSE ), bVisited( FALSE ), - bIsAvailable( TRUE ) + bIsAvailable( TRUE ), + pTempCommandDataList (0), + bTempCommandDataListPermanent (FALSE) /*****************************************************************************/ { } @@ -790,7 +842,9 @@ Prj::Prj( ByteString aName ) : bHardDependencies( FALSE ), bFixedDependencies( FALSE ), bVisited( FALSE ), - bIsAvailable( TRUE ) + bIsAvailable( TRUE ), + pTempCommandDataList (0), + bTempCommandDataListPermanent (FALSE) /*****************************************************************************/ { } @@ -954,7 +1008,8 @@ BOOL Prj::InsertDirectory ( ByteString aDirName, USHORT aWhat, pData->SetLogFile( aLogFileName ); pData->SetClientRestriction( rClientRestriction ); - Insert( pData ); + PrjList* pPrjList = GetCommandDataList (); + pPrjList->Insert( pData ); return FALSE; } @@ -966,14 +1021,15 @@ BOOL Prj::InsertDirectory ( ByteString aDirName, USHORT aWhat, CommandData* Prj::RemoveDirectory ( ByteString aLogFileName ) /*****************************************************************************/ { - ULONG nCount_l = Count(); + PrjList* pPrjList = GetCommandDataList (); + ULONG nCount_l = pPrjList->Count(); CommandData* pData; CommandData* pDataFound = NULL; SByteStringList* pDataDeps; for ( USHORT i = 0; i < nCount_l; i++ ) { - pData = GetObject( i ); + pData = pPrjList->GetObject( i ); if ( pData->GetLogFile() == aLogFileName ) pDataFound = pData; else @@ -1033,6 +1089,56 @@ void Prj::ExtractDependencies() } /*****************************************************************************/ +PrjList* Prj::GetCommandDataList () +/*****************************************************************************/ +{ + if (pTempCommandDataList) + return pTempCommandDataList; + else + return (PrjList*)this; +} + +/*****************************************************************************/ +void Prj::RemoveTempCommandDataList() +/*****************************************************************************/ +{ + if (pTempCommandDataList) + { + delete pTempCommandDataList; // this list remove the elements by itself + pTempCommandDataList = NULL; + } +} + +/*****************************************************************************/ +void Prj::GenerateTempCommandDataList() +/*****************************************************************************/ +{ + if (pTempCommandDataList) + RemoveTempCommandDataList(); + pTempCommandDataList = new PrjList(); + CommandData* pCommandData = First(); + while (pCommandData) { + SvMemoryStream* pStream = new SvMemoryStream(); + *pCommandData >> *pStream; + CommandData* pNewCommandData = new CommandData(); + pStream->Seek( STREAM_SEEK_TO_BEGIN ); + *pNewCommandData << *pStream; + pTempCommandDataList->Insert(pNewCommandData, LIST_APPEND); + delete pStream; + pCommandData = Next(); + } +} + +/*****************************************************************************/ +void Prj::GenerateEmptyTempCommandDataList() +/*****************************************************************************/ +{ + if (pTempCommandDataList) + RemoveTempCommandDataList(); + pTempCommandDataList = new PrjList(); +} + +/*****************************************************************************/ Prj& Prj::operator>> ( SvStream& rStream ) /*****************************************************************************/ { @@ -1639,7 +1745,8 @@ void Star::InsertToken ( char *yytext ) pStaticDepList = 0; break; case 1: - aDirName = yytext; + aDirName = yytext; + aProjectName = aDirName.GetToken ( 0, 0x5c); break; case 2: if ( !strcmp( yytext, ":" )) @@ -1674,7 +1781,6 @@ void Star::InsertToken ( char *yytext ) } if (bPrjDep) { - aProjectName = aDirName.GetToken ( 0, 0x5c); if ( HasProject( aProjectName )) { RemovePrj(GetPrj(aProjectName)); @@ -1708,7 +1814,7 @@ void Star::InsertToken ( char *yytext ) case 5: if ( !bPrjDep ) { - aLogFileName = yytext; + aLogFileName = (ByteString(aProjectName).Append("_")).Append(yytext); } break; default: @@ -1725,7 +1831,8 @@ void Star::InsertToken ( char *yytext ) // ggfs. Dependency liste anlegen und ergaenzen if ( !pStaticDepList ) pStaticDepList = new SByteStringList; - pStaticDepList->PutString( new ByteString( aItem )); + ByteString* pStr = new ByteString ((ByteString (aProjectName).Append("_")).Append(aItem)); + pStaticDepList->PutString( pStr ); } } else @@ -1748,7 +1855,6 @@ void Star::InsertToken ( char *yytext ) bHasModes = TRUE; } - aProjectName = aDirName.GetToken ( 0, 0x5c); if ( HasProject( aProjectName )) { pPrj = GetPrj( aProjectName ); @@ -1782,7 +1888,6 @@ void Star::InsertToken ( char *yytext ) der Solar-Projekte einfuegen */ if ( i == -1 ) { - aProjectName = aDirName.GetToken ( 0, 0x5c); if ( HasProject( aProjectName )) { pPrj = GetPrj( aProjectName ); diff --git a/soldep/inc/soldep/prj.hxx b/soldep/inc/soldep/prj.hxx index 858afac2d56a..bd94a3e87f9a 100644 --- a/soldep/inc/soldep/prj.hxx +++ b/soldep/inc/soldep/prj.hxx @@ -87,6 +87,7 @@ class CommandData ByteString aComment; ByteString sClientRestriction; SByteStringList *pDepList; + SByteStringList *pCommandList; USHORT nOSType; USHORT nCommand; @@ -131,6 +132,9 @@ public: void AddDepth(){nDepth++;} ULONG GetDepth(){return nDepth;} + void AddCommand(ByteString* pCommand); + SByteStringList* GetCommandList() {return pCommandList;} + CommandData& operator<< ( SvStream& rStream ); CommandData& operator>> ( SvStream& rStream ); }; @@ -284,6 +288,8 @@ private: BOOL bIsAvailable; SByteStringList* RemoveStringList(SByteStringList* pStringList ); SDepInfoList* RemoveDepInfoList(SDepInfoList* pInfoList ); + PrjList* pTempCommandDataList; + BOOL bTempCommandDataListPermanent; public: Prj(); Prj( ByteString aName ); @@ -318,6 +324,14 @@ public: void ExtractDependencies(); + PrjList* GetCommandDataList (); + void RemoveTempCommandDataList(); + void GenerateTempCommandDataList(); + void GenerateEmptyTempCommandDataList(); + BOOL HasTempCommandDataList() {return pTempCommandDataList != NULL;} + void SetTempCommandDataListPermanent (BOOL bVar = TRUE) {bTempCommandDataListPermanent = bVar;} + BOOL IsTempCommandDataListPermanent() {return bTempCommandDataListPermanent;} + Prj& operator<< ( SvStream& rStream ); Prj& operator>> ( SvStream& rStream ); }; |