LibreOffice
LibreOffice 7.2 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  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 /*
21  * This file is part of LibreOffice published API.
22  */
23 #ifndef INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
24 #define INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
25 
26 #include "sal/config.h"
27 
28 #include <algorithm>
29 #include <cassert>
30 #include <cstddef>
31 #include <iomanip>
32 #include <ostream>
33 #include <utility>
34 
35 #include "com/sun/star/uno/Any.h"
36 #include "uno/data.h"
37 #include "uno/sequence2.h"
41 #include "com/sun/star/uno/RuntimeException.hpp"
42 #include "cppu/cppudllapi.h"
43 #include "cppu/unotype.hxx"
44 
45 extern "C" CPPU_DLLPUBLIC rtl_uString * SAL_CALL cppu_Any_extraction_failure_msg(
46  uno_Any const * pAny, typelib_TypeDescriptionReference * pType )
48 
49 namespace com
50 {
51 namespace sun
52 {
53 namespace star
54 {
55 namespace uno
56 {
57 
58 
59 inline Any::Any()
60 {
61  ::uno_any_construct( this, NULL, NULL, cpp_acquire );
62 }
63 
64 
65 template <typename T>
66 inline Any::Any( T const & value )
67 {
69  this, const_cast<T *>(&value),
70  ::cppu::getTypeFavourUnsigned(&value).getTypeLibType(),
71  cpp_acquire );
72 }
73 
74 inline Any::Any( bool value )
75 {
76  sal_Bool b = value;
78  this, &b, cppu::UnoType<bool>::get().getTypeLibType(),
79  cpp_acquire );
80 }
81 
82 #if defined LIBO_INTERNAL_ONLY
83 template<typename T1, typename T2>
84 Any::Any(rtl::OUStringConcat<T1, T2> && value):
85  Any(rtl::OUString(std::move(value)))
86 {}
87 #endif
88 
89 inline Any::Any( const Any & rAny )
90 {
91  ::uno_type_any_construct( this, rAny.pData, rAny.pType, cpp_acquire );
92 }
93 
94 inline Any::Any( const void * pData_, const Type & rType )
95 {
97  this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
98  cpp_acquire );
99 }
100 
101 inline Any::Any( const void * pData_, typelib_TypeDescription * pTypeDescr )
102 {
104  this, const_cast< void * >( pData_ ), pTypeDescr, cpp_acquire );
105 }
106 
107 inline Any::Any( const void * pData_, typelib_TypeDescriptionReference * pType_ )
108 {
110  this, const_cast< void * >( pData_ ), pType_, cpp_acquire );
111 }
112 
113 inline Any::~Any()
114 {
116  this, cpp_release );
117 }
118 
119 inline Any & Any::operator = ( const Any & rAny )
120 {
121  if (this != &rAny)
122  {
124  this, rAny.pData, rAny.pType,
126  }
127  return *this;
128 }
129 
130 #if defined LIBO_INTERNAL_ONLY
131 
132 namespace detail {
133 
134 inline void moveAnyInternals(Any & from, Any & to) noexcept {
135  uno_any_construct(&to, nullptr, nullptr, &cpp_acquire);
136  std::swap(from.pType, to.pType);
137  std::swap(from.pData, to.pData);
138  std::swap(from.pReserved, to.pReserved);
139  if (to.pData == &from.pReserved) {
140  to.pData = &to.pReserved;
141  }
142  // This leaves from.pData (where "from" is now VOID) dangling to somewhere (cf.
143  // CONSTRUCT_EMPTY_ANY, cppu/source/uno/prim.hxx), but what's relevant is
144  // only that it isn't a nullptr (as e.g. >>= -> uno_type_assignData ->
145  // _assignData takes a null pSource to mean "construct a default value").
146 }
147 
148 }
149 
150 Any::Any(Any && other) noexcept {
151  detail::moveAnyInternals(other, *this);
152 }
153 
154 Any & Any::operator =(Any && other) noexcept {
156  detail::moveAnyInternals(other, *this);
157  return *this;
158 }
159 
160 #endif
161 
162 inline ::rtl::OUString Any::getValueTypeName() const
163 {
164  return ::rtl::OUString( pType->pTypeName );
165 }
166 
167 inline void Any::setValue( const void * pData_, const Type & rType )
168 {
170  this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
172 }
173 
174 inline void Any::setValue( const void * pData_, typelib_TypeDescriptionReference * pType_ )
175 {
177  this, const_cast< void * >( pData_ ), pType_,
179 }
180 
181 inline void Any::setValue( const void * pData_, typelib_TypeDescription * pTypeDescr )
182 {
184  this, const_cast< void * >( pData_ ), pTypeDescr,
186 }
187 
188 inline void Any::clear()
189 {
191  this, cpp_release );
192 }
193 
194 inline bool Any::isExtractableTo( const Type & rType ) const
195 {
197  rType.getTypeLibType(), pData, pType,
199 }
200 
201 
202 template <typename T>
203 inline bool Any::has() const
204 {
205  Type const & rType = ::cppu::getTypeFavourUnsigned(static_cast< T * >(0));
207  rType.getTypeLibType(), pData, pType,
209  cpp_release );
210 }
211 
212 #if defined LIBO_INTERNAL_ONLY
213 template<> bool Any::has<Any>() const = delete;
214 #endif
215 
216 inline bool Any::operator == ( const Any & rAny ) const
217 {
219  pData, pType, rAny.pData, rAny.pType,
221 }
222 
223 inline bool Any::operator != ( const Any & rAny ) const
224 {
225  return (! ::uno_type_equalData(
226  pData, pType, rAny.pData, rAny.pType,
228 }
229 
230 
231 template< class C >
232 inline Any SAL_CALL makeAny( const C & value )
233 {
234  return Any(value);
235 }
236 
237 #if !defined LIBO_INTERNAL_ONLY
238 template<> Any makeAny(sal_uInt16 const & value)
240 #endif
241 
242 template<typename T> Any toAny(T const & value) { return makeAny(value); }
243 
244 template<> Any toAny(Any const & value) { return value; }
245 
246 #if defined LIBO_INTERNAL_ONLY
247 
248 template<typename T1, typename T2>
249 Any makeAny(rtl::OUStringConcat<T1, T2> && value)
250 { return Any(std::move(value)); }
251 
252 template<typename T1, typename T2>
253 Any toAny(rtl::OUStringConcat<T1, T2> && value)
254 { return makeAny(std::move(value)); }
255 
256 template<typename T>
257 Any makeAny(rtl::OUStringNumber<T> && value)
258 { return Any(OUString(std::move(value))); }
259 
260 template<typename T>
261 Any toAny(rtl::OUStringNumber<T> && value)
262 { return makeAny(std::move(value)); }
263 
264 template<typename T> bool fromAny(Any const & any, T * value) {
265  assert(value != nullptr);
266  return any >>= *value;
267 }
268 
269 template<> bool fromAny(Any const & any, Any * value) {
270  assert(value != nullptr);
271  *value = any;
272  return true;
273 }
274 
275 #endif
276 
277 template< class C >
278 inline void SAL_CALL operator <<= ( Any & rAny, const C & value )
279 {
280  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
282  &rAny, const_cast< C * >( &value ), rType.getTypeLibType(),
284 }
285 
286 // additionally for C++ bool:
287 
288 template<>
289 inline void SAL_CALL operator <<= ( Any & rAny, bool const & value )
290 {
291  sal_Bool b = value;
293  &rAny, &b, cppu::UnoType<bool>::get().getTypeLibType(),
295 }
296 
297 
298 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
299 template< class C1, class C2 >
300 inline void SAL_CALL operator <<= ( Any & rAny, rtl::OUStringConcat< C1, C2 >&& value )
301 {
302  const rtl::OUString str( std::move(value) );
303  const Type & rType = ::cppu::getTypeFavourUnsigned(&str);
305  &rAny, const_cast< rtl::OUString * >( &str ), rType.getTypeLibType(),
307 }
308 template<typename T1, typename T2>
309 void operator <<=(Any &, rtl::OUStringConcat<T1, T2> const &) = delete;
310 template< class C >
311 inline void SAL_CALL operator <<= ( Any & rAny, rtl::OUStringNumber< C >&& value )
312 {
313  const rtl::OUString str( std::move(value) );
314  const Type & rType = ::cppu::getTypeFavourUnsigned(&str);
316  &rAny, const_cast< rtl::OUString * >( &str ), rType.getTypeLibType(),
318 }
319 template<typename T>
320 void operator <<=(Any &, rtl::OUStringNumber<T> const &) = delete;
321 #endif
322 
323 #if defined LIBO_INTERNAL_ONLY
324 template<> void SAL_CALL operator <<=(Any &, Any const &) = delete;
325 #endif
326 
327 template< class C >
328 inline bool SAL_CALL operator >>= ( const Any & rAny, C & value )
329 {
330  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
332  &value, rType.getTypeLibType(),
333  rAny.pData, rAny.pType,
336 }
337 
338 // bool
339 
340 template<>
341 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Bool & value )
342 {
343  if (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass)
344  {
345  value = bool(* static_cast< const sal_Bool * >( rAny.pData ));
346  return true;
347  }
348  return false;
349 }
350 
351 template<>
352 inline bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value )
353 {
354  return (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass &&
355  bool(value) == bool(* static_cast< const sal_Bool * >( rAny.pData )));
356 }
357 
358 
359 template<>
360 inline bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
361 {
362  if (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN)
363  {
364  value = *static_cast< sal_Bool const * >( rAny.pData );
365  return true;
366  }
367  return false;
368 }
369 
370 
371 template<>
372 inline bool SAL_CALL operator == ( Any const & rAny, bool const & value )
373 {
374  return (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN &&
375  (value ==
376  bool(*static_cast< sal_Bool const * >( rAny.pData ))));
377 }
378 
379 // byte
380 
381 template<>
382 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Int8 & value )
383 {
384  if (typelib_TypeClass_BYTE == rAny.pType->eTypeClass)
385  {
386  value = * static_cast< const sal_Int8 * >( rAny.pData );
387  return true;
388  }
389  return false;
390 }
391 // short
392 
393 template<>
394 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value )
395 {
396  switch (rAny.pType->eTypeClass)
397  {
399  value = * static_cast< const sal_Int8 * >( rAny.pData );
400  return true;
403  value = * static_cast< const sal_Int16 * >( rAny.pData );
404  return true;
405  default:
406  return false;
407  }
408 }
409 
410 template<>
411 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value )
412 {
413  switch (rAny.pType->eTypeClass)
414  {
416  value = static_cast<sal_uInt16>( * static_cast< const sal_Int8 * >( rAny.pData ) );
417  return true;
420  value = * static_cast< const sal_uInt16 * >( rAny.pData );
421  return true;
422  default:
423  return false;
424  }
425 }
426 // long
427 
428 template<>
429 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value )
430 {
431  switch (rAny.pType->eTypeClass)
432  {
434  value = * static_cast< const sal_Int8 * >( rAny.pData );
435  return true;
437  value = * 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_Int32 * >( rAny.pData );
445  return true;
446  default:
447  return false;
448  }
449 }
450 
451 template<>
452 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value )
453 {
454  switch (rAny.pType->eTypeClass)
455  {
457  value = static_cast<sal_uInt32>( * static_cast< const sal_Int8 * >( rAny.pData ) );
458  return true;
460  value = static_cast<sal_uInt32>( * static_cast< const sal_Int16 * >( rAny.pData ) );
461  return true;
463  value = * static_cast< const sal_uInt16 * >( rAny.pData );
464  return true;
467  value = * static_cast< const sal_uInt32 * >( rAny.pData );
468  return true;
469  default:
470  return false;
471  }
472 }
473 // hyper
474 
475 template<>
476 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value )
477 {
478  switch (rAny.pType->eTypeClass)
479  {
481  value = * static_cast< const sal_Int8 * >( rAny.pData );
482  return true;
484  value = * static_cast< const sal_Int16 * >( rAny.pData );
485  return true;
487  value = * static_cast< const sal_uInt16 * >( rAny.pData );
488  return true;
490  value = * static_cast< const sal_Int32 * >( rAny.pData );
491  return true;
493  value = * static_cast< const sal_uInt32 * >( rAny.pData );
494  return true;
497  value = * static_cast< const sal_Int64 * >( rAny.pData );
498  return true;
499  default:
500  return false;
501  }
502 }
503 
504 template<>
505 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value )
506 {
507  switch (rAny.pType->eTypeClass)
508  {
510  value = static_cast<sal_uInt64>( * static_cast< const sal_Int8 * >( rAny.pData ) );
511  return true;
513  value = static_cast<sal_uInt64>( * static_cast< const sal_Int16 * >( rAny.pData ) );
514  return true;
516  value = * static_cast< const sal_uInt16 * >( rAny.pData );
517  return true;
519  value = static_cast<sal_uInt64>( * static_cast< const sal_Int32 * >( rAny.pData ) );
520  return true;
522  value = * static_cast< const sal_uInt32 * >( rAny.pData );
523  return true;
526  value = * static_cast< const sal_uInt64 * >( rAny.pData );
527  return true;
528  default:
529  return false;
530  }
531 }
532 // float
533 
534 template<>
535 inline bool SAL_CALL operator >>= ( const Any & rAny, float & 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 float * >( rAny.pData );
550  return true;
551  default:
552  return false;
553  }
554 }
555 // double
556 
557 template<>
558 inline bool SAL_CALL operator >>= ( const Any & rAny, double & value )
559 {
560  switch (rAny.pType->eTypeClass)
561  {
563  value = * static_cast< const sal_Int8 * >( rAny.pData );
564  return true;
566  value = * static_cast< const sal_Int16 * >( rAny.pData );
567  return true;
569  value = * static_cast< const sal_uInt16 * >( rAny.pData );
570  return true;
572  value = * static_cast< const sal_Int32 * >( rAny.pData );
573  return true;
575  value = * static_cast< const sal_uInt32 * >( rAny.pData );
576  return true;
578  value = * static_cast< const float * >( rAny.pData );
579  return true;
581  value = * static_cast< const double * >( rAny.pData );
582  return true;
583  default:
584  return false;
585  }
586 }
587 // string
588 
589 template<>
590 inline bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value )
591 {
592  if (typelib_TypeClass_STRING == rAny.pType->eTypeClass)
593  {
594  value = * static_cast< const ::rtl::OUString * >( rAny.pData );
595  return true;
596  }
597  return false;
598 }
599 
600 template<>
601 inline bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value )
602 {
603  return (typelib_TypeClass_STRING == rAny.pType->eTypeClass &&
604  value == * static_cast< const ::rtl::OUString * >( rAny.pData ) );
605 }
606 // type
607 
608 template<>
609 inline bool SAL_CALL operator >>= ( const Any & rAny, Type & value )
610 {
611  if (typelib_TypeClass_TYPE == rAny.pType->eTypeClass)
612  {
613  value = * static_cast< const Type * >( rAny.pData );
614  return true;
615  }
616  return false;
617 }
618 
619 template<>
620 inline bool SAL_CALL operator == ( const Any & rAny, const Type & value )
621 {
622  return (typelib_TypeClass_TYPE == rAny.pType->eTypeClass &&
623  value.equals( * static_cast< const Type * >( rAny.pData ) ));
624 }
625 // any
626 
627 #if defined LIBO_INTERNAL_ONLY
628 template<> bool SAL_CALL operator >>=(Any const &, Any &) = delete;
629 #else
630 template<>
631 inline bool SAL_CALL operator >>= ( const Any & rAny, Any & value )
632 {
633  if (&rAny != &value)
634  {
636  &value, rAny.pData, rAny.pType,
638  }
639  return true;
640 }
641 #endif
642 // interface
643 
644 template<>
645 inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value )
646 {
647  if (typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass)
648  {
649  return static_cast< const BaseReference * >( rAny.pData )->operator == ( value );
650  }
651  return false;
652 }
653 
654 // operator to compare to an any.
655 
656 template< class C >
657 inline bool SAL_CALL operator == ( const Any & rAny, const C & value )
658 {
659  const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
661  rAny.pData, rAny.pType,
662  const_cast< C * >( &value ), rType.getTypeLibType(),
664 }
665 // operator to compare to an any. may use specialized operators ==.
666 
667 template< class C >
668 inline bool SAL_CALL operator != ( const Any & rAny, const C & value )
669 {
670  return (! operator == ( rAny, value ));
671 }
672 
673 template <typename T>
674 T Any::get() const
675 {
676  T value = T();
677  if (! (*this >>= value)) {
678  throw RuntimeException(
679  ::rtl::OUString(
681  this,
682  ::cppu::getTypeFavourUnsigned(&value).getTypeLibType() ),
683  SAL_NO_ACQUIRE ) );
684  }
685  return value;
686 }
687 
688 #if defined LIBO_INTERNAL_ONLY
689 template<> Any Any::get() const = delete;
690 #endif
691 
698 template<typename charT, typename traits>
699 inline std::basic_ostream<charT, traits> &operator<<(std::basic_ostream<charT, traits> &o, Any const &any) {
700  o << "<Any: (" << any.getValueTypeName() << ')';
701  switch(any.pType->eTypeClass) {
703  break;
705  o << ' ' << any.get<bool>();
706  break;
711  o << ' ' << any.get<sal_Int64>();
712  break;
716  o << ' ' << any.get<sal_uInt64>();
717  break;
720  o << ' ' << any.get<double>();
721  break;
722  case typelib_TypeClass_CHAR: {
723  std::ios_base::fmtflags flgs = o.setf(
724  std::ios_base::hex, std::ios_base::basefield);
725  charT fill = o.fill('0');
726  o << " U+" << std::setw(4)
727  << unsigned(*static_cast<sal_Unicode const *>(any.getValue()));
728  o.setf(flgs);
729  o.fill(fill);
730  break;
731  }
733  o << ' ' << any.get<rtl::OUString>();
734  break;
736  o << ' ' << any.get<css::uno::Type>().getTypeName();
737  break;
739  o << " len "
740  << ((*static_cast<uno_Sequence * const *>(any.getValue()))->
741  nElements);
742  break;
744  o << ' ' << *static_cast<sal_Int32 const *>(any.getValue());
745  break;
748  o << ' ' << any.getValue();
749  break;
751  o << ' ' << *static_cast<void * const *>(any.getValue());
752  break;
753  default:
754  assert(false); // this cannot happen
755  break;
756  }
757  o << '>';
758  return o;
759 }
760 
761 }
762 }
763 }
764 }
765 
766 #endif
767 
768 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
type class of void
Definition: typeclass.h:32
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.
type class of struct
Definition: typeclass.h:66
Any toAny(T const &value)
Wrap a value in an Any, if necessary.
Definition: Any.hxx:242
type class of double
Definition: typeclass.h:54
CPPU_DLLPUBLIC void SAL_THROW_EXTERN_C()
This method is called to wait for a reply of a previously sent request.
CPPU_DLLPUBLIC void uno_any_destruct(uno_Any *pValue, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Destructs an any.
css::uno::Type const & getTypeFavourUnsigned(SAL_UNUSED_PARAMETER T const *)
A working replacement for getCppuType (see there).
Definition: unotype.hxx:324
inline::rtl::OUString getValueTypeName() const
Gets the type name of the set value.
Definition: Any.hxx:162
type class of interface
Definition: typeclass.h:82
bool isExtractableTo(const Type &rType) const
Tests whether this any is extractable to a value of given type.
Definition: Any.hxx:194
type class of unsigned short
Definition: typeclass.h:42
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:168
type class of string
Definition: typeclass.h:56
type class of long
Definition: typeclass.h:44
Any & operator=(const Any &rAny)
Assignment operator: Sets the value of the given any.
Definition: Any.hxx:119
type class of char
Definition: typeclass.h:34
C++ class representing an IDL any.
Definition: Any.h:56
typelib_TypeDescriptionReference * getTypeLibType() const
Gets the C typelib type description reference pointer.
Definition: Type.h:158
type class of unsigned hyper
Definition: typeclass.h:50
bool has() const
Tests whether this any can provide a value of specified type.
Definition: Any.hxx:203
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescription typelib_TypeDescription
Full type description of a type.
~Any()
Destructor: Destructs any content and frees memory.
Definition: Any.hxx:113
bool operator==(const Any &rAny) const
Equality operator: compares two anys.
Definition: Any.hxx:216
signed char sal_Int8
Definition: types.h:43
definition of a no acquire enum for ctors
Definition: types.h:356
CPPU_DLLPUBLIC rtl_uString * cppu_Any_extraction_failure_msg(uno_Any const *pAny, typelib_TypeDescriptionReference *pType) SAL_THROW_EXTERN_C()
void * cpp_queryInterface(void *pCppI, typelib_TypeDescriptionReference *pType)
Function to query for a C++ interface.
Definition: genfunc.hxx:55
bool operator>>=(const Any &rAny, C &value)
Template binary &gt;&gt;= operator to assign a value from an any.
Definition: Any.hxx:328
bool operator!=(const Any &rAny) const
Inequality operator: compares two anys.
Definition: Any.hxx:223
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:657
Get the css::uno::Type instance representing a certain UNO type.
Definition: unotype.hxx:51
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:668
Any makeAny(const C &value)
Template function to generically construct an any from a C++ value.
Definition: Any.hxx:232
#define CPPU_DLLPUBLIC
Definition: cppudllapi.h:13
type class of hyper
Definition: typeclass.h:48
type class of sequence
Definition: typeclass.h:75
void cpp_acquire(void *pCppI)
Function to acquire a C++ interface.
Definition: genfunc.hxx:45
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.
struct SAL_DLLPUBLIC_RTTI _uno_Any uno_Any
This is the binary specification of a UNO any.
C++ class representing an IDL meta type.
Definition: Type.h:58
type class of float
Definition: typeclass.h:52
type class of type
Definition: typeclass.h:58
unsigned char sal_Bool
Definition: types.h:38
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()
Default constructor: Any holds no value; its type is void.
Definition: Any.hxx: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.
void cpp_release(void *pCppI)
Function to release a C++ interface.
Definition: genfunc.hxx:50
void setValue(const void *pData_, const Type &rType)
Sets a value.
Definition: Any.hxx:167
This is the binary specification of a SAL sequence.
Definition: types.h:303
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 boolean
Definition: typeclass.h:36
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.
CPPU_DLLPUBLIC void uno_any_clear(uno_Any *pValue, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Sets value to void.
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescriptionReference typelib_TypeDescriptionReference
Holds a weak reference to a type description.
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 enum
Definition: typeclass.h:62
This base class serves as a base class for all template reference classes and has been introduced due...
Definition: Reference.h:66
type class of byte
Definition: typeclass.h:38
T get() const
Provides a value of specified type, so you can easily write e.g.
Definition: Any.hxx:674
bool equals(const Type &rType) const
Compares two types.
Definition: Type.h:177
type class of exception
Definition: typeclass.h:73
void operator<<=(Any &rAny, const C &value)
Template binary &lt;&lt;= operator to set the value of an any.
Definition: Any.hxx:278
type class of unsigned long
Definition: typeclass.h:46
rtl::OUString getTypeName(rtl::OUString const &rEnvDcp)
Get the OBI type part of an environment descriptor.
Definition: EnvDcp.hxx:41
type class of short
Definition: typeclass.h:40
void clear()
Clears this any.
Definition: Any.hxx:188