AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #ifndef INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
4 #define INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
5 
6 #include "sal/config.h"
7 
8 #include <algorithm>
9 #include <cassert>
10 #include <cstddef>
11 #include <iomanip>
12 #include <ostream>
13 #include <utility>
14 
15 #include "com/sun/star/uno/Any.h"
16 #include "uno/data.h"
17 #include "uno/sequence2.h"
21 #include "com/sun/star/uno/RuntimeException.hpp"
22 #include "cppu/cppudllapi.h"
23 #include "cppu/unotype.hxx"
24 
25 extern "C" CPPU_DLLPUBLIC rtl_uString * SAL_CALL cppu_Any_extraction_failure_msg(
26  uno_Any const * pAny, typelib_TypeDescriptionReference * pType )
28 
29 namespace com
30 {
31 namespace sun
32 {
33 namespace star
34 {
35 namespace uno
36 {
37 
38 
39 inline Any::Any()
40 {
41  ::uno_any_construct( this, NULL, NULL, cpp_acquire );
42 }
43 
44 
45 template <typename T>
46 inline Any::Any( T const & value )
47 {
49  this, const_cast<T *>(&value),
50  ::cppu::getTypeFavourUnsigned(&value).getTypeLibType(),
51  cpp_acquire );
52 }
53 
54 inline Any::Any( bool value )
55 {
56  sal_Bool b = value;
58  this, &b, cppu::UnoType<bool>::get().getTypeLibType(),
59  cpp_acquire );
60 }
61 
62 #if defined LIBO_INTERNAL_ONLY
63 template<typename T1, typename T2>
64 Any::Any(rtl::OUStringConcat<T1, T2> && value):
65  Any(rtl::OUString(std::move(value)))
66 {}
67 template<typename T>
68 Any::Any(rtl::OUStringNumber<T> && value): Any(rtl::OUString(std::move(value))) {}
69 template <std::size_t N>
70 Any::Any(const rtl::OUStringLiteral<N>& value): Any(rtl::OUString(value)) {}
71 #endif
72 
73 inline Any::Any( const Any & rAny )
74 {
75  ::uno_type_any_construct( this, rAny.pData, rAny.pType, cpp_acquire );
76 }
77 
78 inline Any::Any( const void * pData_, const Type & rType )
79 {
81  this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
82  cpp_acquire );
83 }
84 
85 inline Any::Any( const void * pData_, typelib_TypeDescription * pTypeDescr )
86 {
88  this, const_cast< void * >( pData_ ), pTypeDescr, cpp_acquire );
89 }
90 
91 inline Any::Any( const void * pData_, typelib_TypeDescriptionReference * pType_ )
92 {
94  this, const_cast< void * >( pData_ ), pType_, cpp_acquire );
95 }
96 
97 inline Any::~Any()
98 {
100  this, cpp_release );
101 }
102 
103 inline Any & Any::operator = ( const Any & rAny )
104 {
105  if (this != &rAny)
106  {
108  this, rAny.pData, rAny.pType,
110  }
111  return *this;
112 }
113 
114 #if defined LIBO_INTERNAL_ONLY
115 
116 Any::Any(Any && other) noexcept {
117  uno_any_construct(this, nullptr, nullptr, &cpp_acquire);
118  std::swap(other.pType, pType);
119  std::swap(other.pData, pData);
120  std::swap(other.pReserved, pReserved);
121  if (pData == &other.pReserved) {
122  pData = &pReserved;
123  }
124  // This leaves other.pData (where "other" is now VOID) dangling to somewhere (cf.
125  // CONSTRUCT_EMPTY_ANY, cppu/source/uno/prim.hxx), but what's relevant is
126  // only that it isn't a nullptr (as e.g. >>= -> uno_type_assignData ->
127  // _assignData takes a null pSource to mean "construct a default value").
128 }
129 
130 Any & Any::operator =(Any && other) noexcept {
131  std::swap(other.pType, pType);
132  std::swap(other.pData, pData);
133  std::swap(other.pReserved, pReserved);
134  if (pData == &other.pReserved) {
135  pData = &pReserved;
136  }
137  if (other.pData == &pReserved) {
138  other.pData = &other.pReserved;
139  }
140  return *this;
141 }
142 
143 #endif
144 
145 inline ::rtl::OUString Any::getValueTypeName() const
146 {
147  return ::rtl::OUString( pType->pTypeName );
148 }
149 
150 inline void Any::setValue( const void * pData_, const Type & rType )
151 {
153  this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
155 }
156 
157 inline void Any::setValue( const void * pData_, typelib_TypeDescriptionReference * pType_ )
158 {
160  this, const_cast< void * >( pData_ ), pType_,
162 }
163 
164 inline void Any::setValue( const void * pData_, typelib_TypeDescription * pTypeDescr )
165 {
167  this, const_cast< void * >( pData_ ), pTypeDescr,
169 }
170 
171 inline void Any::clear()
172 {
174  this, cpp_release );
175 }
176 
177 inline bool Any::isExtractableTo( const Type & rType ) const
178 {
180  rType.getTypeLibType(), pData, pType,
182 }
183 
184 
185 template <typename T>
186 inline bool Any::has() const
187 {
188  Type const & rType = ::cppu::getTypeFavourUnsigned(static_cast< T * >(NULL));
190  rType.getTypeLibType(), pData, pType,
192  cpp_release );
193 }
194 
195 #if defined LIBO_INTERNAL_ONLY
196 template<> bool Any::has<Any>() const = delete;
197 #endif
198 
199 inline bool Any::operator == ( const Any & rAny ) const
200 {
202  pData, pType, rAny.pData, rAny.pType,
204 }
205 
206 inline bool Any::operator != ( const Any & rAny ) const
207 {
208  return (! ::uno_type_equalData(
209  pData, pType, rAny.pData, rAny.pType,
211 }
212 
213 
214 #if !defined LIBO_INTERNAL_ONLY
215 template< class C >
216 inline Any SAL_CALL makeAny( const C & value )
217 {
218  return Any(value);
219 }
220 
221 template<> Any makeAny(sal_uInt16 const & value)
223 #endif
224 
225 template<typename T> Any toAny(T const & value) {
226  return Any(value);
227 }
228 
229 template<> Any toAny(Any const & value) { return value; }
230 
231 #if defined LIBO_INTERNAL_ONLY
232 
233 template<typename T1, typename T2>
234 Any toAny(rtl::OUStringConcat<T1, T2> && value)
235 { return Any(std::move(value)); }
236 
237 template<typename T>
238 Any toAny(rtl::OUStringNumber<T> && value)
239 { return Any(std::move(value)); }
240 
241 template<typename T> bool fromAny(Any const & any, T * value) {
242  assert(value != nullptr);
243  return any >>= *value;
244 }
245 
246 template<> bool fromAny(Any const & any, Any * value) {
247  assert(value != nullptr);
248  *value = any;
249  return true;
250 }
251 
252 #endif
253 
254 template< class C >
255 inline void SAL_CALL operator <<= ( Any & rAny, const C & value )
256 {
257  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
259  &rAny, const_cast< C * >( &value ), rType.getTypeLibType(),
261 }
262 
263 // additionally for C++ bool:
264 
265 template<>
266 inline void SAL_CALL operator <<= ( Any & rAny, bool const & value )
267 {
268  sal_Bool b = value;
270  &rAny, &b, cppu::UnoType<bool>::get().getTypeLibType(),
272 }
273 
274 
275 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
276 template< class C1, class C2 >
277 inline void operator <<= ( Any & rAny, rtl::OUStringConcat< C1, C2 >&& value )
278 {
279  const rtl::OUString str( std::move(value) );
280  const Type & rType = ::cppu::getTypeFavourUnsigned(&str);
282  &rAny, const_cast< rtl::OUString * >( &str ), rType.getTypeLibType(),
284 }
285 template<typename T1, typename T2>
286 void operator <<=(Any &, rtl::OUStringConcat<T1, T2> const &) = delete;
287 template< class C >
288 inline void operator <<= ( Any & rAny, rtl::OUStringNumber< C >&& value )
289 {
290  const rtl::OUString str( std::move(value) );
291  const Type & rType = ::cppu::getTypeFavourUnsigned(&str);
293  &rAny, const_cast< rtl::OUString * >( &str ), rType.getTypeLibType(),
295 }
296 template<typename T>
297 void operator <<=(Any &, rtl::OUStringNumber<T> const &) = delete;
298 #endif
299 
300 #if defined LIBO_INTERNAL_ONLY
301 template<> void SAL_CALL operator <<=(Any &, Any const &) = delete;
302 #endif
303 
304 template< class C >
305 inline bool SAL_CALL operator >>= ( const Any & rAny, C & value )
306 {
307  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
309  &value, rType.getTypeLibType(),
310  rAny.pData, rAny.pType,
313 }
314 
315 // bool
316 
317 template<>
318 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Bool & value )
319 {
320  if (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass)
321  {
322  value = bool(* static_cast< const sal_Bool * >( rAny.pData ));
323  return true;
324  }
325  return false;
326 }
327 
328 template<>
329 inline bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value )
330 {
331  return (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass &&
332  bool(value) == bool(* static_cast< const sal_Bool * >( rAny.pData )));
333 }
334 
335 
336 template<>
337 inline bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
338 {
339  if (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN)
340  {
341  value = *static_cast< sal_Bool const * >( rAny.pData );
342  return true;
343  }
344  return false;
345 }
346 
347 
348 template<>
349 inline bool SAL_CALL operator == ( Any const & rAny, bool const & value )
350 {
351  return (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN &&
352  (value ==
353  bool(*static_cast< sal_Bool const * >( rAny.pData ))));
354 }
355 
356 // byte
357 
358 template<>
359 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Int8 & value )
360 {
361  if (typelib_TypeClass_BYTE == rAny.pType->eTypeClass)
362  {
363  value = * static_cast< const sal_Int8 * >( rAny.pData );
364  return true;
365  }
366  return false;
367 }
368 // short
369 
370 template<>
371 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value )
372 {
373  switch (rAny.pType->eTypeClass)
374  {
376  value = * static_cast< const sal_Int8 * >( rAny.pData );
377  return true;
380  value = * static_cast< const sal_Int16 * >( rAny.pData );
381  return true;
382  default:
383  return false;
384  }
385 }
386 
387 template<>
388 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value )
389 {
390  switch (rAny.pType->eTypeClass)
391  {
393  value = static_cast<sal_uInt16>( * static_cast< const sal_Int8 * >( rAny.pData ) );
394  return true;
397  value = * static_cast< const sal_uInt16 * >( rAny.pData );
398  return true;
399  default:
400  return false;
401  }
402 }
403 // long
404 
405 template<>
406 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value )
407 {
408  switch (rAny.pType->eTypeClass)
409  {
411  value = * static_cast< const sal_Int8 * >( rAny.pData );
412  return true;
414  value = * static_cast< const sal_Int16 * >( rAny.pData );
415  return true;
417  value = * static_cast< const sal_uInt16 * >( rAny.pData );
418  return true;
421  value = * static_cast< const sal_Int32 * >( rAny.pData );
422  return true;
423  default:
424  return false;
425  }
426 }
427 
428 template<>
429 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value )
430 {
431  switch (rAny.pType->eTypeClass)
432  {
434  value = static_cast<sal_uInt32>( * static_cast< const sal_Int8 * >( rAny.pData ) );
435  return true;
437  value = static_cast<sal_uInt32>( * static_cast< const sal_Int16 * >( rAny.pData ) );
438  return true;
440  value = * static_cast< const sal_uInt16 * >( rAny.pData );
441  return true;
444  value = * static_cast< const sal_uInt32 * >( rAny.pData );
445  return true;
446  default:
447  return false;
448  }
449 }
450 // hyper
451 
452 template<>
453 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value )
454 {
455  switch (rAny.pType->eTypeClass)
456  {
458  value = * static_cast< const sal_Int8 * >( rAny.pData );
459  return true;
461  value = * static_cast< const sal_Int16 * >( rAny.pData );
462  return true;
464  value = * static_cast< const sal_uInt16 * >( rAny.pData );
465  return true;
467  value = * static_cast< const sal_Int32 * >( rAny.pData );
468  return true;
470  value = * static_cast< const sal_uInt32 * >( rAny.pData );
471  return true;
474  value = * static_cast< const sal_Int64 * >( rAny.pData );
475  return true;
476  default:
477  return false;
478  }
479 }
480 
481 template<>
482 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value )
483 {
484  switch (rAny.pType->eTypeClass)
485  {
487  value = static_cast<sal_uInt64>( * static_cast< const sal_Int8 * >( rAny.pData ) );
488  return true;
490  value = static_cast<sal_uInt64>( * static_cast< const sal_Int16 * >( rAny.pData ) );
491  return true;
493  value = * static_cast< const sal_uInt16 * >( rAny.pData );
494  return true;
496  value = static_cast<sal_uInt64>( * static_cast< const sal_Int32 * >( rAny.pData ) );
497  return true;
499  value = * static_cast< const sal_uInt32 * >( rAny.pData );
500  return true;
503  value = * static_cast< const sal_uInt64 * >( rAny.pData );
504  return true;
505  default:
506  return false;
507  }
508 }
509 // float
510 
511 template<>
512 inline bool SAL_CALL operator >>= ( const Any & rAny, float & value )
513 {
514  switch (rAny.pType->eTypeClass)
515  {
517  value = * static_cast< const sal_Int8 * >( rAny.pData );
518  return true;
520  value = * static_cast< const sal_Int16 * >( rAny.pData );
521  return true;
523  value = * static_cast< const sal_uInt16 * >( rAny.pData );
524  return true;
526  value = * static_cast< const float * >( rAny.pData );
527  return true;
528  default:
529  return false;
530  }
531 }
532 // double
533 
534 template<>
535 inline bool SAL_CALL operator >>= ( const Any & rAny, double & value )
536 {
537  switch (rAny.pType->eTypeClass)
538  {
540  value = * static_cast< const sal_Int8 * >( rAny.pData );
541  return true;
543  value = * static_cast< const sal_Int16 * >( rAny.pData );
544  return true;
546  value = * static_cast< const sal_uInt16 * >( rAny.pData );
547  return true;
549  value = * static_cast< const sal_Int32 * >( rAny.pData );
550  return true;
552  value = * static_cast< const sal_uInt32 * >( rAny.pData );
553  return true;
555  value = * static_cast< const float * >( rAny.pData );
556  return true;
558  value = * static_cast< const double * >( rAny.pData );
559  return true;
560  default:
561  return false;
562  }
563 }
564 // string
565 
566 template<>
567 inline bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value )
568 {
569  if (typelib_TypeClass_STRING == rAny.pType->eTypeClass)
570  {
571  value = * static_cast< const ::rtl::OUString * >( rAny.pData );
572  return true;
573  }
574  return false;
575 }
576 
577 template<>
578 inline bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value )
579 {
580  return (typelib_TypeClass_STRING == rAny.pType->eTypeClass &&
581  value == * static_cast< const ::rtl::OUString * >( rAny.pData ) );
582 }
583 
584 #if defined LIBO_INTERNAL_ONLY
585 template<std::size_t N>
586 inline bool SAL_CALL operator == (const Any& rAny, const rtl::OUStringLiteral<N>& value)
587 {
588  return operator ==(rAny, rtl::OUString(value));
589 }
590 #endif
591 // type
592 
593 template<>
594 inline bool SAL_CALL operator >>= ( const Any & rAny, Type & value )
595 {
596  if (typelib_TypeClass_TYPE == rAny.pType->eTypeClass)
597  {
598  value = * static_cast< const Type * >( rAny.pData );
599  return true;
600  }
601  return false;
602 }
603 
604 template<>
605 inline bool SAL_CALL operator == ( const Any & rAny, const Type & value )
606 {
607  return (typelib_TypeClass_TYPE == rAny.pType->eTypeClass &&
608  value.equals( * static_cast< const Type * >( rAny.pData ) ));
609 }
610 // any
611 
612 #if defined LIBO_INTERNAL_ONLY
613 template<> bool SAL_CALL operator >>=(Any const &, Any &) = delete;
614 #else
615 template<>
616 inline bool SAL_CALL operator >>= ( const Any & rAny, Any & value )
617 {
618  if (&rAny != &value)
619  {
621  &value, rAny.pData, rAny.pType,
623  }
624  return true;
625 }
626 #endif
627 // interface
628 
629 template<>
630 inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value )
631 {
632  if (typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass)
633  {
634  return static_cast< const BaseReference * >( rAny.pData )->operator == ( value );
635  }
636  return false;
637 }
638 
639 // operator to compare to an any.
640 
641 template< class C >
642 inline bool SAL_CALL operator == ( const Any & rAny, const C & value )
643 {
644  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
646  rAny.pData, rAny.pType,
647  const_cast< C * >( &value ), rType.getTypeLibType(),
649 }
650 // operator to compare to an any. may use specialized operators ==.
651 
652 template< class C >
653 inline bool SAL_CALL operator != ( const Any & rAny, const C & value )
654 {
655  return (! operator == ( rAny, value ));
656 }
657 
658 template <typename T>
659 T Any::get() const
660 {
661  T value = T();
662  if (! (*this >>= value)) {
663  throw RuntimeException(
664  ::rtl::OUString(
666  this,
667  ::cppu::getTypeFavourUnsigned(&value).getTypeLibType() ),
668  SAL_NO_ACQUIRE ) );
669  }
670  return value;
671 }
672 
673 #if defined LIBO_INTERNAL_ONLY
674 template<> Any Any::get() const = delete;
675 #endif
676 
683 template<typename charT, typename traits>
684 inline std::basic_ostream<charT, traits> &operator<<(std::basic_ostream<charT, traits> &o, Any const &any) {
685  o << "<Any: (" << any.getValueTypeName() << ')';
686  switch(any.pType->eTypeClass) {
688  break;
690  o << ' ' << any.get<bool>();
691  break;
696  o << ' ' << any.get<sal_Int64>();
697  break;
701  o << ' ' << any.get<sal_uInt64>();
702  break;
705  o << ' ' << any.get<double>();
706  break;
707  case typelib_TypeClass_CHAR: {
708  std::ios_base::fmtflags flgs = o.setf(
709  std::ios_base::hex, std::ios_base::basefield);
710  charT fill = o.fill('0');
711  o << " U+" << std::setw(4)
712  << unsigned(*static_cast<sal_Unicode const *>(any.getValue()));
713  o.setf(flgs);
714  o.fill(fill);
715  break;
716  }
718  o << ' ' << any.get<rtl::OUString>();
719  break;
721  o << ' ' << any.get<css::uno::Type>().getTypeName();
722  break;
724  o << " len "
725  << ((*static_cast<uno_Sequence * const *>(any.getValue()))->
726  nElements);
727  break;
729  o << ' ' << *static_cast<sal_Int32 const *>(any.getValue());
730  break;
733  o << ' ' << any.getValue();
734  break;
736  o << ' ' << *static_cast<void * const *>(any.getValue());
737  break;
738  default:
739  assert(false); // this cannot happen
740  break;
741  }
742  o << '>';
743  return o;
744 }
745 
746 }
747 }
748 }
749 }
750 
751 #endif
752 
753 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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.
void cpp_release(void *pCppI)
Function to release a C++ interface.
Definition: genfunc.hxx:30
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.
unsigned char sal_Bool
Definition: types.h:18
type class of enum
Definition: typeclass.h:42
type class of void
Definition: typeclass.h:12
inline::rtl::OUString getValueTypeName() const
Gets the type name of the set value.
Definition: Any.hxx:145
bool isExtractableTo(const Type &rType) const
Tests whether this any is extractable to a value of given type.
Definition: Any.hxx:177
type class of long
Definition: typeclass.h:24
type class of string
Definition: typeclass.h:36
type class of exception
Definition: typeclass.h:53
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescriptionReference typelib_TypeDescriptionReference
Holds a weak reference to a type description.
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:182
type class of double
Definition: typeclass.h:34
type class of char
Definition: typeclass.h:14
type class of unsigned long
Definition: typeclass.h:26
Any & operator=(const Any &rAny)
Assignment operator: Sets the value of the given any.
Definition: Any.hxx:103
type class of short
Definition: typeclass.h:20
C++ class representing an IDL any.
Definition: Any.h:36
typelib_TypeDescriptionReference * getTypeLibType() const
Gets the C typelib type description reference pointer.
Definition: Type.h:142
struct SAL_DLLPUBLIC_RTTI _uno_Any uno_Any
This is the binary specification of a UNO any.
bool has() const
Tests whether this any can provide a value of specified type.
Definition: Any.hxx:186
Any toAny(T const &value)
Wrap a value in an Any, if necessary.
Definition: Any.hxx:225
~Any()
Destructor: Destructs any content and frees memory.
Definition: Any.hxx:97
bool operator==(const Any &rAny) const
Equality operator: compares two anys.
Definition: Any.hxx:199
CPPU_DLLPUBLIC void uno_any_destruct(uno_Any *pValue, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Destructs an any.
bool operator>>=(const Any &rAny, C &value)
Template binary &gt;&gt;= operator to assign a value from an any.
Definition: Any.hxx:305
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:642
CPPU_DLLPUBLIC rtl_uString * cppu_Any_extraction_failure_msg(uno_Any const *pAny, typelib_TypeDescriptionReference *pType) SAL_THROW_EXTERN_C()
bool operator!=(const Any &rAny) const
Inequality operator: compares two anys.
Definition: Any.hxx:206
Get the css::uno::Type instance representing a certain UNO type.
Definition: unotype.hxx:31
void cpp_acquire(void *pCppI)
Function to acquire a C++ interface.
Definition: genfunc.hxx:25
CPPU_DLLPUBLIC void SAL_THROW_EXTERN_C()
This method is called to wait for a reply of a previously sent request.
type class of interface
Definition: typeclass.h:62
Any makeAny(const C &value)
Template function to generically construct an any from a C++ value.
Definition: Any.hxx:216
type class of sequence
Definition: typeclass.h:55
type class of boolean
Definition: typeclass.h:16
type class of hyper
Definition: typeclass.h:28
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.
type class of float
Definition: typeclass.h:32
void operator<<=(Any &rAny, const C &value)
Template binary &lt;&lt;= operator to set the value of an any.
Definition: Any.hxx:255
C++ class representing an IDL meta type.
Definition: Type.h:38
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescription typelib_TypeDescription
Full type description of a type.
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 type
Definition: typeclass.h:38
definition of a no acquire enum for ctors
Definition: types.h:336
bool operator!=(const Any &rAny, const C &value)
Template inequality operator: compares set value of left side any to right side value.
Definition: Any.hxx:653
Any()
Default constructor: Any holds no value; its type is void.
Definition: Any.hxx:39
void setValue(const void *pData_, const Type &rType)
Sets a value.
Definition: Any.hxx:150
This is the binary specification of a SAL sequence.
Definition: types.h:283
type class of struct
Definition: typeclass.h:46
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.
void * cpp_queryInterface(void *pCppI, typelib_TypeDescriptionReference *pType)
Function to query for a C++ interface.
Definition: genfunc.hxx:35
type class of byte
Definition: typeclass.h:18
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 void uno_any_clear(uno_Any *pValue, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Sets value to void.
signed char sal_Int8
Definition: types.h:23
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.
css::uno::Type const & getTypeFavourUnsigned(SAL_UNUSED_PARAMETER T const *)
A working replacement for getCppuType (see there).
Definition: unotype.hxx:304
This base class serves as a base class for all template reference classes and has been introduced due...
Definition: Reference.h:46
type class of unsigned hyper
Definition: typeclass.h:30
T get() const
Provides a value of specified type, so you can easily write e.g.
Definition: Any.hxx:659
bool equals(const Type &rType) const
Compares two types.
Definition: Type.h:161
type class of unsigned short
Definition: typeclass.h:22
rtl::OUString getTypeName(rtl::OUString const &rEnvDcp)
Get the OBI type part of an environment descriptor.
Definition: EnvDcp.hxx:21
void clear()
Clears this any.
Definition: Any.hxx:171
#define CPPU_DLLPUBLIC
Definition: cppudllapi.h:11