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