summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Powers <jpowers27@cox.net>2011-01-25 21:52:10 -0800
committerJoseph Powers <jpowers27@cox.net>2011-01-26 05:44:00 -0800
commit0f44da55121dde853e8e2efb3ac4c80f568909c7 (patch)
tree00e74cb872b90ef7611349cd8737ae78628c81a5
parent4f4bec90b8c07c3c0415de7860a560dd16f3ebae (diff)
Remove DECLARE_LIST( RscStrList, ByteString * )
-rw-r--r--rsc/inc/rscrsc.hxx2
-rw-r--r--rsc/inc/rsctools.hxx5
-rw-r--r--rsc/source/prj/start.cxx34
-rw-r--r--rsc/source/rsc/rsc.cxx41
4 files changed, 26 insertions, 56 deletions
diff --git a/rsc/inc/rscrsc.hxx b/rsc/inc/rscrsc.hxx
index bbbf65e4bc04..9d92f90e48b5 100644
--- a/rsc/inc/rscrsc.hxx
+++ b/rsc/inc/rscrsc.hxx
@@ -51,7 +51,6 @@ class RscCmdLine
public:
RscStrList aInputList; // Liste der Quelldateien
- RscStrList aSymbolList; // Liste der Symbole
ByteString aPath; // Liste der Pfade
RSCBYTEORDER_TYPE nByteOrder;
unsigned short nCommands; // Steuerbits
@@ -91,7 +90,6 @@ struct WriteRcContext;
class RscCompiler
{
private:
- RscStrList aTmpFileList; // Liste der Tmp-Dateien
ByteString aTmpOutputHxx; // Name der TempHxx-Ausgabedatei
ByteString aTmpOutputCxx; // Name der TempCxx-Ausgabedatei
ByteString aTmpOutputRcCtor; // Name der Temp Ctor-Ausgabedatei
diff --git a/rsc/inc/rsctools.hxx b/rsc/inc/rsctools.hxx
index 2bc039109f9c..7706a0e61b8d 100644
--- a/rsc/inc/rsctools.hxx
+++ b/rsc/inc/rsctools.hxx
@@ -37,6 +37,7 @@ class RscPtrPtr;
#include <stdio.h>
#include <tools/string.hxx>
#include <tools/list.hxx>
+#include <vector>
/******************* T y p e s *******************************************/
// Zeichensatz
@@ -63,7 +64,9 @@ int rsc_stricmp( const char *string1, const char *string2 );
char* rsc_strdup( const char* );
/****************** C L A S S E S ****************************************/
-DECLARE_LIST( RscStrList, ByteString * )
+
+typedef ::std::vector< ByteString* > RscStrList;
+
/*********** R s c C h a r ***********************************************/
class RscChar
{
diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx
index 5dc44bfbdb37..ac3de52422fa 100644
--- a/rsc/source/prj/start.cxx
+++ b/rsc/source/prj/start.cxx
@@ -262,15 +262,14 @@ static BOOL CallRsc2( ByteString aRsc2Name,
fprintf( fRspFile, "%s", aSrsName.GetBuffer() );
#endif
- pString = pInputList->First();
- while( pString )
+ for ( size_t i = 0, n = pInputList->size(); i < n; ++i )
{
+ pString = (*pInputList)[ i ];
#ifdef OS2
fprintf( fRspFile, "%s\n", pString->GetBuffer() );
#else
fprintf( fRspFile, " %s", pString->GetBuffer() );
#endif
- pString = pInputList->Next();
};
fclose( fRspFile );
@@ -403,21 +402,21 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
else
{
// Eingabedatei
- aInputList.Insert( new ByteString( *ppStr ), CONTAINER_APPEND );
+ aInputList.push_back( new ByteString( *ppStr ) );
}
ppStr++;
i++;
}
- if( aInputList.Count() )
+ if( !aInputList.empty() )
{
/* build the output file names */
if( ! aResName.Len() )
- aResName = OutputFile( *aInputList.First(), "res" );
+ aResName = OutputFile( *aInputList[ 0 ], "res" );
if( ! bSetSrs )
{
aSrsName = "-fp=";
- aSrsName += OutputFile( *aInputList.First(), "srs" );
+ aSrsName += OutputFile( *aInputList[ 0 ], "srs" );
}
};
@@ -426,13 +425,13 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
bPrePro = FALSE;
bResFile = FALSE;
};
- if( bPrePro && aInputList.Count() )
+ if( bPrePro && !aInputList.empty() )
{
ByteString aTmpName;
- pString = aInputList.First();
- while( pString )
+ for ( size_t i = 0, n = aInputList.size(); i < n; ++i )
{
+ pString = aInputList[ i ];
aTmpName = ::GetTmpFileName();
if( !CallPrePro( aPrePro, *pString, aTmpName, &aCmdLine, bResponse ) )
{
@@ -440,8 +439,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
bError = TRUE;
break;
}
- aTmpList.Insert( new ByteString( aTmpName ), CONTAINER_APPEND );
- pString = aInputList.Next();
+ aTmpList.push_back( new ByteString( aTmpName ) );
};
};
@@ -458,16 +456,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
};
};
- pString = aTmpList.First();
- while( pString )
- {
- #if OSL_DEBUG_LEVEL > 5
- fprintf( stderr, "leaving temp file %s\n", pString->GetBuffer() );
- #else
- unlink( pString->GetBuffer() );
- #endif
- pString = aTmpList.Next();
- };
+ for ( size_t i = 0, n = aTmpList.size(); i < n; ++i )
+ unlink( aTmpList[ i ]->GetBuffer() );
return( bError );
}
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 4e97d8bb9de3..a216614ebfbe 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -216,7 +216,6 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
else if( !rsc_strnicmp( (*ppStr) + 1, "d", 1 ) )
{ // Symbole definieren
nCommands |= DEFINE_FLAG;
- aSymbolList.Insert( new ByteString( (*ppStr) + 2 ), 0xFFFF );
}
else if( !rsc_strnicmp( (*ppStr) + 1, "i", 1 ) )
{ // Include-Pfade definieren
@@ -304,7 +303,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
else
{
// Eingabedatei
- aInputList.Insert( new ByteString( *ppStr ), 0xFFFF );
+ aInputList.push_back( new ByteString( *ppStr ) );
}
ppStr++;
i++;
@@ -313,16 +312,16 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
if( nCommands & HELP_FLAG )
pEH->FatalError( ERR_USAGE, RscId() );
// was an inputted file specified
- else if( aInputList.Count() )
+ else if( !aInputList.empty() )
{
::std::list<OutputFile>::iterator it;
for( it = m_aOutputFiles.begin(); it != m_aOutputFiles.end(); ++it )
{
if( ! it->aOutputRc.Len() )
- it->aOutputRc = ::OutputFile( *aInputList.First(), "rc" );
+ it->aOutputRc = ::OutputFile( *aInputList.front(), "rc" );
}
if( ! bOutputSrsIsSet )
- aOutputSrs = ::OutputFile( *aInputList.First(), "srs" );
+ aOutputSrs = ::OutputFile( *aInputList.front(), "srs" );
}
else if( !(nCommands & PRINTSYNTAX_FLAG) )
pEH->FatalError( ERR_NOINPUT, RscId() );
@@ -337,12 +336,9 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
*************************************************************************/
RscCmdLine::~RscCmdLine()
{
- ByteString *pString;
-
- while( NULL != (pString = aInputList.Remove( (ULONG)0 )) )
- delete pString;
- while( NULL != (pString = aSymbolList.Remove( (ULONG)0 )) )
- delete pString;
+ for ( size_t i = 0, n = aInputList.size(); i < n; ++i )
+ delete aInputList[ i ];
+ aInputList.clear();
}
/*************************************************************************
@@ -418,17 +414,6 @@ RscCompiler::RscCompiler( RscCmdLine * pLine, RscTypCont * pTypCont )
*************************************************************************/
RscCompiler::~RscCompiler()
{
- ByteString* pString;
-
- // Dateien loeschen
- pString = aTmpFileList.First();
- while( pString )
- {
- unlink( pString->GetBuffer() );
- delete pString;
- pString = aTmpFileList.Next();
- }
-
pTC->pEH->SetListFile( NULL );
if( fListing )
@@ -456,7 +441,6 @@ RscCompiler::~RscCompiler()
ERRTYPE RscCompiler::Start()
{
ERRTYPE aError;
- ByteString* pString;
RscFile* pFName;
if( PRINTSYNTAX_FLAG & pCL->nCommands )
@@ -469,15 +453,11 @@ printf( "khg\n" );
}
// Kein Parameter, dann Hilfe
- pString = pCL->aInputList.First();
- if( !pString )
+ if( pCL->aInputList.empty() )
pTC->pEH->FatalError( ERR_NOINPUT, RscId() );
- while( pString )
- {
- pTC->aFileTab.NewCodeFile( *pString );
- pString = pCL->aInputList.Next();
- }
+ for( size_t i = 0, n = pCL->aInputList.size(); i < n; ++i )
+ pTC->aFileTab.NewCodeFile( *pCL->aInputList[ i ] );
if( !(pCL->nCommands & NOSYNTAX_FLAG) )
{
@@ -1096,7 +1076,6 @@ ByteString RscCompiler::GetTmpFileName()
ByteString aFileName;
aFileName = ::GetTmpFileName();
- aTmpFileList.Insert( new ByteString( aFileName ) );
return( aFileName );
}