LibreOffice
LibreOffice 5.1 SDK C/C++ API Reference
Any.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 #ifndef INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
20 #define INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
21 
22 #include <sal/config.h>
23 
24 #include <cassert>
25 #include <cstddef>
26 #include <iomanip>
27 #include <ostream>
28 
29 #include <com/sun/star/uno/Any.h>
30 #include <uno/data.h>
31 #include <uno/sequence2.h>
35 #include <com/sun/star/uno/RuntimeException.hpp>
36 #include <cppu/cppudllapi.h>
37 #include <cppu/unotype.hxx>
38 
39 extern "C" CPPU_DLLPUBLIC rtl_uString * SAL_CALL cppu_Any_extraction_failure_msg(
40  uno_Any const * pAny, typelib_TypeDescriptionReference * pType )
42 
43 namespace com
44 {
45 namespace sun
46 {
47 namespace star
48 {
49 namespace uno
50 {
51 
52 
53 inline Any::Any()
54 {
55  ::uno_any_construct( this, NULL, NULL, cpp_acquire );
56 }
57 
58 
59 template <typename T>
60 inline Any::Any( T const & value )
61 {
63  this, const_cast<T *>(&value),
64  ::cppu::getTypeFavourUnsigned(&value).getTypeLibType(),
65  cpp_acquire );
66 }
67 
68 inline Any::Any( bool value )
69 {
70  sal_Bool b = value;
72  this, &b, cppu::UnoType<bool>::get().getTypeLibType(),
73  cpp_acquire );
74 }
75 
76 
77 inline Any::Any( const Any & rAny )
78 {
79  ::uno_type_any_construct( this, rAny.pData, rAny.pType, cpp_acquire );
80 }
81 
82 inline Any::Any( const void * pData_, const Type & rType )
83 {
85  this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
86  cpp_acquire );
87 }
88 
89 inline Any::Any( const void * pData_, typelib_TypeDescription * pTypeDescr )
90 {
92  this, const_cast< void * >( pData_ ), pTypeDescr, cpp_acquire );
93 }
94 
95 inline Any::Any( const void * pData_, typelib_TypeDescriptionReference * pType_ )
96 {
98  this, const_cast< void * >( pData_ ), pType_, cpp_acquire );
99 }
100 
101 inline Any::~Any()
102 {
104  this, cpp_release );
105 }
106 
107 inline Any & Any::operator = ( const Any & rAny )
108 {
109  if (this != &rAny)
110  {
112  this, rAny.pData, rAny.pType,
114  }
115  return *this;
116 }
117 
118 inline ::rtl::OUString Any::getValueTypeName() const
119 {
120  return ::rtl::OUString( pType->pTypeName );
121 }
122 
123 inline void Any::setValue( const void * pData_, const Type & rType )
124 {
126  this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
128 }
129 
130 inline void Any::setValue( const void * pData_, typelib_TypeDescriptionReference * pType_ )
131 {
133  this, const_cast< void * >( pData_ ), pType_,
135 }
136 
137 inline void Any::setValue( const void * pData_, typelib_TypeDescription * pTypeDescr )
138 {
140  this, const_cast< void * >( pData_ ), pTypeDescr,
142 }
143 
144 inline void Any::clear()
145 {
147  this, cpp_release );
148 }
149 
150 inline bool Any::isExtractableTo( const Type & rType ) const
151 {
153  rType.getTypeLibType(), pData, pType,
155 }
156 
157 
158 template <typename T>
159 inline bool Any::has() const
160 {
161  Type const & rType = ::cppu::getTypeFavourUnsigned(static_cast< T * >(0));
163  rType.getTypeLibType(), pData, pType,
165  cpp_release );
166 }
167 
168 inline bool Any::operator == ( const Any & rAny ) const
169 {
171  pData, pType, rAny.pData, rAny.pType,
173 }
174 
175 inline bool Any::operator != ( const Any & rAny ) const
176 {
177  return (! ::uno_type_equalData(
178  pData, pType, rAny.pData, rAny.pType,
180 }
181 
182 
183 template< class C >
184 inline Any SAL_CALL makeAny( const C & value )
185 {
186  return Any( &value, ::cppu::getTypeFavourUnsigned(&value) );
187 }
188 
189 // additionally specialized for C++ bool
190 
191 template<>
192 inline Any SAL_CALL makeAny( bool const & value )
193 {
194  const sal_Bool b = value;
195  return Any( &b, cppu::UnoType<bool>::get() );
196 }
197 
198 
199 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
200 template< class C1, class C2 >
201 inline Any SAL_CALL makeAny( const rtl::OUStringConcat< C1, C2 >& value )
202 {
203  const rtl::OUString str( value );
204  return Any( &str, ::cppu::getTypeFavourUnsigned(&str) );
205 }
206 #endif
207 
208 template<typename T> Any toAny(T const & value) { return makeAny(value); }
209 
210 template<> Any toAny(Any const & value) { return value; }
211 
212 template< class C >
213 inline void SAL_CALL operator <<= ( Any & rAny, const C & value )
214 {
215  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
217  &rAny, const_cast< C * >( &value ), rType.getTypeLibType(),
219 }
220 
221 // additionally for C++ bool:
222 
223 template<>
224 inline void SAL_CALL operator <<= ( Any & rAny, bool const & value )
225 {
226  sal_Bool b = value;
228  &rAny, &b, cppu::UnoType<bool>::get().getTypeLibType(),
230 }
231 
232 
233 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
234 template< class C1, class C2 >
235 inline void SAL_CALL operator <<= ( Any & rAny, const rtl::OUStringConcat< C1, C2 >& value )
236 {
237  const rtl::OUString str( value );
238  const Type & rType = ::cppu::getTypeFavourUnsigned(&str);
240  &rAny, const_cast< rtl::OUString * >( &str ), rType.getTypeLibType(),
242 }
243 #endif
244 
245 template< class C >
246 inline bool SAL_CALL operator >>= ( const Any & rAny, C & value )
247 {
248  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
250  &value, rType.getTypeLibType(),
251  rAny.pData, rAny.pType,
254 }
255 
256 // bool
257 
258 template<>
259 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Bool & value )
260 {
261  if (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass)
262  {
263  value = (* static_cast< const sal_Bool * >( rAny.pData ) != sal_False);
264  return true;
265  }
266  return false;
267 }
268 
269 template<>
270 inline bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value )
271 {
272  return (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass &&
273  (value != sal_False) == (* static_cast< const sal_Bool * >( rAny.pData ) != sal_False));
274 }
275 
276 
277 template<>
278 inline bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
279 {
280  if (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN)
281  {
282  value = *static_cast< sal_Bool const * >(
283  rAny.pData ) != sal_False;
284  return true;
285  }
286  return false;
287 }
288 
289 
290 template<>
291 inline bool SAL_CALL operator == ( Any const & rAny, bool const & value )
292 {
293  return (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN &&
294  (value ==
295  (*static_cast< sal_Bool const * >( rAny.pData )
296  != sal_False)));
297 }
298 
299 // byte
300 
301 template<>
302 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Int8 & value )
303 {
304  if (typelib_TypeClass_BYTE == rAny.pType->eTypeClass)
305  {
306  value = * static_cast< const sal_Int8 * >( rAny.pData );
307  return true;
308  }
309  return false;
310 }
311 // short
312 
313 template<>
314 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value )
315 {
316  switch (rAny.pType->eTypeClass)
317  {
319  value = * static_cast< const sal_Int8 * >( rAny.pData );
320  return true;
323  value = * static_cast< const sal_Int16 * >( rAny.pData );
324  return true;
325  default:
326  return false;
327  }
328 }
329 
330 template<>
331 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value )
332 {
333  switch (rAny.pType->eTypeClass)
334  {
336  value = (sal_uInt16)( * static_cast< const sal_Int8 * >( rAny.pData ) );
337  return true;
340  value = * static_cast< const sal_uInt16 * >( rAny.pData );
341  return true;
342  default:
343  return false;
344  }
345 }
346 // long
347 
348 template<>
349 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value )
350 {
351  switch (rAny.pType->eTypeClass)
352  {
354  value = * static_cast< const sal_Int8 * >( rAny.pData );
355  return true;
357  value = * static_cast< const sal_Int16 * >( rAny.pData );
358  return true;
360  value = * static_cast< const sal_uInt16 * >( rAny.pData );
361  return true;
364  value = * static_cast< const sal_Int32 * >( rAny.pData );
365  return true;
366  default:
367  return false;
368  }
369 }
370 
371 template<>
372 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value )
373 {
374  switch (rAny.pType->eTypeClass)
375  {
377  value = (sal_uInt32)( * static_cast< const sal_Int8 * >( rAny.pData ) );
378  return true;
380  value = (sal_uInt32)( * static_cast< const sal_Int16 * >( rAny.pData ) );
381  return true;
383  value = * static_cast< const sal_uInt16 * >( rAny.pData );
384  return true;
387  value = * static_cast< const sal_uInt32 * >( rAny.pData );
388  return true;
389  default:
390  return false;
391  }
392 }
393 // hyper
394 
395 template<>
396 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value )
397 {
398  switch (rAny.pType->eTypeClass)
399  {
401  value = * static_cast< const sal_Int8 * >( rAny.pData );
402  return true;
404  value = * static_cast< const sal_Int16 * >( rAny.pData );
405  return true;
407  value = * static_cast< const sal_uInt16 * >( rAny.pData );
408  return true;
410  value = * static_cast< const sal_Int32 * >( rAny.pData );
411  return true;
413  value = * static_cast< const sal_uInt32 * >( rAny.pData );
414  return true;
417  value = * static_cast< const sal_Int64 * >( rAny.pData );
418  return true;
419  default:
420  return false;
421  }
422 }
423 
424 template<>
425 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value )
426 {
427  switch (rAny.pType->eTypeClass)
428  {
430  value = (sal_uInt64)( * static_cast< const sal_Int8 * >( rAny.pData ) );
431  return true;
433  value = (sal_uInt64)( * static_cast< const sal_Int16 * >( rAny.pData ) );
434  return true;
436  value = * static_cast< const sal_uInt16 * >( rAny.pData );
437  return true;
439  value = (sal_uInt64)( * static_cast< const sal_Int32 * >( rAny.pData ) );
440  return true;
442  value = * static_cast< const sal_uInt32 * >( rAny.pData );
443  return true;
446  value = * static_cast< const sal_uInt64 * >( rAny.pData );
447  return true;
448  default:
449  return false;
450  }
451 }
452 // float
453 
454 template<>
455 inline bool SAL_CALL operator >>= ( const Any & rAny, float & value )
456 {
457  switch (rAny.pType->eTypeClass)
458  {
460  value = * static_cast< const sal_Int8 * >( rAny.pData );
461  return true;
463  value = * static_cast< const sal_Int16 * >( rAny.pData );
464  return true;
466  value = * static_cast< const sal_uInt16 * >( rAny.pData );
467  return true;
469  value = * static_cast< const float * >( rAny.pData );
470  return true;
471  default:
472  return false;
473  }
474 }
475 // double
476 
477 template<>
478 inline bool SAL_CALL operator >>= ( const Any & rAny, double & value )
479 {
480  switch (rAny.pType->eTypeClass)
481  {
483  value = * static_cast< const sal_Int8 * >( rAny.pData );
484  return true;
486  value = * static_cast< const sal_Int16 * >( rAny.pData );
487  return true;
489  value = * static_cast< const sal_uInt16 * >( rAny.pData );
490  return true;
492  value = * static_cast< const sal_Int32 * >( rAny.pData );
493  return true;
495  value = * static_cast< const sal_uInt32 * >( rAny.pData );
496  return true;
498  value = * static_cast< const float * >( rAny.pData );
499  return true;
501  value = * static_cast< const double * >( rAny.pData );
502  return true;
503  default:
504  return false;
505  }
506 }
507 // string
508 
509 template<>
510 inline bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value )
511 {
512  if (typelib_TypeClass_STRING == rAny.pType->eTypeClass)
513  {
514  value = * static_cast< const ::rtl::OUString * >( rAny.pData );
515  return true;
516  }
517  return false;
518 }
519 
520 template<>
521 inline bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value )
522 {
523  return (typelib_TypeClass_STRING == rAny.pType->eTypeClass &&
524  value.equals( * static_cast< const ::rtl::OUString * >( rAny.pData ) ));
525 }
526 // type
527 
528 template<>
529 inline bool SAL_CALL operator >>= ( const Any & rAny, Type & value )
530 {
531  if (typelib_TypeClass_TYPE == rAny.pType->eTypeClass)
532  {
533  value = * static_cast< const Type * >( rAny.pData );
534  return true;
535  }
536  return false;
537 }
538 
539 template<>
540 inline bool SAL_CALL operator == ( const Any & rAny, const Type & value )
541 {
542  return (typelib_TypeClass_TYPE == rAny.pType->eTypeClass &&
543  value.equals( * static_cast< const Type * >( rAny.pData ) ));
544 }
545 // any
546 
547 template<>
548 inline bool SAL_CALL operator >>= ( const Any & rAny, Any & value )
549 {
550  if (&rAny != &value)
551  {
553  &value, rAny.pData, rAny.pType,
555  }
556  return true;
557 }
558 // interface
559 
560 template<>
561 inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value )
562 {
563  if (typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass)
564  {
565  return static_cast< const BaseReference * >( rAny.pData )->operator == ( value );
566  }
567  return false;
568 }
569 
570 // operator to compare to an any.
571 
572 template< class C >
573 inline bool SAL_CALL operator == ( const Any & rAny, const C & value )
574 {
575  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
577  rAny.pData, rAny.pType,
578  const_cast< C * >( &value ), rType.getTypeLibType(),
580 }
581 // operator to compare to an any. may use specialized operators ==.
582 
583 template< class C >
584 inline bool SAL_CALL operator != ( const Any & rAny, const C & value )
585 {
586  return (! operator == ( rAny, value ));
587 }
588 
589 template <typename T>
590 T Any::get() const
591 {
592  T value = T();
593  if (! (*this >>= value)) {
594  throw RuntimeException(
595  ::rtl::OUString(
597  this,
598  ::cppu::getTypeFavourUnsigned(&value).getTypeLibType() ),
599  SAL_NO_ACQUIRE ) );
600  }
601  return value;
602 }
603 
610 template<typename charT, typename traits>
611 inline std::basic_ostream<charT, traits> &operator<<(std::basic_ostream<charT, traits> &o, Any const &any) {
612  o << "<Any: (" << any.getValueTypeName() << ')';
613  switch(any.pType->eTypeClass) {
615  break;
617  o << ' ' << any.get<bool>();
618  break;
623  o << ' ' << any.get<sal_Int64>();
624  break;
628  o << ' ' << any.get<sal_uInt64>();
629  break;
632  o << ' ' << any.get<double>();
633  break;
634  case typelib_TypeClass_CHAR: {
635  std::ios_base::fmtflags flgs = o.setf(
636  std::ios_base::hex, std::ios_base::basefield);
637  charT fill = o.fill('0');
638  o << " U+" << std::setw(4)
639  << *static_cast<sal_Unicode const *>(any.getValue());
640  o.setf(flgs);
641  o.fill(fill);
642  break;
643  }
645  o << ' ' << any.get<rtl::OUString>();
646  break;
648  o << ' ' << any.get<css::uno::Type>().getTypeName();
649  break;
651  o << " len "
652  << ((*static_cast<uno_Sequence * const *>(any.getValue()))->
653  nElements);
654  break;
656  o << ' ' << *static_cast<sal_Int32 const *>(any.getValue());
657  break;
660  o << ' ' << any.getValue();
661  break;
663  o << ' ' << *static_cast<void * const *>(any.getValue());
664  break;
665  default:
666  assert(false); // this cannot happen
667  break;
668  }
669  o << '>';
670  return o;
671 }
672 
673 }
674 }
675 }
676 }
677 
678 #endif
679 
680 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
type class of double
Definition: typeclass.h:51
type class of unsigned long
Definition: typeclass.h:43
type class of short
Definition: typeclass.h:37
type class of unsigned hyper
Definition: typeclass.h:47
type class of unsigned short
Definition: typeclass.h:39
CPPU_DLLPUBLIC void uno_any_destruct(uno_Any *pValue, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Destructs an any.
CPPU_DLLPUBLIC void uno_any_clear(uno_Any *pValue, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Sets value to void.
inline::rtl::OUString getValueTypeName() const
Gets the type name of the set value.
Definition: Any.hxx:118
bool isExtractableTo(const Type &rType) const
Tests whether this any is extractable to a value of given type.
Definition: Any.hxx:150
void * cpp_queryInterface(void *pCppI, typelib_TypeDescriptionReference *pType)
Function to query for a C++ interface.
Definition: genfunc.hxx:51
void operator<<=(Any &rAny, const C &value)
Template binary <<= operator to set the value of an any.
Definition: Any.hxx:213
#define CPPU_DLLPUBLIC
Definition: cppudllapi.h:10
Any & operator=(const Any &rAny)
Assignment operator: Sets the value of the given any.
Definition: Any.hxx:107
type class of interface
Definition: typeclass.h:79
type class of sequence
Definition: typeclass.h:72
css::uno::Type const & getTypeFavourUnsigned(SAL_UNUSED_PARAMETER T const *)
A working replacement for getCppuType (see there).
Definition: unotype.hxx:320
C++ class representing an IDL any.
Definition: Any.h:49
type class of hyper
Definition: typeclass.h:45
CPPU_DLLPUBLIC void uno_type_any_assign(uno_Any *pDest, void *pSource, struct _typelib_TypeDescriptionReference *pType, uno_AcquireFunc acquire, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Assign an any with a given value.
bool has() const
Tests whether this any can provide a value of specified type.
Definition: Any.hxx:159
~Any()
Destructor: Destructs any content and frees memory.
Definition: Any.hxx:101
bool operator==(const Any &rAny) const
Equality operator: compares two anys.
Definition: Any.hxx:168
struct SAL_DLLPUBLIC_RTTI _uno_Any uno_Any
This is the binary specification of an UNO any.
Definition: types.h:389
bool operator!=(const Any &rAny) const
Unequality operator: compares two anys.
Definition: Any.hxx:175
type class of long
Definition: typeclass.h:41
type class of string
Definition: typeclass.h:53
void cpp_release(void *pCppI)
Function to release a C++ interface.
Definition: genfunc.hxx:46
unsigned char sal_Bool
Definition: types.h:48
type class of type
Definition: typeclass.h:55
type class of char
Definition: typeclass.h:31
CPPU_DLLPUBLIC void uno_any_construct(uno_Any *pDest, void *pSource, struct _typelib_TypeDescription *pTypeDescr, uno_AcquireFunc acquire) SAL_THROW_EXTERN_C()
Constructs an any with a given value.
typelib_TypeDescriptionReference * getTypeLibType() const
Gets the C typelib type description reference pointer.
Definition: Type.h:154
CPPU_DLLPUBLIC rtl_uString * cppu_Any_extraction_failure_msg(uno_Any const *pAny, typelib_TypeDescriptionReference *pType) SAL_THROW_EXTERN_C()
bool equals(const Type &rType) const
Compares two types.
Definition: Type.h:173
C++ class representing an IDL meta type.
Definition: Type.h:54
CPPU_DLLPUBLIC void uno_any_assign(uno_Any *pDest, void *pSource, struct _typelib_TypeDescription *pTypeDescr, uno_AcquireFunc acquire, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Assign an any with a given value.
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescription typelib_TypeDescription
Full type description of a type.
signed char sal_Int8
Definition: types.h:53
sal_uInt16 sal_Unicode
Definition: types.h:155
CPPU_DLLPUBLIC sal_Bool uno_type_assignData(void *pDest, struct _typelib_TypeDescriptionReference *pDestType, void *pSource, struct _typelib_TypeDescriptionReference *pSourceType, uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Assigns a destination value with a source value.
#define sal_False
Definition: types.h:49
Any()
Default constructor: Any holds no value; its type is void.
Definition: Any.hxx:53
type class of boolean
Definition: typeclass.h:33
CPPU_DLLPUBLIC sal_Bool uno_type_isAssignableFromData(struct _typelib_TypeDescriptionReference *pAssignable, void *pFrom, struct _typelib_TypeDescriptionReference *pFromType, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Tests whether a value of given type is assignable from given value.
void setValue(const void *pData_, const Type &rType)
Sets a value.
Definition: Any.hxx:123
This is the binary specification of a SAL sequence.
Definition: types.h:343
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:106
definition of a no acquire enum for ctors
Definition: types.h:386
type class of float
Definition: typeclass.h:49
rtl::OUString getTypeName(rtl::OUString const &rEnvDcp)
Get the OBI type part of an environment descriptor.
Definition: EnvDcp.hxx:38
void cpp_acquire(void *pCppI)
Function to acquire a C++ interface.
Definition: genfunc.hxx:41
Any makeAny(const C &value)
Template function to generically construct an any from a C++ value.
Definition: Any.hxx:184
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescriptionReference typelib_TypeDescriptionReference
Holds a weak reference to a type description.
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition: types.h:368
This base class serves as a base class for all template reference classes and has been introduced due...
Definition: Reference.h:58
type class of struct
Definition: typeclass.h:63
Any toAny(T const &value)
Wrap a value in an Any, if necessary.
Definition: Any.hxx:208
T get() const
Provides a value of specified type, so you can easily write e.g.
Definition: Any.hxx:590
bool operator>>=(const Any &rAny, C &value)
Template binary >>= operator to assign a value from an any.
Definition: Any.hxx:246
Get the css::uno::Type instance representing a certain UNO type.
Definition: unotype.hxx:47
type class of enum
Definition: typeclass.h:59
CPPU_DLLPUBLIC sal_Bool uno_type_equalData(void *pVal1, struct _typelib_TypeDescriptionReference *pVal1Type, void *pVal2, struct _typelib_TypeDescriptionReference *pVal2Type, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Tests if two values are equal.
type class of void
Definition: typeclass.h:29
CPPU_DLLPUBLIC void uno_type_any_construct(uno_Any *pDest, void *pSource, struct _typelib_TypeDescriptionReference *pType, uno_AcquireFunc acquire) SAL_THROW_EXTERN_C()
Constructs an any with a given value.
type class of byte
Definition: typeclass.h:35
void clear()
Clears this any.
Definition: Any.hxx:144
type class of exception
Definition: typeclass.h:70