summaryrefslogtreecommitdiff
path: root/l10ntools/source/cfgmerge.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-30 20:44:22 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-31 11:37:24 +0000
commitb8b1b1d68351765bbafe331a95909e47c661b664 (patch)
treef746c4a52fa5c9e5706c6073443f08e40bffee2e /l10ntools/source/cfgmerge.cxx
parentc1d04217e87e175017898f918cd77fe6529ec0da (diff)
ByteString->rtl::OString
Diffstat (limited to 'l10ntools/source/cfgmerge.cxx')
-rw-r--r--l10ntools/source/cfgmerge.cxx33
1 files changed, 14 insertions, 19 deletions
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index 30c894228bcb..13cf715ba1f7 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -38,8 +38,8 @@
using comphelper::string::getToken;
-extern "C" { int yyerror( char * ); }
-extern "C" { int YYWarning( char * ); }
+extern "C" { int yyerror(const char *); }
+extern "C" { int YYWarning(const char *); }
// defines to parse command line
#define STATE_NON 0x0001
@@ -63,7 +63,7 @@ ByteString sPrj;
ByteString sPrjRoot;
ByteString sInputFileName;
ByteString sActFileName;
-ByteString sFullEntry;
+rtl::OString sFullEntry;
rtl::OString sOutputFile;
rtl::OString sMergeSrc;
String sUsedTempFile;
@@ -240,8 +240,8 @@ extern FILE *GetCfgFile()
// create file name, beginnig with project root
// (e.g.: source\ui\src\menue.src)
-// printf("sFullEntry = %s\n",sFullEntry.GetBuffer());
- sActFileName = sFullEntry.Copy( sPrjEntry.getLength() + 1 );
+// printf("sFullEntry = %s\n",sFullEntry.getStr());
+ sActFileName = sFullEntry.copy(sPrjEntry.getLength() + 1);
// printf("sActFileName = %s\n",sActFileName.GetBuffer());
sActFileName.SearchAndReplaceAll( "/", "\\" );
@@ -552,34 +552,29 @@ int CfgParser::Execute( int nToken, char * pToken )
return ExecuteAnalyzedToken( nToken, pToken );
}
-
-/*****************************************************************************/
-void CfgParser::Error( const ByteString &rError )
-/*****************************************************************************/
+void CfgParser::Error(const rtl::OString& rError)
{
- yyerror(( char * ) rError.GetBuffer());
+ yyerror(rError.getStr());
}
-
//
// class CfgOutputParser
//
-/*****************************************************************************/
-CfgOutputParser::CfgOutputParser( const ByteString &rOutputFile )
-/*****************************************************************************/
+CfgOutputParser::CfgOutputParser(const rtl::OString &rOutputFile)
{
pOutputStream =
new SvFileStream(
- String( rOutputFile, RTL_TEXTENCODING_ASCII_US ),
+ rtl::OStringToOUString(rOutputFile, RTL_TEXTENCODING_ASCII_US),
STREAM_STD_WRITE | STREAM_TRUNC
);
pOutputStream->SetStreamCharSet( RTL_TEXTENCODING_UTF8 );
- if ( !pOutputStream->IsOpen()) {
- ByteString sError( "ERROR: Unable to open output file: " );
- sError += rOutputFile;
- Error( sError );
+ if ( !pOutputStream->IsOpen())
+ {
+ rtl::OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("ERROR: Unable to open output file: "));
+ sError.append(rOutputFile);
+ Error(sError.makeStringAndClear());
delete pOutputStream;
pOutputStream = NULL;
exit( -13 );