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 @param buffer the binary blob representing the type; must point to at least
38 <code>length</code> bytes, and need only be byte-aligned
40 @param length the size in bytes of the binary blob representing the type
42 @param copy if true, the type reader creates an internal copy of the given
43 buffer, and the given buffer is not accessed after this function returns; if
44 false, the type reader works directly on the given buffer, which must remain
45 available unmodified until the type reader is destroyed
47 @param maxVersion the maximum binary blob version the client is prepared to
48 handle; must not be negative
50 @param result an out-parameter obtaining a handle on the type reader; must
51 not be null; if the given binary blob is malformed, or of a version larger
52 than <code>maxVersion</code>, null is returned
54 @return false iff an out-of-memory condition occurred, in which case
55 <code>result</code> is left unchanged, and no type reader is created
59 REG_DLLPUBLIC
bool SAL_CALL
typereg_reader_create(
60 void const * buffer
, sal_uInt32 length
, bool copy
,
61 typereg_Version maxVersion
, void ** result
);
64 Increments the reference count of a type reader.
66 @param handle a handle on a type reader; may be null
70 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_acquire(void * handle
);
73 Decrements the reference count of a type reader.
75 <p>If the reference count drops to zero, the type reader is destroyed.</p>
77 @param handle a handle on a type reader; may be null
81 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_release(void * handle
);
84 Returns the binary blob version of a type reader.
86 @param handle a handle on a type reader; may be null
88 @return the version of the binary blob from which the type reader was
89 constructed; if <code>handle</code> is null, <code>TYPEREG_VERSION_0</code>
94 REG_DLLPUBLIC typereg_Version SAL_CALL
typereg_reader_getVersion(void * handle
);
97 Returns the documentation of a type reader.
99 @param handle a handle on a type reader; may be null
101 @param result an out-parameter obtaining the documentation string; must not
102 be null; if <code>handle</code> is null, an empty string is returned; if an
103 out-of-memory condition occurs, a pointer to a null pointer is returned
107 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getDocumentation(
108 void * handle
, rtl_uString
** result
);
111 Returns the file name of a type reader.
113 @param handle a handle on a type reader; may be null
115 @param result an out-parameter obtaining the file name string; must not be
116 null; if <code>handle</code> is null, an empty string is returned; if an
117 out-of-memory condition occurs, a pointer to a null pointer is returned
122 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getFileName(void * handle
, rtl_uString
** result
);
125 Returns the type class of a type reader.
127 <p>This function will always return the type class without the internal
128 <code>RT_TYPE_PUBLISHED</code> flag set. Use
129 <code>typereg_reader_isPublished</code> to determine whether a type reader is
132 @param handle a handle on a type reader; may be null
134 @return the type class of the type reader; if <code>handle</code> is null,
135 <code>RT_TYPE_INVALID</code> is returned
139 REG_DLLPUBLIC RTTypeClass SAL_CALL
typereg_reader_getTypeClass(void * handle
);
142 Returns whether a type reader is published.
144 @param handle a handle on a type reader; may be null
146 @return whether the type reader is published; if <code>handle</code> is null,
147 <code>sal_False</code> is returned
151 REG_DLLPUBLIC
bool SAL_CALL
typereg_reader_isPublished(void * handle
);
154 Returns the type name of a type reader.
156 @param handle a handle on a type reader; may be null
158 @param result an out-parameter obtaining the type name string; must not be
159 null; if <code>handle</code> is null, an empty string is returned; if an
160 out-of-memory condition occurs, a pointer to a null pointer is returned
164 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getTypeName(void * handle
, rtl_uString
** result
);
167 Returns the number of super types of a type reader.
169 @param handle a handle on a type reader; may be null
171 @return the number of super types of the type reader; if <code>handle</code>
172 is null, zero is returned
176 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getSuperTypeCount(void * handle
);
179 Returns the type name of a super type of a type reader.
181 @param handle a handle on a type reader; must not be null
183 @param result an out-parameter obtaining the super type's type name string;
184 must not be null; if an out-of-memory condition occurs, a pointer to a null
187 @param index a valid index into the range of super types of the given type
192 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getSuperTypeName(
193 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
196 Returns the number of fields of a type reader.
198 @param handle a handle on a type reader; may be null
200 @return the number of fields of the type reader; if <code>handle</code> is
201 null, zero is returned
205 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getFieldCount(void * handle
);
208 Returns the documentation of a field of a type reader.
210 @param handle a handle on a type reader; must not be null
212 @param result an out-parameter obtaining the field's documentation string;
213 must not be null; if an out-of-memory condition occurs, a pointer to a null
216 @param index a valid index into the range of fields of the given type reader
220 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getFieldDocumentation(
221 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
224 Returns the file name of a field of a type reader.
226 @param handle a handle on a type reader; must not be null
228 @param result an out-parameter obtaining the field's file name string; must
229 not be null; if an out-of-memory condition occurs, a pointer to a null
232 @param index a valid index into the range of fields of the given type reader
237 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getFieldFileName(
238 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
241 Returns the flags of a field of a type reader.
243 @param handle a handle on a type reader; must not be null
245 @param index a valid index into the range of fields of the given type reader
247 @return the flags of the given field of the type reader
251 REG_DLLPUBLIC RTFieldAccess SAL_CALL
typereg_reader_getFieldFlags(
252 void * handle
, sal_uInt16 index
);
255 Returns the name of a field of a type reader.
257 @param handle a handle on a type reader; must not be null
259 @param result an out-parameter obtaining the field's name string; must not be
260 null; if an out-of-memory condition occurs, a pointer to a null pointer is
263 @param index a valid index into the range of fields of the given type reader
267 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getFieldName(
268 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
271 Returns the type name of a field of a type reader.
273 @param handle a handle on a type reader; must not be null
275 @param result an out-parameter obtaining the field's type name string; must
276 not be null; if an out-of-memory condition occurs, a pointer to a null
279 @param index a valid index into the range of fields of the given type reader
283 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getFieldTypeName(
284 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
287 Returns the value of a field of a type reader.
289 @param handle a handle on a type reader; must not be null
291 @param index a valid index into the range of fields of the given type reader
293 @param type an out-parameter obtaining the field value's type; must not be
296 @param value an out-parameter obtaining the field value's value; must not be
299 @return false iff an out-of-memory condition occurred, in which case
300 <code>type</code> and <code>value</code> are left unchanged
304 REG_DLLPUBLIC
bool SAL_CALL
typereg_reader_getFieldValue(
305 void * handle
, sal_uInt16 index
, RTValueType
* type
,
306 union RTConstValueUnion
* value
);
309 Returns the number of methods of a type reader.
311 @param handle a handle on a type reader; may be null
313 @return the number of methods of the type reader; if <code>handle</code> is
314 null, zero is returned
318 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getMethodCount(void * handle
);
321 Returns the documentation of a method of a type reader.
323 @param handle a handle on a type reader; must not be null
325 @param result an out-parameter obtaining the methods's documentation string;
326 must not be null; if an out-of-memory condition occurs, a pointer to a null
329 @param index a valid index into the range of methods of the given type reader
333 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodDocumentation(
334 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
337 Returns the flags of a method of a type reader.
339 @param handle a handle on a type reader; must not be null
341 @param index a valid index into the range of methods of the given type reader
343 @return the flags of the given method of the type reader
347 REG_DLLPUBLIC RTMethodMode SAL_CALL
typereg_reader_getMethodFlags(
348 void * handle
, sal_uInt16 index
);
351 Returns the name of a method of a type reader.
353 @param handle a handle on a type reader; must not be null
355 @param result an out-parameter obtaining the methods's name string; must not
356 be null; if an out-of-memory condition occurs, a pointer to a null pointer is
359 @param index a valid index into the range of methods of the given type reader
363 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodName(
364 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
367 Returns the return type name of a method of a type reader.
369 @param handle a handle on a type reader; must not be null
371 @param result an out-parameter obtaining the methods's return type name
372 string; must not be null; if an out-of-memory condition occurs, a pointer to
373 a null pointer is returned
375 @param index a valid index into the range of methods of the given type reader
379 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodReturnTypeName(
380 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
383 Returns the number of parameters of a method of a type reader.
385 @param handle a handle on a type reader; must not be null
387 @param index a valid index into the range of methods of the given type reader
389 @return the number of parameters of the given method of the type reader
393 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getMethodParameterCount(
394 void * handle
, sal_uInt16 index
);
397 Returns the flags of a parameter of a method of a type reader.
399 @param handle a handle on a type reader; must not be null
401 @param methodIndex a valid index into the range of methods of the given type
404 @param parameterIndex a valid index into the range of parameters of the given
407 @return the flags of the given parameter of the given method of the type
412 REG_DLLPUBLIC RTParamMode SAL_CALL
typereg_reader_getMethodParameterFlags(
413 void * handle
, sal_uInt16 methodIndex
, sal_uInt16 parameterIndex
);
416 Returns the name of a parameter of a method of a type reader.
418 @param handle a handle on a type reader; must not be null
420 @param result an out-parameter obtaining the parameter's name string; must
421 not be null; if an out-of-memory condition occurs, a pointer to a null
424 @param methodIndex a valid index into the range of methods of the given type
427 @param parameterIndex a valid index into the range of parameters of the given
432 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodParameterName(
433 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
434 sal_uInt16 parameterIndex
);
437 Returns the type name of a parameter of a method of a type reader.
439 @param handle a handle on a type reader; must not be null
441 @param result an out-parameter obtaining the parameter's type name string;
442 must not be null; if an out-of-memory condition occurs, a pointer to a null
445 @param methodIndex a valid index into the range of methods of the given type
448 @param parameterIndex a valid index into the range of parameters of the given
453 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodParameterTypeName(
454 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
455 sal_uInt16 parameterIndex
);
458 Returns the number of exceptions of a method of a type reader.
460 @param handle a handle on a type reader; must not be null
462 @param index a valid index into the range of methods of the given type reader
464 @return the number of exceptions of the given method of the type reader
468 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getMethodExceptionCount(
469 void * handle
, sal_uInt16 index
);
472 Returns the type name of an exception of a method of a type reader.
474 @param handle a handle on a type reader; must not be null
476 @param result an out-parameter obtaining the exception's type name string;
477 must not be null; if an out-of-memory condition occurs, a pointer to a null
480 @param methodIndex a valid index into the range of methods of the given type
483 @param exceptionIndex a valid index into the range of exceptions of the given
488 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getMethodExceptionTypeName(
489 void * handle
, rtl_uString
** result
, sal_uInt16 methodIndex
,
490 sal_uInt16 exceptionIndex
);
493 Returns the number of references of a type reader.
495 @param handle a handle on a type reader; may be null
497 @return the number of references of the type reader; if <code>handle</code>
498 is null, zero is returned
502 REG_DLLPUBLIC sal_uInt16 SAL_CALL
typereg_reader_getReferenceCount(void * handle
);
505 Returns the documentation of a reference of a type reader.
507 @param handle a handle on a type reader; must not be null
509 @param result an out-parameter obtaining the reference's documentation
510 string; must not be null; if an out-of-memory condition occurs, a pointer to
511 a null pointer is returned
513 @param index a valid index into the range of references of the given type
518 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getReferenceDocumentation(
519 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
522 Returns the flags of a reference of a type reader.
524 @param handle a handle on a type reader; must not be null
526 @param index a valid index into the range of references of the given type
529 @return the flags of the given reference of the type reader
533 REG_DLLPUBLIC RTFieldAccess SAL_CALL
typereg_reader_getReferenceFlags(
534 void * handle
, sal_uInt16 index
);
537 Returns the sort of a reference of a type reader.
539 @param handle a handle on a type reader; must not be null
541 @param index a valid index into the range of references of the given type
544 @return the sort of the given reference of the type reader
548 REG_DLLPUBLIC RTReferenceType SAL_CALL
typereg_reader_getReferenceSort(
549 void * handle
, sal_uInt16 index
);
552 Returns the type name of a reference of a type reader.
554 @param handle a handle on a type reader; must not be null
556 @param result an out-parameter obtaining the reference's type name string;
557 must not be null; if an out-of-memory condition occurs, a pointer to a null
560 @param index a valid index into the range of references of the given type
565 REG_DLLPUBLIC
void SAL_CALL
typereg_reader_getReferenceTypeName(
566 void * handle
, rtl_uString
** result
, sal_uInt16 index
);
570 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */