My Project
UDK 3.2.7 C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
reflread.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 #ifndef _REGISTRY_REFLREAD_HXX_
21 #define _REGISTRY_REFLREAD_HXX_
22 
23 #include <registry/regdllapi.h>
24 #include <registry/refltype.hxx>
25 #include <registry/regtype.h>
26 #include <rtl/ustring.hxx>
27 
29 typedef void* TypeReaderImpl;
30 
31 /****************************************************************************
32 
33  C-Api
34 
35 *****************************************************************************/
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
46 {
50  sal_uInt16 (TYPEREG_CALLTYPE *getMinorVersion) (TypeReaderImpl);
51  sal_uInt16 (TYPEREG_CALLTYPE *getMajorVersion) (TypeReaderImpl);
54  void (TYPEREG_CALLTYPE *getDoku) (TypeReaderImpl, rtl_uString**);
55  void (TYPEREG_CALLTYPE *getFileName) (TypeReaderImpl, rtl_uString**);
56  void (TYPEREG_CALLTYPE *getTypeName) (TypeReaderImpl, rtl_uString**);
57  void (TYPEREG_CALLTYPE *getSuperTypeName) (TypeReaderImpl, rtl_uString**);
58  sal_uInt32 (TYPEREG_CALLTYPE *getFieldCount) (TypeReaderImpl);
59  void (TYPEREG_CALLTYPE *getFieldName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
60  void (TYPEREG_CALLTYPE *getFieldType) (TypeReaderImpl, rtl_uString**, sal_uInt16);
63  void (TYPEREG_CALLTYPE *getFieldDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16);
64  void (TYPEREG_CALLTYPE *getFieldFileName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
65  sal_uInt32 (TYPEREG_CALLTYPE *getMethodCount) (TypeReaderImpl);
66  void (TYPEREG_CALLTYPE *getMethodName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
67  sal_uInt32 (TYPEREG_CALLTYPE *getMethodParamCount) (TypeReaderImpl, sal_uInt16);
68  void (TYPEREG_CALLTYPE *getMethodParamType) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
69  void (TYPEREG_CALLTYPE *getMethodParamName) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
71  sal_uInt32 (TYPEREG_CALLTYPE *getMethodExcCount) (TypeReaderImpl, sal_uInt16);
72  void (TYPEREG_CALLTYPE *getMethodExcType) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
73  void (TYPEREG_CALLTYPE *getMethodReturnType) (TypeReaderImpl, rtl_uString**, sal_uInt16);
75  void (TYPEREG_CALLTYPE *getMethodDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16);
76 
77  sal_uInt32 (TYPEREG_CALLTYPE *getReferenceCount) (TypeReaderImpl);
78  void (TYPEREG_CALLTYPE *getReferenceName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
80  void (TYPEREG_CALLTYPE *getReferenceDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16);
82 };
83 
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
102 {
103 public:
104 
113  inline RegistryTypeReader(const sal_uInt8* buffer,
114  sal_uInt32 bufferLen,
115  sal_Bool copyData);
116 
118  inline RegistryTypeReader(const RegistryTypeReader& toCopy);
119 
121  inline ~RegistryTypeReader();
122 
124  inline RegistryTypeReader& operator == (const RegistryTypeReader& toAssign);
125 
127  inline sal_Bool isValid() const;
128 
135  inline sal_uInt16 getMinorVersion() const;
136 
143  inline sal_uInt16 getMajorVersion() const;
144 
150  inline RTTypeClass getTypeClass() const;
151 
154  inline ::rtl::OUString getTypeName() const;
155 
158  inline ::rtl::OUString getSuperTypeName() const;
159 
167  inline void getUik(RTUik& uik) const;
168 
171  inline ::rtl::OUString getDoku() const;
172 
175  inline ::rtl::OUString getFileName() const;
176 
181  inline sal_uInt32 getFieldCount() const;
182 
185  inline ::rtl::OUString getFieldName( sal_uInt16 index ) const;
186 
189  inline ::rtl::OUString getFieldType( sal_uInt16 index ) const;
190 
193  inline RTFieldAccess getFieldAccess( sal_uInt16 index ) const;
194 
199  inline RTConstValue getFieldConstValue( sal_uInt16 index ) const;
200 
205  inline ::rtl::OUString getFieldDoku( sal_uInt16 index ) const;
206 
212  inline ::rtl::OUString getFieldFileName( sal_uInt16 index ) const;
213 
216  inline sal_uInt32 getMethodCount() const;
217 
220  inline ::rtl::OUString getMethodName( sal_uInt16 index ) const;
221 
224  inline sal_uInt32 getMethodParamCount( sal_uInt16 index ) const;
225 
231  inline ::rtl::OUString getMethodParamType( sal_uInt16 index, sal_uInt16 paramIndex ) const;
232 
238  inline ::rtl::OUString getMethodParamName( sal_uInt16 index, sal_uInt16 paramIndex ) const;
239 
245  inline RTParamMode getMethodParamMode( sal_uInt16 index, sal_uInt16 paramIndex ) const;
246 
251  inline sal_uInt32 getMethodExcCount( sal_uInt16 index ) const;
252 
258  inline ::rtl::OUString getMethodExcType( sal_uInt16 index, sal_uInt16 excIndex ) const;
259 
262  inline ::rtl::OUString getMethodReturnType( sal_uInt16 index ) const;
263 
268  inline RTMethodMode getMethodMode( sal_uInt16 index ) const;
269 
274  inline ::rtl::OUString getMethodDoku( sal_uInt16 index ) const;
275 
278  inline sal_uInt32 getReferenceCount() const;
279 
284  inline ::rtl::OUString getReferenceName( sal_uInt16 index ) const;
285 
290  inline RTReferenceType getReferenceType( sal_uInt16 index ) const;
291 
296  inline ::rtl::OUString getReferenceDoku( sal_uInt16 index ) const;
297 
304  inline RTFieldAccess getReferenceAccess( sal_uInt16 index ) const;
305 
306 protected:
307 
312 };
313 
314 
315 
317  sal_uInt32 bufferLen,
318  sal_Bool copyData)
319  : m_pApi(initRegistryTypeReader_Api())
320  , m_hImpl(NULL)
321  {
322  m_hImpl = m_pApi->createEntry(buffer, bufferLen, copyData);
323  }
324 
325 
327  : m_pApi(toCopy.m_pApi)
328  , m_hImpl(toCopy.m_hImpl)
329  { m_pApi->acquire(m_hImpl); }
330 
331 
333  { m_pApi->release(m_hImpl); }
334 
336 {
337  if (m_hImpl != toAssign.m_hImpl)
338  {
339  m_pApi->release(m_hImpl);
340  m_hImpl = toAssign.m_hImpl;
341  m_pApi->acquire(m_hImpl);
342  }
343 
344  return *this;
345 }
346 
347 inline sal_uInt16 RegistryTypeReader::getMinorVersion() const
348  { return m_pApi->getMinorVersion(m_hImpl); }
349 
351  { return (m_hImpl != NULL); }
352 
353 inline sal_uInt16 RegistryTypeReader::getMajorVersion() const
354  { return m_pApi->getMajorVersion(m_hImpl); }
355 
357  { return m_pApi->getTypeClass(m_hImpl); }
358 
359 inline ::rtl::OUString RegistryTypeReader::getTypeName() const
360  {
361  ::rtl::OUString sRet;
362  m_pApi->getTypeName(m_hImpl, &sRet.pData);
363  return sRet;
364  }
365 
366 inline ::rtl::OUString RegistryTypeReader::getSuperTypeName() const
367  {
368  ::rtl::OUString sRet;
369  m_pApi->getSuperTypeName(m_hImpl, &sRet.pData);
370  return sRet;
371  }
372 
373 inline void RegistryTypeReader::getUik(RTUik& uik) const
374  { m_pApi->getUik(m_hImpl, &uik); }
375 
376 inline ::rtl::OUString RegistryTypeReader::getDoku() const
377  {
378  ::rtl::OUString sRet;
379  m_pApi->getDoku(m_hImpl, &sRet.pData);
380  return sRet;
381  }
382 
383 inline ::rtl::OUString RegistryTypeReader::getFileName() const
384  {
385  ::rtl::OUString sRet;
386  m_pApi->getFileName(m_hImpl, &sRet.pData);
387  return sRet;
388  }
389 
390 inline sal_uInt32 RegistryTypeReader::getFieldCount() const
391  { return m_pApi->getFieldCount(m_hImpl); }
392 
393 inline ::rtl::OUString RegistryTypeReader::getFieldName( sal_uInt16 index ) const
394  {
395  ::rtl::OUString sRet;
396  m_pApi->getFieldName(m_hImpl, &sRet.pData, index);
397  return sRet;
398  }
399 
400 inline ::rtl::OUString RegistryTypeReader::getFieldType( sal_uInt16 index ) const
401  {
402  ::rtl::OUString sRet;
403  m_pApi->getFieldType(m_hImpl, &sRet.pData, index);
404  return sRet;
405  }
406 
407 inline RTFieldAccess RegistryTypeReader::getFieldAccess( sal_uInt16 index ) const
408  { return m_pApi->getFieldAccess(m_hImpl, index); }
409 
410 inline RTConstValue RegistryTypeReader::getFieldConstValue( sal_uInt16 index ) const
411  {
412  RTConstValue ret;
413  ret.m_type = m_pApi->getFieldConstValue(m_hImpl, index, &ret.m_value);
414  return ret;
415  }
416 
417 inline ::rtl::OUString RegistryTypeReader::getFieldDoku( sal_uInt16 index ) const
418  {
419  ::rtl::OUString sRet;
420  m_pApi->getFieldDoku(m_hImpl, &sRet.pData, index);
421  return sRet;
422  }
423 
424 inline ::rtl::OUString RegistryTypeReader::getFieldFileName( sal_uInt16 index ) const
425  {
426  ::rtl::OUString sRet;
427  m_pApi->getFieldFileName(m_hImpl, &sRet.pData, index);
428  return sRet;
429  }
430 
431 inline sal_uInt32 RegistryTypeReader::getMethodCount() const
432  { return m_pApi->getMethodCount(m_hImpl); }
433 
434 inline ::rtl::OUString RegistryTypeReader::getMethodName( sal_uInt16 index ) const
435  {
436  ::rtl::OUString sRet;
437  m_pApi->getMethodName(m_hImpl, &sRet.pData, index);
438  return sRet;
439  }
440 
441 inline sal_uInt32 RegistryTypeReader::getMethodParamCount( sal_uInt16 index ) const
442  { return m_pApi->getMethodParamCount(m_hImpl, index); }
443 
444 inline ::rtl::OUString RegistryTypeReader::getMethodParamType( sal_uInt16 index, sal_uInt16 paramIndex ) const
445  {
446  ::rtl::OUString sRet;
447  m_pApi->getMethodParamType(m_hImpl, &sRet.pData, index, paramIndex);
448  return sRet;
449  }
450 
451 inline ::rtl::OUString RegistryTypeReader::getMethodParamName( sal_uInt16 index, sal_uInt16 paramIndex ) const
452  {
453  ::rtl::OUString sRet;
454  m_pApi->getMethodParamName(m_hImpl, &sRet.pData, index, paramIndex);
455  return sRet;
456  }
457 
458 inline RTParamMode RegistryTypeReader::getMethodParamMode( sal_uInt16 index, sal_uInt16 paramIndex ) const
459  { return m_pApi->getMethodParamMode(m_hImpl, index, paramIndex); }
460 
461 inline sal_uInt32 RegistryTypeReader::getMethodExcCount( sal_uInt16 index ) const
462  { return m_pApi->getMethodExcCount(m_hImpl, index); }
463 
464 inline ::rtl::OUString RegistryTypeReader::getMethodExcType( sal_uInt16 index, sal_uInt16 excIndex ) const
465  {
466  ::rtl::OUString sRet;
467  m_pApi->getMethodExcType(m_hImpl, &sRet.pData, index, excIndex);
468  return sRet;
469  }
470 
471 inline ::rtl::OUString RegistryTypeReader::getMethodReturnType( sal_uInt16 index ) const
472  {
473  ::rtl::OUString sRet;
474  m_pApi->getMethodReturnType(m_hImpl, &sRet.pData, index);
475  return sRet;
476  }
477 
478 inline RTMethodMode RegistryTypeReader::getMethodMode( sal_uInt16 index ) const
479  { return m_pApi->getMethodMode(m_hImpl, index); }
480 
481 inline ::rtl::OUString RegistryTypeReader::getMethodDoku( sal_uInt16 index ) const
482  {
483  ::rtl::OUString sRet;
484  m_pApi->getMethodDoku(m_hImpl, &sRet.pData, index);
485  return sRet;
486  }
487 
488 inline sal_uInt32 RegistryTypeReader::getReferenceCount() const
489  { return m_pApi->getReferenceCount(m_hImpl); }
490 
491 inline ::rtl::OUString RegistryTypeReader::getReferenceName( sal_uInt16 index ) const
492  {
493  ::rtl::OUString sRet;
494  m_pApi->getReferenceName(m_hImpl, &sRet.pData, index);
495  return sRet;
496  }
497 
499  { return m_pApi->getReferenceType(m_hImpl, index); }
500 
501 inline ::rtl::OUString RegistryTypeReader::getReferenceDoku( sal_uInt16 index ) const
502  {
503  ::rtl::OUString sRet;
504  m_pApi->getReferenceDoku(m_hImpl, &sRet.pData, index);
505  return sRet;
506  }
507 
509  { return m_pApi->getReferenceAccess(m_hImpl, index); }
510 
511 #endif
512 
513 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */