From 8a418586ea319f7ca7394e5412501fb8faed8142 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 10 Dec 2011 22:38:20 +0000 Subject: ByteString->rtl::OString --- rsc/inc/rscconst.hxx | 2 +- rsc/inc/rscdb.hxx | 26 +++++----- rsc/inc/rscdef.hxx | 20 ++++---- rsc/inc/rscrsc.hxx | 26 +++++----- rsc/inc/rsctools.hxx | 8 +-- rsc/inc/rsctop.hxx | 12 ++--- rsc/inc/rsctree.hxx | 8 +-- rsc/source/parser/erscerr.cxx | 2 +- rsc/source/parser/rscdb.cxx | 10 ++-- rsc/source/parser/rscibas.cxx | 4 +- rsc/source/parser/rscyacc.y | 2 +- rsc/source/res/rscclass.cxx | 6 +-- rsc/source/res/rsccont.cxx | 2 +- rsc/source/res/rscmgr.cxx | 14 ++--- rsc/source/res/rscrange.cxx | 2 +- rsc/source/res/rscstr.cxx | 2 +- rsc/source/res/rsctop.cxx | 4 +- rsc/source/rsc/rsc.cxx | 117 +++++++++++++++++++++--------------------- rsc/source/tools/rscdef.cxx | 22 ++++---- rsc/source/tools/rsctools.cxx | 18 +++---- rsc/source/tools/rsctree.cxx | 6 +-- 21 files changed, 156 insertions(+), 157 deletions(-) (limited to 'rsc') diff --git a/rsc/inc/rscconst.hxx b/rsc/inc/rscconst.hxx index d1ebeeff87d3..22253b9379c6 100644 --- a/rsc/inc/rscconst.hxx +++ b/rsc/inc/rscconst.hxx @@ -95,7 +95,7 @@ public: class RscNameTable; -sal_uInt32 GetLangId( const ByteString& alang); +sal_uInt32 GetLangId( const rtl::OString& rLang); class RscLangEnum : public RscEnum { diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index ffe61c3c7df0..2a5f606f4067 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -63,7 +63,7 @@ struct RscSysEntry { sal_uInt32 nKey; sal_uInt32 nRscTyp; - ByteString aFileName; + rtl::OString aFileName; sal_uInt32 nTyp; sal_uInt32 nRefId; }; @@ -73,15 +73,15 @@ typedef ::std::vector< RscSysEntry* > RscSysList; class RscTypCont { CharSet nSourceCharSet; - sal_uInt32 nMachineId; // Globaler Maschinentyp + sal_uInt32 nMachineId; // Globaler Maschinentyp RSCBYTEORDER_TYPE nByteOrder; // Intel oder - ByteString aLanguage; // output language + rtl::OString aLanguage; // output language std::vector< sal_uInt32 > aLangFallbacks; // language fallback list (entry 0 is language itself) - ByteString aSearchPath; // Suchen der Bitmap, Icon, Pointer - ByteString aSysSearchPath; // aSearchPath plus language specific paths - sal_uInt32 nUniqueId; // eindeutiger Id fuer Systemresourcen - sal_uLong nFilePos; // Position in der Datei ( MTF ) - sal_uInt32 nPMId; // eindeutiger Id fuer PM-Rseourcefile + rtl::OString aSearchPath; // Suchen der Bitmap, Icon, Pointer + rtl::OString aSysSearchPath; // aSearchPath plus language specific paths + sal_uInt32 nUniqueId; // eindeutiger Id fuer Systemresourcen + sal_uLong nFilePos; // Position in der Datei ( MTF ) + sal_uInt32 nPMId; // eindeutiger Id fuer PM-Rseourcefile // muss groesser als RSC_VERSIONCONTROL_ID sein RscTop * pRoot; // Zeiger auf die Wurzel vom Typenbaum RSCINST aVersion; // Versionskontrollinstanz @@ -301,7 +301,7 @@ public: std::map aIdTranslator; //Ordnet Resourcetypen und Id's einen Id zu //(unter PM), oder eine Dateiposition (MTF) - RscTypCont( RscError *, RSCBYTEORDER_TYPE, const ByteString & rSearchPath, sal_uInt32 nFlags ); + RscTypCont( RscError *, RSCBYTEORDER_TYPE, const rtl::OString& rSearchPath, sal_uInt32 nFlags ); ~RscTypCont(); Atom AddLanguage( const char* ); @@ -326,9 +326,9 @@ public: nSourceCharSet = aCharSet; return aOld; } - void SetSearchPath( const ByteString & rStr) { aSearchPath = rStr; } - ByteString GetSearchPath() const { return aSearchPath; } - void SetSysSearchPath( const ByteString& rStr ) { aSysSearchPath = rStr; } + void SetSearchPath( const rtl::OString& rStr) { aSearchPath = rStr; } + rtl::OString GetSearchPath() const { return aSearchPath; } + void SetSysSearchPath( const rtl::OString& rStr ) { aSysSearchPath = rStr; } void InsertType( RscTop * pType ) { aBaseLst.push_back( pType ); @@ -345,7 +345,7 @@ public: CharSet nCharSet, sal_Bool bName = sal_True ); ERRTYPE WriteHxx( FILE * fOutput, sal_uLong nFileKey); ERRTYPE WriteCxx( FILE * fOutput, sal_uLong nFileKey, - const ByteString & rHxxName ); + const rtl::OString& rHxxName ); void WriteSyntax( FILE * fOutput ); void WriteRcCtor( FILE * fOutput ); sal_uInt32 PutTranslatorKey( sal_uInt64 nKey ); diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx index e516b018f6a9..ed9a9bd76078 100644 --- a/rsc/inc/rscdef.hxx +++ b/rsc/inc/rscdef.hxx @@ -105,7 +105,7 @@ public: static void SetNames( sal_Bool bSet = sal_True ); operator sal_Int32() const; // Gibt Nummer zurueck - ByteString GetName() const; // Gibt den Namen des Defines zurueck + rtl::OString GetName() const; // Gibt den Namen des Defines zurueck sal_Bool operator < ( const RscId& rRscId ) const; sal_Bool operator > ( const RscId& rRscId ) const; sal_Bool operator == ( const RscId& rRscId ) const; @@ -130,16 +130,16 @@ friend class RscId; RscExpression * pExp; // Ausdruck protected: - RscDefine( sal_uLong lFileKey, const ByteString & rDefName, + RscDefine( sal_uLong lFileKey, const rtl::OString& rDefName, sal_Int32 lDefId ); - RscDefine( sal_uLong lFileKey, const ByteString & rDefName, + RscDefine( sal_uLong lFileKey, const rtl::OString& rDefName, RscExpression * pExpression ); ~RscDefine(); void IncRef(){ nRefCount++; } sal_uInt32 GetRefCount() const { return nRefCount; } void DecRef(); void DefineToNumber(); - void SetName( const ByteString & rNewName ){ aName = rNewName; } + void SetName(const rtl::OString& rNewName) { m_aName = rNewName; } using StringNode::Search; public: @@ -147,7 +147,7 @@ public: sal_uLong GetFileKey() const { return lFileKey; } sal_Bool Evaluate(); sal_Int32 GetNumber() const { return lId; } - ByteString GetMacro(); + rtl::OString GetMacro(); }; typedef ::std::vector< RscDefine* > RscSubDefList; @@ -158,9 +158,9 @@ friend class RscFileTab; private: RscSubDefList maList; // pExpression wird auf jedenfall Eigentum der Liste - RscDefine * New( sal_uLong lFileKey, const ByteString & rDefName, + RscDefine * New( sal_uLong lFileKey, const rtl::OString& rDefName, sal_Int32 lDefId, size_t lPos ); - RscDefine * New( sal_uLong lFileKey, const ByteString & rDefName, + RscDefine * New( sal_uLong lFileKey, const rtl::OString& rDefName, RscExpression * pExpression, size_t lPos ); sal_Bool Remove(); size_t GetPos( RscDefine* item ) { @@ -184,7 +184,7 @@ public: RscExpType aRE ); ~RscExpression(); sal_Bool Evaluate( sal_Int32 * pValue ); - ByteString GetMacro(); + rtl::OString GetMacro(); }; /********************** R S C F I L E ************************************/ @@ -254,9 +254,9 @@ public: sal_Bool TestDef( sal_uLong lFileKey, size_t lPos, const RscExpression * pExpDec ); - RscDefine * NewDef( sal_uLong lKey, const ByteString & rDefName, + RscDefine * NewDef( sal_uLong lKey, const rtl::OString& rDefName, sal_Int32 lId, sal_uLong lPos ); - RscDefine * NewDef( sal_uLong lKey, const ByteString & rDefName, + RscDefine * NewDef( sal_uLong lKey, const rtl::OString& rDefName, RscExpression *, sal_uLong lPos ); // Alle Defines die in dieser Datei Definiert sind loeschen diff --git a/rsc/inc/rscrsc.hxx b/rsc/inc/rscrsc.hxx index 1f79a3e8206a..7a14792dd101 100644 --- a/rsc/inc/rscrsc.hxx +++ b/rsc/inc/rscrsc.hxx @@ -54,14 +54,14 @@ public: rtl::OString aPath; // Liste der Pfade RSCBYTEORDER_TYPE nByteOrder; unsigned short nCommands; // Steuerbits - ByteString aOutputLst; // Name der List-Ausgabedatei - ByteString aOutputSrs; // Name der Srs-Ausgabedatei - ByteString aOutputSrc; // Name der Src-Ausgabedatei - ByteString aOutputRcCtor; // Name der Ctor-Ausgabedatei - ByteString aOutputCxx; // Name der Cxx-Ausgabedatei - ByteString aOutputHxx; // Name der Hxx-Ausgabedatei - ByteString aTouchFile; // create this file when done in rsc2 - ByteString aILDir; + rtl::OString aOutputLst; // Name der List-Ausgabedatei + rtl::OString aOutputSrs; // Name der Srs-Ausgabedatei + rtl::OString aOutputSrc; // Name der Src-Ausgabedatei + rtl::OString aOutputRcCtor; // Name der Ctor-Ausgabedatei + rtl::OString aOutputCxx; // Name der Cxx-Ausgabedatei + rtl::OString aOutputHxx; // Name der Hxx-Ausgabedatei + rtl::OString aTouchFile; // create this file when done in rsc2 + rtl::OString aILDir; struct OutputFile { @@ -88,13 +88,13 @@ struct WriteRcContext; class RscCompiler { private: - ByteString aTmpOutputHxx; // Name der TempHxx-Ausgabedatei - ByteString aTmpOutputCxx; // Name der TempCxx-Ausgabedatei - ByteString aTmpOutputRcCtor; // Name der Temp Ctor-Ausgabedatei - ByteString aTmpOutputSrc; // Name der TempSrc-Ausgabedatei + rtl::OString aTmpOutputHxx; // Name der TempHxx-Ausgabedatei + rtl::OString aTmpOutputCxx; // Name der TempCxx-Ausgabedatei + rtl::OString aTmpOutputRcCtor; // Name der Temp Ctor-Ausgabedatei + rtl::OString aTmpOutputSrc; // Name der TempSrc-Ausgabedatei void CreateResFile( const char * pRc ); - void Append( const ByteString& rOutputSrs, const ByteString& rTmpFile ); + void Append( const rtl::OString& rOutputSrs, const rtl::OString& rTmpFile ); bool GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile, const WriteRcContext& rContext, diff --git a/rsc/inc/rsctools.hxx b/rsc/inc/rsctools.hxx index 7694af3b06b0..c326b1ce7161 100644 --- a/rsc/inc/rsctools.hxx +++ b/rsc/inc/rsctools.hxx @@ -48,10 +48,10 @@ enum RSCBYTEORDER_TYPE { RSC_BIGENDIAN, RSC_LITTLEENDIAN, RSC_SYSTEMENDIAN }; #define ALIGNED_SIZE( nSize ) \ (nSize + sizeof( void * ) -1) / sizeof( void * ) * sizeof( void * ) /******************* F u n c t i o n F o r w a r d s *******************/ -ByteString GetTmpFileName(); -sal_Bool Append( ByteString aDestFile, ByteString aSourceFile ); -sal_Bool Append( FILE * fDest, ByteString aSourceFile ); -ByteString OutputFile( ByteString aInput, const char * ext ); +rtl::OString GetTmpFileName(); +sal_Bool Append(const rtl::OString &rDestFile, const rtl::OString &rSourceFile); +sal_Bool Append(FILE * fDest, rtl::OString &raSourceFile); +rtl::OString OutputFile(const rtl::OString &rInput, const char * ext); char * ResponseFile( RscPtrPtr * ppCmd, char ** ppArgv, sal_uInt32 nArgc ); void RscExit( sal_uInt32 nExit ); diff --git a/rsc/inc/rsctop.hxx b/rsc/inc/rsctop.hxx index 77e32041ac8b..6b627b1eed16 100644 --- a/rsc/inc/rsctop.hxx +++ b/rsc/inc/rsctop.hxx @@ -57,9 +57,9 @@ protected: RscTop * pSuperCl = NULL ); public: - ByteString aCallPar1; // Klassenaufruf ohne Typen bis ResId - ByteString aCallPar2; // Klassenaufruf ohne Typen ab ResId - ByteString aCallParType; // Klassenaufruf mit Typen + rtl::OString aCallPar1; // Klassenaufruf ohne Typen bis ResId + rtl::OString aCallPar2; // Klassenaufruf ohne Typen ab ResId + rtl::OString aCallParType; // Klassenaufruf mit Typen void SetSuperClass( RscTop * pClass ) { @@ -74,10 +74,10 @@ public: sal_Bool InHierarchy( RscTop * pClass ); sal_Bool IsCodeWriteable() const { - return( 0 != aCallParType.Len() ); + return( 0 != aCallParType.getLength() ); } - void SetCallPar( const ByteString & rPar1, const ByteString & rPar2, - const ByteString & rParType ); + void SetCallPar( const rtl::OString& rPar1, const rtl::OString& rPar2, + const rtl::OString& rParType ); void SetRefClass( RscTop * pRef ) { pRefClass = pRef; } RscTop* GetRefClass() const { return pRefClass; } virtual RSCCLASS_TYPE GetClassType() const = 0; diff --git a/rsc/inc/rsctree.hxx b/rsc/inc/rsctree.hxx index 8f94b509615d..b882b33afa44 100644 --- a/rsc/inc/rsctree.hxx +++ b/rsc/inc/rsctree.hxx @@ -104,14 +104,14 @@ class StringNode : public NameNode protected: using NameNode::Search; - ByteString aName; + rtl::OString m_aName; public: - StringNode(){}; - StringNode( const ByteString & rStr ) { aName = rStr; } + StringNode() {} + StringNode(const rtl::OString& rStr) { m_aName = rStr; } StringNode* Search( const char * ) const; - ByteString GetName() const { return aName; } + rtl::OString GetName() const { return m_aName; } }; #endif // _RSCTREE_HXX diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx index 59f179fca04f..0b5738894bee 100644 --- a/rsc/source/parser/erscerr.cxx +++ b/rsc/source/parser/erscerr.cxx @@ -425,7 +425,7 @@ void RscError::ErrorFormat( const ERRTYPE& rError, RscTop * pClass, StdLstErr( ", " ); } if( aId.IsId() ) - StdLstErr( aId.GetName().GetBuffer() ); + StdLstErr( aId.GetName().getStr() ); StdLstErr( "):\n" ); } else diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx index ea229cd964d8..00ec27b77554 100644 --- a/rsc/source/parser/rscdb.cxx +++ b/rsc/source/parser/rscdb.cxx @@ -56,7 +56,7 @@ using ::rtl::OStringBuffer; *************************************************************************/ RscTypCont :: RscTypCont( RscError * pErrHdl, RSCBYTEORDER_TYPE nOrder, - const ByteString & rSearchPath, + const rtl::OString& rSearchPath, sal_uInt32 nFlagsP ) : nSourceCharSet( RTL_TEXTENCODING_UTF8 ), @@ -328,7 +328,7 @@ sal_uInt32 RscTypCont :: PutSysName( sal_uInt32 nRscTyp, char * pFileName, pSysEntry = aSysLst[ i ]; if( pSysEntry->nKey == 1 ) bId1 = sal_True; - if( !strcmp( pSysEntry->aFileName.GetBuffer(), pFileName ) ) + if( !strcmp( pSysEntry->aFileName.getStr(), pFileName ) ) if( pSysEntry->nRscTyp == nRscTyp && pSysEntry->nTyp == nConst && pSysEntry->nRefId == nId @@ -832,14 +832,14 @@ ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, sal_uLong nFileKey ) |* *************************************************************************/ ERRTYPE RscTypCont::WriteCxx( FILE * fOutput, sal_uLong nFileKey, - const ByteString & rHxxName ) + const rtl::OString& rHxxName ) { RscEnumerateRef aEnumRef( this, pRoot, fOutput ); ERRTYPE aError; fprintf( fOutput, "#include \n" ); WriteInc( fOutput, nFileKey ); - if( rHxxName.Len() ) - fprintf( fOutput, "#include \"%s\"\n", rHxxName.GetBuffer() ); + if( rHxxName.getLength() ) + fprintf( fOutput, "#include \"%s\"\n", rHxxName.getStr() ); fprintf( fOutput, "\n\n" ); if( NOFILE_INDEX == nFileKey ) diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx index a7fdf0c6f137..4e2ba9f30080 100644 --- a/rsc/source/parser/rscibas.cxx +++ b/rsc/source/parser/rscibas.cxx @@ -80,9 +80,9 @@ void RscTypCont::SETCONST( RscConst * pClass, Atom nName, sal_uInt32 nVal ) typedef boost::unordered_map< rtl::OString, sal_uInt32, rtl::OStringHash > langmap; static langmap ULong_Iso_map; -sal_uInt32 GetLangId( const ByteString& aLang ) +sal_uInt32 GetLangId(const rtl::OString &rLang) { - langmap::iterator pIter = ULong_Iso_map.find( aLang ); + langmap::iterator pIter = ULong_Iso_map.find( rLang ); if ( pIter != ULong_Iso_map.end()) return pIter->second; return 0; diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y index 61f028e558ec..6c401d55d66a 100644 --- a/rsc/source/parser/rscyacc.y +++ b/rsc/source/parser/rscyacc.y @@ -419,7 +419,7 @@ resource_definition } | '#' DEFINE RSCDEFINE macro_expression { - pTC->pEH->Error( ERR_DOUBLEDEFINE, NULL, RscId(), $3->GetName().GetBuffer() ); + pTC->pEH->Error( ERR_DOUBLEDEFINE, NULL, RscId(), $3->GetName().getStr() ); } | '#' INCLUDE STRING { diff --git a/rsc/source/res/rscclass.cxx b/rsc/source/res/rscclass.cxx index 678c88c86b58..7e4ea5e21a6b 100644 --- a/rsc/source/res/rscclass.cxx +++ b/rsc/source/res/rscclass.cxx @@ -997,7 +997,7 @@ void RscClass::WriteRcAccess ) { fprintf( fOutput, "\t\tSet%s( %s ", pName, pHS->getString( GetId() ).getStr() ); - fprintf( fOutput, "%s ", aCallPar2.GetBuffer() ); + fprintf( fOutput, "%s ", aCallPar2.getStr() ); fprintf( fOutput, "ResId( (RSHEADER_TYPE*)(pResData+nOffset) ) ) );\n" ); fprintf( fOutput, "\t\tnOffset += GetObjSizeRes( (RSHEADER_TYPE*)(pResData+nOffset) );\n" ); } @@ -1011,12 +1011,12 @@ void RscClass::WriteRcCtor( FILE * fOutput, RscTypCont * pTC ) fprintf( fOutput, "%s::%s%s bFreeResource )", pHS->getString( GetId() ).getStr(), pHS->getString( GetId() ).getStr(), - aCallParType.GetBuffer() ); + aCallParType.getStr() ); if( GetSuperClass() ) { // Superaufruf fprintf( fOutput, "\n\t: %s", pHS->getString( GetSuperClass()->GetId() ).getStr() ); - fprintf( fOutput, "%s", GetSuperClass()->aCallPar1.GetBuffer() ); + fprintf( fOutput, "%s", GetSuperClass()->aCallPar1.getStr() ); fprintf( fOutput, " rResId.SetRT2( 0x%lx ) )", sal::static_int_cast< unsigned long >(GetTypId()) ); } diff --git a/rsc/source/res/rsccont.cxx b/rsc/source/res/rsccont.cxx index 3bed42f139ac..e7247216882f 100644 --- a/rsc/source/res/rsccont.cxx +++ b/rsc/source/res/rsccont.cxx @@ -816,7 +816,7 @@ void RscBaseCont::ContWriteRcAccess else { fprintf( fOutput, "\t\tSet%s( %s ", pName, pHS->getString( GetId() ).getStr() ); - fprintf( fOutput, "%s ", aCallPar2.GetBuffer() ); + fprintf( fOutput, "%s ", aCallPar2.getStr() ); fprintf( fOutput, "ResId( (RSHEADER_TYPE*)(pResData+nOffset) ) ) );\n" ); fprintf( fOutput, "\t\tnOffset += GetObjSizeRes( (RSHEADER_TYPE*)(pResData+nOffset) );\n" ); } diff --git a/rsc/source/res/rscmgr.cxx b/rsc/source/res/rscmgr.cxx index c88dad98562d..078be90c5658 100644 --- a/rsc/source/res/rscmgr.cxx +++ b/rsc/source/res/rscmgr.cxx @@ -176,9 +176,9 @@ void RscMgr::WriteSrcHeader( const RSCINST & rInst, FILE * fOutput, fprintf( fOutput, "%s %s", pHS->getString( rInst.pClass->GetId() ).getStr(), - (rId.GetName()).GetBuffer() ); + (rId.GetName()).getStr() ); if( pClassData->aRefId.IsId() ) - fprintf( fOutput, ",%s", pClassData->aRefId.GetName().GetBuffer() ); + fprintf( fOutput, ",%s", pClassData->aRefId.GetName().getStr() ); else { fprintf( fOutput, "\n" ); @@ -405,7 +405,7 @@ ERRTYPE RscMgr::WriteHxxHeader( const RSCINST & rInst, FILE * fOutput, fprintf( fOutput, "%s%s bFreeRes = TRUE )", MakeName( pTC, rInst.pClass, rId.GetName() ).getStr(), - (rInst.pClass->aCallParType).GetBuffer() ); + (rInst.pClass->aCallParType).getStr() ); fprintf( fOutput, ";\n};\n\n" ); } }; @@ -466,11 +466,11 @@ ERRTYPE RscMgr::WriteCxxHeader( const RSCINST & rInst, FILE * fOutput, fprintf( fOutput, "%s::%s", MakeName( pTC, rInst.pClass, rId.GetName() ).getStr(), MakeName( pTC, rInst.pClass, rId.GetName() ).getStr() ); - fprintf( fOutput, "%s", (rInst.pClass->aCallParType).GetBuffer() ); + fprintf( fOutput, "%s", (rInst.pClass->aCallParType).getStr() ); if( GetCount( rInst ) ) fprintf( fOutput, " bFreeRes" ); fprintf( fOutput, " )\n : %s", pHS->getString( rInst.pClass->GetId() ).getStr() ); - fprintf( fOutput, "%s", (rInst.pClass->aCallPar1).GetBuffer() ); + fprintf( fOutput, "%s", (rInst.pClass->aCallPar1).getStr() ); fprintf( fOutput, " rResId )" ); aError = RscClass::WriteCxx( rInst, fOutput, pTC, rId ); @@ -514,8 +514,8 @@ ERRTYPE RscMgr::WriteCxx( const RSCINST & rInst, FILE * fOutput, { fprintf( fOutput, ",\n a%s", MakeName( pTC, rInst.pClass, rId.GetName() ).getStr() ); - fprintf( fOutput, "%s", (rInst.pClass->aCallPar2).GetBuffer() ); - fprintf( fOutput, " ResId( %s ) )", (rId.GetName()).GetBuffer() ); + fprintf( fOutput, "%s", (rInst.pClass->aCallPar2).getStr() ); + fprintf( fOutput, " ResId( %s ) )", (rId.GetName()).getStr() ); return ERR_OK; } diff --git a/rsc/source/res/rscrange.cxx b/rsc/source/res/rscrange.cxx index e78011b901b7..72a56c114110 100644 --- a/rsc/source/res/rscrange.cxx +++ b/rsc/source/res/rscrange.cxx @@ -558,7 +558,7 @@ ERRTYPE RscIdRange::GetRef( const RSCINST & rInst, RscId * pRscId ){ void RscIdRange::WriteSrc( const RSCINST & rInst, FILE * fOutput, RscTypCont *, sal_uInt32, const char * ) { - fprintf( fOutput, "%s", ((RscId *)rInst.pData)->GetName().GetBuffer() ); + fprintf( fOutput, "%s", ((RscId *)rInst.pData)->GetName().getStr() ); } /************************************************************************* diff --git a/rsc/source/res/rscstr.cxx b/rsc/source/res/rscstr.cxx index d19aa828b136..18447c69f708 100644 --- a/rsc/source/res/rscstr.cxx +++ b/rsc/source/res/rscstr.cxx @@ -235,7 +235,7 @@ void RscString::WriteSrc( const RSCINST & rInst, FILE * fOutput, if ( ((RscStringInst *)rInst.pData)->aRefId.IsId() ) { fprintf( fOutput, "%s", - ((RscStringInst *)rInst.pData)->aRefId.GetName().GetBuffer() ); + ((RscStringInst *)rInst.pData)->aRefId.GetName().getStr() ); } else { diff --git a/rsc/source/res/rsctop.cxx b/rsc/source/res/rsctop.cxx index 2bc78f380345..c5ffa5ac4d77 100644 --- a/rsc/source/res/rsctop.cxx +++ b/rsc/source/res/rsctop.cxx @@ -58,8 +58,8 @@ RscTop::RscTop( Atom nId, sal_uInt32 nTypIdent, RscTop * pSuperCl ) |* RscTop::SetCallPar() |* *************************************************************************/ -void RscTop::SetCallPar( const ByteString & rPar1, const ByteString & rPar2, - const ByteString & rParType ) +void RscTop::SetCallPar(const rtl::OString& rPar1, const rtl::OString& rPar2, + const rtl::OString& rParType) { aCallPar1 = rPar1; aCallPar2 = rPar2; diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index ee33b6c16a49..a7bada7b3217 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -284,7 +284,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH ) } else if( !rsc_stricmp( (*ppStr) + 1, "lg" ) ) { - m_aOutputFiles.back().aLangName = ByteString(); + m_aOutputFiles.back().aLangName = rtl::OString(); } else if( !rsc_strnicmp( (*ppStr) + 1, "lg", 2 ) ) { @@ -394,10 +394,10 @@ RscCompiler::RscCompiler( RscCmdLine * pLine, RscTypCont * pTypCont ) pCL = pLine; pTC = pTypCont; - if( pCL->aOutputLst.Len() ) + if( pCL->aOutputLst.getLength() ) { - if ( NULL == (fListing = fopen( pCL->aOutputLst.GetBuffer(), "w" )) ) - pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aOutputLst.GetBuffer() ); + if ( NULL == (fListing = fopen( pCL->aOutputLst.getStr(), "w" )) ) + pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aOutputLst.getStr() ); pTC->pEH->SetListFile( fListing ); } } @@ -416,14 +416,14 @@ RscCompiler::~RscCompiler() if( fExitFile ) fclose( fExitFile ); - if( aTmpOutputHxx.Len() ) - unlink( aTmpOutputHxx.GetBuffer() ); - if( aTmpOutputCxx.Len() ) - unlink( aTmpOutputCxx.GetBuffer() ); - if( aTmpOutputRcCtor.Len() ) - unlink( aTmpOutputRcCtor.GetBuffer() ); - if( aTmpOutputSrc.Len() ) - unlink( aTmpOutputSrc.GetBuffer() ); + if( aTmpOutputHxx.getLength() ) + unlink( aTmpOutputHxx.getStr() ); + if( aTmpOutputCxx.getLength() ) + unlink( aTmpOutputCxx.getStr() ); + if( aTmpOutputRcCtor.getLength() ) + unlink( aTmpOutputRcCtor.getStr() ); + if( aTmpOutputSrc.getLength() ) + unlink( aTmpOutputSrc.getStr() ); } /************************************************************************* @@ -510,21 +510,21 @@ ERRTYPE RscCompiler::Start() *************************************************************************/ void RscCompiler::EndCompile() { - if( pCL->aOutputSrs.Len() && (pCL->nCommands & NOLINK_FLAG) ) + if( pCL->aOutputSrs.getLength() && (pCL->nCommands & NOLINK_FLAG) ) { pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose ); - pTC->pEH->StdOut( pCL->aOutputSrs.GetBuffer(), RscVerbosityVerbose ); + pTC->pEH->StdOut( pCL->aOutputSrs.getStr(), RscVerbosityVerbose ); pTC->pEH->StdOut( ".\n", RscVerbosityVerbose ); // kopiere von TMP auf richtigen Namen - unlink( pCL->aOutputSrs.GetBuffer() ); // Zieldatei loeschen + unlink( pCL->aOutputSrs.getStr() ); // Zieldatei loeschen if( !(pCL->nCommands & NOSYNTAX_FLAG) ) { FILE * foutput; RscFile * pFN; - if( NULL == (foutput = fopen( pCL->aOutputSrs.GetBuffer(), "w" )) ) - pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aOutputSrs.GetBuffer() ); + if( NULL == (foutput = fopen( pCL->aOutputSrs.getStr(), "w" )) ) + pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aOutputSrs.getStr() ); else { // Schreibe Datei @@ -544,64 +544,64 @@ void RscCompiler::EndCompile() }; } - if ( aTmpOutputHxx.Len() ) + if ( aTmpOutputHxx.getLength() ) { pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose ); - pTC->pEH->StdOut( pCL->aOutputHxx.GetBuffer(), RscVerbosityVerbose ); + pTC->pEH->StdOut( pCL->aOutputHxx.getStr(), RscVerbosityVerbose ); pTC->pEH->StdOut( ".\n", RscVerbosityVerbose ); // kopiere von TMP auf richtigen Namen - unlink( pCL->aOutputHxx.GetBuffer() ); // Zieldatei loeschen + unlink( pCL->aOutputHxx.getStr() ); // Zieldatei loeschen Append( pCL->aOutputHxx, aTmpOutputHxx ); - unlink( aTmpOutputHxx.GetBuffer() );// TempDatei loeschen - aTmpOutputHxx = ByteString(); + unlink( aTmpOutputHxx.getStr() );// TempDatei loeschen + aTmpOutputHxx = rtl::OString(); } - if( aTmpOutputCxx.Len() ) + if( aTmpOutputCxx.getLength() ) { pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose ); - pTC->pEH->StdOut( pCL->aOutputCxx.GetBuffer(), RscVerbosityVerbose ); + pTC->pEH->StdOut( pCL->aOutputCxx.getStr(), RscVerbosityVerbose ); pTC->pEH->StdOut( ".\n", RscVerbosityVerbose ); // kopiere von TMP auf richtigen Namen - unlink( pCL->aOutputCxx.GetBuffer() ); // Zieldatei loeschen + unlink( pCL->aOutputCxx.getStr() ); // Zieldatei loeschen Append( pCL->aOutputCxx, aTmpOutputCxx ); - unlink( aTmpOutputCxx.GetBuffer() );// TempDatei loeschen - aTmpOutputCxx = ByteString(); + unlink( aTmpOutputCxx.getStr() );// TempDatei loeschen + aTmpOutputCxx = rtl::OString(); } - if( aTmpOutputRcCtor.Len() ) + if( aTmpOutputRcCtor.getLength() ) { pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose ); - pTC->pEH->StdOut( pCL->aOutputRcCtor.GetBuffer(), RscVerbosityVerbose ); + pTC->pEH->StdOut( pCL->aOutputRcCtor.getStr(), RscVerbosityVerbose ); pTC->pEH->StdOut( ".\n", RscVerbosityVerbose ); // kopiere von TMP auf richtigen Namen - unlink( pCL->aOutputRcCtor.GetBuffer() ); // Zieldatei loeschen + unlink( pCL->aOutputRcCtor.getStr() ); // Zieldatei loeschen Append( pCL->aOutputRcCtor, aTmpOutputRcCtor ); - unlink( aTmpOutputRcCtor.GetBuffer() );// TempDatei loeschen - aTmpOutputRcCtor = ByteString(); + unlink( aTmpOutputRcCtor.getStr() );// TempDatei loeschen + aTmpOutputRcCtor = rtl::OString(); } - if( aTmpOutputSrc.Len() ) + if( aTmpOutputSrc.getLength() ) { // kopiere von TMP auf richtigen Namen - unlink( pCL->aOutputSrc.GetBuffer() ); // Zieldatei loeschen + unlink( pCL->aOutputSrc.getStr() ); // Zieldatei loeschen Append( pCL->aOutputSrc, aTmpOutputSrc ); - unlink( aTmpOutputSrc.GetBuffer() );// TempDatei loeschen - aTmpOutputSrc = ByteString(); + unlink( aTmpOutputSrc.getStr() );// TempDatei loeschen + aTmpOutputSrc = rtl::OString(); } - if( pCL->aTouchFile.Len() ) + if( pCL->aTouchFile.getLength() ) { - FILE* fp = fopen( pCL->aTouchFile.GetBuffer(), "w" ); + FILE* fp = fopen( pCL->aTouchFile.getStr(), "w" ); if( fp ) { fprintf( fp, "Done\n" ); fclose( fp ); } else - pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aTouchFile.GetBuffer() ); + pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aTouchFile.getStr() ); } } @@ -822,7 +822,7 @@ ERRTYPE RscCompiler::Link() OSL_TRACE("temporary rc file: %s", aRcTmp.getStr()); OUString sOilDirUrl; - if(pCL->aILDir.Len()) + if(pCL->aILDir.getLength()) sOilDirUrl = lcl_getAbsoluteUrl(sPwdUrl, pCL->aILDir); else sOilDirUrl = sTempDirUrl; @@ -953,11 +953,11 @@ ERRTYPE RscCompiler::Link() } // hxx-Datei schreiben - if( pCL->aOutputHxx.Len() && aError.IsOk() ) + if( pCL->aOutputHxx.getLength() && aError.IsOk() ) { aTmpOutputHxx = ::GetTmpFileName(); - if ( NULL == (fExitFile = foutput = fopen( aTmpOutputHxx.GetBuffer(), "w" )) ) - pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputHxx.GetBuffer() ); + if ( NULL == (fExitFile = foutput = fopen( aTmpOutputHxx.getStr(), "w" )) ) + pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputHxx.getStr() ); pTC->pEH->StdOut( "Generating .hxx file\n" ); @@ -969,11 +969,11 @@ ERRTYPE RscCompiler::Link() } // cxx-Datei schreiben - if( pCL->aOutputCxx.Len() && aError.IsOk() ) + if( pCL->aOutputCxx.getLength() && aError.IsOk() ) { aTmpOutputCxx = ::GetTmpFileName(); - if ( NULL == (fExitFile = foutput = fopen( aTmpOutputCxx.GetBuffer(), "w" )) ) - pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputCxx.GetBuffer() ); + if ( NULL == (fExitFile = foutput = fopen( aTmpOutputCxx.getStr(), "w" )) ) + pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputCxx.getStr() ); pTC->pEH->StdOut( "Generating .cxx file\n" ); @@ -993,11 +993,11 @@ ERRTYPE RscCompiler::Link() } // RcCtor-Datei schreiben - if( pCL->aOutputRcCtor.Len() && aError.IsOk() ) + if( pCL->aOutputRcCtor.getLength() && aError.IsOk() ) { aTmpOutputRcCtor = ::GetTmpFileName(); - if ( NULL == (fExitFile = foutput = fopen( aTmpOutputRcCtor.GetBuffer(), "w" )) ) - pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputRcCtor.GetBuffer() ); + if ( NULL == (fExitFile = foutput = fopen( aTmpOutputRcCtor.getStr(), "w" )) ) + pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputRcCtor.getStr() ); pTC->pEH->StdOut( "Generating .cxx ressource constructor file\n" ); @@ -1009,11 +1009,11 @@ ERRTYPE RscCompiler::Link() } // src-Datei schreiben - if( pCL->aOutputSrc.Len() && aError.IsOk() ) + if( pCL->aOutputSrc.getLength() && aError.IsOk() ) { aTmpOutputSrc = ::GetTmpFileName(); - if ( NULL == (fExitFile = foutput = fopen( aTmpOutputSrc.GetBuffer(), "w" )) ) - pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputSrc.GetBuffer() ); + if ( NULL == (fExitFile = foutput = fopen( aTmpOutputSrc.getStr(), "w" )) ) + pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputSrc.getStr() ); // Schreibe Datei pTC->WriteSrc( foutput, NOFILE_INDEX, RTL_TEXTENCODING_UNICODE ); @@ -1033,15 +1033,14 @@ ERRTYPE RscCompiler::Link() /* */ /* Description : appends text files */ /********************************************************************/ -void RscCompiler::Append( const ByteString& rOutputSrs, - const ByteString& rTmpFile ) +void RscCompiler::Append( const rtl::OString& rOutputSrs, + const rtl::OString& rTmpFile ) { if( !::Append( rOutputSrs, rTmpFile ) ) { - ByteString aTemp = rOutputSrs; - aTemp += " or "; - aTemp += rTmpFile; - pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTemp.GetBuffer() ); + rtl::OStringBuffer aTemp(rOutputSrs); + aTemp.append(" or ").append(rTmpFile); + pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTemp.getStr() ); } } @@ -1082,7 +1081,7 @@ bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile, const FileStat aFS( aAbsPath.GetFull() ); #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "Searching image: %s\n", ByteString( aRelPath.GetFull(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); + fprintf( stderr, "Searching image: %s\n", rtl::OUStringToOString(aRelPath.GetFull(), RTL_TEXTENCODING_ASCII_US).getStr() ); #endif if( aFS.IsKind( FSYS_KIND_FILE ) ) diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx index ce495e3242bd..355a46da9f8d 100644 --- a/rsc/source/tools/rscdef.cxx +++ b/rsc/source/tools/rscdef.cxx @@ -165,7 +165,7 @@ RscId::operator sal_Int32() const |* RscId::GetNames() |* *************************************************************************/ -ByteString RscId::GetName() const +rtl::OString RscId::GetName() const { rtl::OStringBuffer aStr; @@ -186,7 +186,7 @@ ByteString RscId::GetName() const |* RscDefine::RscDefine() |* *************************************************************************/ -RscDefine::RscDefine( sal_uLong lKey, const ByteString & rDefName, sal_Int32 lDefId ) +RscDefine::RscDefine( sal_uLong lKey, const rtl::OString& rDefName, sal_Int32 lDefId ) : StringNode( rDefName ) { nRefCount = 0; @@ -195,7 +195,7 @@ RscDefine::RscDefine( sal_uLong lKey, const ByteString & rDefName, sal_Int32 lDe pExp = NULL; } -RscDefine::RscDefine( sal_uLong lKey, const ByteString & rDefName, +RscDefine::RscDefine( sal_uLong lKey, const rtl::OString& rDefName, RscExpression * pExpression ) : StringNode( rDefName ) { @@ -270,7 +270,7 @@ RscDefine * RscDefine::Search( const char * pStr ){ |* RscDefine::GetMacro() |* *************************************************************************/ -ByteString RscDefine::GetMacro() +rtl::OString RscDefine::GetMacro() { if( pExp ) return pExp->GetMacro(); @@ -283,7 +283,7 @@ ByteString RscDefine::GetMacro() |* RscDefineList::New() |* *************************************************************************/ -RscDefine * RscDefineList::New( sal_uLong lFileKey, const ByteString & rDefName, +RscDefine * RscDefineList::New( sal_uLong lFileKey, const rtl::OString& rDefName, sal_Int32 lDefId, size_t lPos ) { RscDefine * pDef; @@ -301,7 +301,7 @@ RscDefine * RscDefineList::New( sal_uLong lFileKey, const ByteString & rDefName, return pDef; } -RscDefine * RscDefineList::New( sal_uLong lFileKey, const ByteString & rDefName, +RscDefine * RscDefineList::New( sal_uLong lFileKey, const rtl::OString& rDefName, RscExpression * pExpression, size_t lPos ) { RscDefine * pDef; @@ -339,8 +339,8 @@ void RscDefineList::WriteAll( FILE * fOutput ) for ( size_t i = 0, n = maList.size(); i < n; ++i ) { RscDefine* pDefEle = maList[ i ]; fprintf( fOutput, "#define %s %s\n", - pDefEle->GetName().GetBuffer(), - pDefEle->GetMacro().GetBuffer() + pDefEle->GetName().getStr(), + pDefEle->GetMacro().getStr() ); }; } @@ -452,7 +452,7 @@ sal_Bool RscExpression::Evaluate( sal_Int32 * plValue ){ |* RscExpression::GetMacro() |* *************************************************************************/ -ByteString RscExpression::GetMacro() +rtl::OString RscExpression::GetMacro() { rtl::OStringBuffer aLeft; @@ -778,7 +778,7 @@ sal_Bool RscFileTab::TestDef( sal_uLong lFileKey, size_t lPos, |* RscFileTab::NewDef() |* *************************************************************************/ -RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const ByteString & rDefName, +RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const rtl::OString& rDefName, sal_Int32 lId, sal_uLong lPos ) { RscDefine * pDef = FindDef( rDefName ); @@ -802,7 +802,7 @@ RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const ByteString & rDefName, |* RscFileTab::NewDef() |* *************************************************************************/ -RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const ByteString & rDefName, +RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const rtl::OString& rDefName, RscExpression * pExp, sal_uLong lPos ) { RscDefine * pDef = FindDef( rDefName ); diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx index c4546077f87b..70ef44138f0b 100644 --- a/rsc/source/tools/rsctools.cxx +++ b/rsc/source/tools/rsctools.cxx @@ -119,7 +119,7 @@ char* rsc_strdup( const char* pStr ) |* malloc allokiert |* *************************************************************************/ -ByteString GetTmpFileName() +rtl::OString GetTmpFileName() { OUString aTmpURL, aTmpFile; osl_createTempFile( NULL, NULL, &aTmpURL.pData ); @@ -135,10 +135,10 @@ ByteString GetTmpFileName() /* */ /* Description : appends text files */ /********************************************************************/ -sal_Bool Append( FILE * fDest, ByteString aTmpFile ) +sal_Bool Append(FILE * fDest, const rtl::OString &rTmpFile) { #define MAX_BUF 4096 - FILE *fSource = fopen( aTmpFile.GetBuffer(), "rb" ); + FILE *fSource = fopen(rTmpFile.getStr(), "rb"); if( !fDest || !fSource ) { if( fSource ) @@ -161,11 +161,11 @@ sal_Bool Append( FILE * fDest, ByteString aTmpFile ) return sal_True; } -sal_Bool Append( ByteString aOutputSrs, ByteString aTmpFile ) +sal_Bool Append(const rtl::OString &rOutputSrs, const rtl::OString &rTmpFile) { - FILE * fDest = fopen( aOutputSrs.GetBuffer(), "ab" ); + FILE * fDest = fopen(rOutputSrs.getStr(), "ab"); - sal_Bool bRet = Append( fDest, aTmpFile ); + sal_Bool bRet = Append(fDest, rTmpFile); if( fDest ) fclose( fDest ); @@ -182,10 +182,10 @@ sal_Bool Append( ByteString aOutputSrs, ByteString aTmpFile ) |* pExt, die Extension des Ausgabenamens |* *************************************************************************/ -ByteString OutputFile ( ByteString aInput, const char * pExt ) +rtl::OString OutputFile(const rtl::OString &rInput, const char * pExt) { - UniString aUniInput( aInput, RTL_TEXTENCODING_ASCII_US ); - DirEntry aFileName( aUniInput ); + rtl::OUString aUniInput(rtl::OStringToOUString(rInput, RTL_TEXTENCODING_ASCII_US)); + DirEntry aFileName(aUniInput); UniString aExt( pExt, RTL_TEXTENCODING_ASCII_US ); aFileName.SetExtension( aExt ); diff --git a/rsc/source/tools/rsctree.cxx b/rsc/source/tools/rsctree.cxx index 75315369c12b..14f6a089507e 100644 --- a/rsc/source/tools/rsctree.cxx +++ b/rsc/source/tools/rsctree.cxx @@ -415,8 +415,8 @@ StringNode * StringNode::Search( const char * pSearch ) const{ *************************************************************************/ COMPARE StringNode::Compare( const NameNode * pSearch ) const { - int nCmp = strcmp( aName.GetBuffer(), - ((const StringNode *)pSearch)->aName.GetBuffer() ); + int nCmp = strcmp( m_aName.getStr(), + ((const StringNode *)pSearch)->m_aName.getStr() ); if( nCmp < 0 ) return LESS; else if( nCmp > 0 ) @@ -428,7 +428,7 @@ COMPARE StringNode::Compare( const NameNode * pSearch ) const COMPARE StringNode::Compare( const void * pSearch ) const { // pSearch ist ein Zeiger auf const char * - int nCmp = strcmp( aName.GetBuffer(), (const char *)pSearch ); + int nCmp = strcmp( m_aName.getStr(), (const char *)pSearch ); if( nCmp < 0 ) return LESS; -- cgit