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
c8f876b2
Kaydet (Commit)
c8f876b2
authored
Haz 15, 2011
tarafından
Francois Tigeot
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
We don't want to create MS-DOS short file names.
üst
454d8d65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
149 deletions
+0
-149
dirent.cxx
tools/source/fsys/dirent.cxx
+0
-149
No files found.
tools/source/fsys/dirent.cxx
Dosyayı görüntüle @
c8f876b2
...
...
@@ -662,7 +662,6 @@ DirEntry::DirEntry( const String& rInitName, FSysPathStyle eStyle )
}
#ifdef DBG_UTIL
// ASF nur bei Default eStyle, nicht z.B. aus MakeShortName()
if
(
eStyle
==
FSYS_STYLE_HOST
&&
aTmpName
.
Search
(
"://"
)
!=
STRING_NOTFOUND
)
{
...
...
@@ -709,7 +708,6 @@ DirEntry::DirEntry( const ByteString& rInitName, FSysPathStyle eStyle )
}
#ifdef DBG_UTIL
else
// ASF nur bei Default eStyle, nicht z.B. aus MakeShortName()
if
(
eStyle
==
FSYS_STYLE_HOST
&&
rInitName
.
Search
(
"://"
)
!=
STRING_NOTFOUND
)
{
...
...
@@ -1844,37 +1842,6 @@ FSysError DirEntry::ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eSt
return
FSYS_ERR_OK
;
}
/*************************************************************************
|*
|* DirEntry::MakeShortName()
|*
*************************************************************************/
ErrCode
CreateEntry_Impl
(
const
DirEntry
&
rPath
,
DirEntryKind
eKind
)
{
// versuchen, anzulegen (ausser bei FSYS_KIND_ALL)
ErrCode
eErr
=
ERRCODE_NONE
;
if
(
FSYS_KIND_FILE
==
eKind
)
{
SvFileStream
aStream
(
rPath
.
GetFull
(),
STREAM_STD_WRITE
);
aStream
.
WriteLine
(
""
);
eErr
=
aStream
.
GetError
();
}
else
if
(
FSYS_KIND_ALL
!=
eKind
)
eErr
=
rPath
.
MakeDir
()
?
ERRCODE_NONE
:
ERRCODE_IO_UNKNOWN
;
// erfolgreich?
if
(
!
rPath
.
Exists
()
)
eErr
=
ERRCODE_IO_UNKNOWN
;
// Doch was schiefgegangen ?
// ggf. wieder l"oschen
if
(
FSYS_KIND_NONE
==
eKind
)
rPath
.
Kill
();
// Fehlercode zur?ckliefern
return
eErr
;
}
sal_Bool
IsValidEntry_Impl
(
const
DirEntry
&
rPath
,
const
String
&
rLongName
,
DirEntryKind
eKind
,
...
...
@@ -1921,122 +1888,6 @@ sal_Bool IsValidEntry_Impl( const DirEntry &rPath,
#define MAX_LEN_MAX 255
#define INVALID_CHARS_DEF "\\/\"':|^<>?*"
sal_Bool
DirEntry
::
MakeShortName
(
const
String
&
rLongName
,
DirEntryKind
eKind
,
sal_Bool
bUseDelim
,
FSysPathStyle
eStyle
)
{
String
aLongName
(
rLongName
);
// Alle '#' aus den Dateinamen entfernen, weil das INetURLObject
// damit Probleme hat. Siehe auch #51246#
aLongName
.
EraseAllChars
(
'#'
);
ByteString
bLongName
(
aLongName
,
osl_getThreadTextEncoding
());
// Auf Novell-Servern (wegen der rottigen Clients) nur 7bit ASCII
// bei FSYS_KIND_ALL den alten Namen merken und abh"angen (rename)
ByteString
aOldName
;
if
(
FSYS_KIND_ALL
==
eKind
)
{
aOldName
=
ByteString
(
CutName
(),
osl_getThreadTextEncoding
());
aOldName
=
CMP_LOWER
(
aOldName
);
}
// ist der Langname direkt verwendbar?
if
(
IsValidEntry_Impl
(
*
this
,
aLongName
,
eKind
,
sal_False
,
bUseDelim
)
)
{
operator
+=
(
DirEntry
(
aLongName
)
);
return
sal_True
;
}
// max L"angen feststellen
sal_uInt16
nMaxExt
,
nMaxLen
;
if
(
FSYS_STYLE_DETECT
==
eStyle
)
eStyle
=
DirEntry
::
GetPathStyle
(
GetDevice
().
GetName
()
);
ByteString
aInvalidChars
;
nMaxExt
=
MAX_EXT_MAX
;
nMaxLen
=
MAX_LEN_MAX
;
aInvalidChars
=
INVALID_CHARS_DEF
;
// Extension abschneiden und kuerzen
ByteString
aExt
;
ByteString
aFName
=
bLongName
;
DirEntry
aUnparsed
;
aUnparsed
.
aName
=
bLongName
;
aExt
=
ByteString
(
aUnparsed
.
CutExtension
(),
osl_getThreadTextEncoding
());
aFName
=
aUnparsed
.
aName
;
if
(
aExt
.
Len
()
>
nMaxExt
)
{
char
c
=
aExt
.
GetChar
(
aExt
.
Len
()
-
1
);
aExt
.
Erase
(
nMaxExt
-
1
);
aExt
+=
c
;
}
// ausser auf einem FAT-System geh"ort die Extension zur
// Maxl"ange. Muss also vorher mit dem Punkt abgezogen werden.
nMaxLen
-=
(
aExt
.
Len
()
+
1
);
// Name k"urzen
ByteString
aSName
;
for
(
const
char
*
pc
=
aFName
.
GetBuffer
();
aSName
.
Len
()
<
nMaxLen
&&
*
pc
;
++
pc
)
{
if
(
STRING_NOTFOUND
==
aInvalidChars
.
Search
(
*
pc
)
&&
(
unsigned
char
)
*
pc
>=
(
unsigned
char
)
32
&&
(
!
aSName
.
Len
()
||
*
pc
!=
' '
||
aSName
.
GetChar
(
aSName
.
Len
()
-
1
)
!=
' '
)
)
aSName
+=
*
pc
;
}
aSName
.
EraseTrailingChars
();
// HRO: #74246# Also cut leading spaces
aSName
.
EraseLeadingChars
();
if
(
!
aSName
.
Len
()
)
aSName
=
"noname"
;
// kommt dabei der alte Name raus?
ByteString
aNewName
=
aSName
;
if
(
aExt
.
Len
()
)
(
aNewName
+=
'.'
)
+=
aExt
;
operator
+=
(
DirEntry
(
String
(
aNewName
,
osl_getThreadTextEncoding
()))
);
if
(
FSYS_KIND_ALL
==
eKind
&&
CMP_LOWER
(
aName
)
==
aOldName
)
if
(
FSYS_KIND_ALL
==
eKind
&&
CMP_LOWER
(
ByteString
(
GetName
(),
osl_getThreadTextEncoding
()))
==
aOldName
)
return
sal_True
;
// kann der gek"urzte Name direkt verwendet werden?
if
(
!
Exists
()
&&
(
ERRCODE_NONE
==
CreateEntry_Impl
(
*
this
,
eKind
))
)
return
sal_True
;
// darf '?##' verwendet werden, um eindeutigen Name zu erzeugen?
if
(
bUseDelim
)
{
// eindeutigen Namen per '?##' erzeugen
aSName
.
Erase
(
nMaxLen
-
3
);
if
(
bUseDelim
!=
2
)
aSName
+=
FSYS_SHORTNAME_DELIMITER
;
for
(
int
n
=
1
;
n
<
99
;
++
n
)
{
// Name zusammensetzen
ByteString
aTmpStr
(
aSName
);
aTmpStr
+=
ByteString
::
CreateFromInt32
(
n
);
if
(
aExt
.
Len
()
)
(
aTmpStr
+=
'.'
)
+=
aExt
;
// noch nicht vorhanden?
SetName
(
String
(
aTmpStr
,
osl_getThreadTextEncoding
())
);
if
(
!
Exists
()
)
{
// Fehler setzen !!!
nError
=
CreateEntry_Impl
(
*
this
,
eKind
);
return
(
ERRCODE_NONE
==
nError
);
}
}
}
// keine ## mehr frei / ?## soll nicht verwendet werden
nError
=
ERRCODE_IO_ALREADYEXISTS
;
return
sal_False
;
}
/*************************************************************************
|*
|* DirEntry::CreatePath()
...
...
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