Kaydet (Commit) 2a2fbbec authored tarafından Caolán McNamara's avatar Caolán McNamara

ByteString->rtl::OString

üst d4d79be2
......@@ -223,13 +223,13 @@ friend class FileCopier;
#ifdef FEAT_FSYS_DOUBLESPEED
FileStat* pStat; // optional
#endif
ByteString aName;
rtl::OString aName;
DirEntry* pParent;
sal_uIntPtr nError;
DirEntryFlag eFlag;
private:
TOOLS_DLLPRIVATE DirEntry( const ByteString& rInitName,
TOOLS_DLLPRIVATE DirEntry( const rtl::OString& rInitName,
DirEntryFlag aDirFlag,
FSysPathStyle eStyle );
......@@ -237,13 +237,13 @@ private:
friend class FileStat;
friend const char* ImpCheckDirEntry( const void* p );
TOOLS_DLLPRIVATE FSysError ImpParseName( const ByteString& rIntiName,
TOOLS_DLLPRIVATE FSysError ImpParseName( const rtl::OString& rIntiName,
FSysPathStyle eParser );
#if defined(WNT)
TOOLS_DLLPRIVATE FSysError ImpParseOs2Name( const ByteString& rPfad,
TOOLS_DLLPRIVATE FSysError ImpParseOs2Name( const rtl::OString& rPfad,
FSysPathStyle eStyle );
#else
TOOLS_DLLPRIVATE FSysError ImpParseUnixName( const ByteString& rPfad,
TOOLS_DLLPRIVATE FSysError ImpParseUnixName( const rtl::OString& rPfad,
FSysPathStyle eStyle );
#endif
TOOLS_DLLPRIVATE const DirEntry* ImpGetTopPtr() const;
......@@ -251,7 +251,7 @@ private:
protected:
void ImpTrim( FSysPathStyle eStyle );
const ByteString& ImpTheName() const;
const rtl::OString& ImpTheName() const;
DirEntryFlag ImpTheFlag() const { return eFlag; };
DirEntry* ImpChangeParent( DirEntry* pNewParent, sal_Bool bNormalize = sal_True );
DirEntry* ImpGetParent() { return pParent; }
......@@ -266,7 +266,7 @@ protected:
public:
DirEntry( DirEntryFlag aDirFlag = FSYS_FLAG_CURRENT );
DirEntry( const DirEntry& rEntry );
DirEntry( const ByteString& rInitName,
DirEntry( const rtl::OString& rInitName,
FSysPathStyle eParser = FSYS_STYLE_HOST );
DirEntry( const String& rInitName,
FSysPathStyle eParser = FSYS_STYLE_HOST );
......@@ -323,16 +323,16 @@ public:
sal_Bool operator !=( const DirEntry& rAnotherDir ) const
{ return !(DirEntry::operator==( rAnotherDir )); }
inline StringCompare NameCompareDirect( const DirEntry &rWith ) const
{
inline sal_Int32 NameCompareDirect( const DirEntry &rWith ) const
{
#ifdef UNX
return rWith.aName.CompareTo( aName );
return rWith.aName.compareTo(aName);
#else
rtl::OString aThis(rtl::OString(aName).toAsciiLowerCase());
rtl::OString aWith(rtl::OString(rWith.aName).toAsciiLowerCase());
return static_cast<StringCompare>(aWith.compareTo(aThis));
rtl::OString aThis(rtl::OString(aName).toAsciiLowerCase());
rtl::OString aWith(rtl::OString(rWith.aName).toAsciiLowerCase());
return aWith.compareTo(aThis);
#endif
}
}
static String GetAccessDelimiter( FSysPathStyle eFormatter = FSYS_STYLE_HOST );
static String GetSearchDelimiter( FSysPathStyle eFormatter = FSYS_STYLE_HOST );
......
......@@ -64,7 +64,7 @@ struct DirReader_Impl
dirent* pDosEntry;
DirEntry* pParent;
String aPath;
ByteString aBypass;
rtl::OString aBypass;
sal_Bool bReady;
sal_Bool bInUse;
......@@ -86,8 +86,8 @@ struct DirReader_Impl
#if defined(UNX) //for further eplanation see DirReader_Impl::Read() in unx.cxx
pDosDir = NULL;
#else
aBypass = ByteString(aPath, osl_getThreadTextEncoding());
pDosDir = opendir( (char*) aBypass.GetBuffer() );
aBypass = rtl::OUStringToOString(aPath, osl_getThreadTextEncoding());
pDosDir = opendir( aBypass.getStr() );
#endif
// Parent f"ur die neuen DirEntries ermitteln
......
This diff is collapsed.
......@@ -270,14 +270,14 @@ FSysError FileCopier::DoCopy_Impl(
if ( FSYS_ERR_OK == ERRCODE_TOERROR(eRet) )
{
WIN32_FIND_DATA fdSource;
ByteString aFullSource(aSource.GetFull(), osl_getThreadTextEncoding());
ByteString aFullTarget(aTgt.GetFull(), osl_getThreadTextEncoding());
HANDLE hFind = FindFirstFile( aFullSource.GetBuffer() , &fdSource );
rtl::OString aFullSource(rtl::OUStringToOString(aSource.GetFull(), osl_getThreadTextEncoding()));
rtl::OString aFullTarget(rtl::OUStringToOString(aTgt.GetFull(), osl_getThreadTextEncoding()));
HANDLE hFind = FindFirstFile( aFullSource.getStr() , &fdSource );
if ( hFind != INVALID_HANDLE_VALUE )
{
FindClose( hFind );
HANDLE hFile = CreateFile( aFullTarget.GetBuffer(), GENERIC_WRITE,
HANDLE hFile = CreateFile( aFullTarget.getStr(), GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
......@@ -287,7 +287,7 @@ FSysError FileCopier::DoCopy_Impl(
CloseHandle( hFile );
}
SetFileAttributes( aFullTarget.GetBuffer(), fdSource.dwFileAttributes );
SetFileAttributes( aFullTarget.getStr(), fdSource.dwFileAttributes );
}
}
#endif
......
......@@ -140,16 +140,15 @@ sal_Bool FileStat::IsKind( DirEntryKind nKind ) const
sal_Bool FileStat::GetReadOnlyFlag( const DirEntry &rEntry )
{
ByteString aFPath(rEntry.GetFull(), osl_getThreadTextEncoding());
rtl::OString aFPath(rtl::OUStringToOString(rEntry.GetFull(), osl_getThreadTextEncoding()));
#if defined WNT
DWORD nRes = GetFileAttributes( (LPCTSTR) aFPath.GetBuffer() );
DWORD nRes = GetFileAttributes( (LPCTSTR) aFPath.getStr() );
return ULONG_MAX != nRes &&
( FILE_ATTRIBUTE_READONLY & nRes ) == FILE_ATTRIBUTE_READONLY;
#elif defined UNX
/* could we stat the object? */
struct stat aBuf;
if (stat(aFPath.GetBuffer(), &aBuf))
if (stat(aFPath.getStr(), &aBuf))
return sal_False;
/* jupp, is writable for user? */
return((aBuf.st_mode & S_IWUSR) != S_IWUSR);
......@@ -167,19 +166,19 @@ sal_Bool FileStat::GetReadOnlyFlag( const DirEntry &rEntry )
sal_uIntPtr FileStat::SetReadOnlyFlag( const DirEntry &rEntry, sal_Bool bRO )
{
ByteString aFPath(rEntry.GetFull(), osl_getThreadTextEncoding());
rtl::OString aFPath(rtl::OUStringToOString(rEntry.GetFull(), osl_getThreadTextEncoding()));
#if defined WNT
DWORD nRes = GetFileAttributes( (LPCTSTR) aFPath.GetBuffer() );
DWORD nRes = GetFileAttributes( (LPCTSTR) aFPath.getStr() );
if ( ULONG_MAX != nRes )
nRes = SetFileAttributes( (LPCTSTR) aFPath.GetBuffer(),
nRes = SetFileAttributes( (LPCTSTR) aFPath.getStr(),
( nRes & ~FILE_ATTRIBUTE_READONLY ) |
( bRO ? FILE_ATTRIBUTE_READONLY : 0 ) );
return ( ULONG_MAX == nRes ) ? ERRCODE_IO_UNKNOWN : 0;
#elif defined UNX
/* first, stat the object to get permissions */
struct stat aBuf;
if (stat(aFPath.GetBuffer(), &aBuf))
if (stat(aFPath.getStr(), &aBuf))
return ERRCODE_IO_NOTEXISTS;
/* set or clear write bit for user */
mode_t nMode;
......@@ -192,7 +191,7 @@ sal_uIntPtr FileStat::SetReadOnlyFlag( const DirEntry &rEntry, sal_Bool bRO )
else
nMode = aBuf.st_mode | S_IWUSR;
/* change it on fs */
if (chmod(aFPath.GetBuffer(), nMode))
if (chmod(aFPath.getStr(), nMode))
{
switch (errno)
{
......
......@@ -247,15 +247,14 @@ void Dir::Construct( DirEntryKind nKindFlags )
pSortLst = NULL;
pStatLst = NULL;
eAttrMask = nKindFlags;
ByteString aTempName( GetName(), osl_getThreadTextEncoding() );
if ( aTempName.Search( "*" ) != STRING_NOTFOUND ||
aTempName.Search( "?" ) != STRING_NOTFOUND )
rtl::OString aTempName(rtl::OUStringToOString(GetName(), osl_getThreadTextEncoding()));
if (aTempName.indexOf('*') != -1 || aTempName.indexOf('?') != -1)
{
#if defined( WNT )
ByteString aTStr(CutName(), osl_getThreadTextEncoding());
char* pBuffer = new char[aTStr.Len()+1];
strcpy( pBuffer, aTStr.GetBuffer() );
CharLowerBuff( pBuffer, aTStr.Len() );
rtl::OString aTStr(rtl::OUStringToOString(CutName(), osl_getThreadTextEncoding()));
char* pBuffer = new char[aTStr.getLength()+1];
strcpy( pBuffer, aTStr.getStr() );
CharLowerBuff( pBuffer, aTStr.getLength() );
aNameMask = WildCard( String(pBuffer, osl_getThreadTextEncoding()), ';' );
delete [] pBuffer;
#else
......
......@@ -206,7 +206,7 @@ sal_Bool DirEntry::SetCWD( sal_Bool bSloppy ) const
FSysFailOnErrorImpl();
if ( eFlag == FSYS_FLAG_CURRENT && !aName.Len() )
if ( eFlag == FSYS_FLAG_CURRENT && !aName.getLength() )
return sal_True;
if ( SetCurrentDirectory(rtl::OUStringToOString(GetFull(), osl_getThreadTextEncoding()).getStr()) )
......@@ -659,7 +659,7 @@ sal_Bool FileStat::Update( const DirEntry& rDirEntry, sal_Bool bForceAccess )
// Sonderbehandlung falls es sich um eine Root ohne Laufwerk handelt
if ( !rDirEntry.aName.Len() && rDirEntry.eFlag == FSYS_FLAG_ABSROOT )
if ( !rDirEntry.aName.getLength() && rDirEntry.eFlag == FSYS_FLAG_ABSROOT )
{
nKindFlags = FSYS_KIND_DIR;
nError = FSYS_ERR_OK;
......@@ -701,7 +701,7 @@ sal_Bool FileStat::Update( const DirEntry& rDirEntry, sal_Bool bForceAccess )
aDirEntry.eFlag == FSYS_FLAG_ABSROOT )
{
if ( aDirEntry.eFlag == FSYS_FLAG_VOLUME )
nKindFlags = FSYS_KIND_DEV | ( aDirEntry.aName.Len() == 2
nKindFlags = FSYS_KIND_DEV | ( aDirEntry.aName.getLength() == 2
? FSYS_KIND_BLOCK
: FSYS_KIND_CHAR );
else
......@@ -781,7 +781,7 @@ sal_Bool FileStat::Update( const DirEntry& rDirEntry, sal_Bool bForceAccess )
// UNC-Volume?
DirEntry *pTop = aAbsEntry.ImpGetTopPtr();
if ( pTop->GetFlag() == FSYS_FLAG_ABSROOT &&
( pTop->aName.Len() > 1 && (pTop->aName.GetBuffer()[1] != ':' )) )
( pTop->aName.getLength() > 1 && (pTop->aName[1] != ':' )) )
{
if ( bForceAccess )
{
......
......@@ -70,7 +70,7 @@ typedef struct
#define PATHDELIMITER ";"
#define DEFSTYLE FSYS_STYLE_NTFS
#define MKDIR( p ) mkdir( p )
#define CMP_LOWER(s) ( ByteString(s).ToLowerAscii() )
#define CMP_LOWER(s) ( s.toAsciiLowerCase() )
#define START_DRV 'a'
......
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