1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <registry/regdllapi.h>
23 #include <registry/types.hxx>
24 #include <registry/version.h>
26 #include <rtl/ustring.h>
27 #include <sal/types.h>
30 Creates a type reader working on a binary blob that represents a UNOIDL type.
32 <p>If a non-null handle is returned through <code>result</code>, its
33 reference count will be one. Operations on a non-null handle are not
34 multi-thread–safe.</p>
36 The type reader works directly on the given buffer, which must remain
37 available unmodified until the type reader is destroyed
39 @param buffer the binary blob representing the type; must point to at least
40 <code>length</code> bytes, and need only be byte-aligned
42 @param length the size in bytes of the binary blob representing the type
44 @param result an out-parameter obtaining a handle on the type reader; must
45 not be null; if the given binary blob is malformed, or of a version larger
46 than <code>maxVersion</code>, null is returned
48 @return false iff an out-of-memory condition occurred, in which case
49 <code>result</code> is left unchanged, and no type reader is created
53 REG_DLLPUBLIC
bool typereg_reader_create(
54 void const * buffer
, sal_uInt32 length
,
58 Increments the reference count of a type reader.
60 @param handle a handle on a type reader; may be null
64 REG_DLLPUBLIC
void typereg_reader_acquire(void * handle
);
67 Decrements the reference count of a type reader.
69 <p>If the reference count drops to zero, the type reader is destroyed.</p>
71 @param handle a handle on a type reader; may be null
75 REG_DLLPUBLIC
void typereg_reader_release(void * handle
);
78 Returns the binary blob version of a type reader.
80 @param handle a handle on a type reader; may be null
82 @return the version of the binary blob from which the type reader was
83 constructed; if <code>handle</code> is null, <code>TYPEREG_VERSION_0</code>
88 REG_DLLPUBLIC typereg_Version
typereg_reader_getVersion(void const * handle
);
91 Returns the documentation of a type reader.
93 @param handle a handle on a type reader; may be null
95 @param result an out-parameter obtaining the documentation string; must not
96 be null; if <code>handle</code> is null, an empty string is returned; if an
97 out-of-memory condition occurs, a pointer to a null pointer is returned
101 REG_DLLPUBLIC
void typereg_reader_getDocumentation(
102 void * handle
, rtl_uString
** result
);
105 Returns the file name of a type reader.
107 @param handle a handle on a type reader; may be null
109 @param result an out-parameter obtaining the file name string; must not be
110 null; if <code>handle</code> is null, an empty string is returned; if an
111 out-of-memory condition occurs, a pointer to a null pointer is returned
116 REG_DLLPUBLIC
void typereg_reader_getFileName(void * handle
, rtl_uString
** result
);
119 Returns the type class of a type reader.
121 <p>This function will always return the type class without the internal
122 <code>RT_TYPE_PUBLISHED</code> flag set. Use
123 <code>typereg_reader_isPublished</code> to determine whether a type reader is
126 @param handle a handle on a type reader; may be null
128 @return the type class of the type reader; if <code>handle</code> is null,
129 <code>RT_TYPE_INVALID</code> is returned
133 REG_DLLPUBLIC RTTypeClass
typereg_reader_getTypeClass(void * handle
);
136 Returns whether a type reader is published.
138 @param handle a handle on a type reader; may be null
140 @return whether the type reader is published; if <code>handle</code> is null,
145 REG_DLLPUBLIC
bool typereg_reader_isPublished(void * handle
);
148 Returns the type name of a type reader.
150 @param handle a handle on a type reader; may be null
152 @param result an out-parameter obtaining the type name string; must not be
153 null; if <code>handle</code> is null, an empty string is returned; if an
154 out-of-memory condition occurs, a pointer to a null pointer is returned
158 REG_DLLPUBLIC
void typereg_reader_getTypeName(void * handle
, rtl_uString
** result
);
161 Returns the number of super types of a type reader.
163 @param handle a handle on a type reader; may be null
165 @return the number of super types of the type reader; if <code>handle</code>
166 is null, zero is returned
170 REG_DLLPUBLIC sal_uInt16
typereg_reader_getSuperTypeCount(void * handle
);
173 Returns the type name of a super type of a type reader.
175 @param handle a handle on a type reader; must not be null
177 @param result an out-parameter obtaining the super type's type name string;
178 must not be null; if an out-of-memory condition occurs, a pointer to a null
181 @param index a valid index into the range of super types of the given type
186 REG_DLLPUBLIC
void typereg_reader_getSuperTypeName(
187 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
190 Returns the number of fields of a type reader.
192 @param handle a handle on a type reader; may be null
194 @return the number of fields of the type reader; if <code>handle</code> is
195 null, zero is returned
199 REG_DLLPUBLIC sal_uInt16
typereg_reader_getFieldCount(void * handle
);
202 Returns the documentation of a field of a type reader.
204 @param handle a handle on a type reader; must not be null
206 @param result an out-parameter obtaining the field's documentation string;
207 must not be null; if an out-of-memory condition occurs, a pointer to a null
210 @param index a valid index into the range of fields of the given type reader
214 REG_DLLPUBLIC
void typereg_reader_getFieldDocumentation(
215 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
218 Returns the file name of a field of a type reader.
220 @param handle a handle on a type reader; must not be null
222 @param result an out-parameter obtaining the field's file name string; must
223 not be null; if an out-of-memory condition occurs, a pointer to a null
226 @param index a valid index into the range of fields of the given type reader
231 REG_DLLPUBLIC
void typereg_reader_getFieldFileName(
232 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
235 Returns the flags of a field of a type reader.
237 @param handle a handle on a type reader; must not be null
239 @param index a valid index into the range of fields of the given type reader
241 @return the flags of the given field of the type reader
245 REG_DLLPUBLIC RTFieldAccess
typereg_reader_getFieldFlags(
246 void * handle
, sal_uInt16 index
);
249 Returns the name of a field of a type reader.
251 @param handle a handle on a type reader; must not be null
253 @param result an out-parameter obtaining the field's name string; must not be
254 null; if an out-of-memory condition occurs, a pointer to a null pointer is
257 @param index a valid index into the range of fields of the given type reader
261 REG_DLLPUBLIC
void typereg_reader_getFieldName(
262 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
265 Returns the type name of a field of a type reader.
267 @param handle a handle on a type reader; must not be null
269 @param result an out-parameter obtaining the field's type name string; must
270 not be null; if an out-of-memory condition occurs, a pointer to a null
273 @param index a valid index into the range of fields of the given type reader
277 REG_DLLPUBLIC
void typereg_reader_getFieldTypeName(
278 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
281 Returns the value of a field of a type reader.
283 @param handle a handle on a type reader; must not be null
285 @param index a valid index into the range of fields of the given type reader
287 @param type an out-parameter obtaining the field value's type; must not be
290 @param value an out-parameter obtaining the field value's value; must not be
293 @return false iff an out-of-memory condition occurred, in which case
294 <code>type</code> and <code>value</code> are left unchanged
298 REG_DLLPUBLIC
bool typereg_reader_getFieldValue(
299 void * handle
, sal_uInt16 index
, RTValueType
* type
,
300 union RTConstValueUnion
* value
);
303 Returns the number of methods of a type reader.
305 @param handle a handle on a type reader; may be null
307 @return the number of methods of the type reader; if <code>handle</code> is
308 null, zero is returned
312 REG_DLLPUBLIC sal_uInt16
typereg_reader_getMethodCount(void * handle
);
315 Returns the documentation of a method of a type reader.
317 @param handle a handle on a type reader; must not be null
319 @param result an out-parameter obtaining the methods's documentation string;
320 must not be null; if an out-of-memory condition occurs, a pointer to a null
323 @param index a valid index into the range of methods of the given type reader
327 REG_DLLPUBLIC
void typereg_reader_getMethodDocumentation(
328 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
331 Returns the flags of a method of a type reader.
333 @param handle a handle on a type reader; must not be null
335 @param index a valid index into the range of methods of the given type reader
337 @return the flags of the given method of the type reader
341 REG_DLLPUBLIC RTMethodMode
typereg_reader_getMethodFlags(
342 void * handle
, sal_uInt16 index
);
345 Returns the name of a method of a type reader.
347 @param handle a handle on a type reader; must not be null
349 @param result an out-parameter obtaining the methods's name string; must not
350 be null; if an out-of-memory condition occurs, a pointer to a null pointer is
353 @param index a valid index into the range of methods of the given type reader
357 REG_DLLPUBLIC
void typereg_reader_getMethodName(
358 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
361 Returns the return type name of a method of a type reader.
363 @param handle a handle on a type reader; must not be null
365 @param result an out-parameter obtaining the methods's return type name
366 string; must not be null; if an out-of-memory condition occurs, a pointer to
367 a null pointer is returned
369 @param index a valid index into the range of methods of the given type reader
373 REG_DLLPUBLIC
void typereg_reader_getMethodReturnTypeName(
374 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
377 Returns the number of parameters of a method of a type reader.
379 @param handle a handle on a type reader; must not be null
381 @param index a valid index into the range of methods of the given type reader
383 @return the number of parameters of the given method of the type reader
387 REG_DLLPUBLIC sal_uInt16
typereg_reader_getMethodParameterCount(
388 void * handle
, sal_uInt16 index
);
391 Returns the flags of a parameter of a method of a type reader.
393 @param handle a handle on a type reader; must not be null
395 @param methodIndex a valid index into the range of methods of the given type
398 @param parameterIndex a valid index into the range of parameters of the given
401 @return the flags of the given parameter of the given method of the type
406 REG_DLLPUBLIC RTParamMode
typereg_reader_getMethodParameterFlags(
407 void * handle
, sal_uInt16 methodIndex
, sal_uInt16 parameterIndex
);
410 Returns the name of a parameter of a method of a type reader.
412 @param handle a handle on a type reader; must not be null
414 @param result an out-parameter obtaining the parameter's name string; must
415 not be null; if an out-of-memory condition occurs, a pointer to a null
418 @param methodIndex a valid index into the range of methods of the given type
421 @param parameterIndex a valid index into the range of parameters of the given
426 REG_DLLPUBLIC
void typereg_reader_getMethodParameterName(
427 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
428 sal_uInt16 parameterIndex
);
431 Returns the type name of a parameter of a method of a type reader.
433 @param handle a handle on a type reader; must not be null
435 @param result an out-parameter obtaining the parameter's type name string;
436 must not be null; if an out-of-memory condition occurs, a pointer to a null
439 @param methodIndex a valid index into the range of methods of the given type
442 @param parameterIndex a valid index into the range of parameters of the given
447 REG_DLLPUBLIC
void typereg_reader_getMethodParameterTypeName(
448 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
449 sal_uInt16 parameterIndex
);
452 Returns the number of exceptions of a method of a type reader.
454 @param handle a handle on a type reader; must not be null
456 @param index a valid index into the range of methods of the given type reader
458 @return the number of exceptions of the given method of the type reader
462 REG_DLLPUBLIC sal_uInt16
typereg_reader_getMethodExceptionCount(
463 void * handle
, sal_uInt16 index
);
466 Returns the type name of an exception of a method of a type reader.
468 @param handle a handle on a type reader; must not be null
470 @param result an out-parameter obtaining the exception's type name string;
471 must not be null; if an out-of-memory condition occurs, a pointer to a null
474 @param methodIndex a valid index into the range of methods of the given type
477 @param exceptionIndex a valid index into the range of exceptions of the given
482 REG_DLLPUBLIC
void typereg_reader_getMethodExceptionTypeName(
483 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
484 sal_uInt16 exceptionIndex
);
487 Returns the number of references of a type reader.
489 @param handle a handle on a type reader; may be null
491 @return the number of references of the type reader; if <code>handle</code>
492 is null, zero is returned
496 REG_DLLPUBLIC sal_uInt16
typereg_reader_getReferenceCount(void * handle
);
499 Returns the documentation of a reference of a type reader.
501 @param handle a handle on a type reader; must not be null
503 @param result an out-parameter obtaining the reference's documentation
504 string; must not be null; if an out-of-memory condition occurs, a pointer to
505 a null pointer is returned
507 @param index a valid index into the range of references of the given type
512 REG_DLLPUBLIC
void typereg_reader_getReferenceDocumentation(
513 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
516 Returns the flags of a reference of a type reader.
518 @param handle a handle on a type reader; must not be null
520 @param index a valid index into the range of references of the given type
523 @return the flags of the given reference of the type reader
527 REG_DLLPUBLIC RTFieldAccess
typereg_reader_getReferenceFlags(
528 void * handle
, sal_uInt16 index
);
531 Returns the sort of a reference of a type reader.
533 @param handle a handle on a type reader; must not be null
535 @param index a valid index into the range of references of the given type
538 @return the sort of the given reference of the type reader
542 REG_DLLPUBLIC RTReferenceType
typereg_reader_getReferenceSort(
543 void * handle
, sal_uInt16 index
);
546 Returns the type name of a reference of a type reader.
548 @param handle a handle on a type reader; must not be null
550 @param result an out-parameter obtaining the reference's type name string;
551 must not be null; if an out-of-memory condition occurs, a pointer to a null
554 @param index a valid index into the range of references of the given type
559 REG_DLLPUBLIC
void typereg_reader_getReferenceTypeName(
560 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
562 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */