LibreOffice
LibreOffice 4.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 <iomanip>
26 #include <ostream>
27 
28 #include <com/sun/star/uno/Any.h>
29 #include <uno/data.h>
30 #include <uno/sequence2.h>
34 #include <com/sun/star/uno/RuntimeException.hpp>
35 #include <cppu/unotype.hxx>
36 
37 namespace com
38 {
39 namespace sun
40 {
41 namespace star
42 {
43 namespace uno
44 {
45 
46 
47 inline Any::Any()
48 {
50 }
51 
52 
53 template <typename T>
54 inline Any::Any( T const & value )
55 {
57  this, const_cast<T *>(&value),
58  ::cppu::getTypeFavourUnsigned(&value).getTypeLibType(),
60 }
61 
62 inline Any::Any( bool value )
63 {
64  sal_Bool b = value;
66  this, &b, ::getCppuBooleanType().getTypeLibType(),
68 }
69 
70 
71 inline Any::Any( const Any & rAny )
72 {
74 }
75 
76 inline Any::Any( const void * pData_, const Type & rType )
77 {
79  this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
81 }
82 
83 inline Any::Any( const void * pData_, typelib_TypeDescription * pTypeDescr )
84 {
86  this, const_cast< void * >( pData_ ), pTypeDescr, (uno_AcquireFunc)cpp_acquire );
87 }
88 
89 inline Any::Any( const void * pData_, typelib_TypeDescriptionReference * pType_ )
90 {
92  this, const_cast< void * >( pData_ ), pType_, (uno_AcquireFunc)cpp_acquire );
93 }
94 
95 inline Any::~Any()
96 {
99 }
100 
101 inline Any & Any::operator = ( const Any & rAny )
102 {
103  if (this != &rAny)
104  {
106  this, rAny.pData, rAny.pType,
108  }
109  return *this;
110 }
111 
112 inline ::rtl::OUString Any::getValueTypeName() const
113 {
114  return ::rtl::OUString( pType->pTypeName );
115 }
116 
117 inline void Any::setValue( const void * pData_, const Type & rType )
118 {
120  this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
122 }
123 
124 inline void Any::setValue( const void * pData_, typelib_TypeDescriptionReference * pType_ )
125 {
127  this, const_cast< void * >( pData_ ), pType_,
129 }
130 
131 inline void Any::setValue( const void * pData_, typelib_TypeDescription * pTypeDescr )
132 {
134  this, const_cast< void * >( pData_ ), pTypeDescr,
136 }
137 
138 inline void Any::clear()
139 {
141  this, (uno_ReleaseFunc)cpp_release );
142 }
143 
144 inline bool Any::isExtractableTo( const Type & rType ) const
145 {
147  rType.getTypeLibType(), pData, pType,
149 }
150 
151 
152 template <typename T>
153 inline bool Any::has() const
154 {
155  Type const & rType = ::cppu::getTypeFavourUnsigned(static_cast< T * >(0));
157  rType.getTypeLibType(), pData, pType,
160 }
161 
162 inline bool Any::operator == ( const Any & rAny ) const
163 {
165  pData, pType, rAny.pData, rAny.pType,
167 }
168 
169 inline bool Any::operator != ( const Any & rAny ) const
170 {
171  return (! ::uno_type_equalData(
172  pData, pType, rAny.pData, rAny.pType,
174 }
175 
176 
177 template< class C >
178 inline Any SAL_CALL makeAny( const C & value )
179 {
180  return Any( &value, ::cppu::getTypeFavourUnsigned(&value) );
181 }
182 
183 // additionally specialized for C++ bool
184 
185 template<>
186 inline Any SAL_CALL makeAny( bool const & value )
187 {
188  const sal_Bool b = value;
189  return Any( &b, ::getCppuBooleanType() );
190 }
191 
192 
193 #ifdef RTL_FAST_STRING
194 template< class C1, class C2 >
195 inline Any SAL_CALL makeAny( const rtl::OUStringConcat< C1, C2 >& value )
196 {
197  const rtl::OUString str( value );
198  return Any( &str, ::cppu::getTypeFavourUnsigned(&str) );
199 }
200 #endif
201 
202 template< class C >
203 inline void SAL_CALL operator <<= ( Any & rAny, const C & value )
204 {
205  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
207  &rAny, const_cast< C * >( &value ), rType.getTypeLibType(),
209 }
210 
211 // additionally for C++ bool:
212 
213 template<>
214 inline void SAL_CALL operator <<= ( Any & rAny, bool const & value )
215 {
216  sal_Bool b = value;
218  &rAny, &b, ::getCppuBooleanType().getTypeLibType(),
220 }
221 
222 
223 #ifdef RTL_FAST_STRING
224 template< class C1, class C2 >
225 inline void SAL_CALL operator <<= ( Any & rAny, const rtl::OUStringConcat< C1, C2 >& value )
226 {
227  const rtl::OUString str( value );
228  const Type & rType = ::cppu::getTypeFavourUnsigned(&str);
230  &rAny, const_cast< rtl::OUString * >( &str ), rType.getTypeLibType(),
232 }
233 #endif
234 
235 template< class C >
236 inline bool SAL_CALL operator >>= ( const Any & rAny, C & value )
237 {
238  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
240  &value, rType.getTypeLibType(),
241  rAny.pData, rAny.pType,
244 }
245 
246 // bool
247 
248 template<>
249 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Bool & value )
250 {
251  if (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass)
252  {
253  value = (* reinterpret_cast< const sal_Bool * >( rAny.pData ) != sal_False);
254  return true;
255  }
256  return false;
257 }
258 
259 template<>
260 inline bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value )
261 {
262  return (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass &&
263  (value != sal_False) == (* reinterpret_cast< const sal_Bool * >( rAny.pData ) != sal_False));
264 }
265 
266 
267 template<>
268 inline bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
269 {
271  {
272  value = *reinterpret_cast< sal_Bool const * >(
273  rAny.pData ) != sal_False;
274  return true;
275  }
276  return false;
277 }
278 
279 
280 template<>
281 inline bool SAL_CALL operator == ( Any const & rAny, bool const & value )
282 {
283  return (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN &&
284  (value ==
285  (*reinterpret_cast< sal_Bool const * >( rAny.pData )
286  != sal_False)));
287 }
288 
289 // byte
290 
291 template<>
292 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Int8 & value )
293 {
294  if (typelib_TypeClass_BYTE == rAny.pType->eTypeClass)
295  {
296  value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
297  return true;
298  }
299  return false;
300 }
301 // short
302 
303 template<>
304 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value )
305 {
306  switch (rAny.pType->eTypeClass)
307  {
309  value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
310  return true;
313  value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
314  return true;
315  default:
316  return false;
317  }
318 }
319 
320 template<>
321 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value )
322 {
323  switch (rAny.pType->eTypeClass)
324  {
326  value = (sal_uInt16)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) );
327  return true;
330  value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
331  return true;
332  default:
333  return false;
334  }
335 }
336 // long
337 
338 template<>
339 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value )
340 {
341  switch (rAny.pType->eTypeClass)
342  {
344  value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
345  return true;
347  value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
348  return true;
350  value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
351  return true;
354  value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
355  return true;
356  default:
357  return false;
358  }
359 }
360 
361 template<>
362 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value )
363 {
364  switch (rAny.pType->eTypeClass)
365  {
367  value = (sal_uInt32)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) );
368  return true;
370  value = (sal_uInt32)( * reinterpret_cast< const sal_Int16 * >( rAny.pData ) );
371  return true;
373  value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
374  return true;
377  value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
378  return true;
379  default:
380  return false;
381  }
382 }
383 // hyper
384 
385 template<>
386 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value )
387 {
388  switch (rAny.pType->eTypeClass)
389  {
391  value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
392  return true;
394  value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
395  return true;
397  value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
398  return true;
400  value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
401  return true;
403  value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
404  return true;
407  value = * reinterpret_cast< const sal_Int64 * >( rAny.pData );
408  return true;
409  default:
410  return false;
411  }
412 }
413 
414 template<>
415 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value )
416 {
417  switch (rAny.pType->eTypeClass)
418  {
420  value = (sal_uInt64)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) );
421  return true;
423  value = (sal_uInt64)( * reinterpret_cast< const sal_Int16 * >( rAny.pData ) );
424  return true;
426  value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
427  return true;
429  value = (sal_uInt64)( * reinterpret_cast< const sal_Int32 * >( rAny.pData ) );
430  return true;
432  value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
433  return true;
436  value = * reinterpret_cast< const sal_uInt64 * >( rAny.pData );
437  return true;
438  default:
439  return false;
440  }
441 }
442 // float
443 
444 template<>
445 inline bool SAL_CALL operator >>= ( const Any & rAny, float & value )
446 {
447  switch (rAny.pType->eTypeClass)
448  {
450  value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
451  return true;
453  value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
454  return true;
456  value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
457  return true;
459  value = * reinterpret_cast< const float * >( rAny.pData );
460  return true;
461  default:
462  return false;
463  }
464 }
465 // double
466 
467 template<>
468 inline bool SAL_CALL operator >>= ( const Any & rAny, double & value )
469 {
470  switch (rAny.pType->eTypeClass)
471  {
473  value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
474  return true;
476  value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
477  return true;
479  value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
480  return true;
482  value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
483  return true;
485  value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
486  return true;
488  value = * reinterpret_cast< const float * >( rAny.pData );
489  return true;
491  value = * reinterpret_cast< const double * >( rAny.pData );
492  return true;
493  default:
494  return false;
495  }
496 }
497 // string
498 
499 template<>
500 inline bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value )
501 {
503  {
504  value = * reinterpret_cast< const ::rtl::OUString * >( rAny.pData );
505  return true;
506  }
507  return false;
508 }
509 
510 template<>
511 inline bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value )
512 {
513  return (typelib_TypeClass_STRING == rAny.pType->eTypeClass &&
514  value.equals( * reinterpret_cast< const ::rtl::OUString * >( rAny.pData ) ));
515 }
516 // type
517 
518 template<>
519 inline bool SAL_CALL operator >>= ( const Any & rAny, Type & value )
520 {
522  {
523  value = * reinterpret_cast< const Type * >( rAny.pData );
524  return true;
525  }
526  return false;
527 }
528 
529 template<>
530 inline bool SAL_CALL operator == ( const Any & rAny, const Type & value )
531 {
532  return (typelib_TypeClass_TYPE == rAny.pType->eTypeClass &&
533  value.equals( * reinterpret_cast< const Type * >( rAny.pData ) ));
534 }
535 // any
536 
537 template<>
538 inline bool SAL_CALL operator >>= ( const Any & rAny, Any & value )
539 {
540  if (&rAny != &value)
541  {
543  &value, rAny.pData, rAny.pType,
545  }
546  return true;
547 }
548 // interface
549 
550 template<>
551 inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value )
552 {
554  {
555  return reinterpret_cast< const BaseReference * >( rAny.pData )->operator == ( value );
556  }
557  return false;
558 }
559 
560 // operator to compare to an any.
561 
562 template< class C >
563 inline bool SAL_CALL operator == ( const Any & rAny, const C & value )
564 {
565  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
567  rAny.pData, rAny.pType,
568  const_cast< C * >( &value ), rType.getTypeLibType(),
570 }
571 // operator to compare to an any. may use specialized operators ==.
572 
573 template< class C >
574 inline bool SAL_CALL operator != ( const Any & rAny, const C & value )
575 {
576  return (! operator == ( rAny, value ));
577 }
578 
579 extern "C" rtl_uString * SAL_CALL cppu_Any_extraction_failure_msg(
580  uno_Any const * pAny, typelib_TypeDescriptionReference * pType )
582 
583 
584 template <typename T>
585 T Any::get() const
586 {
587  T value = T();
588  if (! (*this >>= value)) {
589  throw RuntimeException(
590  ::rtl::OUString(
592  this,
593  ::cppu::getTypeFavourUnsigned(&value).getTypeLibType() ),
594  SAL_NO_ACQUIRE ) );
595  }
596  return value;
597 }
598 
605 template<typename charT, typename traits>
606 inline std::basic_ostream<charT, traits> &operator<<(std::basic_ostream<charT, traits> &o, Any const &any) {
607  o << "<Any: (" << any.getValueTypeName() << ')';
608  switch(any.pType->eTypeClass) {
610  break;
612  o << ' ' << any.get<bool>();
613  break;
618  o << ' ' << any.get<sal_Int64>();
619  break;
623  o << ' ' << any.get<sal_uInt64>();
624  break;
627  o << ' ' << any.get<double>();
628  break;
629  case typelib_TypeClass_CHAR: {
630  std::ios_base::fmtflags flgs = o.setf(
631  std::ios_base::hex, std::ios_base::basefield);
632  charT fill = o.fill('0');
633  o << " U+" << std::setw(4)
634  << *static_cast<sal_Unicode const *>(any.getValue());
635  o.setf(flgs);
636  o.fill(fill);
637  break;
638  }
640  o << ' ' << any.get<rtl::OUString>();
641  break;
643  o << ' ' << any.get<css::uno::Type>().getTypeName();
644  break;
646  o << " len "
647  << ((*static_cast<uno_Sequence * const *>(any.getValue()))->
648  nElements);
649  break;
651  o << ' ' << *static_cast<sal_Int32 const *>(any.getValue());
652  break;
655  o << ' ' << any.getValue();
656  break;
658  o << ' ' << *static_cast<void * const *>(any.getValue());
659  break;
660  default:
661  assert(false); // this cannot happen
662  break;
663  }
664  o << '>';
665  return o;
666 }
667 
668 }
669 }
670 }
671 }
672 
673 #endif
674 
675 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool operator==(const Any &rAny, const C &value)
Template equality operator: compares set value of left side any to right side value.
Definition: Any.hxx:563
type class of exception
Definition: typeclass.h:70
bool has() const
Tests whether this any can provide a value of specified type.
Definition: Any.hxx:153
definition of a no acquire enum for ctors
Definition: types.h:372
type class of unsigned long
Definition: typeclass.h:43
unsigned char sal_Bool
Definition: types.h:48
void *(* uno_QueryInterfaceFunc)(void *pInterface, struct _typelib_TypeDescriptionReference *pType)
Generic function pointer declaration to query for an interface.
Definition: data.h:40
type class of unsigned short
Definition: typeclass.h:39
type class of void
Definition: typeclass.h:29
type class of string
Definition: typeclass.h:53
const ::com::sun::star::uno::Type & getCppuBooleanType()
Gets the meta type of IDL type boolean.
Definition: Type.hxx:110
type class of char
Definition: typeclass.h:31
bool operator!=(const Any &rAny) const
Unequality operator: compares two anys.
Definition: Any.hxx:169
type class of struct
Definition: typeclass.h:63
#define sal_False
Definition: types.h:49
type class of double
Definition: typeclass.h:51
void * cpp_queryInterface(void *pCppI, typelib_TypeDescriptionReference *pType)
Function to query for a C++ interface.
Definition: genfunc.hxx:47
void operator<<=(Any &rAny, const C &value)
Template binary <<= operator to set the value of an any.
Definition: Any.hxx:203
CPPU_DLLPUBLIC void uno_any_clear(uno_Any *pValue, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Sets value to void.
type class of interface
Definition: typeclass.h:79
CPPU_DLLPUBLIC void uno_any_destruct(uno_Any *pValue, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Destructs an any.
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.
rtl_uString * pTypeName
fully qualified name of type
Definition: typedescription.h:55
type class of long
Definition: typeclass.h:41
~Any()
Destructor: Destructs any content and frees memory.
Definition: Any.hxx:95
type class of unsigned hyper
Definition: typeclass.h:47
rtl::OUString getTypeName(rtl::OUString const &rEnvDcp)
Get the OBI type part of an environment descriptor.
Definition: EnvDcp.hxx:38
void cpp_release(void *pCppI)
Function to release a C++ interface.
Definition: genfunc.hxx:42
struct _typelib_TypeDescriptionReference * pType
type of value
Definition: any2.h:44
Any()
Default constructor: Any holds no value; its type is void.
Definition: Any.hxx:47
Holds a weak reference to a type description.
Definition: typedescription.h:40
typelib_TypeDescriptionReference * getTypeLibType() const
Gets the C typelib type description reference pointer.
Definition: Type.h:154
type class of type
Definition: typeclass.h:55
bool operator!=(const Any &rAny, const C &value)
Template unequality operator: compares set value of left side any to right side value.
Definition: Any.hxx:574
This is the binary specification of a SAL sequence.
Definition: types.h:329
bool equals(const Type &rType) const
Compares two types.
Definition: Type.h:173
bool operator==(const Any &rAny) const
Equality operator: compares two anys.
Definition: Any.hxx:162
type class of sequence
Definition: typeclass.h:72
type class of hyper
Definition: typeclass.h:45
C++ class representing an IDL meta type.
Definition: Type.h:54
rtl_uString * cppu_Any_extraction_failure_msg(uno_Any const *pAny, typelib_TypeDescriptionReference *pType) SAL_THROW_EXTERN_C()
signed char sal_Int8
Definition: types.h:53
type class of boolean
Definition: typeclass.h:33
C++ class representing an IDL any.
Definition: Any.h:49
type class of float
Definition: typeclass.h:49
Full type description of a type.
Definition: typedescription.h:71
::com::sun::star::uno::Type const & getTypeFavourUnsigned(SAL_UNUSED_PARAMETER T const *)
A working replacement for getCppuType (see there).
Definition: unotype.hxx:287
void(* uno_AcquireFunc)(void *pInterface)
Generic function pointer declaration to acquire an interface.
Definition: data.h:46
This base class serves as a base class for all template reference classes and has been introduced due...
Definition: Reference.h:57
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:81
void setValue(const void *pData_, const Type &rType)
Sets a value.
Definition: Any.hxx:117
bool isExtractableTo(const Type &rType) const
Tests whether this any is extractable to a value of given type.
Definition: Any.hxx:144
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.
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.
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 clear()
Clears this any.
Definition: Any.hxx:138
inline::rtl::OUString getValueTypeName() const
Gets the type name of the set value.
Definition: Any.hxx:112
sal_uInt16 sal_Unicode
Definition: types.h:152
void cpp_acquire(void *pCppI)
Function to acquire a C++ interface.
Definition: genfunc.hxx:37
Any makeAny(const C &value)
Template function to generically construct an any from a C++ value.
Definition: Any.hxx:178
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.
type class of short
Definition: typeclass.h:37
void(* uno_ReleaseFunc)(void *pInterface)
Generic function pointer declaration to release an interface.
Definition: data.h:52
This is the binary specification of an UNO any.
Definition: any2.h:40
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition: types.h:354
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.
Any & operator=(const Any &rAny)
Assignment operator: Sets the value of the given any.
Definition: Any.hxx:101
bool operator>>=(const Any &rAny, C &value)
Template binary >>= operator to assign a value from an any.
Definition: Any.hxx:236
typelib_TypeClass eTypeClass
type class of type
Definition: typedescription.h:52
void * pData
pointer to value; this may point to pReserved and thus the uno_Any is not anytime mem-copyable! You m...
Definition: any2.h:49
type class of enum
Definition: typeclass.h:59
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.
type class of byte
Definition: typeclass.h:35
T get() const
Provides a value of specified type, so you can easily write e.g.
Definition: Any.hxx:585