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
0ff9244d
Kaydet (Commit)
0ff9244d
authored
Eyl 16, 2013
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clean up the unoidl Providers (no need to have them exported)
Change-Id: I96b99e96b44f12b7ad7f376e4b3a68d7e9531643
üst
69f08eda
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
100 deletions
+63
-100
legacyprovider.cxx
unoidl/source/legacyprovider.cxx
+4
-3
legacyprovider.hxx
unoidl/source/legacyprovider.hxx
+4
-7
sourceprovider.cxx
unoidl/source/sourceprovider.cxx
+5
-5
sourceprovider.hxx
unoidl/source/sourceprovider.hxx
+4
-6
unoidl.cxx
unoidl/source/unoidl.cxx
+7
-6
unoidlprovider.cxx
unoidl/source/unoidlprovider.cxx
+34
-56
unoidlprovider.hxx
unoidl/source/unoidlprovider.hxx
+5
-17
No files found.
unoidl/source/legacyprovider.cxx
Dosyayı görüntüle @
0ff9244d
...
...
@@ -19,10 +19,11 @@
#include "rtl/ref.hxx"
#include "rtl/ustring.hxx"
#include "sal/types.h"
#include "unoidl/legacyprovider.hxx"
#include "unoidl/unoidl.hxx"
namespace
unoidl
{
#include "legacyprovider.hxx"
namespace
unoidl
{
namespace
detail
{
namespace
{
...
...
@@ -823,6 +824,6 @@ rtl::Reference< Entity > LegacyProvider::findEntity(OUString const & name)
LegacyProvider
::~
LegacyProvider
()
throw
()
{}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
include/unoidl
/legacyprovider.hxx
→
unoidl/source
/legacyprovider.hxx
Dosyayı görüntüle @
0ff9244d
...
...
@@ -14,14 +14,11 @@
#include "registry/registry.hxx"
#include "rtl/ref.hxx"
#include "sal/types.h"
#include "unoidl/detail/dllapi.hxx"
#include "unoidl/unoidl.hxx"
namespace
unoidl
{
namespace
detail
{
namespace
unoidl
{
class
LO_DLLPUBLIC_UNOIDL
LegacyProvider
:
public
Provider
{
class
LegacyProvider
:
public
Provider
{
public
:
// throws FileFormatException, NoSuchFileException:
LegacyProvider
(
...
...
@@ -35,13 +32,13 @@ public:
const
;
private
:
virtual
SAL_DLLPRIVATE
~
LegacyProvider
()
throw
();
virtual
~
LegacyProvider
()
throw
();
rtl
::
Reference
<
Manager
>
manager_
;
mutable
RegistryKey
ucr_
;
};
}
}
}
#endif
...
...
unoidl/source/sourceprovider.cxx
Dosyayı görüntüle @
0ff9244d
...
...
@@ -20,14 +20,14 @@
#include "rtl/ref.hxx"
#include "rtl/ustrbuf.hxx"
#include "rtl/ustring.hxx"
#include "unoidl/sourceprovider.hxx"
#include "unoidl/unoidl.hxx"
#include "sourceprovider-parser-requires.hxx"
#include "sourceprovider-parser.hxx"
#include "sourceprovider-scanner.hxx"
#include "sourceprovider.hxx"
namespace
unoidl
{
namespace
unoidl
{
namespace
detail
{
namespace
{
...
...
@@ -35,7 +35,7 @@ rtl::Reference<Entity> parse(
rtl
::
Reference
<
Manager
>
const
&
manager
,
OUString
const
&
name
,
OUString
const
&
uri
,
void
const
*
address
,
sal_uInt64
size
)
{
detail
::
SourceProviderScannerData
data
(
manager
,
address
,
size
);
SourceProviderScannerData
data
(
manager
,
address
,
size
);
yyscan_t
yyscanner
;
if
(
yylex_init_extra
(
&
data
,
&
yyscanner
)
!=
0
)
{
// Checking errno for the specific EINVAL, ENOMEM documented for
...
...
@@ -50,7 +50,7 @@ rtl::Reference<Entity> parse(
switch
(
e
)
{
case
0
:
{
std
::
map
<
OUString
,
detail
::
SourceProviderEntity
>::
const_iterator
i
(
std
::
map
<
OUString
,
SourceProviderEntity
>::
const_iterator
i
(
data
.
entities
.
find
(
name
));
return
i
==
data
.
entities
.
end
()
?
rtl
::
Reference
<
Entity
>
()
:
i
->
second
.
entity
;
...
...
@@ -230,6 +230,6 @@ rtl::Reference<Entity> SourceProvider::findEntity(OUString const & name) const {
SourceProvider
::~
SourceProvider
()
throw
()
{}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
include/unoidl
/sourceprovider.hxx
→
unoidl/source
/sourceprovider.hxx
Dosyayı görüntüle @
0ff9244d
...
...
@@ -15,13 +15,11 @@
#include <map>
#include "rtl/ref.hxx"
#include "sal/types.h"
#include "unoidl/detail/dllapi.hxx"
#include "unoidl/unoidl.hxx"
namespace
unoidl
{
namespace
unoidl
{
namespace
detail
{
class
LO_DLLPUBLIC_UNOIDL
SourceProvider
:
public
Provider
{
class
SourceProvider
:
public
Provider
{
public
:
// throws FileFormatException, NoSuchFileException:
SourceProvider
(
...
...
@@ -34,14 +32,14 @@ public:
virtual
rtl
::
Reference
<
Entity
>
findEntity
(
OUString
const
&
name
)
const
;
private
:
virtual
SAL_DLLPRIVATE
~
SourceProvider
()
throw
();
virtual
~
SourceProvider
()
throw
();
rtl
::
Reference
<
Manager
>
manager_
;
OUString
uri_
;
mutable
std
::
map
<
OUString
,
rtl
::
Reference
<
Entity
>
>
cache_
;
//TODO: at manager
};
}
}
}
#endif
...
...
unoidl/source/unoidl.cxx
Dosyayı görüntüle @
0ff9244d
...
...
@@ -17,10 +17,11 @@
#include "osl/mutex.hxx"
#include "rtl/ref.hxx"
#include "rtl/ustring.hxx"
#include "unoidl/legacyprovider.hxx"
#include "unoidl/sourceprovider.hxx"
#include "unoidl/unoidl.hxx"
#include "unoidl/unoidlprovider.hxx"
#include "legacyprovider.hxx"
#include "sourceprovider.hxx"
#include "unoidlprovider.hxx"
namespace
unoidl
{
...
...
@@ -113,17 +114,17 @@ rtl::Reference< Provider > loadProvider(
if
(
item
.
getFileStatus
(
status
)
==
osl
::
FileBase
::
E_None
&&
status
.
getFileType
()
==
osl
::
FileStatus
::
Directory
)
{
return
new
SourceProvider
(
manager
,
uri
);
return
new
detail
::
SourceProvider
(
manager
,
uri
);
}
}
try
{
return
new
UnoidlProvider
(
uri
);
return
new
detail
::
UnoidlProvider
(
uri
);
}
catch
(
FileFormatException
&
e
)
{
SAL_INFO
(
"unoidl"
,
"FileFormatException
\"
"
<<
e
.
getDetail
()
<<
"
\"
, retrying <"
<<
uri
<<
"> as legacy format"
);
return
new
LegacyProvider
(
manager
,
uri
);
return
new
detail
::
LegacyProvider
(
manager
,
uri
);
}
}
...
...
unoidl/source/unoidlprovider.cxx
Dosyayı görüntüle @
0ff9244d
...
...
@@ -24,7 +24,10 @@
#include "sal/types.h"
#include "salhelper/simplereferenceobject.hxx"
#include "unoidl/unoidl.hxx"
#include "unoidl/unoidlprovider.hxx"
#include "unoidlprovider.hxx"
namespace
unoidl
{
namespace
detail
{
namespace
{
...
...
@@ -114,10 +117,6 @@ struct Memory64 {
}
namespace
unoidl
{
namespace
detail
{
class
MappedFile
:
public
salhelper
::
SimpleReferenceObject
{
public
:
explicit
MappedFile
(
OUString
const
&
fileUrl
);
...
...
@@ -365,15 +364,13 @@ struct MapEntry {
Memory32
data
;
};
}
namespace
{
enum
Compare
{
COMPARE_LESS
,
COMPARE_GREATER
,
COMPARE_EQUAL
};
Compare
compare
(
rtl
::
Reference
<
detail
::
MappedFile
>
const
&
file
,
OUString
const
&
name
,
sal_Int32
nameOffset
,
sal_Int32
nameLength
,
detail
::
MapEntry
const
*
entry
)
rtl
::
Reference
<
MappedFile
>
const
&
file
,
OUString
const
&
name
,
sal_Int32
nameOffset
,
sal_Int32
nameLength
,
MapEntry
const
*
entry
)
{
assert
(
file
.
is
());
assert
(
entry
!=
0
);
...
...
@@ -411,15 +408,15 @@ Compare compare(
}
sal_uInt32
findInMap
(
rtl
::
Reference
<
detail
::
MappedFile
>
const
&
file
,
detail
::
MapEntry
const
*
mapBegin
,
sal_uInt32
mapSize
,
OUString
const
&
name
,
sal_Int32
nameOffset
,
sal_Int32
nameLength
)
rtl
::
Reference
<
MappedFile
>
const
&
file
,
MapEntry
const
*
mapBegin
,
sal_uInt32
mapSize
,
OUString
const
&
name
,
sal_Int32
nameOffset
,
sal_Int32
nameLength
)
{
if
(
mapSize
==
0
)
{
return
0
;
}
sal_uInt32
n
=
mapSize
/
2
;
detail
::
MapEntry
const
*
p
=
mapBegin
+
n
;
MapEntry
const
*
p
=
mapBegin
+
n
;
switch
(
compare
(
file
,
name
,
nameOffset
,
nameLength
,
p
))
{
case
COMPARE_LESS
:
return
findInMap
(
file
,
mapBegin
,
n
,
name
,
nameOffset
,
nameLength
);
...
...
@@ -438,7 +435,7 @@ sal_uInt32 findInMap(
}
std
::
vector
<
OUString
>
readAnnotations
(
bool
annotated
,
rtl
::
Reference
<
detail
::
MappedFile
>
const
&
file
,
bool
annotated
,
rtl
::
Reference
<
MappedFile
>
const
&
file
,
sal_uInt32
offset
,
sal_uInt32
*
newOffset
=
0
)
{
std
::
vector
<
OUString
>
ans
;
...
...
@@ -456,7 +453,7 @@ std::vector< OUString > readAnnotations(
}
ConstantValue
readConstant
(
rtl
::
Reference
<
detail
::
MappedFile
>
const
&
file
,
sal_uInt32
offset
,
rtl
::
Reference
<
MappedFile
>
const
&
file
,
sal_uInt32
offset
,
sal_uInt32
*
newOffset
=
0
,
bool
*
annotated
=
0
)
{
assert
(
file
.
is
());
...
...
@@ -546,13 +543,13 @@ ConstantValue readConstant(
}
rtl
::
Reference
<
Entity
>
readEntity
(
rtl
::
Reference
<
detail
::
MappedFile
>
const
&
file
,
sal_uInt32
offset
);
rtl
::
Reference
<
MappedFile
>
const
&
file
,
sal_uInt32
offset
);
class
UnoidlCursor
:
public
MapCursor
{
public
:
UnoidlCursor
(
rtl
::
Reference
<
detail
::
MappedFile
>
file
,
detail
::
MapEntry
const
*
mapBegin
,
sal_uInt32
mapSize
)
:
rtl
::
Reference
<
MappedFile
>
file
,
MapEntry
const
*
mapBegin
,
sal_uInt32
mapSize
)
:
file_
(
file
),
mapIndex_
(
mapBegin
),
mapEnd_
(
mapBegin
+
mapSize
)
{}
...
...
@@ -561,9 +558,9 @@ private:
virtual
rtl
::
Reference
<
Entity
>
getNext
(
OUString
*
name
);
rtl
::
Reference
<
detail
::
MappedFile
>
file_
;
detail
::
MapEntry
const
*
mapIndex_
;
detail
::
MapEntry
const
*
mapEnd_
;
rtl
::
Reference
<
MappedFile
>
file_
;
MapEntry
const
*
mapIndex_
;
MapEntry
const
*
mapEnd_
;
};
rtl
::
Reference
<
Entity
>
UnoidlCursor
::
getNext
(
OUString
*
name
)
{
...
...
@@ -580,11 +577,11 @@ rtl::Reference< Entity > UnoidlCursor::getNext(OUString * name) {
class
UnoidlModuleEntity
:
public
ModuleEntity
{
public
:
UnoidlModuleEntity
(
rtl
::
Reference
<
detail
::
MappedFile
>
const
&
file
,
sal_uInt32
mapOffset
,
rtl
::
Reference
<
MappedFile
>
const
&
file
,
sal_uInt32
mapOffset
,
sal_uInt32
mapSize
)
:
file_
(
file
),
mapBegin_
(
reinterpret_cast
<
detail
::
MapEntry
const
*
>
(
reinterpret_cast
<
MapEntry
const
*
>
(
static_cast
<
char
const
*
>
(
file_
->
address
)
+
mapOffset
)),
mapSize_
(
mapSize
)
{
assert
(
file
.
is
());
}
...
...
@@ -597,8 +594,8 @@ private:
virtual
rtl
::
Reference
<
MapCursor
>
createCursor
()
const
{
return
new
UnoidlCursor
(
file_
,
mapBegin_
,
mapSize_
);
}
rtl
::
Reference
<
detail
::
MappedFile
>
file_
;
detail
::
MapEntry
const
*
mapBegin_
;
rtl
::
Reference
<
MappedFile
>
file_
;
MapEntry
const
*
mapBegin_
;
sal_uInt32
mapSize_
;
};
...
...
@@ -611,7 +608,7 @@ std::vector< OUString > UnoidlModuleEntity::getMemberNames() const {
}
rtl
::
Reference
<
Entity
>
readEntity
(
rtl
::
Reference
<
detail
::
MappedFile
>
const
&
file
,
sal_uInt32
offset
)
rtl
::
Reference
<
MappedFile
>
const
&
file
,
sal_uInt32
offset
)
{
assert
(
file
.
is
());
int
v
=
file
->
read8
(
offset
);
...
...
@@ -959,9 +956,8 @@ rtl::Reference< Entity > readEntity(
(
"UNOIDL format: constant group map offset + size too"
" large"
));
}
detail
::
MapEntry
const
*
p
=
reinterpret_cast
<
detail
::
MapEntry
const
*
>
(
static_cast
<
char
const
*
>
(
file
->
address
)
+
offset
+
5
);
MapEntry
const
*
p
=
reinterpret_cast
<
MapEntry
const
*
>
(
static_cast
<
char
const
*
>
(
file
->
address
)
+
offset
+
5
);
std
::
vector
<
ConstantGroupEntity
::
Member
>
mems
;
for
(
sal_uInt32
i
=
0
;
i
!=
n
;
++
i
)
{
sal_uInt32
off
=
p
[
i
].
data
.
getUnsigned32
();
...
...
@@ -1179,8 +1175,7 @@ rtl::Reference< Entity > readEntity(
}
UnoidlProvider
::
UnoidlProvider
(
OUString
const
&
uri
)
:
file_
(
new
detail
::
MappedFile
(
uri
))
UnoidlProvider
::
UnoidlProvider
(
OUString
const
&
uri
)
:
file_
(
new
MappedFile
(
uri
))
{
if
(
file_
->
size
<
8
||
std
::
memcmp
(
file_
->
address
,
"UNOIDL
\xFF\0
"
,
8
)
!=
0
)
{
...
...
@@ -1195,7 +1190,7 @@ UnoidlProvider::UnoidlProvider(OUString const & uri):
throw
FileFormatException
(
file_
->
uri
,
"UNOIDL format: root map offset + size too large"
);
}
mapBegin_
=
reinterpret_cast
<
detail
::
MapEntry
const
*
>
(
mapBegin_
=
reinterpret_cast
<
MapEntry
const
*
>
(
static_cast
<
char
const
*
>
(
file_
->
address
)
+
off
);
}
...
...
@@ -1205,13 +1200,7 @@ rtl::Reference< MapCursor > UnoidlProvider::createRootCursor() const {
rtl
::
Reference
<
Entity
>
UnoidlProvider
::
findEntity
(
OUString
const
&
name
)
const
{
bool
cnst
;
sal_uInt32
off
=
find
(
name
,
&
cnst
);
return
off
==
0
||
cnst
?
rtl
::
Reference
<
Entity
>
()
:
getEntity
(
off
);
}
sal_uInt32
UnoidlProvider
::
find
(
OUString
const
&
name
,
bool
*
constant
)
const
{
detail
::
MapEntry
const
*
mapBegin
=
mapBegin_
;
MapEntry
const
*
mapBegin
=
mapBegin_
;
sal_uInt32
mapSize
=
mapSize_
;
bool
cgroup
=
false
;
for
(
sal_Int32
i
=
0
;;)
{
...
...
@@ -1221,16 +1210,13 @@ sal_uInt32 UnoidlProvider::find(OUString const & name, bool * constant) const {
}
sal_Int32
off
=
findInMap
(
file_
,
mapBegin
,
mapSize
,
name
,
i
,
j
-
i
);
if
(
off
==
0
)
{
return
0
;
return
rtl
::
Reference
<
Entity
>
()
;
}
if
(
j
==
name
.
getLength
())
{
if
(
constant
!=
0
)
{
*
constant
=
cgroup
;
}
return
off
;
return
cgroup
?
rtl
::
Reference
<
Entity
>
()
:
readEntity
(
file_
,
off
);
}
if
(
cgroup
)
{
return
0
;
return
rtl
::
Reference
<
Entity
>
()
;
//TODO: throw an exception instead here, where the segments of a
// constant's name are a prefix of the requested name's
// segments?
...
...
@@ -1240,7 +1226,7 @@ sal_uInt32 UnoidlProvider::find(OUString const & name, bool * constant) const {
if
((
v
&
0x3F
)
==
7
)
{
// constant group
cgroup
=
true
;
}
else
{
return
0
;
return
rtl
::
Reference
<
Entity
>
()
;
//TODO: throw an exception instead here, where the segments
// of a non-module, non-constant-group entity's name are a
// prefix of the requested name's segments?
...
...
@@ -1251,22 +1237,14 @@ sal_uInt32 UnoidlProvider::find(OUString const & name, bool * constant) const {
throw
FileFormatException
(
file_
->
uri
,
"UNOIDL format: map offset + size too large"
);
}
mapBegin
=
reinterpret_cast
<
detail
::
MapEntry
const
*
>
(
mapBegin
=
reinterpret_cast
<
MapEntry
const
*
>
(
static_cast
<
char
const
*
>
(
file_
->
address
)
+
off
+
5
);
i
=
j
+
1
;
}
}
rtl
::
Reference
<
Entity
>
UnoidlProvider
::
getEntity
(
sal_uInt32
offset
)
const
{
return
readEntity
(
file_
,
offset
);
}
ConstantValue
UnoidlProvider
::
getConstant
(
sal_uInt32
offset
)
const
{
return
readConstant
(
file_
,
offset
);
}
UnoidlProvider
::~
UnoidlProvider
()
throw
()
{}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
include/unoidl
/unoidlprovider.hxx
→
unoidl/source
/unoidlprovider.hxx
Dosyayı görüntüle @
0ff9244d
...
...
@@ -14,17 +14,14 @@
#include "rtl/ref.hxx"
#include "sal/types.h"
#include "unoidl/detail/dllapi.hxx"
#include "unoidl/unoidl.hxx"
namespace
unoidl
{
namespace
detail
{
class
MappedFile
;
struct
MapEntry
;
}
}
namespace
unoidl
{
class
MappedFile
;
struct
MapEntry
;
class
LO_DLLPUBLIC_UNOIDL
UnoidlProvider
:
public
Provider
{
class
UnoidlProvider
:
public
Provider
{
public
:
// throws FileFormatException, NoSuchFileException:
explicit
UnoidlProvider
(
OUString
const
&
uri
);
...
...
@@ -36,24 +33,15 @@ public:
virtual
rtl
::
Reference
<
Entity
>
findEntity
(
OUString
const
&
name
)
const
;
// throws FileFormatException:
sal_uInt32
find
(
OUString
const
&
name
,
bool
*
constant
=
0
)
const
;
// throws FileFormatException:
rtl
::
Reference
<
Entity
>
getEntity
(
sal_uInt32
offset
)
const
;
// throws FileFormatException:
ConstantValue
getConstant
(
sal_uInt32
offset
)
const
;
private
:
virtual
SAL_DLLPRIVATE
~
UnoidlProvider
()
throw
();
virtual
~
UnoidlProvider
()
throw
();
rtl
::
Reference
<
detail
::
MappedFile
>
file_
;
detail
::
MapEntry
const
*
mapBegin_
;
sal_uInt32
mapSize_
;
};
}
}
}
#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