Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
2a2fbbec
Kaydet (Commit)
2a2fbbec
authored
Kas 21, 2011
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ByteString->rtl::OString
üst
d4d79be2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
43 deletions
+41
-43
fsys.hxx
tools/inc/tools/fsys.hxx
+14
-14
comdep.hxx
tools/source/fsys/comdep.hxx
+3
-3
dirent.cxx
tools/source/fsys/dirent.cxx
+0
-0
filecopy.cxx
tools/source/fsys/filecopy.cxx
+5
-5
fstat.cxx
tools/source/fsys/fstat.cxx
+8
-9
tdir.cxx
tools/source/fsys/tdir.cxx
+6
-7
wntmsc.cxx
tools/source/fsys/wntmsc.cxx
+4
-4
wntmsc.hxx
tools/source/fsys/wntmsc.hxx
+1
-1
No files found.
tools/inc/tools/fsys.hxx
Dosyayı görüntüle @
2a2fbbec
...
...
@@ -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
Byte
String
&
rInitName
,
TOOLS_DLLPRIVATE
DirEntry
(
const
rtl
::
O
String
&
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
Byte
String
&
rIntiName
,
TOOLS_DLLPRIVATE
FSysError
ImpParseName
(
const
rtl
::
O
String
&
rIntiName
,
FSysPathStyle
eParser
);
#if defined(WNT)
TOOLS_DLLPRIVATE
FSysError
ImpParseOs2Name
(
const
Byte
String
&
rPfad
,
TOOLS_DLLPRIVATE
FSysError
ImpParseOs2Name
(
const
rtl
::
O
String
&
rPfad
,
FSysPathStyle
eStyle
);
#else
TOOLS_DLLPRIVATE
FSysError
ImpParseUnixName
(
const
Byte
String
&
rPfad
,
TOOLS_DLLPRIVATE
FSysError
ImpParseUnixName
(
const
rtl
::
O
String
&
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
Byte
String
&
rInitName
,
DirEntry
(
const
rtl
::
O
String
&
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
);
...
...
tools/source/fsys/comdep.hxx
Dosyayı görüntüle @
2a2fbbec
...
...
@@ -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
=
Byte
String
(
aPath
,
osl_getThreadTextEncoding
());
pDosDir
=
opendir
(
(
char
*
)
aBypass
.
GetBuffe
r
()
);
aBypass
=
rtl
::
OUStringToO
String
(
aPath
,
osl_getThreadTextEncoding
());
pDosDir
=
opendir
(
aBypass
.
getSt
r
()
);
#endif
// Parent f"ur die neuen DirEntries ermitteln
...
...
tools/source/fsys/dirent.cxx
Dosyayı görüntüle @
2a2fbbec
This diff is collapsed.
Click to expand it.
tools/source/fsys/filecopy.cxx
Dosyayı görüntüle @
2a2fbbec
...
...
@@ -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
.
GetBuffe
r
()
,
&
fdSource
);
rtl
::
OString
aFullSource
(
rtl
::
OUStringToOString
(
aSource
.
GetFull
(),
osl_getThreadTextEncoding
()
));
rtl
::
OString
aFullTarget
(
rtl
::
OUStringToOString
(
aTgt
.
GetFull
(),
osl_getThreadTextEncoding
()
));
HANDLE
hFind
=
FindFirstFile
(
aFullSource
.
getSt
r
()
,
&
fdSource
);
if
(
hFind
!=
INVALID_HANDLE_VALUE
)
{
FindClose
(
hFind
);
HANDLE
hFile
=
CreateFile
(
aFullTarget
.
GetBuffe
r
(),
GENERIC_WRITE
,
HANDLE
hFile
=
CreateFile
(
aFullTarget
.
getSt
r
(),
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
.
GetBuffe
r
(),
fdSource
.
dwFileAttributes
);
SetFileAttributes
(
aFullTarget
.
getSt
r
(),
fdSource
.
dwFileAttributes
);
}
}
#endif
...
...
tools/source/fsys/fstat.cxx
Dosyayı görüntüle @
2a2fbbec
...
...
@@ -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
.
GetBuffe
r
()
);
DWORD
nRes
=
GetFileAttributes
(
(
LPCTSTR
)
aFPath
.
getSt
r
()
);
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
.
GetBuffe
r
(),
&
aBuf
))
if
(
stat
(
aFPath
.
getSt
r
(),
&
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
.
GetBuffe
r
()
);
DWORD
nRes
=
GetFileAttributes
(
(
LPCTSTR
)
aFPath
.
getSt
r
()
);
if
(
ULONG_MAX
!=
nRes
)
nRes
=
SetFileAttributes
(
(
LPCTSTR
)
aFPath
.
GetBuffe
r
(),
nRes
=
SetFileAttributes
(
(
LPCTSTR
)
aFPath
.
getSt
r
(),
(
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
.
GetBuffe
r
(),
&
aBuf
))
if
(
stat
(
aFPath
.
getSt
r
(),
&
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
.
GetBuffe
r
(),
nMode
))
if
(
chmod
(
aFPath
.
getSt
r
(),
nMode
))
{
switch
(
errno
)
{
...
...
tools/source/fsys/tdir.cxx
Dosyayı görüntüle @
2a2fbbec
...
...
@@ -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
.
GetBuffe
r
()
);
CharLowerBuff
(
pBuffer
,
aTStr
.
Len
()
);
rtl
::
OString
aTStr
(
rtl
::
OUStringToOString
(
CutName
(),
osl_getThreadTextEncoding
()
));
char
*
pBuffer
=
new
char
[
aTStr
.
getLength
()
+
1
];
strcpy
(
pBuffer
,
aTStr
.
getSt
r
()
);
CharLowerBuff
(
pBuffer
,
aTStr
.
getLength
()
);
aNameMask
=
WildCard
(
String
(
pBuffer
,
osl_getThreadTextEncoding
()),
';'
);
delete
[]
pBuffer
;
#else
...
...
tools/source/fsys/wntmsc.cxx
Dosyayı görüntüle @
2a2fbbec
...
...
@@ -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
)
{
...
...
tools/source/fsys/wntmsc.hxx
Dosyayı görüntüle @
2a2fbbec
...
...
@@ -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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment