ByteString->rtl::OString[Buffer]

This commit is contained in:
Caolán McNamara 2011-09-19 23:44:54 +01:00
parent 512c562b86
commit 557ba43663
5 changed files with 20 additions and 17 deletions

View file

@ -66,7 +66,7 @@ public:
SvToken & operator = ( const SvToken & rObj );
ByteString GetTokenAsString() const;
rtl::OString GetTokenAsString() const;
SVTOKEN_ENUM GetType() const { return nType; }
void SetLine( sal_uLong nLineP ) { nLine = nLineP; }

View file

@ -245,7 +245,7 @@ public:
void WriteTypePrefix( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab, WriteType );
void WriteMethodArgs( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab, WriteType );
void WriteTheType( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab, WriteType );
ByteString GetParserString() const;
rtl::OString GetParserString() const;
void WriteParamNames( SvIdlDataBase & rBase, SvStream & rOutStm,
const ByteString & rChief );
#endif

View file

@ -38,9 +38,9 @@
#include <globals.hxx>
#include <tools/bigint.hxx>
ByteString SvToken::GetTokenAsString() const
rtl::OString SvToken::GetTokenAsString() const
{
ByteString aStr;
rtl::OString aStr;
switch( nType )
{
case SVTOKEN_EMPTY:
@ -61,7 +61,7 @@ ByteString SvToken::GetTokenAsString() const
aStr = aString;
break;
case SVTOKEN_CHAR:
aStr = cChar;
aStr = rtl::OString(cChar);
break;
case SVTOKEN_RTTIBASE:
aStr = "RTTIBASE";

View file

@ -1699,14 +1699,14 @@ void SvMetaType::WriteTheType( SvIdlDataBase & rBase, SvStream & rOutStm,
WriteMethodArgs( rBase, rOutStm, nTab +2, nT );
}
ByteString SvMetaType::GetParserString() const
rtl::OString SvMetaType::GetParserString() const
{
SvMetaType * pBT = GetBaseType();
if( pBT != this )
return pBT->GetParserString();
int type = GetType();
ByteString aPStr;
rtl::OString aPStr;
if( TYPE_METHOD == type || TYPE_STRUCT == type )
{
@ -1719,7 +1719,7 @@ ByteString SvMetaType::GetParserString() const
}
}
else
aPStr = GetParserChar();
aPStr = rtl::OString(GetParserChar());
return aPStr;
}

View file

@ -311,32 +311,35 @@ sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName )
else if( pTok->Is( SvHash_include() ) )
{
pTok = aTokStm.GetToken_Next();
ByteString aName;
rtl::OStringBuffer aName;
if( pTok->IsString() )
aName = pTok->GetString();
aName.append(pTok->GetString());
else if( pTok->IsChar() && pTok->GetChar() == '<' )
{
pTok = aTokStm.GetToken_Next();
while( !pTok->IsEof()
&& !(pTok->IsChar() && pTok->GetChar() == '>') )
{
aName += pTok->GetTokenAsString();
aName.append(pTok->GetTokenAsString());
pTok = aTokStm.GetToken_Next();
}
if( pTok->IsEof() )
{
ByteString aStr( "unexpected eof in #include" );
rtl::OString aStr(RTL_CONSTASCII_STRINGPARAM(
"unexpected eof in #include"));
// set error
SetError( aStr, pTok );
SetError(aStr, pTok);
WriteError( aTokStm );
return sal_False;
}
}
if( !ReadIdFile( String::CreateFromAscii(aName.GetBuffer()) ) )
if (!ReadIdFile(rtl::OStringToOUString(aName.toString(),
RTL_TEXTENCODING_ASCII_US)))
{
ByteString aStr = "cannot read file: ";
aStr += aName;
SetError( aStr, pTok );
rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
"cannot read file: "));
aStr.append(aName);
SetError(aStr.makeStringAndClear(), pTok);
WriteError( aTokStm );
return sal_False;
}