Kaydet (Commit) 74500c21 authored tarafından Caolán McNamara's avatar Caolán McNamara

ByteString->rtl::OString

üst ca48cd4c
......@@ -146,11 +146,11 @@ class SvTokenStream
void InitCtor();
ByteString aBufStr;
rtl::OString aBufStr;
int GetNextChar();
int GetFastNextChar()
{
return aBufStr.GetChar((sal_uInt16)nBufPos++);
return aBufStr[nBufPos++];
}
void FillTokenList();
......@@ -171,7 +171,7 @@ class SvTokenStream
sal_uInt16 n = 0;
nColumn = 0;
while( n < nBufPos )
nColumn += aBufStr.GetChar(n++) == '\t' ? nTabSize : 1;
nColumn += aBufStr[n++] == '\t' ? nTabSize : 1;
}
}
public:
......
......@@ -165,7 +165,7 @@ void SvTokenStream::FillTokenList()
int SvTokenStream::GetNextChar()
{
int nChar;
if( (int)aBufStr.Len() < nBufPos )
if( aBufStr.getLength() < nBufPos )
{
if( rInStream.ReadLine( aBufStr ) )
{
......@@ -175,13 +175,13 @@ int SvTokenStream::GetNextChar()
}
else
{
aBufStr.Erase();
aBufStr = rtl::OString();
nColumn = 0;
nBufPos = 0;
return '\0';
}
}
nChar = aBufStr.GetChar( (sal_uInt16)nBufPos++ );
nChar = aBufStr[nBufPos++];
nColumn += nChar == '\t' ? nTabSize : 1;
return nChar;
}
......
......@@ -196,20 +196,20 @@ static sal_Bool ResponseFile( StringList * pList, int argc, char ** argv )
if( aStm.GetError() != SVSTREAM_OK )
return sal_False;
ByteString aStr;
rtl::OString aStr;
while( aStm.ReadLine( aStr ) )
{
sal_uInt16 n = 0;
sal_uInt16 nPos = 1;
while( n != nPos )
{
while( aStr.GetChar(n) && isspace( aStr.GetChar(n) ) )
while( aStr[n] && isspace( aStr[n] ) )
n++;
nPos = n;
while( aStr.GetChar(n) && !isspace( aStr.GetChar(n) ) )
while( aStr[n] && !isspace( aStr[n] ) )
n++;
if( n != nPos )
pList->push_back( new String( String::CreateFromAscii( aStr.Copy( nPos, n - nPos ).GetBuffer() ) ) );
pList->push_back( new String( rtl::OStringToOUString(aStr.copy(nPos, n - nPos), RTL_TEXTENCODING_ASCII_US) ) );
}
}
}
......
......@@ -96,18 +96,20 @@ sal_Bool CppDep::Search( ByteString aFileName )
sal_Bool bRet = sal_False;
SvFileStream aFile;
ByteString aReadLine;
rtl::OString aReadLine;
UniString suFileName(aFileName, osl_getThreadTextEncoding());
aFile.Open( suFileName, STREAM_READ );
while ( aFile.ReadLine( aReadLine ))
{
sal_uInt16 nPos = aReadLine.Search( "include" );
if ( nPos != STRING_NOTFOUND )
using comphelper::string::indexOfL;
sal_Int32 nPos = indexOfL(aReadLine,
RTL_CONSTASCII_STRINGPARAM("include"));
if ( nPos != -1 )
{
#ifdef DEBUG_VERBOSE
fprintf( stderr, "found : %d %s\n", nPos, aReadLine.GetBuffer() );
fprintf( stderr, "found : %d %s\n", nPos, aReadLine.getStr() );
#endif
ByteString aResult = IsIncludeStatement( aReadLine );
#ifdef DEBUG_VERBOSE
......@@ -127,7 +129,7 @@ sal_Bool CppDep::Search( ByteString aFileName )
bFound = sal_True;
}
#ifdef DEBUG_VERBOSE
fprintf( stderr, "not in list : %d %s\n", nPos, aReadLine.GetBuffer() );
fprintf( stderr, "not in list : %d %s\n", nPos, aReadLine.getStr() );
#endif
if ( !bFound )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment