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 .
20 #ifndef INCLUDED_registry_reader_h
21 #define INCLUDED_registry_reader_h
23 #include "registry/regdllapi.h"
24 #include "registry/types.h"
25 #include "registry/version.h"
27 #include "rtl/ustring.h"
28 #include "sal/types.h"
35 Creates a type reader working on a binary blob that represents a UNOIDL type.
37 <p>If a non-null handle is returned through <code>result</code>, its
38 reference count will be one. Operations on a non-null handle are not
39 multi-thread–safe.</p>
41 @param buffer the binary blob representing the type; must point to at least
42 <code>length</code> bytes, and need only be byte-aligned
44 @param length the size in bytes of the binary blob representing the type
46 @param copy if true, the type reader creates an internal copy of the given
47 buffer, and the given buffer is not accessed after this function returns; if
48 false, the type reader works directly on the given buffer, which must remain
49 available unmodified until the type reader is destroyed
51 @param maxVersion the maximum binary blob version the client is prepared to
52 handle; must not be negative
54 @param result an out-parameter obtaining a handle on the type reader; must
55 not be null; if the given binary blob is malformed, or of a version larger
56 than <code>maxVersion</code>, null is returned
58 @return false iff an out-of-memory condition occurred, in which case
59 <code>result</code> is left unchanged, and no type reader is created
63 REG_DLLPUBLIC sal_Bool SAL_CALL
typereg_reader_create(
64 void const * buffer
, sal_uInt32 length
, sal_Bool copy
,
65 enum typereg_Version maxVersion
, void ** result
)
69 Increments the reference count of a type reader.
71 @param handle a handle on a type reader; may be null
75 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_acquire(void * handle
) SAL_THROW_EXTERN_C();
78 Decrements the reference count of a type reader.
80 <p>If the reference count drops to zero, the type reader is destroyed.</p>
82 @param handle a handle on a type reader; may be null
86 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_release(void * handle
) SAL_THROW_EXTERN_C();
89 Returns the binary blob version of a type reader.
91 @param handle a handle on a type reader; may be null
93 @return the version of the binary blob from which the type reader was
94 constructed; if <code>handle</code> is null, <code>TYPEREG_VERSION_0</code>
99 REG_DLLPUBLIC
enum typereg_Version SAL_CALL
typereg_reader_getVersion(void * handle
)
100 SAL_THROW_EXTERN_C();
103 Returns the documentation of a type reader.
105 @param handle a handle on a type reader; may be null
107 @param result an out-parameter obtaining the documentation string; must not
108 be null; if <code>handle</code> is null, an empty string is returned; if an
109 out-of-memory condition occurs, a pointer to a null pointer is returned
113 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getDocumentation(
114 void * handle
, rtl_uString
** result
) SAL_THROW_EXTERN_C();
117 Returns the file name of a type reader.
119 @param handle a handle on a type reader; may be null
121 @param result an out-parameter obtaining the file name string; must not be
122 null; if <code>handle</code> is null, an empty string is returned; if an
123 out-of-memory condition occurs, a pointer to a null pointer is returned
128 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getFileName(void * handle
, rtl_uString
** result
)
129 SAL_THROW_EXTERN_C();
132 Returns the type class of a type reader.
134 <p>This function will always return the type class without the internal
135 <code>RT_TYPE_PUBLISHED</code> flag set. Use
136 <code>typereg_reader_isPublished</code> to determine whether a type reader is
139 @param handle a handle on a type reader; may be null
141 @return the type class of the type reader; if <code>handle</code> is null,
142 <code>RT_TYPE_INVALID</code> is returned
146 REG_DLLPUBLIC
enum RTTypeClass SAL_CALL
typereg_reader_getTypeClass(void * handle
)
147 SAL_THROW_EXTERN_C();
150 Returns whether a type reader is published.
152 @param handle a handle on a type reader; may be null
154 @return whether the type reader is published; if <code>handle</code> is null,
155 <code>sal_False</code> is returned
159 REG_DLLPUBLIC sal_Bool SAL_CALL
typereg_reader_isPublished(void * handle
)
160 SAL_THROW_EXTERN_C();
163 Returns the type name of a type reader.
165 @param handle a handle on a type reader; may be null
167 @param result an out-parameter obtaining the type name string; must not be
168 null; if <code>handle</code> is null, an empty string is returned; if an
169 out-of-memory condition occurs, a pointer to a null pointer is returned
173 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getTypeName(void * handle
, rtl_uString
** result
)
174 SAL_THROW_EXTERN_C();
177 Returns the number of super types of a type reader.
179 @param handle a handle on a type reader; may be null
181 @return the number of super types of the type reader; if <code>handle</code>
182 is null, zero is returned
186 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getSuperTypeCount(void * handle
)
187 SAL_THROW_EXTERN_C();
190 Returns the type name of a super type of a type reader.
192 @param handle a handle on a type reader; must not be null
194 @param result an out-parameter obtaining the super type's type name string;
195 must not be null; if an out-of-memory condition occurs, a pointer to a null
198 @param index a valid index into the range of super types of the given type
203 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getSuperTypeName(
204 void * handle
, rtl_uString
** result
, sal_uInt16 index
)
205 SAL_THROW_EXTERN_C();
208 Returns the number of fields of a type reader.
210 @param handle a handle on a type reader; may be null
212 @return the number of fields of the type reader; if <code>handle</code> is
213 null, zero is returned
217 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getFieldCount(void * handle
)
218 SAL_THROW_EXTERN_C();
221 Returns the documentation of a field of a type reader.
223 @param handle a handle on a type reader; must not be null
225 @param result an out-parameter obtaining the field's documentation string;
226 must not be null; if an out-of-memory condition occurs, a pointer to a null
229 @param index a valid index into the range of fields of the given type reader
233 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getFieldDocumentation(
234 void * handle
, rtl_uString
** result
, sal_uInt16 index
)
235 SAL_THROW_EXTERN_C();
238 Returns the file name of a field of a type reader.
240 @param handle a handle on a type reader; must not be null
242 @param result an out-parameter obtaining the field's file name string; must
243 not be null; if an out-of-memory condition occurs, a pointer to a null
246 @param index a valid index into the range of fields of the given type reader
251 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getFieldFileName(
252 void * handle
, rtl_uString
** result
, sal_uInt16 index
)
253 SAL_THROW_EXTERN_C();
256 Returns the flags of a field of a type reader.
258 @param handle a handle on a type reader; must not be null
260 @param index a valid index into the range of fields of the given type reader
262 @return the flags of the given field of the type reader
266 REG_DLLPUBLIC RTFieldAccess SAL_CALL
typereg_reader_getFieldFlags(
267 void * handle
, sal_uInt16 index
) SAL_THROW_EXTERN_C();
270 Returns the name of a field of a type reader.
272 @param handle a handle on a type reader; must not be null
274 @param result an out-parameter obtaining the field's name string; must not be
275 null; if an out-of-memory condition occurs, a pointer to a null pointer is
278 @param index a valid index into the range of fields of the given type reader
282 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getFieldName(
283 void * handle
, rtl_uString
** result
, sal_uInt16 index
)
284 SAL_THROW_EXTERN_C();
287 Returns the type name of a field of a type reader.
289 @param handle a handle on a type reader; must not be null
291 @param result an out-parameter obtaining the field's type name string; must
292 not be null; if an out-of-memory condition occurs, a pointer to a null
295 @param index a valid index into the range of fields of the given type reader
299 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getFieldTypeName(
300 void * handle
, rtl_uString
** result
, sal_uInt16 index
)
301 SAL_THROW_EXTERN_C();
304 Returns the value of a field of a type reader.
306 @param handle a handle on a type reader; must not be null
308 @param index a valid index into the range of fields of the given type reader
310 @param type an out-parameter obtaining the field value's type; must not be
313 @param value an out-parameter obtaining the field value's value; must not be
316 @return false iff an out-of-memory condition occurred, in which case
317 <code>type</code> and <code>value</code> are left unchanged
321 REG_DLLPUBLIC sal_Bool SAL_CALL
typereg_reader_getFieldValue(
322 void * handle
, sal_uInt16 index
, enum RTValueType
* type
,
323 union RTConstValueUnion
* value
)
324 SAL_THROW_EXTERN_C();
327 Returns the number of methods of a type reader.
329 @param handle a handle on a type reader; may be null
331 @return the number of methods of the type reader; if <code>handle</code> is
332 null, zero is returned
336 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getMethodCount(void * handle
)
337 SAL_THROW_EXTERN_C();
340 Returns the documentation of a method of a type reader.
342 @param handle a handle on a type reader; must not be null
344 @param result an out-parameter obtaining the methods's documentation string;
345 must not be null; if an out-of-memory condition occurs, a pointer to a null
348 @param index a valid index into the range of methods of the given type reader
352 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodDocumentation(
353 void * handle
, rtl_uString
** result
, sal_uInt16 index
)
354 SAL_THROW_EXTERN_C();
357 Returns the flags of a method of a type reader.
359 @param handle a handle on a type reader; must not be null
361 @param index a valid index into the range of methods of the given type reader
363 @return the flags of the given method of the type reader
367 REG_DLLPUBLIC
enum RTMethodMode SAL_CALL
typereg_reader_getMethodFlags(
368 void * handle
, sal_uInt16 index
) SAL_THROW_EXTERN_C();
371 Returns the name of a method of a type reader.
373 @param handle a handle on a type reader; must not be null
375 @param result an out-parameter obtaining the methods's name string; must not
376 be null; if an out-of-memory condition occurs, a pointer to a null pointer is
379 @param index a valid index into the range of methods of the given type reader
383 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodName(
384 void * handle
, rtl_uString
** result
, sal_uInt16 index
)
385 SAL_THROW_EXTERN_C();
388 Returns the return type name of a method of a type reader.
390 @param handle a handle on a type reader; must not be null
392 @param result an out-parameter obtaining the methods's return type name
393 string; must not be null; if an out-of-memory condition occurs, a pointer to
394 a null pointer is returned
396 @param index a valid index into the range of methods of the given type reader
400 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodReturnTypeName(
401 void * handle
, rtl_uString
** result
, sal_uInt16 index
)
402 SAL_THROW_EXTERN_C();
405 Returns the number of parameters of a method of a type reader.
407 @param handle a handle on a type reader; must not be null
409 @param index a valid index into the range of methods of the given type reader
411 @return the number of parameters of the given method of the type reader
415 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getMethodParameterCount(
416 void * handle
, sal_uInt16 index
) SAL_THROW_EXTERN_C();
419 Returns the flags of a parameter of a method of a type reader.
421 @param handle a handle on a type reader; must not be null
423 @param methodIndex a valid index into the range of methods of the given type
426 @param parameterIndex a valid index into the range of parameters of the given
429 @return the flags of the given parameter of the given method of the type
434 REG_DLLPUBLIC
enum RTParamMode SAL_CALL
typereg_reader_getMethodParameterFlags(
435 void * handle
, sal_uInt16 methodIndex
, sal_uInt16 parameterIndex
)
436 SAL_THROW_EXTERN_C();
439 Returns the name of a parameter of a method of a type reader.
441 @param handle a handle on a type reader; must not be null
443 @param result an out-parameter obtaining the parameter's name string; must
444 not be null; if an out-of-memory condition occurs, a pointer to a null
447 @param methodIndex a valid index into the range of methods of the given type
450 @param parameterIndex a valid index into the range of parameters of the given
455 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodParameterName(
456 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
457 sal_uInt16 parameterIndex
)
458 SAL_THROW_EXTERN_C();
461 Returns the type name of a parameter of a method of a type reader.
463 @param handle a handle on a type reader; must not be null
465 @param result an out-parameter obtaining the parameter's type name string;
466 must not be null; if an out-of-memory condition occurs, a pointer to a null
469 @param methodIndex a valid index into the range of methods of the given type
472 @param parameterIndex a valid index into the range of parameters of the given
477 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodParameterTypeName(
478 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
479 sal_uInt16 parameterIndex
)
480 SAL_THROW_EXTERN_C();
483 Returns the number of exceptions of a method of a type reader.
485 @param handle a handle on a type reader; must not be null
487 @param index a valid index into the range of methods of the given type reader
489 @return the number of exceptions of the given method of the type reader
493 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getMethodExceptionCount(
494 void * handle
, sal_uInt16 index
) SAL_THROW_EXTERN_C();
497 Returns the type name of an exception of a method of a type reader.
499 @param handle a handle on a type reader; must not be null
501 @param result an out-parameter obtaining the exception's type name string;
502 must not be null; if an out-of-memory condition occurs, a pointer to a null
505 @param methodIndex a valid index into the range of methods of the given type
508 @param exceptionIndex a valid index into the range of exceptions of the given
513 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodExceptionTypeName(
514 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
515 sal_uInt16 exceptionIndex
)
516 SAL_THROW_EXTERN_C();
519 Returns the number of references of a type reader.
521 @param handle a handle on a type reader; may be null
523 @return the number of references of the type reader; if <code>handle</code>
524 is null, zero is returned
528 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getReferenceCount(void * handle
)
529 SAL_THROW_EXTERN_C();
532 Returns the documentation of a reference of a type reader.
534 @param handle a handle on a type reader; must not be null
536 @param result an out-parameter obtaining the reference's documentation
537 string; must not be null; if an out-of-memory condition occurs, a pointer to
538 a null pointer is returned
540 @param index a valid index into the range of references of the given type
545 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getReferenceDocumentation(
546 void * handle
, rtl_uString
** result
, sal_uInt16 index
)
547 SAL_THROW_EXTERN_C();
550 Returns the flags of a reference of a type reader.
552 @param handle a handle on a type reader; must not be null
554 @param index a valid index into the range of references of the given type
557 @return the flags of the given reference of the type reader
561 REG_DLLPUBLIC RTFieldAccess SAL_CALL
typereg_reader_getReferenceFlags(
562 void * handle
, sal_uInt16 index
) SAL_THROW_EXTERN_C();
565 Returns the sort of a reference of a type reader.
567 @param handle a handle on a type reader; must not be null
569 @param index a valid index into the range of references of the given type
572 @return the sort of the given reference of the type reader
576 REG_DLLPUBLIC
enum RTReferenceType SAL_CALL
typereg_reader_getReferenceSort(
577 void * handle
, sal_uInt16 index
) SAL_THROW_EXTERN_C();
580 Returns the type name of a reference of a type reader.
582 @param handle a handle on a type reader; must not be null
584 @param result an out-parameter obtaining the reference's type name string;
585 must not be null; if an out-of-memory condition occurs, a pointer to a null
588 @param index a valid index into the range of references of the given type
593 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getReferenceTypeName(
594 void * handle
, rtl_uString
** result
, sal_uInt16 index
)
595 SAL_THROW_EXTERN_C();
603 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */