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
31ba2cb2
Kaydet (Commit)
31ba2cb2
authored
Haz 04, 2014
tarafından
David Tardon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add convenience functions to handle dirs
Change-Id: I81c94565e09e0d839d95bf4f09b029838bb37ad5
üst
ccb51e13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
DirectoryStream.hxx
include/writerperfect/DirectoryStream.hxx
+3
-0
DirectoryStream.cxx
writerperfect/source/common/DirectoryStream.cxx
+41
-0
No files found.
include/writerperfect/DirectoryStream.hxx
Dosyayı görüntüle @
31ba2cb2
...
@@ -31,6 +31,9 @@ public:
...
@@ -31,6 +31,9 @@ public:
explicit
DirectoryStream
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
ucb
::
XContent
>
&
xContent
);
explicit
DirectoryStream
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
ucb
::
XContent
>
&
xContent
);
virtual
~
DirectoryStream
();
virtual
~
DirectoryStream
();
static
DirectoryStream
*
createForParent
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
ucb
::
XContent
>
&
xContent
);
static
bool
isDirectory
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
ucb
::
XContent
>
&
xContent
);
virtual
bool
isStructured
()
SAL_OVERRIDE
;
virtual
bool
isStructured
()
SAL_OVERRIDE
;
virtual
unsigned
subStreamCount
()
SAL_OVERRIDE
;
virtual
unsigned
subStreamCount
()
SAL_OVERRIDE
;
virtual
const
char
*
subStreamName
(
unsigned
id
)
SAL_OVERRIDE
;
virtual
const
char
*
subStreamName
(
unsigned
id
)
SAL_OVERRIDE
;
...
...
writerperfect/source/common/DirectoryStream.cxx
Dosyayı görüntüle @
31ba2cb2
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
* For further information visit http://libwpd.sourceforge.net
* For further information visit http://libwpd.sourceforge.net
*/
*/
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
...
@@ -38,6 +39,7 @@
...
@@ -38,6 +39,7 @@
#include <writerperfect/DirectoryStream.hxx>
#include <writerperfect/DirectoryStream.hxx>
#include <writerperfect/WPXSvInputStream.hxx>
#include <writerperfect/WPXSvInputStream.hxx>
namespace
container
=
com
::
sun
::
star
::
container
;
namespace
io
=
com
::
sun
::
star
::
io
;
namespace
io
=
com
::
sun
::
star
::
io
;
namespace
sdbc
=
com
::
sun
::
star
::
sdbc
;
namespace
sdbc
=
com
::
sun
::
star
::
sdbc
;
namespace
ucb
=
com
::
sun
::
star
::
ucb
;
namespace
ucb
=
com
::
sun
::
star
::
ucb
;
...
@@ -112,6 +114,45 @@ DirectoryStream::~DirectoryStream()
...
@@ -112,6 +114,45 @@ DirectoryStream::~DirectoryStream()
delete
m_pImpl
;
delete
m_pImpl
;
}
}
DirectoryStream
*
DirectoryStream
::
createForParent
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
ucb
::
XContent
>
&
xContent
)
try
{
if
(
!
xContent
.
is
())
return
0
;
DirectoryStream
*
pDir
(
0
);
const
uno
::
Reference
<
container
::
XChild
>
xChild
(
xContent
,
uno
::
UNO_QUERY
);
if
(
xChild
.
is
())
{
const
uno
::
Reference
<
ucb
::
XContent
>
xDirContent
(
xChild
->
getParent
(),
uno
::
UNO_QUERY
);
if
(
xDirContent
.
is
())
{
pDir
=
new
writerperfect
::
DirectoryStream
(
xDirContent
);
if
(
!
pDir
->
isStructured
())
pDir
=
0
;
}
}
return
pDir
;
}
catch
(...)
{
return
0
;
}
bool
DirectoryStream
::
isDirectory
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
ucb
::
XContent
>
&
xContent
)
try
{
if
(
!
xContent
.
is
())
return
false
;
ucbhelper
::
Content
aContent
(
xContent
,
uno
::
Reference
<
ucb
::
XCommandEnvironment
>
(),
comphelper
::
getProcessComponentContext
());
return
aContent
.
isFolder
();
}
catch
(...)
{
return
false
;
}
bool
DirectoryStream
::
isStructured
()
bool
DirectoryStream
::
isStructured
()
{
{
return
true
;
return
true
;
...
...
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