19 #ifndef INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
20 #define INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
34 #include <com/sun/star/uno/RuntimeException.hpp>
57 this, const_cast<T *>(&value),
127 this, const_cast< void * >( pData_ ), pType_,
134 this, const_cast< void * >( pData_ ), pTypeDescr,
152 template <
typename T>
193 #ifdef RTL_FAST_STRING
194 template<
class C1,
class C2 >
195 inline Any SAL_CALL
makeAny(
const rtl::OUStringConcat< C1, C2 >& value )
223 #ifdef RTL_FAST_STRING
224 template<
class C1,
class C2 >
225 inline void SAL_CALL operator <<= ( Any & rAny, const rtl::OUStringConcat< C1, C2 >& value )
230 &rAny, const_cast< rtl::OUString * >( &str ), rType.getTypeLibType(),
272 value = *
reinterpret_cast< sal_Bool const *
>(
285 (*reinterpret_cast< sal_Bool const * >( rAny.
pData )
296 value = *
reinterpret_cast< const sal_Int8 *
>( rAny.pData );
309 value = *
reinterpret_cast< const sal_Int8 *
>( rAny.
pData );
313 value = *
reinterpret_cast< const sal_Int16 *
>( rAny.
pData );
326 value = (sal_uInt16)( * reinterpret_cast< const sal_Int8 * >( rAny.
pData ) );
330 value = *
reinterpret_cast< const sal_uInt16 *
>( rAny.
pData );
344 value = *
reinterpret_cast< const sal_Int8 *
>( rAny.
pData );
347 value = *
reinterpret_cast< const sal_Int16 *
>( rAny.
pData );
350 value = *
reinterpret_cast< const sal_uInt16 *
>( rAny.
pData );
354 value = *
reinterpret_cast< const sal_Int32 *
>( rAny.
pData );
367 value = (sal_uInt32)( * reinterpret_cast< const sal_Int8 * >( rAny.
pData ) );
370 value = (sal_uInt32)( * reinterpret_cast< const sal_Int16 * >( rAny.
pData ) );
373 value = *
reinterpret_cast< const sal_uInt16 *
>( rAny.
pData );
377 value = *
reinterpret_cast< const sal_uInt32 *
>( rAny.
pData );
391 value = *
reinterpret_cast< const sal_Int8 *
>( rAny.
pData );
394 value = *
reinterpret_cast< const sal_Int16 *
>( rAny.
pData );
397 value = *
reinterpret_cast< const sal_uInt16 *
>( rAny.
pData );
400 value = *
reinterpret_cast< const sal_Int32 *
>( rAny.
pData );
403 value = *
reinterpret_cast< const sal_uInt32 *
>( rAny.
pData );
407 value = *
reinterpret_cast< const sal_Int64 *
>( rAny.
pData );
420 value = (sal_uInt64)( * reinterpret_cast< const sal_Int8 * >( rAny.
pData ) );
423 value = (sal_uInt64)( * reinterpret_cast< const sal_Int16 * >( rAny.
pData ) );
426 value = *
reinterpret_cast< const sal_uInt16 *
>( rAny.
pData );
429 value = (sal_uInt64)( * reinterpret_cast< const sal_Int32 * >( rAny.
pData ) );
432 value = *
reinterpret_cast< const sal_uInt32 *
>( rAny.
pData );
436 value = *
reinterpret_cast< const sal_uInt64 *
>( rAny.
pData );
450 value = *
reinterpret_cast< const sal_Int8 *
>( rAny.
pData );
453 value = *
reinterpret_cast< const sal_Int16 *
>( rAny.
pData );
456 value = *
reinterpret_cast< const sal_uInt16 *
>( rAny.
pData );
459 value = *
reinterpret_cast< const float *
>( rAny.
pData );
473 value = *
reinterpret_cast< const sal_Int8 *
>( rAny.
pData );
476 value = *
reinterpret_cast< const sal_Int16 *
>( rAny.
pData );
479 value = *
reinterpret_cast< const sal_uInt16 *
>( rAny.
pData );
482 value = *
reinterpret_cast< const sal_Int32 *
>( rAny.
pData );
485 value = *
reinterpret_cast< const sal_uInt32 *
>( rAny.
pData );
488 value = *
reinterpret_cast< const float *
>( rAny.
pData );
491 value = *
reinterpret_cast< const double *
>( rAny.
pData );
511 inline bool SAL_CALL
operator == (
const Any & rAny, const ::rtl::OUString & value )
514 value.equals( * reinterpret_cast< const ::rtl::OUString * >( rAny.
pData ) ));
523 value = *
reinterpret_cast< const Type *
>( rAny.
pData );
533 value.
equals( * reinterpret_cast< const Type * >( rAny.
pData ) ));
555 return reinterpret_cast< const BaseReference *
>( rAny.
pData )->
operator == ( value );
576 return (!
operator == ( rAny, value ));
584 template <
typename T>
588 if (! (*
this >>= value)) {
589 throw RuntimeException(
605 template<
typename charT,
typename traits>
606 inline std::basic_ostream<charT, traits> &operator<<(std::basic_ostream<charT, traits> &o,
Any const &any) {
608 switch(any.pType->eTypeClass) {
612 o <<
' ' << any.get<
bool>();
618 o <<
' ' << any.get<sal_Int64>();
623 o <<
' ' << any.get<sal_uInt64>();
627 o <<
' ' << any.get<
double>();
630 std::ios_base::fmtflags flgs = o.setf(
631 std::ios_base::hex, std::ios_base::basefield);
632 charT fill = o.fill(
'0');
633 o <<
" U+" << std::setw(4)
634 << *
static_cast<sal_Unicode const *
>(any.getValue());
643 o <<
' ' << any.get<css::uno::Type>().
getTypeName();
647 << ((*
static_cast<uno_Sequence *
const *
>(any.getValue()))->
651 o << ' ' << *static_cast<sal_Int32 const *>(any.getValue());
655 o <<
' ' << any.getValue();
658 o << ' ' << *static_cast<void * const *>(any.getValue());
675 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */