LibreOffice
LibreOffice 6.0 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 <algorithm>
25 #include <cassert>
26 #include <cstddef>
27 #include <iomanip>
28 #include <ostream>
29 
30 #include <com/sun/star/uno/Any.h>
31 #include <uno/data.h>
32 #include <uno/sequence2.h>
36 #include <com/sun/star/uno/RuntimeException.hpp>
37 #include <cppu/cppudllapi.h>
38 #include <cppu/unotype.hxx>
39 
40 extern "C" CPPU_DLLPUBLIC rtl_uString * SAL_CALL cppu_Any_extraction_failure_msg(
41  uno_Any const * pAny, typelib_TypeDescriptionReference * pType )
43 
44 namespace com
45 {
46 namespace sun
47 {
48 namespace star
49 {
50 namespace uno
51 {
52 
53 
54 inline Any::Any()
55 {
56  ::uno_any_construct( this, NULL, NULL, cpp_acquire );
57 }
58 
59 
60 template <typename T>
61 inline Any::Any( T const & value )
62 {
64  this, const_cast<T *>(&value),
65  ::cppu::getTypeFavourUnsigned(&value).getTypeLibType(),
66  cpp_acquire );
67 }
68 
69 inline Any::Any( bool value )
70 {
71  sal_Bool b = value;
73  this, &b, cppu::UnoType<bool>::get().getTypeLibType(),
74  cpp_acquire );
75 }
76 
77 #if defined LIBO_INTERNAL_ONLY
78 template<typename T1, typename T2>
79 Any::Any(rtl::OUStringConcat<T1, T2> const & value): Any(rtl::OUString(value))
80 {}
81 #endif
82 
83 inline Any::Any( const Any & rAny )
84 {
85  ::uno_type_any_construct( this, rAny.pData, rAny.pType, cpp_acquire );
86 }
87 
88 inline Any::Any( const void * pData_, const Type & rType )
89 {
91  this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
92  cpp_acquire );
93 }
94 
95 inline Any::Any( const void * pData_, typelib_TypeDescription * pTypeDescr )
96 {
98  this, const_cast< void * >( pData_ ), pTypeDescr, cpp_acquire );
99 }
100 
101 inline Any::Any( const void * pData_, typelib_TypeDescriptionReference * pType_ )
102 {
104  this, const_cast< void * >( pData_ ), pType_, cpp_acquire );
105 }
106 
107 inline Any::~Any()
108 {
110  this, cpp_release );
111 }
112 
113 inline Any & Any::operator = ( const Any & rAny )
114 {
115  if (this != &rAny)
116  {
118  this, rAny.pData, rAny.pType,
120  }
121  return *this;
122 }
123 
124 #if defined LIBO_INTERNAL_ONLY
125 
126 namespace detail {
127 
128 inline void moveAnyInternals(Any & from, Any & to) {
129  uno_any_construct(&to, nullptr, nullptr, &cpp_acquire);
130  std::swap(from.pType, to.pType);
131  std::swap(from.pData, to.pData);
132  std::swap(from.pReserved, to.pReserved);
133  if (to.pData == &from.pReserved) {
134  to.pData = &to.pReserved;
135  }
136  // This leaves to.pData (where "to" is now VOID) dangling to somewhere (cf.
137  // CONSTRUCT_EMPTY_ANY, cppu/source/uno/prim.hxx), but what's relevant is
138  // only that it isn't a nullptr (as e.g. >>= -> uno_type_assignData ->
139  // _assignData takes a null pSource to mean "construct a default value").
140 }
141 
142 }
143 
144 Any::Any(Any && other) {
145  detail::moveAnyInternals(other, *this);
146 }
147 
148 Any & Any::operator =(Any && other) {
150  detail::moveAnyInternals(other, *this);
151  return *this;
152 }
153 
154 #endif
155 
156 inline ::rtl::OUString Any::getValueTypeName() const
157 {
158  return ::rtl::OUString( pType->pTypeName );
159 }
160 
161 inline void Any::setValue( const void * pData_, const Type & rType )
162 {
164  this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
166 }
167 
168 inline void Any::setValue( const void * pData_, typelib_TypeDescriptionReference * pType_ )
169 {
171  this, const_cast< void * >( pData_ ), pType_,
173 }
174 
175 inline void Any::setValue( const void * pData_, typelib_TypeDescription * pTypeDescr )
176 {
178  this, const_cast< void * >( pData_ ), pTypeDescr,
180 }
181 
182 inline void Any::clear()
183 {
185  this, cpp_release );
186 }
187 
188 inline bool Any::isExtractableTo( const Type & rType ) const
189 {
191  rType.getTypeLibType(), pData, pType,
193 }
194 
195 
196 template <typename T>
197 inline bool Any::has() const
198 {
199  Type const & rType = ::cppu::getTypeFavourUnsigned(static_cast< T * >(0));
201  rType.getTypeLibType(), pData, pType,
203  cpp_release );
204 }
205 
206 #if defined LIBO_INTERNAL_ONLY
207 template<> bool Any::has<Any>() const = delete;
208 #endif
209 
210 inline bool Any::operator == ( const Any & rAny ) const
211 {
213  pData, pType, rAny.pData, rAny.pType,
215 }
216 
217 inline bool Any::operator != ( const Any & rAny ) const
218 {
219  return (! ::uno_type_equalData(
220  pData, pType, rAny.pData, rAny.pType,
222 }
223 
224 
225 template< class C >
226 inline Any SAL_CALL makeAny( const C & value )
227 {
228  return Any(value);
229 }
230 
231 #if !defined LIBO_INTERNAL_ONLY
232 template<> Any makeAny(sal_uInt16 const & value)
234 #endif
235 
236 template<typename T> Any toAny(T const & value) { return makeAny(value); }
237 
238 template<> Any toAny(Any const & value) { return value; }
239 
240 #if defined LIBO_INTERNAL_ONLY
241 
242 template<typename T> bool fromAny(Any const & any, T * value) {
243  assert(value != nullptr);
244  return any >>= *value;
245 }
246 
247 template<> bool fromAny(Any const & any, Any * value) {
248  assert(value != nullptr);
249  *value = any;
250  return true;
251 }
252 
253 #endif
254 
255 template< class C >
256 inline void SAL_CALL operator <<= ( Any & rAny, const C & value )
257 {
258  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
260  &rAny, const_cast< C * >( &value ), rType.getTypeLibType(),
262 }
263 
264 // additionally for C++ bool:
265 
266 template<>
267 inline void SAL_CALL operator <<= ( Any & rAny, bool const & value )
268 {
269  sal_Bool b = value;
271  &rAny, &b, cppu::UnoType<bool>::get().getTypeLibType(),
273 }
274 
275 
276 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
277 template< class C1, class C2 >
278 inline void SAL_CALL operator <<= ( Any & rAny, const rtl::OUStringConcat< C1, C2 >& value )
279 {
280  const rtl::OUString str( value );
281  const Type & rType = ::cppu::getTypeFavourUnsigned(&str);
283  &rAny, const_cast< rtl::OUString * >( &str ), rType.getTypeLibType(),
285 }
286 #endif
287 
288 #if defined LIBO_INTERNAL_ONLY
289 template<> void SAL_CALL operator <<=(Any &, Any const &) = delete;
290 #endif
291 
292 template< class C >
293 inline bool SAL_CALL operator >>= ( const Any & rAny, C & value )
294 {
295  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
297  &value, rType.getTypeLibType(),
298  rAny.pData, rAny.pType,
301 }
302 
303 // bool
304 
305 template<>
306 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Bool & value )
307 {
308  if (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass)
309  {
310  value = bool(* static_cast< const sal_Bool * >( rAny.pData ));
311  return true;
312  }
313  return false;
314 }
315 
316 template<>
317 inline bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value )
318 {
319  return (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass &&
320  bool(value) == bool(* static_cast< const sal_Bool * >( rAny.pData )));
321 }
322 
323 
324 template<>
325 inline bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
326 {
327  if (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN)
328  {
329  value = *static_cast< sal_Bool const * >( rAny.pData );
330  return true;
331  }
332  return false;
333 }
334 
335 
336 template<>
337 inline bool SAL_CALL operator == ( Any const & rAny, bool const & value )
338 {
339  return (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN &&
340  (value ==
341  bool(*static_cast< sal_Bool const * >( rAny.pData ))));
342 }
343 
344 // byte
345 
346 template<>
347 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Int8 & value )
348 {
349  if (typelib_TypeClass_BYTE == rAny.pType->eTypeClass)
350  {
351  value = * static_cast< const sal_Int8 * >( rAny.pData );
352  return true;
353  }
354  return false;
355 }
356 // short
357 
358 template<>
359 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value )
360 {
361  switch (rAny.pType->eTypeClass)
362  {
364  value = * static_cast< const sal_Int8 * >( rAny.pData );
365  return true;
368  value = * static_cast< const sal_Int16 * >( rAny.pData );
369  return true;
370  default:
371  return false;
372  }
373 }
374 
375 template<>
376 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value )
377 {
378  switch (rAny.pType->eTypeClass)
379  {
381  value = (sal_uInt16)( * static_cast< const sal_Int8 * >( rAny.pData ) );
382  return true;
385  value = * static_cast< const sal_uInt16 * >( rAny.pData );
386  return true;
387  default:
388  return false;
389  }
390 }
391 // long
392 
393 template<>
394 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value )
395 {
396  switch (rAny.pType->eTypeClass)
397  {
399  value = * static_cast< const sal_Int8 * >( rAny.pData );
400  return true;
402  value = * static_cast< const sal_Int16 * >( rAny.pData );
403  return true;
405  value = * static_cast< const sal_uInt16 * >( rAny.pData );
406  return true;
409  value = * static_cast< const sal_Int32 * >( rAny.pData );
410  return true;
411  default:
412  return false;
413  }
414 }
415 
416 template<>
417 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value )
418 {
419  switch (rAny.pType->eTypeClass)
420  {
422  value = (sal_uInt32)( * static_cast< const sal_Int8 * >( rAny.pData ) );
423  return true;
425  value = (sal_uInt32)( * static_cast< const sal_Int16 * >( rAny.pData ) );
426  return true;
428  value = * static_cast< const sal_uInt16 * >( rAny.pData );
429  return true;
432  value = * static_cast< const sal_uInt32 * >( rAny.pData );
433  return true;
434  default:
435  return false;
436  }
437 }
438 // hyper
439 
440 template<>
441 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value )
442 {
443  switch (rAny.pType->eTypeClass)
444  {
446  value = * static_cast< const sal_Int8 * >( rAny.pData );
447  return true;
449  value = * static_cast< const sal_Int16 * >( rAny.pData );
450  return true;
452  value = * static_cast< const sal_uInt16 * >( rAny.pData );
453  return true;
455  value = * static_cast< const sal_Int32 * >( rAny.pData );
456  return true;
458  value = * static_cast< const sal_uInt32 * >( rAny.pData );
459  return true;
462  value = * static_cast< const sal_Int64 * >( rAny.pData );
463  return true;
464  default:
465  return false;
466  }
467 }
468 
469 template<>
470 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value )
471 {
472  switch (rAny.pType->eTypeClass)
473  {
475  value = (sal_uInt64)( * static_cast< const sal_Int8 * >( rAny.pData ) );
476  return true;
478  value = (sal_uInt64)( * static_cast< const sal_Int16 * >( rAny.pData ) );
479  return true;
481  value = * static_cast< const sal_uInt16 * >( rAny.pData );
482  return true;
484  value = (sal_uInt64)( * static_cast< const sal_Int32 * >( rAny.pData ) );
485  return true;
487  value = * static_cast< const sal_uInt32 * >( rAny.pData );
488  return true;
491  value = * static_cast< const sal_uInt64 * >( rAny.pData );
492  return true;
493  default:
494  return false;
495  }
496 }
497 // float
498 
499 template<>
500 inline bool SAL_CALL operator >>= ( const Any & rAny, float & value )
501 {
502  switch (rAny.pType->eTypeClass)
503  {
505  value = * static_cast< const sal_Int8 * >( rAny.pData );
506  return true;
508  value = * static_cast< const sal_Int16 * >( rAny.pData );
509  return true;
511  value = * static_cast< const sal_uInt16 * >( rAny.pData );
512  return true;
514  value = * static_cast< const float * >( rAny.pData );
515  return true;
516  default:
517  return false;
518  }
519 }
520 // double
521 
522 template<>
523 inline bool SAL_CALL operator >>= ( const Any & rAny, double & value )
524 {
525  switch (rAny.pType->eTypeClass)
526  {
528  value = * static_cast< const sal_Int8 * >( rAny.pData );
529  return true;
531  value = * static_cast< const sal_Int16 * >( rAny.pData );
532  return true;
534  value = * static_cast< const sal_uInt16 * >( rAny.pData );
535  return true;
537  value = * static_cast< const sal_Int32 * >( rAny.pData );
538  return true;
540  value = * static_cast< const sal_uInt32 * >( rAny.pData );
541  return true;
543  value = * static_cast< const float * >( rAny.pData );
544  return true;
546  value = * static_cast< const double * >( rAny.pData );
547  return true;
548  default:
549  return false;
550  }
551 }
552 // string
553 
554 template<>
555 inline bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value )
556 {
557  if (typelib_TypeClass_STRING == rAny.pType->eTypeClass)
558  {
559  value = * static_cast< const ::rtl::OUString * >( rAny.pData );
560  return true;
561  }
562  return false;
563 }
564 
565 template<>
566 inline bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value )
567 {
568  return (typelib_TypeClass_STRING == rAny.pType->eTypeClass &&
569  value == * static_cast< const ::rtl::OUString * >( rAny.pData ) );
570 }
571 // type
572 
573 template<>
574 inline bool SAL_CALL operator >>= ( const Any & rAny, Type & value )
575 {
576  if (typelib_TypeClass_TYPE == rAny.pType->eTypeClass)
577  {
578  value = * static_cast< const Type * >( rAny.pData );
579  return true;
580  }
581  return false;
582 }
583 
584 template<>
585 inline bool SAL_CALL operator == ( const Any & rAny, const Type & value )
586 {
587  return (typelib_TypeClass_TYPE == rAny.pType->eTypeClass &&
588  value.equals( * static_cast< const Type * >( rAny.pData ) ));
589 }
590 // any
591 
592 #if defined LIBO_INTERNAL_ONLY
593 template<> bool SAL_CALL operator >>=(Any const &, Any &) = delete;
594 #else
595 template<>
596 inline bool SAL_CALL operator >>= ( const Any & rAny, Any & value )
597 {
598  if (&rAny != &value)
599  {
601  &value, rAny.pData, rAny.pType,
603  }
604  return true;
605 }
606 #endif
607 // interface
608 
609 template<>
610 inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value )
611 {
612  if (typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass)
613  {
614  return static_cast< const BaseReference * >( rAny.pData )->operator == ( value );
615  }
616  return false;
617 }
618 
619 // operator to compare to an any.
620 
621 template< class C >
622 inline bool SAL_CALL operator == ( const Any & rAny, const C & value )
623 {
624  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
626  rAny.pData, rAny.pType,
627  const_cast< C * >( &value ), rType.getTypeLibType(),
629 }
630 // operator to compare to an any. may use specialized operators ==.
631 
632 template< class C >
633 inline bool SAL_CALL operator != ( const Any & rAny, const C & value )
634 {
635  return (! operator == ( rAny, value ));
636 }
637 
638 template <typename T>
639 T Any::get() const
640 {
641  T value = T();
642  if (! (*this >>= value)) {
643  throw RuntimeException(
644  ::rtl::OUString(
646  this,
647  ::cppu::getTypeFavourUnsigned(&value).getTypeLibType() ),
648  SAL_NO_ACQUIRE ) );
649  }
650  return value;
651 }
652 
653 #if defined LIBO_INTERNAL_ONLY
654 template<> Any Any::get() const = delete;
655 #endif
656 
663 template<typename charT, typename traits>
664 inline std::basic_ostream<charT, traits> &operator<<(std::basic_ostream<charT, traits> &o, Any const &any) {
665  o << "<Any: (" << any.getValueTypeName() << ')';
666  switch(any.pType->eTypeClass) {
668  break;
670  o << ' ' << any.get<bool>();
671  break;
676  o << ' ' << any.get<sal_Int64>();
677  break;
681  o << ' ' << any.get<sal_uInt64>();
682  break;
685  o << ' ' << any.get<double>();
686  break;
687  case typelib_TypeClass_CHAR: {
688  std::ios_base::fmtflags flgs = o.setf(
689  std::ios_base::hex, std::ios_base::basefield);
690  charT fill = o.fill('0');
691  o << " U+" << std::setw(4)
692  << *static_cast<sal_Unicode const *>(any.getValue());
693  o.setf(flgs);
694  o.fill(fill);
695  break;
696  }
698  o << ' ' << any.get<rtl::OUString>();
699  break;
701  o << ' ' << any.get<css::uno::Type>().getTypeName();
702  break;
704  o << " len "
705  << ((*static_cast<uno_Sequence * const *>(any.getValue()))->
706  nElements);
707  break;
709  o << ' ' << *static_cast<sal_Int32 const *>(any.getValue());
710  break;
713  o << ' ' << any.getValue();
714  break;
716  o << ' ' << *static_cast<void * const *>(any.getValue());
717  break;
718  default:
719  assert(false); // this cannot happen
720  break;
721  }
722  o << '>';
723  return o;
724 }
725 
726 }
727 }
728 }
729 }
730 
731 #endif
732 
733 /* 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
const void * getValue() const
Gets a pointer to the set value.
Definition: Any.h:188
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:156
bool isExtractableTo(const Type &rType) const
Tests whether this any is extractable to a value of given type.
Definition: Any.hxx:188
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:256
#define CPPU_DLLPUBLIC
Definition: cppudllapi.h:10
Any & operator=(const Any &rAny)
Assignment operator: Sets the value of the given any.
Definition: Any.hxx:113
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:52
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:197
~Any()
Destructor: Destructs any content and frees memory.
Definition: Any.hxx:107
bool operator==(const Any &rAny) const
Equality operator: compares two anys.
Definition: Any.hxx:210
struct SAL_DLLPUBLIC_RTTI _uno_Any uno_Any
This is the binary specification of an UNO any.
Definition: types.h:383
bool operator!=(const Any &rAny) const
Unequality operator: compares two anys.
Definition: Any.hxx:217
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:39
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:44
sal_uInt16 sal_Unicode
Definition: types.h:142
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.
Any()
Default constructor: Any holds no value; its type is void.
Definition: Any.hxx:54
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:161
This is the binary specification of a SAL sequence.
Definition: types.h:327
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:120
definition of a no acquire enum for ctors
Definition: types.h:380
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:226
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:352
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:236
T get() const
Provides a value of specified type, so you can easily write e.g.
Definition: Any.hxx:639
bool operator>>=(const Any &rAny, C &value)
Template binary >>= operator to assign a value from an any.
Definition: Any.hxx:293
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:182
type class of exception
Definition: typeclass.h:70