23#ifndef INCLUDED_COM_SUN_STAR_UNO_ANY_H
24#define INCLUDED_COM_SUN_STAR_UNO_ANY_H
34#include "com/sun/star/uno/TypeClass.hdl"
47template<
class interface_type>
class Reference;
62 static void * SAL_CALL
operator new (
size_t nSize )
63 { return ::rtl_allocateMemory( nSize ); }
64 static void SAL_CALL
operator delete (
void * pMem )
66 static void * SAL_CALL
operator new ( size_t,
void * pMem )
68 static void SAL_CALL
operator delete (
void *,
void * )
81 explicit inline Any( T
const & value );
83 explicit inline Any(
bool value );
85#if defined LIBO_INTERNAL_ONLY
86 template<
typename T1,
typename T2>
87 explicit inline Any(rtl::OUStringConcat<T1, T2> && value);
88 template<
typename T1,
typename T2>
89 explicit Any(rtl::OUStringConcat<T1, T2>
const &) =
delete;
90 template<std::
size_t nBufSize>
explicit inline Any(rtl::StringNumber<sal_Unicode, nBufSize> && value);
91 template<std::
size_t nBufSize>
explicit Any(rtl::StringNumber<sal_Unicode, nBufSize>
const &) =
delete;
92 template <std::
size_t N>
explicit inline Any(
const rtl::OUStringLiteral<N>& value);
99 inline Any(
const Any & rAny );
106 inline Any(
const void * pData_,
const Type & rType );
122#if defined LIBO_INTERNAL_ONLY
123 Any(
bool const *,
Type const &) =
delete;
129 Any(std::nullptr_t,
Type const & type):
130 Any(
static_cast<void *
>(
nullptr), type) {}
132 Any(
static_cast<void *
>(
nullptr), type) {}
134 Any(
static_cast<void *
>(
nullptr), type) {}
146 inline Any & SAL_CALL operator = (
const Any & rAny );
148#if defined LIBO_INTERNAL_ONLY
149 inline Any(
Any && other)
noexcept;
150 inline Any & operator =(
Any && other)
noexcept;
158 {
return *
reinterpret_cast< const Type *
>( &pType ); }
179 {
return static_cast<TypeClass
>(pType->eTypeClass); }
185 inline ::rtl::OUString SAL_CALL getValueTypeName()
const;
213 template <
typename T>
214 inline T get()
const;
222 inline void SAL_CALL setValue(
const void * pData_,
const Type & rType );
238#if defined LIBO_INTERNAL_ONLY
239 void setValue(
bool const *,
Type const &) =
delete;
246 void setValue(std::nullptr_t,
Type const & type)
247 { setValue(
static_cast<void *
>(
nullptr), type); }
249 { setValue(
static_cast<void *
>(
nullptr), type); }
251 { setValue(
static_cast<void *
>(
nullptr), type); }
257 inline void SAL_CALL clear();
265 inline bool SAL_CALL isExtractableTo(
const Type & rType )
const;
273 template <
typename T>
274 inline bool has()
const;
282 inline bool SAL_CALL operator == (
const Any & rAny )
const;
289 inline bool SAL_CALL operator != (
const Any & rAny )
const;
291#if defined LIBO_INTERNAL_ONLY
295 template<
class interface_type>
inline Reference<interface_type> query()
const;
296 template<
class interface_type>
inline Reference<interface_type> queryThrow()
const;
300#if !defined LIBO_INTERNAL_ONLY
308#if !defined LIBO_INTERNAL_ONLY
316#if !defined LIBO_INTERNAL_ONLY
329inline Any SAL_CALL
makeAny(
const C & value );
331template<>
inline Any SAL_CALL
makeAny(sal_uInt16
const & value);
343template<
typename T>
inline Any toAny(T
const & value);
347#if defined LIBO_INTERNAL_ONLY
366template<
typename T>
inline bool fromAny(
Any const & any, T * value);
368template<>
inline bool fromAny(
Any const & any,
Any * value);
410inline bool SAL_CALL
operator == (
const Any & rAny,
const C & value );
422inline bool SAL_CALL
operator != (
const Any & rAny,
const C & value );
433inline bool SAL_CALL
operator == (
Any const & rAny,
bool const & value );
439inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_Int16 & value );
441inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_uInt16 & value );
444inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_Int32 & value );
446inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_uInt32 & value );
449inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_Int64 & value );
451inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_uInt64 & value );
462inline bool SAL_CALL
operator == (
const Any & rAny, const ::rtl::OUString & value );
463#if defined LIBO_INTERNAL_ONLY
464template<std::
size_t N>
465inline bool SAL_CALL
operator == (
const Any& rAny,
const rtl::OUStringLiteral<N>& value);
473#if !defined LIBO_INTERNAL_ONLY
501 return ::cppu::UnoType< ::com::sun::star::uno::Any >::get();
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition types.h:474
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition types.h:378
#define SAL_UNUSED_PARAMETER
Annotate unused but required C++ function parameters.
Definition types.h:568
unsigned char sal_Bool
Definition types.h:38
signed char sal_Int8
Definition types.h:43
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition types.h:587
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescription typelib_TypeDescription
Full type description of a type.
CPPU_DLLPUBLIC void typelib_typedescriptionreference_getDescription(typelib_TypeDescription **ppRet, typelib_TypeDescriptionReference *pRef) SAL_THROW_EXTERN_C()
Retrieves the type description for a given reference.
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescriptionReference typelib_TypeDescriptionReference
Holds a weak reference to a type description.
@ typelib_TypeClass_VOID
type class of void
Definition typeclass.h:32
struct SAL_DLLPUBLIC_RTTI _uno_Any uno_Any
This is the binary specification of a UNO any.
const ::com::sun::star::uno::Type & getCppuType()
Gets the meta type of an IDL type.
Definition Type.hxx:218
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:664
Any makeAny(const C &value)
Template function to generically construct an any from a C++ value.
Definition Any.hxx:236
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:675
bool operator>>=(const Any &rAny, C &value)
Template binary >>= operator to assign a value from an any.
Definition Any.hxx:327
Any toAny(T const &value)
Wrap a value in an Any, if necessary.
Definition Any.hxx:245
void operator<<=(Any &rAny, const C &value)
Template binary <<= operator to set the value of an any.
Definition Any.hxx:277
This String class provides base functionality for C++ like Unicode character array handling.
Definition ustring.hxx:171
C++ class representing an IDL any.
Definition Any.h:58
const Type & getValueType() const
Gets the type of the set value.
Definition Any.h:157
void getValueTypeDescription(typelib_TypeDescription **ppTypeDescr) const
Gets the type description of the set value.
Definition Any.h:171
bool hasValue() const
Tests if any contains a value.
Definition Any.h:191
typelib_TypeDescriptionReference * getValueTypeRef() const
Gets the type of the set value.
Definition Any.h:163
const void * getValue() const
Gets a pointer to the set value.
Definition Any.h:198
TypeClass getValueTypeClass() const
Gets the type class of the set value.
Definition Any.h:178
This base class serves as a base class for all template reference classes and has been introduced due...
Definition Reference.h:67
C++ class representing an IDL meta type.
Definition Type.h:59