29#include <rtl/ustring.hxx>
49 if (xProvider->findEntity(
name).is()) {
64 if (cursor !=
nullptr) {
65 *cursor =
manager_->createCursor(
"");
72 if (
name ==
"boolean") {
78 if (
name ==
"short") {
81 if (
name ==
"unsigned short") {
87 if (
name ==
"unsigned long") {
90 if (
name ==
"hyper") {
93 if (
name ==
"unsigned hyper") {
96 if (
name ==
"float") {
99 if (
name ==
"double") {
102 if (
name ==
"char") {
105 if (
name ==
"string") {
108 if (
name ==
"type") {
114 if (
name.startsWith(
"[")) {
117 if (
name.indexOf(
'<') != -1) {
124 if (entity !=
nullptr) {
127 switch (ent->getSort()) {
129 if (cursor !=
nullptr) {
156 for (;;) { std::abort(); }
161 std::u16string_view name,
bool resolveTypedefs, OUString * nucleus,
162 sal_Int32 * rank, std::vector< OUString > * arguments,
166 std::vector< OString >
args;
175 "template arguments mismatch for \"" +
n
176 +
"\" resolved from \"" +
name +
"\"");
180 if (resolveTypedefs) {
182 while (
n.startsWith(
"[]")) {
184 n =
n.copy(std::strlen(
"[]"));
208 if (nucleus !=
nullptr) {
211 if (rank !=
nullptr) {
214 if (arguments !=
nullptr) {
217 if (entity !=
nullptr) {
224 getTypeParameters().
size()))
227 "bad number of template arguments for \"" +
n
228 +
"\" resolved from \"" +
name +
"\"");
230 if (nucleus !=
nullptr) {
233 if (rank !=
nullptr) {
236 if (arguments !=
nullptr) {
238 for (
const OString& rArg :
args)
240 arguments->push_back(
b2u(rArg));
243 if (entity !=
nullptr) {
249 for (;;) std::abort();
252 "unexpected \"" +
n +
"\" resolved from \"" +
name
253 +
"\"in call to TypeManager::decompose");
std::vector< rtl::Reference< unoidl::Provider > > primaryProviders_
codemaker::UnoType::Sort decompose(std::u16string_view name, bool resolveTypedefs, OUString *nucleus, sal_Int32 *rank, std::vector< OUString > *arguments, rtl::Reference< unoidl::Entity > *entity) const
virtual ~TypeManager() override
codemaker::UnoType::Sort getSort(OUString const &name, rtl::Reference< unoidl::Entity > *entity=nullptr, rtl::Reference< unoidl::MapCursor > *cursor=nullptr) const
bool foundAtPrimaryProvider(OUString const &name) const
void loadProvider(OUString const &uri, bool primary)
rtl::Reference< unoidl::Manager > manager_
SORT_ACCUMULATION_BASED_SERVICE
SORT_SINGLE_INTERFACE_BASED_SERVICE
SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE
SORT_INTERFACE_BASED_SINGLETON
SORT_SERVICE_BASED_SINGLETON
const OUString & getType() const
constexpr LanguageType primary(LanguageType lt)
rtl::Reference< Manager > manager_
Sort
An enumeration of all the sorts of relevant UNOIDL entities.
@ InstantiatedPolymorphicStruct
@ InterfaceBasedSingleton
@ SingleInterfaceBasedService
@ PolymorphicStructTemplate
@ AccumulationBasedService
rtl::OString decompose(rtl::OString const &type, sal_Int32 *rank=nullptr, std::vector< rtl::OString > *arguments=nullptr)
Decomposes a UNO type name or UNO type registry name.
OUString b2u(std::string_view s)
OString u2b(std::u16string_view s)