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.hxx>
25 #include <registry/version.h>
27 #include <rtl/ustring.h>
28 #include <sal/types.h>
31 Creates a type reader working on a binary blob that represents a UNOIDL type.
33 <p>If a non-null handle is returned through <code>result</code>, its
34 reference count will be one. Operations on a non-null handle are not
35 multi-thread–safe.</p>
37 The type reader works directly on the given buffer, which must remain
38 available unmodified until the type reader is destroyed
40 @param buffer the binary blob representing the type; must point to at least
41 <code>length</code> bytes, and need only be byte-aligned
43 @param length the size in bytes of the binary blob representing the type
45 @param result an out-parameter obtaining a handle on the type reader; must
46 not be null; if the given binary blob is malformed, or of a version larger
47 than <code>maxVersion</code>, null is returned
49 @return false iff an out-of-memory condition occurred, in which case
50 <code>result</code> is left unchanged, and no type reader is created
54 REG_DLLPUBLIC
bool typereg_reader_create(
55 void const * buffer
, sal_uInt32 length
,
59 Increments the reference count of a type reader.
61 @param handle a handle on a type reader; may be null
65 REG_DLLPUBLIC
void typereg_reader_acquire(void * handle
);
68 Decrements the reference count of a type reader.
70 <p>If the reference count drops to zero, the type reader is destroyed.</p>
72 @param handle a handle on a type reader; may be null
76 REG_DLLPUBLIC
void typereg_reader_release(void * handle
);
79 Returns the binary blob version of a type reader.
81 @param handle a handle on a type reader; may be null
83 @return the version of the binary blob from which the type reader was
84 constructed; if <code>handle</code> is null, <code>TYPEREG_VERSION_0</code>
89 REG_DLLPUBLIC typereg_Version
typereg_reader_getVersion(void const * handle
);
92 Returns the documentation of a type reader.
94 @param handle a handle on a type reader; may be null
96 @param result an out-parameter obtaining the documentation string; must not
97 be null; if <code>handle</code> is null, an empty string is returned; if an
98 out-of-memory condition occurs, a pointer to a null pointer is returned
102 REG_DLLPUBLIC
void typereg_reader_getDocumentation(
103 void * handle
, rtl_uString
** result
);
106 Returns the file name of a type reader.
108 @param handle a handle on a type reader; may be null
110 @param result an out-parameter obtaining the file name string; must not be
111 null; if <code>handle</code> is null, an empty string is returned; if an
112 out-of-memory condition occurs, a pointer to a null pointer is returned
117 REG_DLLPUBLIC
void typereg_reader_getFileName(void * handle
, rtl_uString
** result
);
120 Returns the type class of a type reader.
122 <p>This function will always return the type class without the internal
123 <code>RT_TYPE_PUBLISHED</code> flag set. Use
124 <code>typereg_reader_isPublished</code> to determine whether a type reader is
127 @param handle a handle on a type reader; may be null
129 @return the type class of the type reader; if <code>handle</code> is null,
130 <code>RT_TYPE_INVALID</code> is returned
134 REG_DLLPUBLIC RTTypeClass
typereg_reader_getTypeClass(void * handle
);
137 Returns whether a type reader is published.
139 @param handle a handle on a type reader; may be null
141 @return whether the type reader is published; if <code>handle</code> is null,
142 <code>sal_False</code> is returned
146 REG_DLLPUBLIC
bool typereg_reader_isPublished(void * handle
);
149 Returns the type name of a type reader.
151 @param handle a handle on a type reader; may be null
153 @param result an out-parameter obtaining the type name string; must not be
154 null; if <code>handle</code> is null, an empty string is returned; if an
155 out-of-memory condition occurs, a pointer to a null pointer is returned
159 REG_DLLPUBLIC
void typereg_reader_getTypeName(void * handle
, rtl_uString
** result
);
162 Returns the number of super types of a type reader.
164 @param handle a handle on a type reader; may be null
166 @return the number of super types of the type reader; if <code>handle</code>
167 is null, zero is returned
171 REG_DLLPUBLIC sal_uInt16
typereg_reader_getSuperTypeCount(void * handle
);
174 Returns the type name of a super type of a type reader.
176 @param handle a handle on a type reader; must not be null
178 @param result an out-parameter obtaining the super type's type name string;
179 must not be null; if an out-of-memory condition occurs, a pointer to a null
182 @param index a valid index into the range of super types of the given type
187 REG_DLLPUBLIC
void typereg_reader_getSuperTypeName(
188 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
191 Returns the number of fields of a type reader.
193 @param handle a handle on a type reader; may be null
195 @return the number of fields of the type reader; if <code>handle</code> is
196 null, zero is returned
200 REG_DLLPUBLIC sal_uInt16
typereg_reader_getFieldCount(void * handle
);
203 Returns the documentation of a field of a type reader.
205 @param handle a handle on a type reader; must not be null
207 @param result an out-parameter obtaining the field's documentation string;
208 must not be null; if an out-of-memory condition occurs, a pointer to a null
211 @param index a valid index into the range of fields of the given type reader
215 REG_DLLPUBLIC
void typereg_reader_getFieldDocumentation(
216 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
219 Returns the file name of a field of a type reader.
221 @param handle a handle on a type reader; must not be null
223 @param result an out-parameter obtaining the field's file name string; must
224 not be null; if an out-of-memory condition occurs, a pointer to a null
227 @param index a valid index into the range of fields of the given type reader
232 REG_DLLPUBLIC
void typereg_reader_getFieldFileName(
233 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
236 Returns the flags of a field of a type reader.
238 @param handle a handle on a type reader; must not be null
240 @param index a valid index into the range of fields of the given type reader
242 @return the flags of the given field of the type reader
246 REG_DLLPUBLIC RTFieldAccess
typereg_reader_getFieldFlags(
247 void * handle
, sal_uInt16 index
);
250 Returns the name of a field of a type reader.
252 @param handle a handle on a type reader; must not be null
254 @param result an out-parameter obtaining the field's name string; must not be
255 null; if an out-of-memory condition occurs, a pointer to a null pointer is
258 @param index a valid index into the range of fields of the given type reader
262 REG_DLLPUBLIC
void typereg_reader_getFieldName(
263 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
266 Returns the type name of a field of a type reader.
268 @param handle a handle on a type reader; must not be null
270 @param result an out-parameter obtaining the field's type name string; must
271 not be null; if an out-of-memory condition occurs, a pointer to a null
274 @param index a valid index into the range of fields of the given type reader
278 REG_DLLPUBLIC
void typereg_reader_getFieldTypeName(
279 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
282 Returns the value of a field of a type reader.
284 @param handle a handle on a type reader; must not be null
286 @param index a valid index into the range of fields of the given type reader
288 @param type an out-parameter obtaining the field value's type; must not be
291 @param value an out-parameter obtaining the field value's value; must not be
294 @return false iff an out-of-memory condition occurred, in which case
295 <code>type</code> and <code>value</code> are left unchanged
299 REG_DLLPUBLIC
bool typereg_reader_getFieldValue(
300 void * handle
, sal_uInt16 index
, RTValueType
* type
,
301 union RTConstValueUnion
* value
);
304 Returns the number of methods of a type reader.
306 @param handle a handle on a type reader; may be null
308 @return the number of methods of the type reader; if <code>handle</code> is
309 null, zero is returned
313 REG_DLLPUBLIC sal_uInt16
typereg_reader_getMethodCount(void * handle
);
316 Returns the documentation of a method of a type reader.
318 @param handle a handle on a type reader; must not be null
320 @param result an out-parameter obtaining the methods's documentation string;
321 must not be null; if an out-of-memory condition occurs, a pointer to a null
324 @param index a valid index into the range of methods of the given type reader
328 REG_DLLPUBLIC
void typereg_reader_getMethodDocumentation(
329 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
332 Returns the flags of a method of a type reader.
334 @param handle a handle on a type reader; must not be null
336 @param index a valid index into the range of methods of the given type reader
338 @return the flags of the given method of the type reader
342 REG_DLLPUBLIC RTMethodMode
typereg_reader_getMethodFlags(
343 void * handle
, sal_uInt16 index
);
346 Returns the name of a method of a type reader.
348 @param handle a handle on a type reader; must not be null
350 @param result an out-parameter obtaining the methods's name string; must not
351 be null; if an out-of-memory condition occurs, a pointer to a null pointer is
354 @param index a valid index into the range of methods of the given type reader
358 REG_DLLPUBLIC
void typereg_reader_getMethodName(
359 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
362 Returns the return type name of a method of a type reader.
364 @param handle a handle on a type reader; must not be null
366 @param result an out-parameter obtaining the methods's return type name
367 string; must not be null; if an out-of-memory condition occurs, a pointer to
368 a null pointer is returned
370 @param index a valid index into the range of methods of the given type reader
374 REG_DLLPUBLIC
void typereg_reader_getMethodReturnTypeName(
375 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
378 Returns the number of parameters of a method of a type reader.
380 @param handle a handle on a type reader; must not be null
382 @param index a valid index into the range of methods of the given type reader
384 @return the number of parameters of the given method of the type reader
388 REG_DLLPUBLIC sal_uInt16
typereg_reader_getMethodParameterCount(
389 void * handle
, sal_uInt16 index
);
392 Returns the flags of a parameter of a method of a type reader.
394 @param handle a handle on a type reader; must not be null
396 @param methodIndex a valid index into the range of methods of the given type
399 @param parameterIndex a valid index into the range of parameters of the given
402 @return the flags of the given parameter of the given method of the type
407 REG_DLLPUBLIC RTParamMode
typereg_reader_getMethodParameterFlags(
408 void * handle
, sal_uInt16 methodIndex
, sal_uInt16 parameterIndex
);
411 Returns the name of a parameter of a method of a type reader.
413 @param handle a handle on a type reader; must not be null
415 @param result an out-parameter obtaining the parameter's name string; must
416 not be null; if an out-of-memory condition occurs, a pointer to a null
419 @param methodIndex a valid index into the range of methods of the given type
422 @param parameterIndex a valid index into the range of parameters of the given
427 REG_DLLPUBLIC
void typereg_reader_getMethodParameterName(
428 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
429 sal_uInt16 parameterIndex
);
432 Returns the type name of a parameter of a method of a type reader.
434 @param handle a handle on a type reader; must not be null
436 @param result an out-parameter obtaining the parameter's type name string;
437 must not be null; if an out-of-memory condition occurs, a pointer to a null
440 @param methodIndex a valid index into the range of methods of the given type
443 @param parameterIndex a valid index into the range of parameters of the given
448 REG_DLLPUBLIC
void typereg_reader_getMethodParameterTypeName(
449 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
450 sal_uInt16 parameterIndex
);
453 Returns the number of exceptions of a method of a type reader.
455 @param handle a handle on a type reader; must not be null
457 @param index a valid index into the range of methods of the given type reader
459 @return the number of exceptions of the given method of the type reader
463 REG_DLLPUBLIC sal_uInt16
typereg_reader_getMethodExceptionCount(
464 void * handle
, sal_uInt16 index
);
467 Returns the type name of an exception of a method of a type reader.
469 @param handle a handle on a type reader; must not be null
471 @param result an out-parameter obtaining the exception's type name string;
472 must not be null; if an out-of-memory condition occurs, a pointer to a null
475 @param methodIndex a valid index into the range of methods of the given type
478 @param exceptionIndex a valid index into the range of exceptions of the given
483 REG_DLLPUBLIC
void typereg_reader_getMethodExceptionTypeName(
484 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
485 sal_uInt16 exceptionIndex
);
488 Returns the number of references of a type reader.
490 @param handle a handle on a type reader; may be null
492 @return the number of references of the type reader; if <code>handle</code>
493 is null, zero is returned
497 REG_DLLPUBLIC sal_uInt16
typereg_reader_getReferenceCount(void * handle
);
500 Returns the documentation of a reference of a type reader.
502 @param handle a handle on a type reader; must not be null
504 @param result an out-parameter obtaining the reference's documentation
505 string; must not be null; if an out-of-memory condition occurs, a pointer to
506 a null pointer is returned
508 @param index a valid index into the range of references of the given type
513 REG_DLLPUBLIC
void typereg_reader_getReferenceDocumentation(
514 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
517 Returns the flags of a reference of a type reader.
519 @param handle a handle on a type reader; must not be null
521 @param index a valid index into the range of references of the given type
524 @return the flags of the given reference of the type reader
528 REG_DLLPUBLIC RTFieldAccess
typereg_reader_getReferenceFlags(
529 void * handle
, sal_uInt16 index
);
532 Returns the sort of a reference of a type reader.
534 @param handle a handle on a type reader; must not be null
536 @param index a valid index into the range of references of the given type
539 @return the sort of the given reference of the type reader
543 REG_DLLPUBLIC RTReferenceType
typereg_reader_getReferenceSort(
544 void * handle
, sal_uInt16 index
);
547 Returns the type name of a reference of a type reader.
549 @param handle a handle on a type reader; must not be null
551 @param result an out-parameter obtaining the reference's type name string;
552 must not be null; if an out-of-memory condition occurs, a pointer to a null
555 @param index a valid index into the range of references of the given type
560 REG_DLLPUBLIC
void typereg_reader_getReferenceTypeName(
561 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
565 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */