LibreOffice Module registry (master) 1
reader.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
23#include <registry/refltype.hxx>
24#include <registry/types.hxx>
25#include <registry/version.h>
26
27#include <rtl/ustring.hxx>
28#include <sal/types.h>
29
30#include <new>
31
32namespace typereg {
33
41class Reader {
42public:
57 Reader(void const * buffer, sal_uInt32 length)
58 {
60 {
61 throw std::bad_alloc();
62 }
63 }
64
70 Reader(Reader const & other): m_handle(other.m_handle) {
72 }
73
82 }
83
91 Reader & operator =(Reader const & other) {
92 Reader temp(other);
93 std::swap(m_handle, temp.m_handle);
94 return *this;
95 }
96
102 bool isValid() const {
103 return m_handle != nullptr;
104 }
105
115 }
116
125 OUString getDocumentation() const {
126 rtl_uString * s = nullptr;
128 if (s == nullptr) {
129 throw std::bad_alloc();
130 }
131 return OUString(s, SAL_NO_ACQUIRE);
132 }
133
143 OUString getFileName() const {
144 rtl_uString * s = nullptr;
146 if (s == nullptr) {
147 throw std::bad_alloc();
148 }
149 return OUString(s, SAL_NO_ACQUIRE);
150 }
151
164 }
165
172 bool isPublished() const {
174 }
175
184 OUString getTypeName() const {
185 rtl_uString * s = nullptr;
187 if (s == nullptr) {
188 throw std::bad_alloc();
189 }
190 return OUString(s, SAL_NO_ACQUIRE);
191 }
192
199 sal_uInt16 getSuperTypeCount() const {
201 }
202
213 OUString getSuperTypeName(sal_uInt16 index) const {
214 rtl_uString * s = nullptr;
216 if (s == nullptr) {
217 throw std::bad_alloc();
218 }
219 return OUString(s, SAL_NO_ACQUIRE);
220 }
221
228 sal_uInt16 getFieldCount() const {
230 }
231
241 OUString getFieldDocumentation(sal_uInt16 index) const {
242 rtl_uString * s = nullptr;
244 if (s == nullptr) {
245 throw std::bad_alloc();
246 }
247 return OUString(s, SAL_NO_ACQUIRE);
248 }
249
260 OUString getFieldFileName(sal_uInt16 index) const {
261 rtl_uString * s = nullptr;
263 if (s == nullptr) {
264 throw std::bad_alloc();
265 }
266 return OUString(s, SAL_NO_ACQUIRE);
267 }
268
276 RTFieldAccess getFieldFlags(sal_uInt16 index) const {
278 }
279
289 OUString getFieldName(sal_uInt16 index) const {
290 rtl_uString * s = nullptr;
292 if (s == nullptr) {
293 throw std::bad_alloc();
294 }
295 return OUString(s, SAL_NO_ACQUIRE);
296 }
297
307 OUString getFieldTypeName(sal_uInt16 index) const {
308 rtl_uString * s = nullptr;
310 if (s == nullptr) {
311 throw std::bad_alloc();
312 }
313 return OUString(s, SAL_NO_ACQUIRE);
314 }
315
325 RTConstValue getFieldValue(sal_uInt16 index) const {
328 m_handle, index, &v.m_type, &v.m_value))
329 {
330 throw std::bad_alloc();
331 }
332 return v;
333 }
334
341 sal_uInt16 getMethodCount() const {
343 }
344
354 OUString getMethodDocumentation(sal_uInt16 index) const {
355 rtl_uString * s = nullptr;
357 if (s == nullptr) {
358 throw std::bad_alloc();
359 }
360 return OUString(s, SAL_NO_ACQUIRE);
361 }
362
370 RTMethodMode getMethodFlags(sal_uInt16 index) const {
372 }
373
383 OUString getMethodName(sal_uInt16 index) const {
384 rtl_uString * s = nullptr;
386 if (s == nullptr) {
387 throw std::bad_alloc();
388 }
389 return OUString(s, SAL_NO_ACQUIRE);
390 }
391
401 OUString getMethodReturnTypeName(sal_uInt16 index) const {
402 rtl_uString * s = nullptr;
404 if (s == nullptr) {
405 throw std::bad_alloc();
406 }
407 return OUString(s, SAL_NO_ACQUIRE);
408 }
409
417 sal_uInt16 getMethodParameterCount(sal_uInt16 index) const {
419 }
420
433 sal_uInt16 methodIndex, sal_uInt16 parameterIndex) const
434 {
436 m_handle, methodIndex, parameterIndex);
437 }
438
453 sal_uInt16 methodIndex, sal_uInt16 parameterIndex) const
454 {
455 rtl_uString * s = nullptr;
457 m_handle, &s, methodIndex, parameterIndex);
458 if (s == nullptr) {
459 throw std::bad_alloc();
460 }
461 return OUString(s, SAL_NO_ACQUIRE);
462 }
463
478 sal_uInt16 methodIndex, sal_uInt16 parameterIndex) const
479 {
480 rtl_uString * s = nullptr;
482 m_handle, &s, methodIndex, parameterIndex);
483 if (s == nullptr) {
484 throw std::bad_alloc();
485 }
486 return OUString(s, SAL_NO_ACQUIRE);
487 }
488
496 sal_uInt16 getMethodExceptionCount(sal_uInt16 index) const {
498 }
499
514 sal_uInt16 methodIndex, sal_uInt16 exceptionIndex) const
515 {
516 rtl_uString * s = nullptr;
518 m_handle, &s, methodIndex, exceptionIndex);
519 if (s == nullptr) {
520 throw std::bad_alloc();
521 }
522 return OUString(s, SAL_NO_ACQUIRE);
523 }
524
531 sal_uInt16 getReferenceCount() const {
533 }
534
545 OUString getReferenceDocumentation(sal_uInt16 index) const {
546 rtl_uString * s = nullptr;
548 if (s == nullptr) {
549 throw std::bad_alloc();
550 }
551 return OUString(s, SAL_NO_ACQUIRE);
552 }
553
562 RTFieldAccess getReferenceFlags(sal_uInt16 index) const {
564 }
565
574 RTReferenceType getReferenceSort(sal_uInt16 index) const {
576 }
577
588 OUString getReferenceTypeName(sal_uInt16 index) const {
589 rtl_uString * s = nullptr;
591 if (s == nullptr) {
592 throw std::bad_alloc();
593 }
594 return OUString(s, SAL_NO_ACQUIRE);
595 }
596
597private:
598 void * m_handle;
599};
600
601}
602
603/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
specifies a helper class for const values.
Definition: refltype.hxx:31
A type reader working on a binary blob that represents a UNOIDL type.
Definition: reader.hxx:41
OUString getFieldDocumentation(sal_uInt16 index) const
Returns the documentation of a field of this type reader.
Definition: reader.hxx:241
OUString getSuperTypeName(sal_uInt16 index) const
Returns the type name of a super type of this type reader.
Definition: reader.hxx:213
sal_uInt16 getSuperTypeCount() const
Returns the number of super types of this type reader.
Definition: reader.hxx:199
void * m_handle
Definition: reader.hxx:598
OUString getFileName() const
Returns the file name of this type reader.
Definition: reader.hxx:143
typereg_Version getVersion() const
Returns the binary blob version of this type reader.
Definition: reader.hxx:113
RTConstValue getFieldValue(sal_uInt16 index) const
Returns the value of a field of this type reader.
Definition: reader.hxx:325
sal_uInt16 getMethodParameterCount(sal_uInt16 index) const
Returns the number of parameters of a method of this type reader.
Definition: reader.hxx:417
OUString getMethodName(sal_uInt16 index) const
Returns the name of a method of this type reader.
Definition: reader.hxx:383
OUString getReferenceTypeName(sal_uInt16 index) const
Returns the type name of a reference of this type reader.
Definition: reader.hxx:588
Reader(Reader const &other)
Shares a type reader between two Reader instances.
Definition: reader.hxx:70
OUString getFieldFileName(sal_uInt16 index) const
Returns the file name of a field of this type reader.
Definition: reader.hxx:260
OUString getMethodParameterName(sal_uInt16 methodIndex, sal_uInt16 parameterIndex) const
Returns the name of a parameter of a method of this type reader.
Definition: reader.hxx:452
OUString getDocumentation() const
Returns the documentation of this type reader.
Definition: reader.hxx:125
RTParamMode getMethodParameterFlags(sal_uInt16 methodIndex, sal_uInt16 parameterIndex) const
Returns the flags of a parameter of a method of this type reader.
Definition: reader.hxx:432
Reader & operator=(Reader const &other)
Replaces the underlying type reader.
Definition: reader.hxx:91
RTMethodMode getMethodFlags(sal_uInt16 index) const
Returns the flags of a method of this type reader.
Definition: reader.hxx:370
sal_uInt16 getMethodExceptionCount(sal_uInt16 index) const
Returns the number of exceptions of a method of this type reader.
Definition: reader.hxx:496
OUString getTypeName() const
Returns the type name of this type reader.
Definition: reader.hxx:184
bool isPublished() const
Returns whether this type reader is published.
Definition: reader.hxx:172
~Reader()
Destroys this Reader instance.
Definition: reader.hxx:80
OUString getReferenceDocumentation(sal_uInt16 index) const
Returns the documentation of a reference of this type reader.
Definition: reader.hxx:545
OUString getMethodDocumentation(sal_uInt16 index) const
Returns the documentation of a method of this type reader.
Definition: reader.hxx:354
RTFieldAccess getReferenceFlags(sal_uInt16 index) const
Returns the flags of a reference of this type reader.
Definition: reader.hxx:562
Reader(void const *buffer, sal_uInt32 length)
Creates a type reader.
Definition: reader.hxx:57
OUString getMethodExceptionTypeName(sal_uInt16 methodIndex, sal_uInt16 exceptionIndex) const
Returns the type name of an exception of a method of this type reader.
Definition: reader.hxx:513
RTFieldAccess getFieldFlags(sal_uInt16 index) const
Returns the flags of a field of this type reader.
Definition: reader.hxx:276
RTTypeClass getTypeClass() const
Returns the type class of this type reader.
Definition: reader.hxx:162
OUString getFieldTypeName(sal_uInt16 index) const
Returns the type name of a field of this type reader.
Definition: reader.hxx:307
OUString getMethodReturnTypeName(sal_uInt16 index) const
Returns the return type name of a method of this type reader.
Definition: reader.hxx:401
sal_uInt16 getFieldCount() const
Returns the number of fields of this type reader.
Definition: reader.hxx:228
OUString getFieldName(sal_uInt16 index) const
Returns the name of a field of this type reader.
Definition: reader.hxx:289
OUString getMethodParameterTypeName(sal_uInt16 methodIndex, sal_uInt16 parameterIndex) const
Returns the type name of a parameter of a method of this type reader.
Definition: reader.hxx:477
sal_uInt16 getReferenceCount() const
Returns the number of references of this type reader.
Definition: reader.hxx:531
bool isValid() const
Returns whether this type reader is valid.
Definition: reader.hxx:102
sal_uInt16 getMethodCount() const
Returns the number of methods of this type reader.
Definition: reader.hxx:341
RTReferenceType getReferenceSort(sal_uInt16 index) const
Returns the sort of a reference of this type reader.
Definition: reader.hxx:574
float v
index
void TYPEREG_CALLTYPE typereg_reader_getFieldDocumentation(void *hEntry, rtl_uString **pDoku, sal_uInt16 index)
Returns the documentation of a field of a type reader.
Definition: reflread.cxx:1346
sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodExceptionCount(void *hEntry, sal_uInt16 index)
Returns the number of exceptions of a method of a type reader.
Definition: reflread.cxx:1455
sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getReferenceCount(void *hEntry)
Returns the number of references of a type reader.
Definition: reflread.cxx:1522
void TYPEREG_CALLTYPE typereg_reader_getFieldFileName(void *hEntry, rtl_uString **pFieldFileName, sal_uInt16 index)
Returns the file name of a field of a type reader.
Definition: reflread.cxx:1362
void TYPEREG_CALLTYPE typereg_reader_getFileName(void *hEntry, rtl_uString **pFileName)
Returns the file name of a type reader.
Definition: reflread.cxx:1260
bool TYPEREG_CALLTYPE typereg_reader_getFieldValue(void *hEntry, sal_uInt16 index, RTValueType *type, RTConstValueUnion *value)
Returns the value of a field of a type reader.
Definition: reflread.cxx:1327
void TYPEREG_CALLTYPE typereg_reader_getSuperTypeName(void *hEntry, rtl_uString **pSuperTypeName, sal_uInt16 index)
Returns the type name of a super type of a type reader.
Definition: reflread.cxx:1590
sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodCount(void *hEntry)
Returns the number of methods of a type reader.
Definition: reflread.cxx:1379
void TYPEREG_CALLTYPE typereg_reader_acquire(void *hEntry)
Increments the reference count of a type reader.
Definition: reflread.cxx:1169
void TYPEREG_CALLTYPE typereg_reader_getDocumentation(void *hEntry, rtl_uString **pDoku)
Returns the documentation of a type reader.
Definition: reflread.cxx:1243
void TYPEREG_CALLTYPE typereg_reader_getMethodParameterName(void *hEntry, rtl_uString **pMethodParamName, sal_uInt16 index, sal_uInt16 paramIndex)
Returns the name of a parameter of a method of a type reader.
Definition: reflread.cxx:1430
bool TYPEREG_CALLTYPE typereg_reader_create(void const *buffer, sal_uInt32 length, void **result)
Creates a type reader working on a binary blob that represents a UNOIDL type.
Definition: reflread.cxx:1135
void TYPEREG_CALLTYPE typereg_reader_release(void *hEntry)
Decrements the reference count of a type reader.
Definition: reflread.cxx:1177
typereg_Version TYPEREG_CALLTYPE typereg_reader_getVersion(void const *handle)
Returns the binary blob version of a type reader.
Definition: reflread.cxx:1188
RTTypeClass TYPEREG_CALLTYPE typereg_reader_getTypeClass(void *hEntry)
Returns the type class of a type reader.
Definition: reflread.cxx:1199
void TYPEREG_CALLTYPE typereg_reader_getFieldName(void *hEntry, rtl_uString **pFieldName, sal_uInt16 index)
Returns the name of a field of a type reader.
Definition: reflread.cxx:1287
bool TYPEREG_CALLTYPE typereg_reader_isPublished(void *hEntry)
Returns whether a type reader is published.
Definition: reflread.cxx:1212
void TYPEREG_CALLTYPE typereg_reader_getTypeName(void *hEntry, rtl_uString **pTypeName)
Returns the type name of a type reader.
Definition: reflread.cxx:1225
RTMethodMode TYPEREG_CALLTYPE typereg_reader_getMethodFlags(void *hEntry, sal_uInt16 index)
Returns the flags of a method of a type reader.
Definition: reflread.cxx:1497
void TYPEREG_CALLTYPE typereg_reader_getFieldTypeName(void *hEntry, rtl_uString **pFieldType, sal_uInt16 index)
Returns the type name of a field of a type reader.
Definition: reflread.cxx:1302
sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getSuperTypeCount(void *hEntry)
Returns the number of super types of a type reader.
Definition: reflread.cxx:1581
RTFieldAccess TYPEREG_CALLTYPE typereg_reader_getFieldFlags(void *hEntry, sal_uInt16 index)
Returns the flags of a field of a type reader.
Definition: reflread.cxx:1318
RTParamMode TYPEREG_CALLTYPE typereg_reader_getMethodParameterFlags(void *hEntry, sal_uInt16 index, sal_uInt16 paramIndex)
Returns the flags of a parameter of a method of a type reader.
Definition: reflread.cxx:1446
void TYPEREG_CALLTYPE typereg_reader_getMethodName(void *hEntry, rtl_uString **pMethodName, sal_uInt16 index)
Returns the name of a method of a type reader.
Definition: reflread.cxx:1388
void TYPEREG_CALLTYPE typereg_reader_getReferenceDocumentation(void *hEntry, rtl_uString **pReferenceDoku, sal_uInt16 index)
Returns the documentation of a reference of a type reader.
Definition: reflread.cxx:1556
void TYPEREG_CALLTYPE typereg_reader_getMethodReturnTypeName(void *hEntry, rtl_uString **pMethodReturnType, sal_uInt16 index)
Returns the return type name of a method of a type reader.
Definition: reflread.cxx:1481
RTReferenceType TYPEREG_CALLTYPE typereg_reader_getReferenceSort(void *hEntry, sal_uInt16 index)
Returns the sort of a reference of a type reader.
Definition: reflread.cxx:1547
void TYPEREG_CALLTYPE typereg_reader_getMethodExceptionTypeName(void *hEntry, rtl_uString **pMethodExcpType, sal_uInt16 index, sal_uInt16 excIndex)
Returns the type name of an exception of a method of a type reader.
Definition: reflread.cxx:1465
void TYPEREG_CALLTYPE typereg_reader_getMethodParameterTypeName(void *hEntry, rtl_uString **pMethodParamType, sal_uInt16 index, sal_uInt16 paramIndex)
Returns the type name of a parameter of a method of a type reader.
Definition: reflread.cxx:1414
void TYPEREG_CALLTYPE typereg_reader_getMethodDocumentation(void *hEntry, rtl_uString **pMethodDoku, sal_uInt16 index)
Returns the documentation of a method of a type reader.
Definition: reflread.cxx:1506
RTFieldAccess TYPEREG_CALLTYPE typereg_reader_getReferenceFlags(void *hEntry, sal_uInt16 index)
Returns the flags of a reference of a type reader.
Definition: reflread.cxx:1572
sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodParameterCount(void *hEntry, sal_uInt16 index)
Returns the number of parameters of a method of a type reader.
Definition: reflread.cxx:1404
sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getFieldCount(void *hEntry)
Returns the number of fields of a type reader.
Definition: reflread.cxx:1278
void TYPEREG_CALLTYPE typereg_reader_getReferenceTypeName(void *hEntry, rtl_uString **pReferenceName, sal_uInt16 index)
Returns the type name of a reference of a type reader.
Definition: reflread.cxx:1531
RTReferenceType
specifies the type of a reference used in a service description.
Definition: types.hxx:303
RTParamMode
specifies the mode of a parameter.
Definition: types.hxx:274
RTFieldAccess
specifies the type for the field access.
Definition: types.hxx:133
RTMethodMode
specifies the mode of a method.
Definition: types.hxx:235
RTTypeClass
specifies the typeclass of a binary type blob.
Definition: types.hxx:31
typereg_Version
The version of a binary blob that represents a UNOIDL type.
Definition: version.h:40