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"
61 static void * SAL_CALL
operator new (
size_t nSize )
63 static void SAL_CALL
operator delete (
void * pMem )
65 static void * SAL_CALL
operator new ( size_t,
void * pMem )
67 static void SAL_CALL
operator delete (
void *,
void * )
80 explicit inline Any( T
const & value );
82 explicit inline Any(
bool value );
84 #if defined LIBO_INTERNAL_ONLY
85 template<
typename T1,
typename T2>
86 explicit inline Any(rtl::OUStringConcat<T1, T2> && value);
87 template<
typename T1,
typename T2>
88 explicit Any(rtl::OUStringConcat<T1, T2>
const &) =
delete;
95 inline Any(
const Any & rAny );
102 inline Any(
const void * pData_,
const Type & rType );
118 #if defined LIBO_INTERNAL_ONLY
119 Any(
bool const *,
Type const &) =
delete;
125 Any(std::nullptr_t,
Type const & type):
126 Any(static_cast<void *>(
nullptr), type) {}
128 Any(static_cast<void *>(
nullptr), type) {}
130 Any(static_cast<void *>(
nullptr), type) {}
142 inline Any & SAL_CALL operator = (
const Any & rAny );
144 #if defined LIBO_INTERNAL_ONLY
145 inline Any(
Any && other) noexcept;
146 inline Any & operator =(
Any && other) noexcept;
154 {
return *
reinterpret_cast< const Type *
>( &pType ); }
175 {
return static_cast<TypeClass
>(pType->eTypeClass); }
181 inline ::rtl::OUString SAL_CALL getValueTypeName()
const;
209 template <
typename T>
210 inline T
get()
const;
218 inline void SAL_CALL setValue(
const void * pData_,
const Type & rType );
234 #if defined LIBO_INTERNAL_ONLY
235 void setValue(
bool const *,
Type const &) =
delete;
242 void setValue(std::nullptr_t,
Type const & type)
243 { setValue(static_cast<void *>(
nullptr), type); }
245 { setValue(static_cast<void *>(
nullptr), type); }
247 { setValue(static_cast<void *>(
nullptr), type); }
253 inline void SAL_CALL clear();
261 inline bool SAL_CALL isExtractableTo(
const Type & rType )
const;
269 template <
typename T>
270 inline bool has()
const;
278 inline bool SAL_CALL
operator == (
const Any & rAny )
const;
285 inline bool SAL_CALL
operator != (
const Any & rAny )
const;
288 #if !defined LIBO_INTERNAL_ONLY
296 #if !defined LIBO_INTERNAL_ONLY
316 inline Any SAL_CALL
makeAny(
const C & value );
318 #if !defined LIBO_INTERNAL_ONLY
319 template<>
inline Any SAL_CALL
makeAny(sal_uInt16
const & value);
331 template<typename T> inline Any
toAny(T const & value);
333 template<> inline Any
toAny(Any const & value);
335 #if defined LIBO_INTERNAL_ONLY
354 template<
typename T>
inline bool fromAny(Any
const & any, T * value);
356 template<>
inline bool fromAny(Any
const & any, Any * value);
369 inline void SAL_CALL
operator <<= ( Any & rAny,
const C & value );
373 inline void SAL_CALL
operator <<= ( Any & rAny,
bool const & value );
385 inline bool SAL_CALL
operator >>= (
const Any & rAny, C & value );
398 inline bool SAL_CALL
operator == (
const Any & rAny,
const C & value );
410 inline bool SAL_CALL
operator != (
const Any & rAny,
const C & value );
419 inline bool SAL_CALL
operator >>= ( Any
const & rAny,
bool & value );
421 inline bool SAL_CALL
operator == ( Any
const & rAny,
bool const & value );
427 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_Int16 & value );
429 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_uInt16 & value );
432 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_Int32 & value );
434 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_uInt32 & value );
437 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_Int64 & value );
439 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_uInt64 & value );
442 inline bool SAL_CALL
operator >>= (
const Any & rAny,
float & value );
445 inline bool SAL_CALL
operator >>= (
const Any & rAny,
double & value );
450 inline bool SAL_CALL
operator == (
const Any & rAny, const ::rtl::OUString & value );
453 inline bool SAL_CALL
operator >>= (
const Any & rAny, Type & value );
455 inline bool SAL_CALL
operator == (
const Any & rAny,
const Type & value );
457 #if !defined LIBO_INTERNAL_ONLY
459 inline bool SAL_CALL
operator >>= (
const Any & rAny, Any & value );
463 inline bool SAL_CALL
operator == (
const Any & rAny,
const BaseReference & value );
485 return ::cppu::UnoType< ::com::sun::star::uno::Any >::get();
const ::com::sun::star::uno::Type & getCppuType(SAL_UNUSED_PARAMETER const ::com::sun::star::uno::Any *)
Gets the meta type of IDL type any.
Definition: Any.h:483
type class of void
Definition: typeclass.h:32
const void * getValue() const
Gets a pointer to the set value.
Definition: Any.h:194
Any toAny(T const &value)
Wrap a value in an Any, if necessary.
Definition: Any.hxx:242
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:474
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:203
C++ class representing an IDL any.
Definition: Any.h:56
#define SAL_UNUSED_PARAMETER
Annotate unused but required C++ function parameters.
Definition: types.h:568
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescription typelib_TypeDescription
Full type description of a type.
signed char sal_Int8
Definition: types.h:43
bool operator>>=(const Any &rAny, C &value)
Template binary >>= operator to assign a value from an any.
Definition: Any.hxx:328
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
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
typelib_TypeDescriptionReference * getValueTypeRef() const
Gets the type of the set value.
Definition: Any.h:159
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
const Type & getValueType() const
Gets the type of the set value.
Definition: Any.h:153
unsigned char sal_Bool
Definition: types.h:38
bool hasValue() const
Tests if any contains a value.
Definition: Any.h:187
TypeClass getValueTypeClass() const
Gets the type class of the set value.
Definition: Any.h:174
CPPU_DLLPUBLIC void typelib_typedescriptionreference_getDescription(typelib_TypeDescription **ppRet, typelib_TypeDescriptionReference *pRef) SAL_THROW_EXTERN_C()
Retrieves the type description for a given reference.
void getValueTypeDescription(typelib_TypeDescription **ppTypeDescr) const
Gets the type description of the set value.
Definition: Any.h:167
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:378
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:587
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescriptionReference typelib_TypeDescriptionReference
Holds a weak reference to a type description.
void operator<<=(Any &rAny, const C &value)
Template binary <<= operator to set the value of an any.
Definition: Any.hxx:278
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.