1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
29 #include <bootstrp/sstring.hxx>
30 #include <vos/mutex.hxx>
32 #define ENABLE_BYTESTRING_STREAM_OPERATORS
33 #include <tools/stream.hxx>
34 #include <tools/geninfo.hxx>
35 #include <soldep/prj.hxx>
36 #include <bootstrp/inimgr.hxx>
48 #if defined(DOS) || defined(WNT) || defined(OS2)
49 #define LIST_DELIMETER ';'
52 #define LIST_DELIMETER ':'
55 #define LIST_DELIMETER ','
60 #if defined(DOS) || defined(WNT) || defined(OS2) || defined(WIN)
61 #define PATH_DELIMETER '\\'
64 #define PATH_DELIMETER '/'
67 #define PATH_DELIMETER ':'
72 //static const char * XML_ALL = "all";
78 /*****************************************************************************/
79 SimpleConfig::SimpleConfig( String aSimpleConfigFileName
)
80 /*****************************************************************************/
83 aFileName
= aSimpleConfigFileName
;
84 aFileStream
.Open ( aFileName
, STREAM_READ
);
87 /*****************************************************************************/
88 SimpleConfig::SimpleConfig( DirEntry
& rDirEntry
)
89 /*****************************************************************************/
92 aFileName
= rDirEntry
.GetFull();
93 aFileStream
.Open ( aFileName
, STREAM_READ
);
96 /*****************************************************************************/
97 SimpleConfig::~SimpleConfig()
98 /*****************************************************************************/
100 aFileStream
.Close ();
103 /*****************************************************************************/
104 ByteString
SimpleConfig::GetNext()
105 /*****************************************************************************/
109 if ( aStringBuffer
=="" )
110 while ((aStringBuffer
= GetNextLine()) == "\t"); //solange bis != "\t"
111 if ( aStringBuffer
=="" )
114 aString
= aStringBuffer
.GetToken(0,'\t');
115 aStringBuffer
.Erase(0, aString
.Len()+1);
117 aStringBuffer
.EraseLeadingChars( '\t' );
122 /*****************************************************************************/
123 ByteString
SimpleConfig::GetNextLine()
124 /*****************************************************************************/
131 bStreamOk
= aFileStream
.ReadLine ( aTmpStr
);
132 if ( (aTmpStr
.Search( "#" ) == 0) )
134 aTmpStr
= aTmpStr
.EraseLeadingChars();
135 aTmpStr
= aTmpStr
.EraseTrailingChars();
136 while ( aTmpStr
.SearchAndReplace(ByteString(' '),ByteString('\t') ) != STRING_NOTFOUND
);
137 int nLength
= aTmpStr
.Len();
138 if ( bStreamOk
&& (nLength
== 0) )
142 ByteString aEraseString
;
143 for ( USHORT i
= 0; i
<= nLength
; i
++)
146 if ( aTmpStr
.GetChar( i
) == '"')
148 if ( bFound
) bFound
= FALSE
;
150 aTmpStr
.SetChar( i
, '\t' );
153 if ( aTmpStr
.GetChar( i
) == 0x20 && !bFound
)
154 aTmpStr
.SetChar( i
, 0x09 );
159 /*****************************************************************************/
160 ByteString
SimpleConfig::GetCleanedNextLine( BOOL bReadComments
)
161 /*****************************************************************************/
164 sal_Bool bReadNextLine
= sal_True
;
165 while (bReadNextLine
)
167 bStreamOk
= aFileStream
.ReadLine ( aTmpStr
);
171 ByteString sTab
= "\t";
172 ByteString sDoubleTab
= "\t\t";
173 ByteString sSpace
= " ";
174 xub_StrLen nIndex
= 0;
176 aTmpStr
.SearchAndReplaceAll(sSpace
, sTab
);
177 while ( (nIndex
= aTmpStr
.SearchAndReplace(sDoubleTab
, sTab
, nIndex
)) != STRING_NOTFOUND
);
179 aTmpStr
= aTmpStr
.EraseLeadingAndTrailingChars('\t'); // remove tabs
181 if ( aTmpStr
.Search( "#" ) == 0 )
186 else if (aTmpStr
!= ByteString::EmptyString())
187 bReadNextLine
= sal_False
;
198 /*****************************************************************************/
199 CommandData::CommandData()
200 /*****************************************************************************/
208 /*****************************************************************************/
209 CommandData::~CommandData()
210 /*****************************************************************************/
214 ByteString
*pString
= pDepList
->First();
218 pString
= pDepList
->Next();
226 ByteString
*pString
= pCommandList
->First();
230 pString
= pCommandList
->Next();
238 /*****************************************************************************/
239 ByteString
CommandData::GetOSTypeString()
240 /*****************************************************************************/
246 case OS_WIN16
| OS_WIN32
| OS_OS2
| OS_UNX
| OS_MAC
:
249 case OS_WIN32
| OS_WIN16
:
274 /*****************************************************************************/
275 ByteString
CommandData::GetCommandTypeString()
276 /*****************************************************************************/
290 aRetStr
+= ByteString::CreateFromInt64( nCommand
+ 1 - COMMAND_USER_START
);
297 /*****************************************************************************/
298 void CommandData::AddCommand(ByteString
* pCommand
)
299 /*****************************************************************************/
302 pCommandList
= new SByteStringList();
303 pCommandList
->Insert(pCommand
, LIST_APPEND
);
306 /*****************************************************************************/
307 CommandData
& CommandData::operator>> ( SvStream
& rStream
)
308 /*****************************************************************************/
311 rStream
<< aLogFileName
;
314 rStream
<< aUpdMinor
;
320 rStream
<< aCommandPara
;
322 rStream
<< sClientRestriction
;
331 *pDepList
>> rStream
;
334 rStream
<< sal_False
;
339 *pCommandList
>> rStream
;
342 rStream
<< sal_False
;
347 /*****************************************************************************/
348 CommandData
& CommandData::operator<< ( SvStream
& rStream
)
349 /*****************************************************************************/
352 rStream
>> aLogFileName
;
355 rStream
>> aUpdMinor
;
361 rStream
>> aCommandPara
;
363 rStream
>> sClientRestriction
;
376 pDepList
= new SByteStringList();
377 *pDepList
<< rStream
;
386 rStream
>> bCommandList
;
388 pCommandList
->CleanUp();
392 pCommandList
= new SByteStringList();
393 *pCommandList
<< rStream
;
398 DELETEZ (pCommandList
);
410 /*****************************************************************************/
412 /*****************************************************************************/
418 ByteString
*pString
= pModeList
->First();
422 pString
= pModeList
->Next();
430 /*****************************************************************************/
431 void DepInfo::SetProject (ByteString
* pStr
)
432 /*****************************************************************************/
438 /*****************************************************************************/
439 void DepInfo::RemoveProject ()
440 /*****************************************************************************/
449 /*****************************************************************************/
450 DepInfo
& DepInfo::operator<< ( SvStream
& rStream
)
451 /*****************************************************************************/
454 pProject
= new ByteString();
455 rStream
>> *pProject
;
458 rStream
>> bModeList
;
460 pModeList
->CleanUp();
464 pModeList
= new SByteStringList();
465 *pModeList
<< rStream
;
470 rStream
>> bAllModes
;
474 /*****************************************************************************/
475 DepInfo
& DepInfo::operator>> ( SvStream
& rStream
)
476 /*****************************************************************************/
478 rStream
<< *pProject
;
482 *pModeList
>> rStream
;
485 rStream
<< sal_False
;
486 rStream
<< bAllModes
;
492 // class SDepInfoList
495 /*****************************************************************************/
496 SDepInfoList::SDepInfoList()
497 /*****************************************************************************/
502 /*****************************************************************************/
503 SDepInfoList::~SDepInfoList()
504 /*****************************************************************************/
510 /*****************************************************************************/
511 ULONG
SDepInfoList::IsString( ByteString
* pStr
)
512 /*****************************************************************************/
514 ULONG nRet
= NOT_THERE
;
515 if ( (nRet
= GetPrevString( pStr
)) != 0 )
517 ByteString
* pString
= GetObject( nRet
)->GetProject();
518 if ( *pString
== *pStr
)
525 ByteString
* pString
= GetObject( 0 )->GetProject();
526 if ( pString
&& (*pString
== *pStr
) )
534 /*****************************************************************************/
535 ULONG
SDepInfoList::GetPrevString( ByteString
* pStr
)
536 /*****************************************************************************/
540 ULONG nCount_l
= Count();
541 ULONG nUpper
= nCount_l
;
543 ULONG nCurrent
= nUpper
/ 2;
549 if ( (nCurrent
== nLower
) || (nCurrent
== nUpper
) )
551 pString
= GetObject( nCurrent
)->GetProject();
552 int nResult
= pStr
->CompareTo( *pString
);
553 if ( nResult
== COMPARE_LESS
)
556 nCurrent
= (nCurrent
+ nLower
) /2;
558 else if ( nResult
== COMPARE_GREATER
)
561 nCurrent
= (nUpper
+ nCurrent
) /2;
563 else if ( nResult
== COMPARE_EQUAL
)
565 if ( nRem
== nCurrent
)
573 /*****************************************************************************/
574 void SDepInfoList::PutModeString( DepInfo
* pInfoList
, ByteString
* pStr
)
575 /*****************************************************************************/
577 SByteStringList
* pList
= pInfoList
->GetModeList();
580 pList
= new SByteStringList
;
581 pInfoList
->SetModeList(pList
);
587 // check if string exists
588 ByteString
*pString
= pList
->First();
591 if (*pString
== *pStr
)
596 pString
= pList
->Next();
598 pList
->PutString( pStr
);
604 /*****************************************************************************/
605 ULONG
SDepInfoList::PutString( ByteString
* pStr
)
606 /*****************************************************************************/
608 return PutString( pStr
, NULL
);
611 /**************************************************************************
613 * Sortiert einen ByteString in die Liste ein und gibt die Position,
614 * an der einsortiert wurde, zurueck
616 **************************************************************************/
618 ULONG
SDepInfoList::PutString( ByteString
* pStr
, ByteString
* pModeStr
)
626 ULONG nPos
= GetPrevString ( pStr
);
630 DepInfo
* pInfo
= GetObject( 0 );
631 ByteString
* pString
= pInfo
->GetProject();
632 if ( pString
->CompareTo( *pStr
) == COMPARE_GREATER
)
637 pInfo
->SetProject(pStr
);
639 PutModeString(pInfo
, pModeStr
);
641 pInfo
->SetAllModes();
642 Insert( pInfo
, (ULONG
)0 );
647 ByteString
* pString
= GetObject( nPos
)->GetProject();
648 if ( *pStr
!= *pString
)
650 DepInfo
* pInfo
= new DepInfo
;
653 pInfo
->SetProject(pStr
);
655 PutModeString(pInfo
, pModeStr
);
657 pInfo
->SetAllModes();
658 Insert( pInfo
, nPos
+1 );
665 DepInfo
* pInfo
= GetObject( nPos
);
667 PutModeString(pInfo
, pModeStr
);
669 pInfo
->SetAllModes();
675 DepInfo
* pInfo
= new DepInfo
;
678 pInfo
->SetProject(pStr
);
680 PutModeString(pInfo
, pModeStr
);
682 pInfo
->SetAllModes();
694 /*****************************************************************************/
695 ByteString
* SDepInfoList::RemoveString( const ByteString
& rName
)
696 /*****************************************************************************/
706 for( i
= 0 ; i
< Count(); i
++ )
708 if ( rName
== *(GetObject( i
)->GetProject()) )
710 pReturn
= new ByteString(*(GetObject(i
)->GetProject()));
712 pInfo
= GetObject(i
);
722 /*****************************************************************************/
723 SByteStringList
* SDepInfoList::GetAllDepModes()
724 /*****************************************************************************/
729 DepInfo
*pInfo
= First();
732 if (!pInfo
->IsAllModes() && pInfo
->GetModeList())
735 pAllModeList
= new SByteStringList();
736 ByteString
* pStr
= pInfo
->GetModeList()->First();
739 if (pAllModeList
->IsString(pStr
) == NOT_THERE
)
740 pAllModeList
->PutString(pStr
);
741 pStr
= pInfo
->GetModeList()->Next();
749 /*****************************************************************************/
750 SDepInfoList
& SDepInfoList::operator<< ( SvStream
& rStream
)
751 /*****************************************************************************/
755 for ( USHORT i
= 0; i
< nCount_l
; i
++ ) {
756 DepInfo
* pDepInfo
= new DepInfo();
757 *pDepInfo
<< rStream
;
758 Insert (pDepInfo
, LIST_APPEND
);
763 /*****************************************************************************/
764 SDepInfoList
& SDepInfoList::operator>> ( SvStream
& rStream
)
765 /*****************************************************************************/
767 ULONG nCount_l
= Count();
769 DepInfo
* pDepInfo
= First();
771 *pDepInfo
>> rStream
;
778 /*****************************************************************************/
779 CommandData
* Prj::GetDirectoryList ( USHORT nWhatOS
, USHORT nCommand
)
780 /*****************************************************************************/
782 return (CommandData
*)NULL
;
785 /*****************************************************************************/
786 CommandData
* Prj::GetDirectoryData( ByteString aLogFileName
)
787 /*****************************************************************************/
789 PrjList
* pPrjList
= GetCommandDataList ();
790 CommandData
*pData
= NULL
;
791 ULONG nCount_l
= pPrjList
->Count();
792 for ( ULONG i
=0; i
<nCount_l
; i
++ )
794 pData
= pPrjList
->GetObject(i
);
795 if ( pData
->GetLogFile() == aLogFileName
)
805 /*****************************************************************************/
807 pPrjInitialDepList(0),
811 bHardDependencies( FALSE
),
812 bFixedDependencies( FALSE
),
814 bIsAvailable( TRUE
),
815 pTempCommandDataList (0),
816 bTempCommandDataListPermanent (FALSE
),
818 /*****************************************************************************/
822 /*****************************************************************************/
823 Prj::Prj( ByteString aName
) :
824 aProjectName( aName
),
825 pPrjInitialDepList(0),
829 bHardDependencies( FALSE
),
830 bFixedDependencies( FALSE
),
832 bIsAvailable( TRUE
),
833 pTempCommandDataList (0),
834 bTempCommandDataListPermanent (FALSE
),
836 /*****************************************************************************/
840 /*****************************************************************************/
842 /*****************************************************************************/
844 pPrjDepList
= RemoveStringList (pPrjDepList
);
845 pPrjInitialDepList
= RemoveStringList (pPrjInitialDepList
);
846 pPrjDepInfoList
= RemoveDepInfoList (pPrjDepInfoList
);
849 /*****************************************************************************/
850 SByteStringList
* Prj::RemoveStringList(SByteStringList
* pStringList
)
851 /*****************************************************************************/
855 ByteString
*pString
= pStringList
->First();
859 pString
= pStringList
->Next();
869 /*****************************************************************************/
870 SDepInfoList
* Prj::RemoveDepInfoList(SDepInfoList
* pInfoList
)
871 /*****************************************************************************/
875 DepInfo
*pInfo
= pInfoList
->First();
879 pInfo
= pInfoList
->Next();
889 /*****************************************************************************/
890 void Prj::AddDependencies( ByteString aStr
)
891 /*****************************************************************************/
894 if ( !pPrjDepInfoList
)
895 pPrjDepInfoList
= new SDepInfoList
;
897 pPrjDepInfoList
->PutString( new ByteString(aStr
) );
900 /*****************************************************************************/
901 void Prj::AddDependencies( ByteString aStr
, ByteString aModeStr
)
902 /*****************************************************************************/
905 // needs dirty flag - not expanded
906 if ( !pPrjDepInfoList
)
907 pPrjDepInfoList
= new SDepInfoList
;
909 pPrjDepInfoList
->PutString( new ByteString(aStr
), new ByteString(aModeStr
) );
912 /*****************************************************************************/
913 SByteStringList
* Prj::GetDependencies( BOOL bExpanded
)
914 /*****************************************************************************/
924 if (!pPrjInitialDepList
)
926 return pPrjInitialDepList
;
930 /*****************************************************************************/
931 void Prj::SetMode(SByteStringList
* pModList
)
932 /*****************************************************************************/
934 pPrjDepList
= RemoveStringList (pPrjDepList
);
935 pPrjInitialDepList
= RemoveStringList (pPrjInitialDepList
);
937 if (!pPrjDepInfoList
)
940 pPrjDepList
= new SByteStringList
;
941 pPrjInitialDepList
= new SByteStringList
;
943 DepInfo
*pInfo
= pPrjDepInfoList
->First();
946 if (pInfo
->IsAllModes() || !pInfo
->GetModeList() || !pModList
)
948 pPrjDepList
->PutString( new ByteString((ByteString
) *(pInfo
->GetProject())));
949 pPrjInitialDepList
->PutString( new ByteString((ByteString
) *(pInfo
->GetProject())));
950 //pPrjDepList->PutString( pInfo->GetProject());
951 //pPrjInitialDepList->PutString( pInfo->GetProject());
955 BOOL bStringFound
= FALSE
;
956 SByteStringList
* pDepList
= pInfo
->GetModeList();
957 ByteString
*pModString
= pDepList
->First();
960 ByteString
*pDefModString
= pModList
->First();
961 while ( pDefModString
)
963 if (*pDefModString
== *pModString
)
965 pPrjDepList
->PutString( new ByteString((ByteString
) *(pInfo
->GetProject())));
966 pPrjInitialDepList
->PutString( new ByteString((ByteString
) *(pInfo
->GetProject())));
967 //pPrjDepList->PutString( pInfo->GetProject());
968 //pPrjInitialDepList->PutString( pInfo->GetProject());
972 pDefModString
= pModList
->Next();
976 pModString
= pDepList
->Next();
981 pInfo
= pPrjDepInfoList
->Next();
985 /*****************************************************************************/
986 BOOL
Prj::InsertDirectory ( ByteString aDirName
, USHORT aWhat
,
987 USHORT aWhatOS
, ByteString aLogFileName
,
988 const ByteString
&rClientRestriction
)
989 /*****************************************************************************/
991 CommandData
* pData
= new CommandData();
993 pData
->SetPath( aDirName
);
994 pData
->SetCommandType( aWhat
);
995 pData
->SetOSType( aWhatOS
);
996 pData
->SetLogFile( aLogFileName
);
997 pData
->SetClientRestriction( rClientRestriction
);
999 PrjList
* pPrjList
= GetCommandDataList ();
1000 pPrjList
->Insert( pData
);
1005 /*****************************************************************************/
1007 // removes directory and existing dependencies on it
1009 CommandData
* Prj::RemoveDirectory ( ByteString aLogFileName
)
1010 /*****************************************************************************/
1012 PrjList
* pPrjList
= GetCommandDataList ();
1013 ULONG nCount_l
= pPrjList
->Count();
1015 CommandData
* pDataFound
= NULL
;
1016 SByteStringList
* pDataDeps
;
1018 for ( USHORT i
= 0; i
< nCount_l
; i
++ )
1020 pData
= pPrjList
->GetObject( i
);
1021 if ( pData
->GetLogFile() == aLogFileName
)
1025 pDataDeps
= pData
->GetDependencies();
1028 ByteString
* pString
;
1029 ULONG nDataDepsCount
= pDataDeps
->Count();
1030 for ( ULONG j
= nDataDepsCount
; j
> 0; j
-- )
1032 pString
= pDataDeps
->GetObject( j
- 1 );
1033 if ( pString
->GetToken( 0, '.') == aLogFileName
)
1034 pDataDeps
->Remove( pString
);
1040 Remove( pDataFound
);
1045 /*****************************************************************************/
1046 void Prj::ExtractDependencies()
1047 /*****************************************************************************/
1050 CommandData
* pData
= GetObject(nPos
);
1053 SByteStringList
* pDepList
= pData
->GetDependencies();
1056 ByteString
* pDepStr
= pDepList
->First();
1059 CommandData
* pSearchData
= First();
1062 if ((*pDepStr
== pSearchData
->GetPath()) && (pData
->GetOSType() & pSearchData
->GetOSType()))
1064 *pDepStr
= pSearchData
->GetLogFile();
1068 pSearchData
= Next();
1071 pDepStr
= pDepList
->Next();
1075 pData
= GetObject(nPos
);
1079 /*****************************************************************************/
1080 PrjList
* Prj::GetCommandDataList ()
1081 /*****************************************************************************/
1083 if (pTempCommandDataList
)
1084 return pTempCommandDataList
;
1086 return (PrjList
*)this;
1089 /*****************************************************************************/
1090 void Prj::RemoveTempCommandDataList()
1091 /*****************************************************************************/
1093 if (pTempCommandDataList
)
1095 delete pTempCommandDataList
; // this list remove the elements by itself
1096 pTempCommandDataList
= NULL
;
1100 /*****************************************************************************/
1101 void Prj::GenerateTempCommandDataList()
1102 /*****************************************************************************/
1104 if (pTempCommandDataList
)
1105 RemoveTempCommandDataList();
1106 pTempCommandDataList
= new PrjList();
1107 CommandData
* pCommandData
= First();
1108 while (pCommandData
) {
1109 SvMemoryStream
* pStream
= new SvMemoryStream();
1110 *pCommandData
>> *pStream
;
1111 CommandData
* pNewCommandData
= new CommandData();
1112 pStream
->Seek( STREAM_SEEK_TO_BEGIN
);
1113 *pNewCommandData
<< *pStream
;
1114 pTempCommandDataList
->Insert(pNewCommandData
, LIST_APPEND
);
1116 pCommandData
= Next();
1120 /*****************************************************************************/
1121 void Prj::GenerateEmptyTempCommandDataList()
1122 /*****************************************************************************/
1124 if (pTempCommandDataList
)
1125 RemoveTempCommandDataList();
1126 pTempCommandDataList
= new PrjList();
1129 /*****************************************************************************/
1130 Prj
& Prj::operator>> ( SvStream
& rStream
)
1131 /*****************************************************************************/
1133 rStream
<< bVisited
;
1134 rStream
<< aProjectName
;
1135 rStream
<< aProjectPrefix
;
1136 rStream
<< bHardDependencies
;
1137 rStream
<< bFixedDependencies
;
1139 rStream
<< bIsAvailable
;
1142 if (pPrjDepInfoList
)
1144 rStream
<< sal_True
;
1145 *pPrjDepInfoList
>> rStream
;
1148 rStream
<< sal_False
;
1150 ULONG nCount_l
= Count();
1151 rStream
<< nCount_l
;
1153 CommandData
* pData
= First();
1162 /*****************************************************************************/
1163 Prj
& Prj::operator<< ( SvStream
& rStream
)
1164 /*****************************************************************************/
1166 rStream
>> bVisited
;
1167 rStream
>> aProjectName
;
1168 rStream
>> aProjectPrefix
;
1169 rStream
>> bHardDependencies
;
1170 rStream
>> bFixedDependencies
;
1172 rStream
>> bIsAvailable
;
1176 rStream
>> bDepList
;
1177 DELETEZ (pPrjDepInfoList
);
1180 pPrjDepInfoList
= new SDepInfoList();
1181 *pPrjDepInfoList
<< rStream
;
1185 rStream
>> nCount_l
;
1187 for ( USHORT i
= 0; i
< nCount_l
; i
++ ) {
1188 CommandData
* pData
= new CommandData();
1190 Insert (pData
, LIST_APPEND
);
1201 /*****************************************************************************/
1203 /*****************************************************************************/
1207 // this ctor is only used by StarWriter
1210 /*****************************************************************************/
1211 Star::Star(String aFileName
, USHORT nMode
)
1212 /*****************************************************************************/
1213 : nStarMode( nMode
),
1214 sFileName( aFileName
),
1221 /*****************************************************************************/
1222 Star::Star(SolarFileList
*pSolarFiles
)
1223 /*****************************************************************************/
1224 : nStarMode( STAR_MODE_MULTIPLE_PARSE
),
1228 // this ctor is used by StarBuilder to get the information for the whole workspace
1229 Read( pSolarFiles
);
1232 /*****************************************************************************/
1233 Star::Star(GenericInformationList
*pStandLst
, ByteString
&rVersion
,
1234 BOOL bLocal
, const char *pSourceRoot
)
1235 /*****************************************************************************/
1239 UpdateFileList (pStandLst
, rVersion
, TRUE
, bLocal
, pSourceRoot
);
1242 /*****************************************************************************/
1243 void Star::UpdateFileList( GenericInformationList
*pStandLst
, ByteString
&rVersion
,
1244 BOOL bRead
, BOOL bLocal
, const char *pSourceRoot
)
1245 /*****************************************************************************/
1247 sSourceRoot
=String::CreateFromAscii(""); // clear old SourceRoot
1248 ByteString
sPath( rVersion
);
1250 sSourceRoot
= String::CreateFromAscii( pSourceRoot
);
1253 sPath
+= "/settings/UNXSOLARLIST";
1255 sPath
+= "/settings/SOLARLIST";
1257 GenericInformation
*pInfo
= pStandLst
->GetInfo( sPath
, TRUE
);
1259 if( pInfo
&& pInfo
->GetValue().Len()) {
1260 ByteString
sFile( pInfo
->GetValue());
1262 IniManager aIniManager
;
1263 aIniManager
.ToLocal( sFile
);
1265 String
sFileName_l( sFile
, RTL_TEXTENCODING_ASCII_US
);
1266 nStarMode
= STAR_MODE_SINGLE_PARSE
;
1268 Read( sFileName_l
);
1271 SolarFileList
*pFileList
= new SolarFileList();
1276 GenericInformation
*pInfo_l
= pStandLst
->GetInfo( sPath
, TRUE
);
1277 if ( pInfo_l
&& pInfo_l
->GetSubList()) {
1278 GenericInformationList
*pDrives
= pInfo_l
->GetSubList();
1279 for ( ULONG i
= 0; i
< pDrives
->Count(); i
++ ) {
1280 GenericInformation
*pDrive
= pDrives
->GetObject( i
);
1284 if ( sSourceRoot
.Len()) {
1285 aEntry
= DirEntry( sSourceRoot
);
1290 sPath
= "UnixVolume";
1291 GenericInformation
*pUnixVolume
= pDrive
->GetSubInfo( sPath
);
1292 if ( pUnixVolume
) {
1293 String
sRoot( pUnixVolume
->GetValue(), RTL_TEXTENCODING_ASCII_US
);
1294 aEntry
= DirEntry( sRoot
);
1299 String
sRoot( *pDrive
, RTL_TEXTENCODING_ASCII_US
);
1300 sRoot
+= String::CreateFromAscii( "\\" );
1301 aEntry
= DirEntry( sRoot
);
1306 GenericInformation
*pProjectsKey
= pDrive
->GetSubInfo( sPath
, TRUE
);
1307 if ( pProjectsKey
) {
1308 if ( !sSourceRoot
.Len()) {
1310 sPath
+= "/settings/PATH";
1311 GenericInformation
*pPath
= pStandLst
->GetInfo( sPath
, TRUE
);
1313 ByteString
sAddPath( pPath
->GetValue());
1315 sAddPath
.SearchAndReplaceAll( "\\", "/" );
1317 sAddPath
.SearchAndReplaceAll( "/", "\\" );
1319 String
ssAddPath( sAddPath
, RTL_TEXTENCODING_ASCII_US
);
1320 aEntry
+= DirEntry( ssAddPath
);
1324 sPath
+= "/settings/SHORTPATH";
1325 GenericInformation
*pShortPath
= pStandLst
->GetInfo( sPath
, TRUE
);
1326 BOOL bShortPath
= FALSE
;
1327 if (pShortPath
&& (pShortPath
->GetValue() == "_TRUE"))
1329 sSourceRoot
= aEntry
.GetFull();
1330 GenericInformationList
*pProjects
= pProjectsKey
->GetSubList();
1332 GenericInformation
* pProject
= pProjects
->First();
1334 String sLocalSourceRoot
= sSourceRoot
;
1335 ByteString
sProject( *pProject
);
1336 String
ssProject( sProject
, RTL_TEXTENCODING_ASCII_US
);
1338 ByteString
aDirStr ("Directory");
1339 GenericInformation
* pDir
= pProject
->GetSubInfo (aDirStr
);
1341 ByteString aDir
= pDir
->GetValue();
1342 DirEntry aRootEntry
;
1344 aRootEntry
= aEntry
+ DirEntry(aDir
);
1346 aRootEntry
= aEntry
.GetPath() + DirEntry(aDir
);
1347 sLocalSourceRoot
= aRootEntry
.GetFull();
1350 String aBuildListPath
= CreateFileName(ssProject
, sLocalSourceRoot
);
1352 pFileList
->Insert( new String( aBuildListPath
), LIST_APPEND
);
1353 ByteString
sFile( aBuildListPath
, RTL_TEXTENCODING_ASCII_US
);
1354 pProject
= pProjects
->Next();
1363 if (!CheckFileLoadList(pFileList
))
1365 ClearAvailableDeps();
1367 ClearLoadedFilesList();
1369 bRead
= TRUE
; // read new list because old list is deleted
1375 GenerateFileLoadList( pFileList
);
1379 /*****************************************************************************/
1380 void Star::FullReload( GenericInformationList
*pStandLst
, ByteString
&rVersion
,
1381 BOOL bRead
, BOOL bLocal
, const char *pSourceRoot
)
1382 /*****************************************************************************/
1384 ClearAvailableDeps();
1386 ClearLoadedFilesList();
1388 UpdateFileList( pStandLst
, rVersion
, bRead
, bLocal
, pSourceRoot
);
1391 /*****************************************************************************/
1392 BOOL
Star::CheckFileLoadList(SolarFileList
*pSolarFiles
)
1393 /*****************************************************************************/
1396 if (aLoadedFilesList
.Count() == 0)
1398 StarFile
* pLoadFile
= aLoadedFilesList
.First();
1401 BOOL bIsAvailable
= FALSE
;
1402 String
* pFile
= pSolarFiles
->First();
1405 if (*pFile
== pLoadFile
->GetName())
1407 bIsAvailable
= TRUE
;
1410 pFile
= pSolarFiles
->Next();
1417 pLoadFile
= aLoadedFilesList
.Next();
1422 /*****************************************************************************/
1424 /*****************************************************************************/
1426 ClearAvailableDeps();
1428 ClearLoadedFilesList();
1432 /*****************************************************************************/
1433 void Star::GenerateFileLoadList( SolarFileList
*pSolarFiles
)
1434 /*****************************************************************************/
1436 SolarFileList
* pNewSolarFiles
= NULL
;
1437 while( pSolarFiles
->Count()) {
1438 StarFile
*pFile
= new StarFile( *pSolarFiles
->GetObject(( ULONG
) 0 ));
1440 ULONG nPos
= SearchFileEntry(&aLoadedFilesList
, pFile
);
1441 if ( nPos
== LIST_ENTRY_NOTFOUND
)
1443 if (!pNewSolarFiles
)
1444 pNewSolarFiles
= new SolarFileList();
1446 pNewSolarFiles
->Insert(new String(pFile
->GetName()), LIST_APPEND
);
1449 delete pSolarFiles
->Remove(( ULONG
) 0 );
1454 Read (pNewSolarFiles
);
1457 /*****************************************************************************/
1458 SolarFileList
* Star::NeedsFilesForUpdate()
1459 /*****************************************************************************/
1462 SolarFileList
* pPrjList
= NULL
;
1463 for ( ULONG i
= 0; i
< aLoadedFilesList
.Count(); i
++ )
1464 if ( aLoadedFilesList
.GetObject( i
)->NeedsUpdate()) {
1466 pPrjList
= new SolarFileList();
1468 pPrjList
->Insert(new String (aLoadedFilesList
.GetObject( i
)->GetName()), LIST_APPEND
);
1475 /*****************************************************************************/
1476 BOOL
Star::NeedsUpdate()
1477 /*****************************************************************************/
1480 for ( ULONG i
= 0; i
< aLoadedFilesList
.Count(); i
++ )
1481 if ( aLoadedFilesList
.GetObject( i
)->NeedsUpdate()) {
1490 /*****************************************************************************/
1491 void Star::Read( String
&rFileName
)
1492 /*****************************************************************************/
1494 ClearAvailableDeps ();
1496 aFileList
.Insert( new String( rFileName
));
1498 DirEntry
aEntry( rFileName
);
1500 aEntry
= aEntry
.GetPath().GetPath().GetPath();
1501 sSourceRoot
= aEntry
.GetFull();
1503 while( aFileList
.Count()) {
1504 String ssFileName
= *aFileList
.GetObject(( ULONG
) 0 );
1505 StarFile
* pFile
= ReadBuildlist (ssFileName
);
1507 ReplaceFileEntry (&aLoadedFilesList
, pFile
);
1508 //aLoadedFilesList.Insert( pFile, LIST_APPEND );
1510 aFileList
.Remove(( ULONG
) 0 );
1512 // resolve all dependencies recursive
1516 /*****************************************************************************/
1517 ULONG
Star::SearchFileEntry( StarFileList
*pStarFiles
, StarFile
* pFile
)
1518 /*****************************************************************************/
1520 StarFile
*pSearchFile
;
1523 nCount_l
= pStarFiles
->Count();
1525 for ( ULONG i
=0; i
<nCount_l
; i
++)
1527 pSearchFile
= pStarFiles
->GetObject(i
);
1528 if ( pSearchFile
->GetName() == pFile
->GetName() )
1533 return LIST_ENTRY_NOTFOUND
;
1536 /*****************************************************************************/
1537 void Star::ReplaceFileEntry( StarFileList
*pStarFiles
, StarFile
* pFile
)
1538 /*****************************************************************************/
1540 ULONG nPos
= SearchFileEntry(pStarFiles
, pFile
);
1541 if ( nPos
!= LIST_ENTRY_NOTFOUND
)
1543 StarFile
* pTmpStarFile
= pStarFiles
->GetObject(nPos
);
1544 delete pTmpStarFile
;
1545 pStarFiles
->Replace(pFile
, nPos
);
1548 pStarFiles
->Insert( pFile
, LIST_APPEND
);
1551 /*****************************************************************************/
1552 void Star::Read( SolarFileList
*pSolarFiles
)
1553 /*****************************************************************************/
1555 ClearAvailableDeps ();
1556 while( pSolarFiles
->Count()) {
1559 String ssFileName
= *pSolarFiles
->GetObject(( ULONG
) 0 );
1560 StarFile
*pFile
= ReadBuildlist ( ssFileName
);
1562 if ( pFile
->Exists()) {
1563 DirEntry
aEntry( pFile
->GetName() );
1564 DirEntry aEntryPrj
= aEntry
.GetPath().GetPath();
1565 if (aEntryPrj
.GetExtension() != String::CreateFromAscii( "" ))
1567 aEntryPrj
.CutExtension();
1568 ByteString aPrjName
= ByteString( aEntryPrj
.GetName(), gsl_getSystemTextEncoding());
1569 Prj
* pPrj
= GetPrj(aPrjName
);
1571 pPrj
->IsAvailable (FALSE
);
1577 ReplaceFileEntry (&aLoadedFilesList
, pFile
);
1578 //aLoadedFilesList.Insert( pFile, LIST_APPEND );
1580 delete pSolarFiles
->Remove(( ULONG
) 0 );
1587 /*****************************************************************************/
1588 String
Star::CreateFileName( String
& rProject
, String
& rSourceRoot
)
1589 /*****************************************************************************/
1591 // this method is used to find solarlist parts of nabours (other projects)
1592 String
sPrjDir( String::CreateFromAscii( "prj" ));
1593 String
sBuildList( String::CreateFromAscii( "build.lst" ));
1594 // String sXmlBuildList( String::CreateFromAscii( "build.xlist" ));
1596 DirEntry
aEntry( rSourceRoot
);
1597 aEntry
+= DirEntry( rProject
);
1599 // if this project not exists, maybe it's a not added project of a CWS
1601 if ( !aEntry
.Exists() ) {
1602 aEntry
.SetExtension(String::CreateFromAscii( "lnk" ));
1603 if ( !aEntry
.Exists() )
1604 aEntry
.CutExtension();
1606 aEntry
.SetExtension(String::CreateFromAscii( "link" ));
1607 if ( !aEntry
.Exists() )
1608 aEntry
.CutExtension();
1611 aEntry
+= DirEntry( sPrjDir
);
1613 // DirEntry aPossibleEntry(aEntry);
1614 // aPossibleEntry += DirEntry( sXmlBuildList );
1616 aEntry
+= DirEntry( sBuildList
);
1618 DirEntry
& aActualEntry
= aEntry
;
1620 if (aPossibleEntry.Exists()) {
1621 aActualEntry = aPossibleEntry;
1623 if ( !aActualEntry
.Exists() && aDBNotFoundHdl
.IsSet())
1624 aDBNotFoundHdl
.Call( &rProject
);
1625 return aActualEntry
.GetFull();
1628 /*****************************************************************************/
1629 void Star::InsertSolarList( String sProject
)
1630 /*****************************************************************************/
1632 // inserts a new solarlist part of another project
1633 String
sFileName_l( CreateFileName( sProject
, sSourceRoot
));
1635 for ( ULONG i
= 0; i
< aFileList
.Count(); i
++ ) {
1636 if (( *aFileList
.GetObject( i
)) == sFileName_l
)
1640 ByteString
ssProject( sProject
, RTL_TEXTENCODING_ASCII_US
);
1641 if ( HasProject( ssProject
))
1644 aFileList
.Insert( new String( sFileName_l
), LIST_APPEND
);
1647 /*****************************************************************************/
1648 void Star::ExpandPrj_Impl( Prj
*pPrj
, Prj
*pDepPrj
)
1649 /*****************************************************************************/
1651 if ( pDepPrj
->bVisited
)
1654 pDepPrj
->bVisited
= TRUE
;
1656 SByteStringList
* pPrjLst
= pPrj
->GetDependencies();
1657 SByteStringList
* pDepLst
= NULL
;
1658 ByteString
* pDepend
;
1659 ByteString
* pPutStr
;
1660 Prj
*pNextPrj
= NULL
;
1664 pDepLst
= pDepPrj
->GetDependencies();
1666 for ( i
= 0; i
< pDepLst
->Count(); i
++ ) {
1667 pDepend
= pDepLst
->GetObject( i
);
1668 pPutStr
= new ByteString( *pDepend
);
1669 nRetPos
= pPrjLst
->PutString( pPutStr
);
1670 if( nRetPos
== NOT_THERE
)
1672 pNextPrj
= GetPrj( *pDepend
);
1674 ExpandPrj_Impl( pPrj
, pNextPrj
);
1681 /*****************************************************************************/
1682 void Star::Expand_Impl()
1683 /*****************************************************************************/
1685 for ( ULONG i
= 0; i
< Count(); i
++ ) {
1686 for ( ULONG j
= 0; j
< Count(); j
++ )
1687 GetObject( j
)->bVisited
= FALSE
;
1689 Prj
* pPrj
= GetObject( i
);
1690 pPrj
->SetMode(pDepMode
); // DepList für Mode initialisieren
1691 ExpandPrj_Impl( pPrj
, pPrj
);
1695 /*****************************************************************************/
1696 StarFile
* Star::ReadBuildlist (const String
& rFilename
, BOOL bReadComments
, BOOL bExtendAlias
)
1697 /*****************************************************************************/
1699 ByteString
sFileName_l(rFilename
, RTL_TEXTENCODING_ASCII_US
);
1700 StarFile
*pFile
= new StarFile( rFilename
);
1701 if ( pFile
->Exists()) {
1702 SimpleConfig
aSolarConfig( rFilename
);
1703 DirEntry
aEntry(rFilename
);
1704 ByteString
sProjectName (aEntry
.GetPath().GetPath().GetName(), RTL_TEXTENCODING_ASCII_US
);
1705 Prj
* pPrj
= GetPrj (sProjectName
); // 0, if Prj not found
1708 Remove(pPrj
); // Project exist, remove old Project and read again
1709 DELETEZ (pPrj
); // delete and set pPrj to 0
1712 while (( aString
= aSolarConfig
.GetCleanedNextLine( bReadComments
)) != ByteString::EmptyString() )
1713 InsertTokenLine ( aString
, &pPrj
, sProjectName
, bExtendAlias
);
1718 /*****************************************************************************/
1719 void Star::InsertTokenLine ( const ByteString
& rTokenLine
, Prj
** ppPrj
, const ByteString
& rProjectName
, const sal_Bool bExtendAlias
)
1720 /*****************************************************************************/
1723 ByteString aWhat
, aWhatOS
,
1724 sClientRestriction
, aLogFileName
, aProjectName
, aPrefix
, aCommandPara
;
1725 ByteString aDirName
;
1726 BOOL bPrjDep
= FALSE
;
1727 BOOL bHardDep
= FALSE
;
1728 BOOL bFixedDep
= FALSE
;
1729 BOOL bNewProject
= FALSE
;
1730 int nCommandType
=0, nOSType
=0;
1732 CommandData
* pCmdData
;
1733 SByteStringList
*pDepList
= NULL
;
1734 ByteString aCommentString
;
1736 ByteString sStringBuffer
= rTokenLine
;
1738 while (sStringBuffer
!= ByteString::EmptyString())
1740 ByteString sToken
= sStringBuffer
.GetToken(0,'\t');
1741 sStringBuffer
.Erase(0, sToken
.Len()+1);
1746 if ( sToken
.Search( "#" ) == 0 )
1749 aCommentString
= sToken
;
1750 sStringBuffer
= ByteString::EmptyString();
1752 aDirName
= "null_entry" ; //comments at begin of file
1762 aProjectName
= aDirName
.GetToken ( 0, 0x5c);
1763 if (aProjectName
!= rProjectName
)
1764 sStringBuffer
= ByteString::EmptyString(); // something is wrong, ignore line
1767 if ( sToken
.CompareTo(":") == COMPARE_EQUAL
)
1774 else if ( sToken
.CompareTo("::") == COMPARE_EQUAL
)
1781 else if ( sToken
.CompareTo(":::") == COMPARE_EQUAL
)
1795 nCommandType
= GetJobType(aWhat
);
1800 sStringBuffer
= ByteString::EmptyString(); // definition more than once or not first line, ignore line
1809 aCommandPara
= ByteString();
1812 aCommandPara
= aWhat
;
1819 if ( aWhatOS
.GetTokenCount( ',' ) > 1 ) {
1820 sClientRestriction
= aWhatOS
.Copy( aWhatOS
.GetToken( 0, ',' ).Len() + 1 );
1821 aWhatOS
= aWhatOS
.GetToken( 0, ',' );
1823 nOSType
= GetOSType (aWhatOS
);
1830 aLogFileName
= (ByteString(aProjectName
).Append("_")).Append(sToken
);
1832 aLogFileName
= sToken
;
1839 ByteString aItem
= sToken
;
1840 if ( aItem
== "NULL" )
1847 // ggfs. Dependency liste anlegen und ergaenzen
1849 pDepList
= new SByteStringList
;
1852 pStr
= new ByteString ((ByteString (aProjectName
).Append("_")).Append(aItem
));
1854 pStr
= new ByteString (aItem
);
1855 pDepList
->PutString( pStr
);
1860 ByteString aItem
= sToken
;
1861 if ( aItem
== "NULL" )
1870 BOOL bHasModes
= FALSE
;
1871 if (aItem
.Search(":") != STRING_NOTFOUND
)
1873 sMode
= aItem
.GetToken ( 0, ':');
1874 aItem
= aItem
.GetToken ( 1, ':');
1879 // neues Project anlegen
1880 pPrj
= new Prj ( aProjectName
);
1881 pPrj
->SetPreFix( aPrefix
);
1885 pPrj
->AddDependencies( aItem
, sMode
);
1887 pPrj
->AddDependencies( aItem
);
1888 pPrj
->HasHardDependencies( bHardDep
);
1889 pPrj
->HasFixedDependencies( bFixedDep
);
1898 /* Wenn dieses Project noch nicht vertreten ist, in die Liste
1899 der Solar-Projekte einfuegen */
1904 // neues Project anlegen
1905 pPrj
= new Prj ( aProjectName
);
1906 pPrj
->SetPreFix( aPrefix
);
1911 Insert(pPrj
,LIST_APPEND
);
1913 pCmdData
= new CommandData
;
1914 pCmdData
->SetPath( aDirName
);
1915 pCmdData
->SetCommandType( nCommandType
);
1916 pCmdData
->SetCommandPara( aCommandPara
);
1917 pCmdData
->SetOSType( nOSType
);
1918 pCmdData
->SetLogFile( aLogFileName
);
1919 pCmdData
->SetComment( aCommentString
);
1920 pCmdData
->SetClientRestriction( sClientRestriction
);
1922 pCmdData
->SetDependencies( pDepList
);
1925 pPrj
->Insert ( pCmdData
, LIST_APPEND
);
1927 // und wer raeumt die depLst wieder ab ?
1928 // CommandData macht das
1934 // new project to set the error flag
1935 pPrj
= new Prj ( rProjectName
);
1936 pPrj
->SetPreFix( aPrefix
);
1943 Insert(pPrj
,LIST_APPEND
); // add project even if there is a buildlist error
1951 /*****************************************************************************/
1952 BOOL
Star::HasProject ( ByteString aProjectName
)
1953 /*****************************************************************************/
1960 for ( int i
=0; i
<nCount_l
; i
++)
1962 pPrj
= GetObject(i
);
1963 if ( pPrj
->GetProjectName().ToLowerAscii() == aProjectName
.ToLowerAscii() )
1969 /*****************************************************************************/
1970 Prj
* Star::GetPrj ( ByteString aProjectName
)
1971 /*****************************************************************************/
1974 int nCount_l
= Count();
1975 for ( int i
=0;i
<nCount_l
;i
++)
1977 pPrj
= GetObject(i
);
1978 if ( pPrj
->GetProjectName().ToLowerAscii() == aProjectName
.ToLowerAscii() )
1981 // return (Prj*)NULL;
1985 /*****************************************************************************/
1986 BOOL
Star::RemovePrj ( Prj
* pPrj
)
1987 /*****************************************************************************/
1989 ULONG nPos
= GetPos(pPrj
);
1990 if (nPos
!= LIST_ENTRY_NOTFOUND
) {
1998 /*****************************************************************************/
1999 void Star::RemoveAllPrj ()
2000 /*****************************************************************************/
2002 Prj
* pPrj
= First();
2011 /*****************************************************************************/
2012 ByteString
Star::GetPrjName( DirEntry
&aPath
)
2013 /*****************************************************************************/
2015 ByteString aRetPrj
, aDirName
;
2016 ByteString aFullPathName
= ByteString( aPath
.GetFull(), gsl_getSystemTextEncoding());
2018 USHORT nToken
= aFullPathName
.GetTokenCount(PATH_DELIMETER
);
2019 for ( int i
=0; i
< nToken
; i
++ )
2021 aDirName
= aFullPathName
.GetToken( i
, PATH_DELIMETER
);
2022 if ( HasProject( aDirName
))
2032 /*****************************************************************************/
2033 void Star::ClearAvailableDeps ()
2034 /*****************************************************************************/
2038 ByteString
*pString
= pAllDepMode
->First();
2042 pString
= pAllDepMode
->Next();
2049 /*****************************************************************************/
2050 void Star::ClearLoadedFilesList ()
2051 /*****************************************************************************/
2053 StarFile
*pStarFile
= aLoadedFilesList
.First();
2057 pStarFile
= aLoadedFilesList
.Next();
2059 aLoadedFilesList
.Clear();
2062 /*****************************************************************************/
2063 void Star::ClearCurrentDeps ()
2064 /*****************************************************************************/
2068 ByteString
*pString
= pDepMode
->First();
2072 pString
= pDepMode
->Next();
2079 /*****************************************************************************/
2080 SByteStringList
* Star::GetAvailableDeps ()
2081 /*****************************************************************************/
2091 SByteStringList
* pModeList
= NULL
;
2092 if (pPrj
->GetModeAndDependencies() && (pModeList
= pPrj
->GetModeAndDependencies()->GetAllDepModes()))
2094 pStr
= pModeList
->First();
2098 pAllDepMode
= new SByteStringList();
2100 if (pAllDepMode
->IsString(pStr
) == NOT_THERE
)
2101 pAllDepMode
->PutString(new ByteString(*pStr
));
2103 pStr
= pModeList
->Next();
2111 /*****************************************************************************/
2112 void Star::SetCurrentDeps (SByteStringList
* pDepList
)
2113 /*****************************************************************************/
2119 pDepMode
= new SByteStringList();
2120 ByteString
*pString
= pDepList
->First();
2123 ByteString
* pStr
= new ByteString (*pString
);
2124 if (pDepMode
->PutString(pStr
) == NOT_THERE
)
2125 delete pStr
; // String is not in List
2126 pString
= pDepList
->Next();
2132 ///*****************************************************************************/
2133 //void Star::ReadXmlBuildList(const ByteString& sBuildLstPath) {
2134 ///*****************************************************************************/
2135 // if (mpXmlBuildList) {
2136 // Prj* pPrj = NULL;
2139 // mpXmlBuildList->loadXMLFile(sBuildLstPath);
2141 // catch (XmlBuildListException) {
2142 // DirEntry aDirEntry (sBuildLstPath);
2143 // String ssPrjName = aDirEntry.GetPath().GetPath().GetBase();
2144 // ByteString sPrjName = ByteString(ssPrjName, RTL_TEXTENCODING_ASCII_US);
2145 // pPrj = GetPrj( sPrjName );
2148 // //remove old Project
2149 // RemovePrj (pPrj);
2155 // ByteString sProjectName = mpXmlBuildList->getModuleName();
2156 // pPrj = GetPrj( sProjectName );
2159 // //remove old Project
2160 // RemovePrj (pPrj);
2163 // // insert new Project
2164 // pPrj = new Prj ( sProjectName );
2165 // pPrj->SetPreFix( sProjectName ); // use ProjectName as Prefix
2166 // Insert(pPrj,LIST_APPEND);
2168 // // get global dependencies
2169 // FullByteStringListWrapper aProducts = mpXmlBuildList->getProducts();
2170 // ByteString aDepType = ByteString(DEP_MD_ALWAYS_STR);
2171 // if (mpXmlBuildList->hasModuleDepType(aProducts, aDepType))
2172 // pPrj->HasHardDependencies( TRUE );
2174 // aDepType = ByteString(DEP_MD_FORCE_STR);
2175 // if (mpXmlBuildList->hasModuleDepType(aProducts, aDepType))
2177 // pPrj->HasHardDependencies( TRUE );
2178 // pPrj->HasFixedDependencies( TRUE );
2181 // // modul dependencies
2182 // ByteString sModulDepType = ByteString();
2183 // FullByteStringListWrapper aModulDeps = mpXmlBuildList->getModuleDependencies(aProducts, sModulDepType);
2184 // ByteString * pModulDep = aModulDeps.First();
2185 // while (pModulDep)
2187 // FullByteStringListWrapper aModulProducts = mpXmlBuildList->getModuleProducts(*pModulDep);
2188 // ByteString *pModulePoduct = aModulProducts.First();
2189 // while (pModulePoduct)
2191 // if (*pModulePoduct == XML_ALL)
2192 // pPrj->AddDependencies( *pModulDep );
2194 // pPrj->AddDependencies( *pModulDep, *pModulePoduct);
2196 // pModulePoduct = aModulProducts.Next();
2198 // pModulDep = aModulDeps.Next();
2202 // ByteString sJobType = ByteString();
2203 // ByteString sJobPlatforms = ByteString();
2204 // FullByteStringListWrapper aJobDirs = mpXmlBuildList->getJobDirectories(sJobType, sJobPlatforms); // all dirs
2205 // ByteString* pJobDir = aJobDirs.First();
2208 // FullByteStringListWrapper aJobPlatforms = mpXmlBuildList->getJobPlatforms (*pJobDir);
2209 // ByteString* pJobPlatform = aJobPlatforms.First();
2210 // while (pJobPlatform)
2212 // ByteString sJobRestriction = ByteString();
2213 // FullByteStringListWrapper aJobReq = mpXmlBuildList->getJobBuildReqs (*pJobDir, *pJobPlatform);
2214 // // nur ein Req pro Platform wird zur Zeit unterstützt
2215 // // mehr geht wegen der Struktur zur Zeit nicht!
2216 // // lese sie trotzdem kommasepariert ein, wenn nötig
2217 // if (aJobReq.Count() > 0)
2219 // ByteString* pRestriction = aJobReq.First();
2220 // sJobRestriction = ByteString (*pRestriction);
2221 // pRestriction = aJobReq.Next();
2222 // while (pRestriction)
2224 // sJobRestriction += ByteString (",");
2225 // sJobRestriction += ByteString (*pRestriction);
2226 // pRestriction = aJobReq.Next();
2230 // FullByteStringListWrapper aJobTypes = mpXmlBuildList->getJobTypes (*pJobDir);
2231 // ByteString * pJobType = aJobTypes.First();
2234 // FullByteStringListWrapper aDirDependencies = mpXmlBuildList->getDirDependencies(*pJobDir, *pJobType, *pJobPlatform);
2235 // SByteStringList *pDepList = NULL;
2236 // if (aDirDependencies.Count() > 0)
2238 // pDepList = new SByteStringList;
2239 // ByteString* pDirDep = aDirDependencies.First();
2242 // ByteString sFullDir = sProjectName;
2243 // sFullDir += *pDirDep;
2244 // sFullDir.SearchAndReplaceAll('/', '\\');
2245 // *pDirDep = sFullDir;
2246 // pDepList->PutString(pDirDep); // String wird übergeben
2247 // aDirDependencies.Remove(); // Zeiger aus alter Liste löschen
2248 // pDirDep = aDirDependencies.First();
2251 // // insert CommandData
2252 // CommandData * pCmdData = new CommandData;
2253 // ByteString sRequiredPath = sProjectName;
2254 // sRequiredPath += *pJobDir;
2255 // sRequiredPath.SearchAndReplaceAll('/', '\\');
2256 // pCmdData->SetPath(sRequiredPath);
2257 // pCmdData->SetCommandType( GetJobType(*pJobType) );
2258 // pCmdData->SetCommandPara( ByteString() );
2259 // pCmdData->SetOSType( GetOSType(*pJobPlatform) );
2260 // ByteString sLogFileName = sProjectName;
2261 // sLogFileName += ByteString::CreateFromInt64( pPrj->Count() );
2262 // pCmdData->SetLogFile( sLogFileName );
2263 // pCmdData->SetClientRestriction( sJobRestriction );
2265 // pCmdData->SetDependencies( pDepList );
2267 // pPrj->Insert ( pCmdData, LIST_APPEND );
2269 // pJobType = aJobTypes.Next();
2272 // pJobPlatform = aJobPlatforms.Next();
2275 // pJobDir = aJobDirs.Next();
2277 // pPrj->ExtractDependencies();
2279 // catch (XmlBuildListException) {
2282 // RemovePrj (pPrj);
2290 /*****************************************************************************/
2291 int Star::GetOSType ( ByteString
& aWhatOS
) {
2292 /*****************************************************************************/
2293 int nOSType
= OS_NONE
;
2294 if ( aWhatOS
== "all" )
2295 nOSType
= ( OS_WIN16
| OS_WIN32
| OS_OS2
| OS_UNX
| OS_MAC
);
2296 else if ( aWhatOS
== "w" || aWhatOS
== "wnt" )
2297 nOSType
= ( OS_WIN16
| OS_WIN32
);
2298 else if ( aWhatOS
== "p" )
2300 else if ( aWhatOS
== "u" || aWhatOS
== "unx" )
2302 else if ( aWhatOS
== "d" )
2304 else if ( aWhatOS
== "n" )
2306 else if ( aWhatOS
== "m" || aWhatOS
== "mac" )
2312 /*****************************************************************************/
2313 int Star::GetJobType ( ByteString
& JobType
) {
2314 /*****************************************************************************/
2315 int nCommandType
= 0;
2316 if ( JobType
== "nmake" || JobType
== "make")
2317 nCommandType
= COMMAND_NMAKE
;
2318 else if ( JobType
== "get" )
2319 nCommandType
= COMMAND_GET
;
2321 ULONG nOffset
= JobType
.Copy( 3 ).ToInt32();
2322 nCommandType
= COMMAND_USER_START
+ nOffset
- 1;
2324 return nCommandType
;
2327 /*****************************************************************************/
2328 void Star::PutPrjIntoStream (SByteStringList
* pPrjNameList
, SvStream
* pStream
)
2329 /*****************************************************************************/
2332 *pStream
<< sal_False
; // not full Star / only some Projects
2334 ULONG nCount_l
= pPrjNameList
->Count();
2335 *pStream
<< nCount_l
;
2336 ByteString
* pStr
= pPrjNameList
->First();
2338 Prj
* pPrj
= GetPrj (*pStr
);
2340 pStr
= pPrjNameList
->Next();
2345 /*****************************************************************************/
2346 Star
& Star::operator>> ( SvStream
& rStream
)
2347 /*****************************************************************************/
2350 rStream
<< sal_True
; // full Star
2351 rStream
<< nStarMode
;
2354 rStream
<< sal_True
;
2355 *pDepMode
>> rStream
;
2358 rStream
<< sal_False
;
2360 ULONG nCount_l
= Count();
2361 rStream
<< nCount_l
;
2362 Prj
* pPrj
= First();
2372 /*****************************************************************************/
2373 Star
& Star::operator<< ( SvStream
& rStream
)
2374 /*****************************************************************************/
2378 rStream
>> bFullList
;
2381 rStream
>> nStarMode
;
2383 rStream
>> bDepMode
;
2385 pDepMode
->CleanUp();
2389 pDepMode
= new SByteStringList();
2390 *pDepMode
<< rStream
;
2397 rStream
>> nCount_l
;
2398 for ( USHORT i
= 0; i
< nCount_l
; i
++ ) {
2399 Prj
* pPrj
= new Prj();
2401 pPrj
->SetMode(pDepMode
);
2402 if (HasProject (pPrj
->GetProjectName())) {
2403 Prj
* pTmpPrj
= GetPrj( pPrj
->GetProjectName() );
2404 Replace (pPrj
, pTmpPrj
);
2408 Insert (pPrj
, LIST_APPEND
);
2421 /*****************************************************************************/
2422 StarWriter::StarWriter( String aFileName
, BOOL bReadComments
, USHORT nMode
)
2423 /*****************************************************************************/
2426 sFileName
= aFileName
;
2427 Read ( aFileName
, bReadComments
, nMode
);
2430 /*****************************************************************************/
2431 StarWriter::StarWriter( SolarFileList
*pSolarFiles
, BOOL bReadComments
)
2432 /*****************************************************************************/
2435 Read( pSolarFiles
, bReadComments
);
2438 /*****************************************************************************/
2439 StarWriter::StarWriter( GenericInformationList
*pStandLst
, ByteString
&rVersion
,
2440 ByteString
&rMinor
, BOOL bReadComments
, BOOL bLocal
, const char *pSourceRoot
)
2441 /*****************************************************************************/
2444 ByteString
sPath( rVersion
);
2446 sSourceRoot
= String::CreateFromAscii( pSourceRoot
);
2449 sPath
+= "/settings/UNXSOLARLIST";
2451 sPath
+= "/settings/SOLARLIST";
2453 GenericInformation
*pInfo_l
= pStandLst
->GetInfo( sPath
, TRUE
);
2455 if( pInfo_l
&& pInfo_l
->GetValue().Len()) {
2456 ByteString
sFile( pInfo_l
->GetValue());
2458 IniManager aIniManager
;
2459 aIniManager
.ToLocal( sFile
);
2461 String
sFileName_l( sFile
, RTL_TEXTENCODING_ASCII_US
);
2462 nStarMode
= STAR_MODE_SINGLE_PARSE
;
2463 Read( sFileName_l
, bReadComments
);
2466 SolarFileList
*pFileList
= new SolarFileList();
2471 GenericInformation
*pInfo_k
= pStandLst
->GetInfo( sPath
, TRUE
);
2472 if ( pInfo_k
&& pInfo_k
->GetSubList()) {
2473 GenericInformationList
*pDrives
= pInfo_k
->GetSubList();
2474 for ( ULONG i
= 0; i
< pDrives
->Count(); i
++ ) {
2475 GenericInformation
*pDrive
= pDrives
->GetObject( i
);
2479 if ( sSourceRoot
.Len()) {
2480 aEntry
= DirEntry( sSourceRoot
);
2485 sPath
= "UnixVolume";
2486 GenericInformation
*pUnixVolume
= pDrive
->GetSubInfo( sPath
);
2487 if ( pUnixVolume
) {
2488 String
sRoot( pUnixVolume
->GetValue(), RTL_TEXTENCODING_ASCII_US
);
2489 aEntry
= DirEntry( sRoot
);
2494 String
sRoot( *pDrive
, RTL_TEXTENCODING_ASCII_US
);
2495 sRoot
+= String::CreateFromAscii( "\\" );
2496 aEntry
= DirEntry( sRoot
);
2501 GenericInformation
*pProjectsKey
= pDrive
->GetSubInfo( sPath
, TRUE
);
2502 if ( pProjectsKey
) {
2503 if ( !sSourceRoot
.Len()) {
2505 sPath
+= "/settings/PATH";
2506 GenericInformation
*pPath
= pStandLst
->GetInfo( sPath
, TRUE
);
2508 ByteString
sAddPath( pPath
->GetValue());
2510 sAddPath
.SearchAndReplaceAll( "\\", "/" );
2512 sAddPath
.SearchAndReplaceAll( "/", "\\" );
2514 //If Minor has been set add it to path
2515 if (rMinor
.Len()>0) {
2519 String
ssAddPath( sAddPath
, RTL_TEXTENCODING_ASCII_US
);
2521 aEntry
+= DirEntry( ssAddPath
);
2525 sPath
+= "/settings/SHORTPATH";
2526 GenericInformation
*pShortPath
= pStandLst
->GetInfo( sPath
, TRUE
);
2527 BOOL bShortPath
= FALSE
;
2528 if (pShortPath
&& (pShortPath
->GetValue() == "_TRUE"))
2530 sSourceRoot
= aEntry
.GetFull();
2531 GenericInformationList
*pProjects
= pProjectsKey
->GetSubList();
2533 String
sPrjDir( String::CreateFromAscii( "prj" ));
2534 String
sSolarFile( String::CreateFromAscii( "build.lst" ));
2536 GenericInformation
* pProject
= pProjects
->First();
2538 ByteString
sProject( *pProject
);
2539 String
ssProject( sProject
, RTL_TEXTENCODING_ASCII_US
);
2541 DirEntry
aPrjEntry( aEntry
);
2543 ByteString
aDirStr ("Directory");
2544 GenericInformation
* pDir
= pProject
->GetSubInfo (aDirStr
);
2546 ByteString aDir
= pDir
->GetValue();
2550 aPrjEntry
= aEntry
.GetPath();
2551 aPrjEntry
+= DirEntry(aDir
);
2554 aPrjEntry
+= DirEntry( ssProject
);
2555 aPrjEntry
+= DirEntry( sPrjDir
);
2556 aPrjEntry
+= DirEntry( sSolarFile
);
2558 pFileList
->Insert( new String( aPrjEntry
.GetFull()), LIST_APPEND
);
2560 ByteString
sFile( aPrjEntry
.GetFull(), RTL_TEXTENCODING_ASCII_US
);
2561 fprintf( stdout
, "%s\n", sFile
.GetBuffer());
2562 pProject
= pProjects
->Next();
2570 Read( pFileList
, bReadComments
);
2574 /*****************************************************************************/
2575 void StarWriter::CleanUp()
2576 /*****************************************************************************/
2581 /*****************************************************************************/
2582 USHORT
StarWriter::Read( String aFileName
, BOOL bReadComments
, USHORT nMode
)
2583 /*****************************************************************************/
2585 sFileName
= aFileName
;
2590 aFileList
.Insert( new String( aFileName
));
2592 DirEntry
aEntry( aFileName
);
2594 aEntry
= aEntry
.GetPath().GetPath().GetPath();
2595 sSourceRoot
= aEntry
.GetFull();
2597 while( aFileList
.Count()) {
2598 String ssFileName
= *aFileList
.GetObject(( ULONG
) 0 );
2599 StarFile
* pFile
= ReadBuildlist (ssFileName
, bReadComments
, FALSE
);
2601 aLoadedFilesList
.Insert( pFile
, LIST_APPEND
);
2603 delete aFileList
.Remove(( ULONG
) 0 );
2605 // resolve all dependencies recursive
2608 // Die gefundenen Abhaengigkeiten rekursiv aufloesen
2613 /*****************************************************************************/
2614 USHORT
StarWriter::Read( SolarFileList
*pSolarFiles
, BOOL bReadComments
)
2615 /*****************************************************************************/
2617 nStarMode
= STAR_MODE_MULTIPLE_PARSE
;
2619 // this ctor is used by StarBuilder to get the information for the whole workspace
2620 while( pSolarFiles
->Count()) {
2622 String ssFileName
= *pSolarFiles
->GetObject(( ULONG
) 0 );
2623 StarFile
* pFile
= ReadBuildlist(ssFileName
, bReadComments
, FALSE
);
2625 aLoadedFilesList
.Insert( pFile
, LIST_APPEND
);
2627 delete pSolarFiles
->Remove(( ULONG
) 0 );
2635 /*****************************************************************************/
2636 USHORT
StarWriter::WritePrj( Prj
*pPrj
, SvFileStream
& rStream
)
2637 /*****************************************************************************/
2639 ByteString aDataString
;
2640 ByteString
aTab('\t');
2641 ByteString
aSpace(' ');
2642 ByteString
aEmptyString("");
2643 SByteStringList
* pCmdDepList
;
2644 SByteStringList
* pPrjDepList
;
2646 CommandData
* pCmdData
= NULL
;
2647 if ( pPrj
->Count() > 0 )
2649 pCmdData
= pPrj
->First();
2650 if ( (pPrjDepList
= pPrj
->GetDependencies( FALSE
)) )
2652 aDataString
= pPrj
->GetPreFix();
2653 aDataString
+= aTab
;
2654 aDataString
+= pPrj
->GetProjectName();
2655 aDataString
+= aTab
;
2656 if ( pPrj
->HasFixedDependencies())
2657 aDataString
+= ByteString(":::");
2658 else if ( pPrj
->HasHardDependencies())
2659 aDataString
+= ByteString("::");
2661 aDataString
+= ByteString(":");
2662 aDataString
+= aTab
;
2663 for ( USHORT i
= 0; i
< pPrjDepList
->Count(); i
++ ) {
2664 aDataString
+= *pPrjDepList
->GetObject( i
);
2665 aDataString
+= aSpace
;
2667 aDataString
+= "NULL";
2669 rStream
.WriteLine( aDataString
);
2671 pCmdData
= pPrj
->Next();
2676 if (( aDataString
= pCmdData
->GetComment()) == aEmptyString
)
2678 aDataString
= pPrj
->GetPreFix();
2679 aDataString
+= aTab
;
2681 aDataString
+= pCmdData
->GetPath();
2682 aDataString
+= aTab
;
2683 USHORT nPathLen
= pCmdData
->GetPath().Len();
2684 if ( nPathLen
< 40 )
2685 for ( int i
= 0; i
< 9 - pCmdData
->GetPath().Len() / 4 ; i
++ )
2686 aDataString
+= aTab
;
2688 for ( int i
= 0; i
< 12 - pCmdData
->GetPath().Len() / 4 ; i
++ )
2689 aDataString
+= aTab
;
2690 aDataString
+= pCmdData
->GetCommandTypeString();
2691 aDataString
+= aTab
;
2692 if ( pCmdData
->GetCommandType() == COMMAND_GET
)
2693 aDataString
+= aTab
;
2694 if ( pCmdData
->GetCommandPara() == aEmptyString
)
2695 aDataString
+= ByteString("-");
2697 aDataString
+= pCmdData
->GetCommandPara();
2698 aDataString
+= aTab
;
2699 aDataString
+= pCmdData
->GetOSTypeString();
2700 if ( pCmdData
->GetClientRestriction().Len()) {
2701 aDataString
+= ByteString( "," );
2702 aDataString
+= pCmdData
->GetClientRestriction();
2704 aDataString
+= aTab
;
2705 aDataString
+= pCmdData
->GetLogFile();
2706 aDataString
+= aSpace
;
2708 pCmdDepList
= pCmdData
->GetDependencies();
2710 for ( USHORT i
= 0; i
< pCmdDepList
->Count(); i
++ ) {
2711 aDataString
+= *pCmdDepList
->GetObject( i
);
2712 aDataString
+= aSpace
;
2714 aDataString
+= "NULL";
2717 rStream
.WriteLine( aDataString
);
2719 pCmdData
= pPrj
->Next();
2720 } while ( pCmdData
);
2726 /*****************************************************************************/
2727 USHORT
StarWriter::Write( String aFileName
)
2728 /*****************************************************************************/
2730 sFileName
= aFileName
;
2732 FileStat::SetReadOnlyFlag( DirEntry( aFileName
), FALSE
);
2734 SvFileStream aFileStream
;
2736 aFileStream
.Open( aFileName
, STREAM_WRITE
| STREAM_TRUNC
);
2737 if ( !aFileStream
.IsOpen() && aFileIOErrorHdl
.IsSet()) {
2738 String
sError( String::CreateFromAscii( "Error: Unable to open \"" ));
2739 sError
+= aFileName
;
2740 sError
+= String::CreateFromAscii( "for writing!" );
2741 aFileIOErrorHdl
.Call( &sError
);
2746 Prj
* pPrj
= First();
2749 WritePrj( pPrj
, aFileStream
);
2754 aFileStream
.Close();
2759 /*****************************************************************************/
2760 USHORT
StarWriter::WriteMultiple( String rSourceRoot
)
2761 /*****************************************************************************/
2763 sSourceRoot
= rSourceRoot
;
2767 String
sPrjDir( String::CreateFromAscii( "prj" ));
2768 String
sSolarFile( String::CreateFromAscii( "build.lst" ));
2770 Prj
* pPrj
= First();
2773 String
sName( pPrj
->GetProjectName(), RTL_TEXTENCODING_ASCII_US
);
2775 DirEntry
aEntry( rSourceRoot
);
2776 aEntry
+= DirEntry( sName
);
2777 aEntry
+= DirEntry( sPrjDir
);
2778 aEntry
+= DirEntry( sSolarFile
);
2780 FileStat::SetReadOnlyFlag( aEntry
, FALSE
);
2782 SvFileStream aFileStream
;
2783 aFileStream
.Open( aEntry
.GetFull(), STREAM_WRITE
| STREAM_TRUNC
);
2785 if ( !aFileStream
.IsOpen() && aFileIOErrorHdl
.IsSet()) {
2786 String
sError( String::CreateFromAscii( "Error: Unable to open \"" ));
2787 sError
+= aEntry
.GetFull();
2788 sError
+= String::CreateFromAscii( "for writing!" );
2789 aFileIOErrorHdl
.Call( &sError
);
2792 WritePrj( pPrj
, aFileStream
);
2794 aFileStream
.Close();
2803 /*****************************************************************************/
2804 void StarWriter::InsertTokenLine ( const ByteString
& rTokenLine
)
2805 /*****************************************************************************/
2807 ByteString sProjectName
= rTokenLine
.GetToken(1,'\t');
2808 Prj
* pPrj
= GetPrj (sProjectName
); // 0, if Prj not found;
2809 Star::InsertTokenLine ( rTokenLine
, &pPrj
, sProjectName
, sal_False
);
2812 /*****************************************************************************/
2813 BOOL
StarWriter::InsertProject ( Prj
* /*pNewPrj*/ )
2814 /*****************************************************************************/
2819 /*****************************************************************************/
2820 Prj
* StarWriter::RemoveProject ( ByteString aProjectName
)
2821 /*****************************************************************************/
2823 ULONG nCount_l
= Count();
2825 Prj
* pPrjFound
= NULL
;
2826 SByteStringList
* pPrjDeps
;
2828 for ( USHORT i
= 0; i
< nCount_l
; i
++ )
2830 pPrj
= GetObject( i
);
2831 if ( pPrj
->GetProjectName() == aProjectName
)
2835 pPrjDeps
= pPrj
->GetDependencies( FALSE
);
2838 ByteString
* pString
;
2839 ULONG nPrjDepsCount
= pPrjDeps
->Count();
2840 for ( ULONG j
= nPrjDepsCount
; j
> 0; j
-- )
2842 pString
= pPrjDeps
->GetObject( j
- 1 );
2843 if ( pString
->GetToken( 0, '.') == aProjectName
)
2844 pPrjDeps
->Remove( pString
);
2850 Remove( pPrjFound
);
2859 /*****************************************************************************/
2860 StarFile::StarFile( const String
&rFile
)
2861 /*****************************************************************************/
2862 : aFileName( rFile
)
2864 DirEntry
aEntry( aFileName
);
2865 if ( aEntry
.Exists()) {
2867 FileStat
aStat( aEntry
);
2868 aDate
= aStat
.DateModified();
2869 aTime
= aStat
.TimeModified();
2870 aDateCreated
= aStat
.DateCreated();
2871 aTimeCreated
= aStat
.TimeCreated();
2877 /*****************************************************************************/
2878 BOOL
StarFile::NeedsUpdate()
2879 /*****************************************************************************/
2881 DirEntry
aEntry( aFileName
);
2882 if ( aEntry
.Exists()) {
2887 FileStat
aStat( aEntry
);
2888 if (( aStat
.DateModified() != aDate
) || ( aStat
.TimeModified() != aTime
)
2889 || ( aStat
.DateCreated() != aDateCreated
) || ( aStat
.TimeCreated() != aTimeCreated
))