summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-12-06 23:32:42 +0000
committerEike Rathke <erack@redhat.com>2011-12-07 17:19:51 +0100
commitc10cd312cd6e08ec9ff69cff990f5b3ee5bc2259 (patch)
tree0675cec9a753f0e9286572cd710f34b71d4165f3 /tools
parent24960ac1ac34cbe220c2568a1f8535e1bd47a1cd (diff)
ditch some ByteStrings
Diffstat (limited to 'tools')
-rw-r--r--tools/bootstrp/cppdep.cxx18
-rw-r--r--tools/bootstrp/cppdep.hxx4
-rw-r--r--tools/bootstrp/mkunroll/mkunroll.cxx18
-rw-r--r--tools/bootstrp/rscdep.cxx7
4 files changed, 23 insertions, 24 deletions
diff --git a/tools/bootstrp/cppdep.cxx b/tools/bootstrp/cppdep.cxx
index ea9179d2a071..c03a6a456bc0 100644
--- a/tools/bootstrp/cppdep.cxx
+++ b/tools/bootstrp/cppdep.cxx
@@ -67,17 +67,17 @@ sal_Bool CppDep::AddSource( const char* pSource )
return sal_False;
}
-sal_Bool CppDep::Search( ByteString aFileName )
+sal_Bool CppDep::Search(const rtl::OString &rFileName)
{
#ifdef DEBUG_VERBOSE
- fprintf( stderr, "SEARCH : %s\n", aFileName.GetBuffer());
+ fprintf( stderr, "SEARCH : %s\n", rFileName.getStr());
#endif
sal_Bool bRet = sal_False;
SvFileStream aFile;
rtl::OString aReadLine;
- UniString suFileName(aFileName, osl_getThreadTextEncoding());
+ UniString suFileName(rtl::OStringToOUString(rFileName, osl_getThreadTextEncoding()));
aFile.Open( suFileName, STREAM_READ );
while ( aFile.ReadLine( aReadLine ))
@@ -90,13 +90,13 @@ sal_Bool CppDep::Search( ByteString aFileName )
#ifdef DEBUG_VERBOSE
fprintf( stderr, "found : %d %s\n", nPos, aReadLine.getStr() );
#endif
- ByteString aResult = IsIncludeStatement( aReadLine );
+ rtl::OString aResult = IsIncludeStatement( aReadLine );
#ifdef DEBUG_VERBOSE
- fprintf( stderr, "Result : %s\n", aResult.GetBuffer() );
+ fprintf( stderr, "Result : %s\n", aResult.getStr() );
#endif
rtl::OString aNewFile;
- if ( aResult !="")
+ if (!aResult.isEmpty())
if ( (aNewFile = Exists( aResult )).getLength() )
{
sal_Bool bFound = sal_False;
@@ -126,12 +126,12 @@ sal_Bool CppDep::Search( ByteString aFileName )
return bRet;
}
-rtl::OString CppDep::Exists( rtl::OString aFileName )
+rtl::OString CppDep::Exists(const rtl::OString &rFileName)
{
char pFullName[1023];
#ifdef DEBUG_VERBOSE
- fprintf( stderr, "Searching %s \n", aFileName.getStr() );
+ fprintf( stderr, "Searching %s \n", rFileName.getStr() );
#endif
size_t nCount = m_aSearchPath.size();
@@ -142,7 +142,7 @@ rtl::OString CppDep::Exists( rtl::OString aFileName )
strcpy( pFullName, rPathName.getStr());
strcat( pFullName, DIR_SEP );
- strcat( pFullName, aFileName.getStr());
+ strcat( pFullName, rFileName.getStr());
#ifdef DEBUG_VERBOSE
fprintf( stderr, "looking for %s\t ", pFullName );
diff --git a/tools/bootstrp/cppdep.hxx b/tools/bootstrp/cppdep.hxx
index b60242790890..3ed2942d5e84 100644
--- a/tools/bootstrp/cppdep.hxx
+++ b/tools/bootstrp/cppdep.hxx
@@ -39,8 +39,8 @@ protected:
std::vector<rtl::OString> m_aFileList;
std::vector<rtl::OString> m_aSources;
- sal_Bool Search( ByteString aFileName );
- rtl::OString Exists( rtl::OString aFileName );
+ sal_Bool Search(const rtl::OString& rFileName);
+ rtl::OString Exists(const rtl::OString& rFileName);
rtl::OString IsIncludeStatement(rtl::OString aLine);
public:
diff --git a/tools/bootstrp/mkunroll/mkunroll.cxx b/tools/bootstrp/mkunroll/mkunroll.cxx
index 694645745658..d315af5b6305 100644
--- a/tools/bootstrp/mkunroll/mkunroll.cxx
+++ b/tools/bootstrp/mkunroll/mkunroll.cxx
@@ -38,26 +38,26 @@ protected:
FILE *pIn, *pOut;
virtual void Filter();
public:
- TextFilter( ByteString aInFile = "stdin",
- ByteString aOutFile = "stdout" );
+ TextFilter( rtl::OString aInFile = "stdin",
+ rtl::OString aOutFile = "stdout" );
virtual ~TextFilter();
virtual void Execute();
};
-TextFilter::TextFilter( ByteString aInFile, ByteString aOutFile )
+TextFilter::TextFilter( rtl::OString aInFile, rtl::OString aOutFile )
{
if ( aInFile == "stdin" )
pIn = stdin;
else
- if (( pIn = fopen( aInFile.GetBuffer(), "r" )) == NULL )
- printf( "Can't read %s\n", aInFile.GetBuffer() );
+ if (( pIn = fopen( aInFile.getStr(), "r" )) == NULL )
+ printf( "Can't read %s\n", aInFile.getStr() );
if ( aOutFile == "stdout" )
pOut = stdout;
else
- if (( pOut = fopen( aOutFile.GetBuffer(), "w" )) == NULL )
- printf( "Can't write %s\n", aOutFile.GetBuffer() );
+ if (( pOut = fopen( aOutFile.getStr(), "w" )) == NULL )
+ printf( "Can't write %s\n", aOutFile.getStr() );
}
TextFilter::~TextFilter()
@@ -110,11 +110,11 @@ class MkFilter : public TextFilter
protected:
virtual void Filter();
public:
- MkFilter( ByteString aInFile = "stdin", ByteString aOutFile = "stdout");
+ MkFilter( rtl::OString aInFile = "stdin", rtl::OString aOutFile = "stdout");
~MkFilter();
};
-MkFilter::MkFilter( ByteString aInFile, ByteString aOutFile ) :
+MkFilter::MkFilter( rtl::OString aInFile, rtl::OString aOutFile ) :
TextFilter( aInFile, aOutFile )
{
pLst = new ByteStringList;
diff --git a/tools/bootstrp/rscdep.cxx b/tools/bootstrp/rscdep.cxx
index eb6993e8498d..4afde22fae14 100644
--- a/tools/bootstrp/rscdep.cxx
+++ b/tools/bootstrp/rscdep.cxx
@@ -85,7 +85,7 @@ int main( int argc, char** argv )
char pSrsFileName[255];
String aSrsBaseName;
sal_Bool bSource = sal_False;
- ByteString aRespArg;
+ rtl::OStringBuffer aRespArg;
// who needs anything but '/' ?
sal_Char cDelim = '/';
@@ -155,8 +155,7 @@ int main( int argc, char** argv )
if (( aBuf2[0] != '-' ) && ( aBuf2[0] != '@' ))
{
pDep->AddSource( &aBuf2[0] );
- aRespArg += " ";
- aRespArg += &aBuf2[0];
+ aRespArg.append(' ').append(&aBuf2[0]);
bSource = sal_True;
}
}
@@ -239,7 +238,7 @@ int main( int argc, char** argv )
}
}
}
- aString.append(aRespArg);
+ aString.append(aRespArg.makeStringAndClear());
pDep->Execute();
std::vector<rtl::OString>& rLst = pDep->GetDepList();
size_t nCount = rLst.size();