tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / include / com / sun / star / uno / Any.hxx
blob0573ad9681a03676cff65e6e26f1d4cdaa93d8f4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 * This file is part of LibreOffice published API.
23 #ifndef INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
24 #define INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
26 #include "sal/config.h"
28 #include <algorithm>
29 #include <cassert>
30 #include <cstddef>
31 #include <iomanip>
32 #include <ostream>
33 #include <utility>
35 #include "com/sun/star/uno/Any.h"
36 #include "uno/data.h"
37 #include "uno/sequence2.h"
38 #include "com/sun/star/uno/Type.hxx"
39 #include "com/sun/star/uno/Reference.h"
40 #include "com/sun/star/uno/genfunc.hxx"
41 #include "com/sun/star/uno/RuntimeException.hpp"
42 #include "cppu/cppudllapi.h"
43 #include "cppu/unotype.hxx"
45 extern "C" CPPU_DLLPUBLIC rtl_uString * SAL_CALL cppu_Any_extraction_failure_msg(
46 uno_Any const * pAny, typelib_TypeDescriptionReference * pType )
47 SAL_THROW_EXTERN_C();
49 namespace com
51 namespace sun
53 namespace star
55 namespace uno
59 inline Any::Any()
61 ::uno_any_construct( this, NULL, NULL, cpp_acquire );
65 template <typename T>
66 inline Any::Any( T const & value )
68 ::uno_type_any_construct(
69 this, const_cast<T *>(&value),
70 ::cppu::getTypeFavourUnsigned(&value).getTypeLibType(),
71 cpp_acquire );
74 inline Any::Any( bool value )
76 sal_Bool b = value;
77 ::uno_type_any_construct(
78 this, &b, cppu::UnoType<bool>::get().getTypeLibType(),
79 cpp_acquire );
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)))
87 template<std::size_t nBufSize>
88 Any::Any(rtl::StringNumber<sal_Unicode, nBufSize> && value): Any(rtl::OUString(std::move(value))) {}
89 template <std::size_t N>
90 Any::Any(const rtl::OUStringLiteral<N>& value): Any(rtl::OUString(value)) {}
91 #endif
93 inline Any::Any( const Any & rAny )
95 ::uno_type_any_construct( this, rAny.pData, rAny.pType, cpp_acquire );
98 inline Any::Any( const void * pData_, const Type & rType )
100 ::uno_type_any_construct(
101 this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
102 cpp_acquire );
105 inline Any::Any( const void * pData_, typelib_TypeDescription * pTypeDescr )
107 ::uno_any_construct(
108 this, const_cast< void * >( pData_ ), pTypeDescr, cpp_acquire );
111 inline Any::Any( const void * pData_, typelib_TypeDescriptionReference * pType_ )
113 ::uno_type_any_construct(
114 this, const_cast< void * >( pData_ ), pType_, cpp_acquire );
117 inline Any::~Any()
119 ::uno_any_destruct(
120 this, cpp_release );
123 inline Any & Any::operator = ( const Any & rAny )
125 if (this != &rAny)
127 ::uno_type_any_assign(
128 this, rAny.pData, rAny.pType,
129 cpp_acquire, cpp_release );
131 return *this;
134 #if defined LIBO_INTERNAL_ONLY
136 #if !defined(__COVERITY__) // suppress COPY_INSTEAD_OF_MOVE suggestions
137 Any::Any(Any && other) noexcept {
138 uno_any_construct(this, nullptr, nullptr, &cpp_acquire);
139 std::swap(other.pType, pType);
140 std::swap(other.pData, pData);
141 std::swap(other.pReserved, pReserved);
142 if (pData == &other.pReserved) {
143 pData = &pReserved;
145 // This leaves other.pData (where "other" is now VOID) dangling to somewhere (cf.
146 // CONSTRUCT_EMPTY_ANY, cppu/source/uno/prim.hxx), but what's relevant is
147 // only that it isn't a nullptr (as e.g. >>= -> uno_type_assignData ->
148 // _assignData takes a null pSource to mean "construct a default value").
150 #endif
152 Any & Any::operator =(Any && other) noexcept {
153 std::swap(other.pType, pType);
154 std::swap(other.pData, pData);
155 std::swap(other.pReserved, pReserved);
156 if (pData == &other.pReserved) {
157 pData = &pReserved;
159 if (other.pData == &pReserved) {
160 other.pData = &other.pReserved;
162 return *this;
165 #endif
167 inline ::rtl::OUString Any::getValueTypeName() const
169 return ::rtl::OUString( pType->pTypeName );
172 inline void Any::setValue( const void * pData_, const Type & rType )
174 ::uno_type_any_assign(
175 this, const_cast< void * >( pData_ ), rType.getTypeLibType(),
176 cpp_acquire, cpp_release );
179 inline void Any::setValue( const void * pData_, typelib_TypeDescriptionReference * pType_ )
181 ::uno_type_any_assign(
182 this, const_cast< void * >( pData_ ), pType_,
183 cpp_acquire, cpp_release );
186 inline void Any::setValue( const void * pData_, typelib_TypeDescription * pTypeDescr )
188 ::uno_any_assign(
189 this, const_cast< void * >( pData_ ), pTypeDescr,
190 cpp_acquire, cpp_release );
193 inline void Any::clear()
195 ::uno_any_clear(
196 this, cpp_release );
199 inline bool Any::isExtractableTo( const Type & rType ) const
201 return ::uno_type_isAssignableFromData(
202 rType.getTypeLibType(), pData, pType,
203 cpp_queryInterface, cpp_release );
207 template <typename T>
208 inline bool Any::has() const
210 Type const & rType = ::cppu::getTypeFavourUnsigned(static_cast< T * >(NULL));
211 return ::uno_type_isAssignableFromData(
212 rType.getTypeLibType(), pData, pType,
213 cpp_queryInterface,
214 cpp_release );
217 #if defined LIBO_INTERNAL_ONLY
218 template<> bool Any::has<Any>() const = delete;
219 #endif
221 inline bool Any::operator == ( const Any & rAny ) const
223 return ::uno_type_equalData(
224 pData, pType, rAny.pData, rAny.pType,
225 cpp_queryInterface, cpp_release );
228 inline bool Any::operator != ( const Any & rAny ) const
230 return (! ::uno_type_equalData(
231 pData, pType, rAny.pData, rAny.pType,
232 cpp_queryInterface, cpp_release ));
236 #if !defined LIBO_INTERNAL_ONLY
237 template< class C >
238 inline Any SAL_CALL makeAny( const C & value )
240 return Any(value);
243 template<> Any makeAny(sal_uInt16 const & value)
244 { return Any(&value, cppu::UnoType<cppu::UnoUnsignedShortType>::get()); }
245 #endif
247 template<typename T> Any toAny(T const & value) {
248 return Any(value);
251 template<> Any toAny(Any const & value) { return value; }
253 #if defined LIBO_INTERNAL_ONLY
255 inline Any toAny(Any&& value) { return std::move(value); }
257 template<typename T1, typename T2>
258 Any toAny(rtl::OUStringConcat<T1, T2> && value)
259 { return Any(std::move(value)); }
261 template<std::size_t nBufSize>
262 Any toAny(rtl::StringNumber<sal_Unicode, nBufSize> && value)
263 { return Any(std::move(value)); }
265 template<typename T> bool fromAny(Any const & any, T * value) {
266 assert(value != nullptr);
267 return any >>= *value;
270 template<> bool fromAny(Any const & any, Any * value) {
271 assert(value != nullptr);
272 *value = any;
273 return true;
276 #endif
278 template< class C >
279 inline void SAL_CALL operator <<= ( Any & rAny, const C & value )
281 const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
282 ::uno_type_any_assign(
283 &rAny, const_cast< C * >( &value ), rType.getTypeLibType(),
284 cpp_acquire, cpp_release );
287 // additionally for C++ bool:
289 template<>
290 inline void SAL_CALL operator <<= ( Any & rAny, bool const & value )
292 sal_Bool b = value;
293 ::uno_type_any_assign(
294 &rAny, &b, cppu::UnoType<bool>::get().getTypeLibType(),
295 cpp_acquire, cpp_release );
299 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
300 template< class C1, class C2 >
301 inline void operator <<= ( Any & rAny, rtl::OUStringConcat< C1, C2 >&& value )
303 const rtl::OUString str( std::move(value) );
304 const Type & rType = ::cppu::getTypeFavourUnsigned(&str);
305 ::uno_type_any_assign(
306 &rAny, const_cast< rtl::OUString * >( &str ), rType.getTypeLibType(),
307 cpp_acquire, cpp_release );
309 template<typename T1, typename T2>
310 void operator <<=(Any &, rtl::OUStringConcat<T1, T2> const &) = delete;
311 template< std::size_t nBufSize >
312 inline void operator <<= ( Any & rAny, rtl::StringNumber< sal_Unicode, nBufSize >&& value )
314 const rtl::OUString str( std::move(value) );
315 const Type & rType = ::cppu::getTypeFavourUnsigned(&str);
316 ::uno_type_any_assign(
317 &rAny, const_cast< rtl::OUString * >( &str ), rType.getTypeLibType(),
318 cpp_acquire, cpp_release );
320 template<std::size_t nBufSize>
321 void operator <<=(Any &, rtl::StringNumber<sal_Unicode, nBufSize> const &) = delete;
322 #endif
324 #if defined LIBO_INTERNAL_ONLY
325 template<> void SAL_CALL operator <<=(Any &, Any const &) = delete;
326 #endif
328 template< class C >
329 inline bool SAL_CALL operator >>= ( const Any & rAny, C & value )
331 const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
332 return ::uno_type_assignData(
333 &value, rType.getTypeLibType(),
334 rAny.pData, rAny.pType,
335 cpp_queryInterface,
336 cpp_acquire, cpp_release );
339 // bool
341 template<>
342 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Bool & value )
344 if (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass)
346 value = bool(* static_cast< const sal_Bool * >( rAny.pData ));
347 return true;
349 return false;
352 template<>
353 inline bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value )
355 return (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass &&
356 bool(value) == bool(* static_cast< const sal_Bool * >( rAny.pData )));
360 template<>
361 inline bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
363 if (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN)
365 value = *static_cast< sal_Bool const * >( rAny.pData );
366 return true;
368 return false;
372 template<>
373 inline bool SAL_CALL operator == ( Any const & rAny, bool const & value )
375 return (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN &&
376 (value ==
377 bool(*static_cast< sal_Bool const * >( rAny.pData ))));
380 // byte
382 template<>
383 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Int8 & value )
385 if (typelib_TypeClass_BYTE == rAny.pType->eTypeClass)
387 value = * static_cast< const sal_Int8 * >( rAny.pData );
388 return true;
390 return false;
392 // short
394 template<>
395 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value )
397 switch (rAny.pType->eTypeClass)
399 case typelib_TypeClass_BYTE:
400 value = * static_cast< const sal_Int8 * >( rAny.pData );
401 return true;
402 case typelib_TypeClass_SHORT:
403 case typelib_TypeClass_UNSIGNED_SHORT:
404 value = * static_cast< const sal_Int16 * >( rAny.pData );
405 return true;
406 default:
407 return false;
411 template<>
412 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value )
414 switch (rAny.pType->eTypeClass)
416 case typelib_TypeClass_BYTE:
417 value = static_cast<sal_uInt16>( * static_cast< const sal_Int8 * >( rAny.pData ) );
418 return true;
419 case typelib_TypeClass_SHORT:
420 case typelib_TypeClass_UNSIGNED_SHORT:
421 value = * static_cast< const sal_uInt16 * >( rAny.pData );
422 return true;
423 default:
424 return false;
427 // long
429 template<>
430 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value )
432 switch (rAny.pType->eTypeClass)
434 case typelib_TypeClass_BYTE:
435 value = * static_cast< const sal_Int8 * >( rAny.pData );
436 return true;
437 case typelib_TypeClass_SHORT:
438 value = * static_cast< const sal_Int16 * >( rAny.pData );
439 return true;
440 case typelib_TypeClass_UNSIGNED_SHORT:
441 value = * static_cast< const sal_uInt16 * >( rAny.pData );
442 return true;
443 case typelib_TypeClass_LONG:
444 case typelib_TypeClass_UNSIGNED_LONG:
445 value = * static_cast< const sal_Int32 * >( rAny.pData );
446 return true;
447 default:
448 return false;
452 template<>
453 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value )
455 switch (rAny.pType->eTypeClass)
457 case typelib_TypeClass_BYTE:
458 value = static_cast<sal_uInt32>( * static_cast< const sal_Int8 * >( rAny.pData ) );
459 return true;
460 case typelib_TypeClass_SHORT:
461 value = static_cast<sal_uInt32>( * static_cast< const sal_Int16 * >( rAny.pData ) );
462 return true;
463 case typelib_TypeClass_UNSIGNED_SHORT:
464 value = * static_cast< const sal_uInt16 * >( rAny.pData );
465 return true;
466 case typelib_TypeClass_LONG:
467 case typelib_TypeClass_UNSIGNED_LONG:
468 value = * static_cast< const sal_uInt32 * >( rAny.pData );
469 return true;
470 default:
471 return false;
474 // hyper
476 template<>
477 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value )
479 switch (rAny.pType->eTypeClass)
481 case typelib_TypeClass_BYTE:
482 value = * static_cast< const sal_Int8 * >( rAny.pData );
483 return true;
484 case typelib_TypeClass_SHORT:
485 value = * static_cast< const sal_Int16 * >( rAny.pData );
486 return true;
487 case typelib_TypeClass_UNSIGNED_SHORT:
488 value = * static_cast< const sal_uInt16 * >( rAny.pData );
489 return true;
490 case typelib_TypeClass_LONG:
491 value = * static_cast< const sal_Int32 * >( rAny.pData );
492 return true;
493 case typelib_TypeClass_UNSIGNED_LONG:
494 value = * static_cast< const sal_uInt32 * >( rAny.pData );
495 return true;
496 case typelib_TypeClass_HYPER:
497 case typelib_TypeClass_UNSIGNED_HYPER:
498 value = * static_cast< const sal_Int64 * >( rAny.pData );
499 return true;
500 default:
501 return false;
505 template<>
506 inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value )
508 switch (rAny.pType->eTypeClass)
510 case typelib_TypeClass_BYTE:
511 value = static_cast<sal_uInt64>( * static_cast< const sal_Int8 * >( rAny.pData ) );
512 return true;
513 case typelib_TypeClass_SHORT:
514 value = static_cast<sal_uInt64>( * static_cast< const sal_Int16 * >( rAny.pData ) );
515 return true;
516 case typelib_TypeClass_UNSIGNED_SHORT:
517 value = * static_cast< const sal_uInt16 * >( rAny.pData );
518 return true;
519 case typelib_TypeClass_LONG:
520 value = static_cast<sal_uInt64>( * static_cast< const sal_Int32 * >( rAny.pData ) );
521 return true;
522 case typelib_TypeClass_UNSIGNED_LONG:
523 value = * static_cast< const sal_uInt32 * >( rAny.pData );
524 return true;
525 case typelib_TypeClass_HYPER:
526 case typelib_TypeClass_UNSIGNED_HYPER:
527 value = * static_cast< const sal_uInt64 * >( rAny.pData );
528 return true;
529 default:
530 return false;
533 // float
535 template<>
536 inline bool SAL_CALL operator >>= ( const Any & rAny, float & value )
538 switch (rAny.pType->eTypeClass)
540 case typelib_TypeClass_BYTE:
541 value = * static_cast< const sal_Int8 * >( rAny.pData );
542 return true;
543 case typelib_TypeClass_SHORT:
544 value = * static_cast< const sal_Int16 * >( rAny.pData );
545 return true;
546 case typelib_TypeClass_UNSIGNED_SHORT:
547 value = * static_cast< const sal_uInt16 * >( rAny.pData );
548 return true;
549 case typelib_TypeClass_FLOAT:
550 value = * static_cast< const float * >( rAny.pData );
551 return true;
552 default:
553 return false;
556 // double
558 template<>
559 inline bool SAL_CALL operator >>= ( const Any & rAny, double & value )
561 switch (rAny.pType->eTypeClass)
563 case typelib_TypeClass_BYTE:
564 value = * static_cast< const sal_Int8 * >( rAny.pData );
565 return true;
566 case typelib_TypeClass_SHORT:
567 value = * static_cast< const sal_Int16 * >( rAny.pData );
568 return true;
569 case typelib_TypeClass_UNSIGNED_SHORT:
570 value = * static_cast< const sal_uInt16 * >( rAny.pData );
571 return true;
572 case typelib_TypeClass_LONG:
573 value = * static_cast< const sal_Int32 * >( rAny.pData );
574 return true;
575 case typelib_TypeClass_UNSIGNED_LONG:
576 value = * static_cast< const sal_uInt32 * >( rAny.pData );
577 return true;
578 case typelib_TypeClass_FLOAT:
579 value = * static_cast< const float * >( rAny.pData );
580 return true;
581 case typelib_TypeClass_DOUBLE:
582 value = * static_cast< const double * >( rAny.pData );
583 return true;
584 default:
585 return false;
588 // string
590 template<>
591 inline bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value )
593 if (typelib_TypeClass_STRING == rAny.pType->eTypeClass)
595 value = * static_cast< const ::rtl::OUString * >( rAny.pData );
596 return true;
598 return false;
601 template<>
602 inline bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value )
604 return (typelib_TypeClass_STRING == rAny.pType->eTypeClass &&
605 value == * static_cast< const ::rtl::OUString * >( rAny.pData ) );
608 #if defined LIBO_INTERNAL_ONLY
609 template<std::size_t N>
610 inline bool SAL_CALL operator == (const Any& rAny, const rtl::OUStringLiteral<N>& value)
612 return operator ==(rAny, rtl::OUString(value));
614 #endif
615 // type
617 template<>
618 inline bool SAL_CALL operator >>= ( const Any & rAny, Type & value )
620 if (typelib_TypeClass_TYPE == rAny.pType->eTypeClass)
622 value = * static_cast< const Type * >( rAny.pData );
623 return true;
625 return false;
628 template<>
629 inline bool SAL_CALL operator == ( const Any & rAny, const Type & value )
631 return (typelib_TypeClass_TYPE == rAny.pType->eTypeClass &&
632 value.equals( * static_cast< const Type * >( rAny.pData ) ));
634 // any
636 #if defined LIBO_INTERNAL_ONLY
637 template<> bool SAL_CALL operator >>=(Any const &, Any &) = delete;
638 #else
639 template<>
640 inline bool SAL_CALL operator >>= ( const Any & rAny, Any & value )
642 if (&rAny != &value)
644 ::uno_type_any_assign(
645 &value, rAny.pData, rAny.pType,
646 cpp_acquire, cpp_release );
648 return true;
650 #endif
651 // interface
653 template<>
654 inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value )
656 if (typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass)
658 return static_cast< const BaseReference * >( rAny.pData )->operator == ( value );
660 return false;
663 // operator to compare to an any.
665 template< class C >
666 inline bool SAL_CALL operator == ( const Any & rAny, const C & value )
668 const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
669 return ::uno_type_equalData(
670 rAny.pData, rAny.pType,
671 const_cast< C * >( &value ), rType.getTypeLibType(),
672 cpp_queryInterface, cpp_release );
674 // operator to compare to an any. may use specialized operators ==.
676 template< class C >
677 inline bool SAL_CALL operator != ( const Any & rAny, const C & value )
679 return (! operator == ( rAny, value ));
682 template <typename T>
683 T Any::get() const
685 T value = T();
686 if (! (*this >>= value)) {
687 throw RuntimeException(
688 ::rtl::OUString(
689 cppu_Any_extraction_failure_msg(
690 this,
691 ::cppu::getTypeFavourUnsigned(&value).getTypeLibType() ),
692 SAL_NO_ACQUIRE ) );
694 return value;
697 #if defined LIBO_INTERNAL_ONLY
698 template<> Any Any::get() const = delete;
699 #endif
702 Support for Any in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO
703 macros, for example).
705 @since LibreOffice 4.2
707 template<typename charT, typename traits>
708 inline std::basic_ostream<charT, traits> &operator<<(std::basic_ostream<charT, traits> &o, Any const &any) {
709 o << "<Any: (" << any.getValueTypeName() << ')';
710 switch(any.pType->eTypeClass) {
711 case typelib_TypeClass_VOID:
712 break;
713 case typelib_TypeClass_BOOLEAN:
714 o << ' ' << any.get<bool>();
715 break;
716 case typelib_TypeClass_BYTE:
717 case typelib_TypeClass_SHORT:
718 case typelib_TypeClass_LONG:
719 case typelib_TypeClass_HYPER:
720 o << ' ' << any.get<sal_Int64>();
721 break;
722 case typelib_TypeClass_UNSIGNED_SHORT:
723 case typelib_TypeClass_UNSIGNED_LONG:
724 case typelib_TypeClass_UNSIGNED_HYPER:
725 o << ' ' << any.get<sal_uInt64>();
726 break;
727 case typelib_TypeClass_FLOAT:
728 case typelib_TypeClass_DOUBLE:
729 o << ' ' << any.get<double>();
730 break;
731 case typelib_TypeClass_CHAR: {
732 std::ios_base::fmtflags flgs = o.setf(
733 std::ios_base::hex, std::ios_base::basefield);
734 charT fill = o.fill('0');
735 o << " U+" << std::setw(4)
736 << unsigned(*static_cast<sal_Unicode const *>(any.getValue()));
737 o.setf(flgs);
738 o.fill(fill);
739 break;
741 case typelib_TypeClass_STRING:
742 o << ' ' << any.get<rtl::OUString>();
743 break;
744 case typelib_TypeClass_TYPE:
745 o << ' ' << any.get<css::uno::Type>().getTypeName();
746 break;
747 case typelib_TypeClass_SEQUENCE:
748 o << " len "
749 << ((*static_cast<uno_Sequence * const *>(any.getValue()))->
750 nElements);
751 break;
752 case typelib_TypeClass_ENUM:
753 o << ' ' << *static_cast<sal_Int32 const *>(any.getValue());
754 break;
755 case typelib_TypeClass_STRUCT:
756 case typelib_TypeClass_EXCEPTION:
757 o << ' ' << any.getValue();
758 break;
759 case typelib_TypeClass_INTERFACE:
760 o << ' ' << *static_cast<void * const *>(any.getValue());
761 break;
762 default:
763 assert(false); // this cannot happen
764 break;
766 o << '>';
767 return o;
775 #endif
777 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */