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
a82f7b20
Kaydet (Commit)
a82f7b20
authored
Şub 26, 2013
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
port horrible tools temp directory abstraction to sal.
Change-Id: I3688c8babf7719091404317b13014283a8ce9492
üst
c607d643
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
60 deletions
+21
-60
dirent.cxx
tools/source/fsys/dirent.cxx
+7
-3
tempfile.cxx
tools/source/fsys/tempfile.cxx
+14
-20
unx.cxx
tools/source/fsys/unx.cxx
+0
-22
unx.hxx
tools/source/fsys/unx.hxx
+0
-2
wntmsc.cxx
tools/source/fsys/wntmsc.cxx
+0
-11
wntmsc.hxx
tools/source/fsys/wntmsc.hxx
+0
-2
No files found.
tools/source/fsys/dirent.cxx
Dosyayı görüntüle @
a82f7b20
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
using
namespace
osl
;
using
namespace
osl
;
using
::
rtl
::
OUString
;
using
::
rtl
::
OUString
;
int
ApiRet2ToSolarError_Impl
(
int
nApiRet
);
extern
rtl
::
OUString
GetSystemTempDirPath_Impl
(
);
int
Sys2SolarError_Impl
(
int
nSysErr
)
int
Sys2SolarError_Impl
(
int
nSysErr
)
{
{
...
@@ -1304,9 +1304,13 @@ DirEntry DirEntry::TempName( DirEntryKind eKind ) const
...
@@ -1304,9 +1304,13 @@ DirEntry DirEntry::TempName( DirEntryKind eKind ) const
}
}
dir
=
aDirName
.
getStr
();
dir
=
aDirName
.
getStr
();
char
sBuf
[
_MAX_PATH
]
;
OString
sTempRoot
;
if
(
eFlag
==
FSYS_FLAG_CURRENT
||
(
!
pParent
&&
pWild
)
)
if
(
eFlag
==
FSYS_FLAG_CURRENT
||
(
!
pParent
&&
pWild
)
)
dir
=
TempDirImpl
(
sBuf
);
{
rtl
::
OUString
aPath
=
GetSystemTempDirPath_Impl
();
sTempRoot
=
OUStringToOString
(
aPath
,
osl_getThreadTextEncoding
()
);
dir
=
sTempRoot
.
getStr
();
}
DirEntry
aRet
(
FSYS_FLAG_INVALID
);
DirEntry
aRet
(
FSYS_FLAG_INVALID
);
i
=
strlen
(
dir
);
i
=
strlen
(
dir
);
...
...
tools/source/fsys/tempfile.cxx
Dosyayı görüntüle @
a82f7b20
...
@@ -43,26 +43,21 @@ struct TempFile_Impl
...
@@ -43,26 +43,21 @@ struct TempFile_Impl
sal_Bool
bIsDirectory
;
sal_Bool
bIsDirectory
;
};
};
String
GetSystemTempDir_Impl
()
extern
rtl
::
OUString
GetSystemTempDirPath_Impl
();
rtl
::
OUString
GetSystemTempDirPath_Impl
()
{
{
char
sBuf
[
_MAX_PATH
];
rtl
::
OUString
aTmpURL
,
aPath
;
const
char
*
pDir
=
TempDirImpl
(
sBuf
);
osl
::
FileBase
::
getTempDirURL
(
aTmpURL
);
osl
::
FileBase
::
getSystemPathFromFileURL
(
aTmpURL
,
aPath
);
::
rtl
::
OString
aTmpA
(
pDir
);
return
aPath
;
::
rtl
::
OUString
aTmp
=
::
rtl
::
OStringToOUString
(
aTmpA
,
osl_getThreadTextEncoding
()
);
rtl
::
OUString
aRet
;
FileBase
::
getFileURLFromSystemPath
(
aTmp
,
aRet
);
String
aName
=
aRet
;
if
(
aName
.
GetChar
(
aName
.
Len
()
-
1
)
!=
'/'
)
aName
+=
'/'
;
return
aName
;
}
}
#define TMPNAME_SIZE ( 1 + 5 + 5 + 4 + 1 )
#define TMPNAME_SIZE ( 1 + 5 + 5 + 4 + 1 )
String
ConstructTempDir_Impl
(
const
String
*
pParent
)
OU
String
ConstructTempDir_Impl
(
const
String
*
pParent
)
{
{
String
aName
;
OU
String
aName
;
if
(
pParent
&&
pParent
->
Len
()
)
if
(
pParent
&&
pParent
->
Len
()
)
{
{
rtl
::
OUString
aRet
;
rtl
::
OUString
aRet
;
...
@@ -79,19 +74,18 @@ String ConstructTempDir_Impl( const String* pParent )
...
@@ -79,19 +74,18 @@ String ConstructTempDir_Impl( const String* pParent )
}
}
}
}
if
(
!
aName
.
Len
()
)
if
(
aName
.
isEmpty
()
)
{
{
// if no parent or invalid parent : use system directory
// if no parent or invalid parent : use system directory
::
rtl
::
OUString
&
rTempNameBase_Impl
=
TempNameBase_Impl
::
get
();
::
rtl
::
OUString
&
rTempNameBase_Impl
=
TempNameBase_Impl
::
get
();
if
(
rTempNameBase_Impl
.
isEmpty
()
)
if
(
rTempNameBase_Impl
.
isEmpty
()
)
rTempNameBase_Impl
=
GetSystemTempDir_Impl
();
rTempNameBase_Impl
=
GetSystemTempDir
Path
_Impl
();
aName
=
rTempNameBase_Impl
;
aName
=
rTempNameBase_Impl
;
}
}
// Make sure that directory ends with a separator
// Make sure that directory ends with a separator
xub_StrLen
i
=
aName
.
Len
();
if
(
!
aName
.
endsWith
(
"/"
)
)
if
(
i
>
0
&&
aName
.
GetChar
(
i
-
1
)
!=
'/'
)
aName
+=
"/"
;
aName
+=
'/'
;
return
aName
;
return
aName
;
}
}
...
...
tools/source/fsys/unx.cxx
Dosyayı görüntüle @
a82f7b20
...
@@ -363,26 +363,4 @@ sal_Bool FileStat::Update( const DirEntry& rDirEntry, SAL_UNUSED_PARAMETER sal_B
...
@@ -363,26 +363,4 @@ sal_Bool FileStat::Update( const DirEntry& rDirEntry, SAL_UNUSED_PARAMETER sal_B
return
sal_True
;
return
sal_True
;
}
}
const
char
*
TempDirImpl
(
char
*
pBuf
)
{
#ifdef MACOSX
// P_tmpdir is /var/tmp on Mac OS X, and it is not cleaned up on system
// startup
strcpy
(
pBuf
,
"/tmp"
);
#else
const
char
*
pValue
=
getenv
(
"TEMP"
);
if
(
!
pValue
)
pValue
=
getenv
(
"TMP"
);
if
(
pValue
)
strcpy
(
pBuf
,
pValue
);
else
// P_tempdir exists in Solaris and Linux
strcpy
(
pBuf
,
P_tmpdir
);
// don't use "/tmp" as hard coded directory
//strcpy( pBuf, "/tmp" );
#endif
/* MACOSX */
return
pBuf
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools/source/fsys/unx.hxx
Dosyayı görüntüle @
a82f7b20
...
@@ -71,8 +71,6 @@ inline void Unx2DateAndTime( time_t nDate, Time& rTime, Date& rDate )
...
@@ -71,8 +71,6 @@ inline void Unx2DateAndTime( time_t nDate, Time& rTime, Date& rDate )
rDate
=
Date
(
pTime
->
tm_mday
,
pTime
->
tm_mon
+
1
,
pTime
->
tm_year
+
1900
);
rDate
=
Date
(
pTime
->
tm_mday
,
pTime
->
tm_mon
+
1
,
pTime
->
tm_year
+
1900
);
}
}
const
char
*
TempDirImpl
(
char
*
pBuf
);
#define FSysFailOnErrorImpl()
#define FSysFailOnErrorImpl()
#endif
#endif
...
...
tools/source/fsys/wntmsc.cxx
Dosyayı görüntüle @
a82f7b20
...
@@ -776,15 +776,4 @@ sal_Bool IsRedirectable_Impl( const rtl::OString& rPath )
...
@@ -776,15 +776,4 @@ sal_Bool IsRedirectable_Impl( const rtl::OString& rPath )
return
sal_False
;
return
sal_False
;
}
}
/// get name of the directory for temporary files
const
char
*
TempDirImpl
(
char
*
pBuf
)
{
if
(
!
GetTempPath
(
MAX_PATH
,
pBuf
)
&&
!
GetWindowsDirectory
(
pBuf
,
MAX_PATH
)
&&
!
GetEnvironmentVariable
(
"HOMEPATH"
,
pBuf
,
MAX_PATH
)
)
return
0
;
return
pBuf
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools/source/fsys/wntmsc.hxx
Dosyayı görüntüle @
a82f7b20
...
@@ -63,8 +63,6 @@ inline sal_Bool DRIVE_EXISTS(char c)
...
@@ -63,8 +63,6 @@ inline sal_Bool DRIVE_EXISTS(char c)
return
GetDriveType
(
aDriveRoot
.
getStr
()
)
>
1
;
return
GetDriveType
(
aDriveRoot
.
getStr
()
)
>
1
;
}
}
const
char
*
TempDirImpl
(
char
*
pBuf
);
#define FSysFailOnErrorImpl()
#define FSysFailOnErrorImpl()
#endif
#endif
...
...
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