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"
37 #if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
38 #include <type_traits>
51 template<
class interface_type>
class Reference;
66 static void * SAL_CALL
operator new (
size_t nSize )
68 static void SAL_CALL
operator delete (
void * pMem )
70 static void * SAL_CALL
operator new ( size_t,
void * pMem )
72 static void SAL_CALL
operator delete (
void *,
void * )
85 #if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
89 requires (!std::is_base_of_v<XInterface, T>)
91 explicit inline Any( T
const & value );
93 explicit inline Any(
bool value );
95 #if defined LIBO_INTERNAL_ONLY
96 template<
typename T1,
typename T2>
97 explicit inline Any(rtl::OUStringConcat<T1, T2> && value);
98 template<
typename T1,
typename T2>
99 explicit Any(rtl::OUStringConcat<T1, T2>
const &) =
delete;
100 template<std::
size_t nBufSize>
explicit inline Any(rtl::StringNumber<sal_Unicode, nBufSize> && value);
101 template<std::
size_t nBufSize>
explicit Any(rtl::StringNumber<sal_Unicode, nBufSize>
const &) =
delete;
102 template <std::
size_t N>
explicit inline Any(
const rtl::OUStringLiteral<N>& value);
109 inline Any(
const Any & rAny );
116 inline Any(
const void * pData_,
const Type & rType );
132 #if defined LIBO_INTERNAL_ONLY
133 Any(
bool const *,
Type const &) =
delete;
139 Any(std::nullptr_t,
Type const & type):
140 Any(
static_cast<void *
>(
nullptr), type) {}
142 Any(
static_cast<void *
>(
nullptr), type) {}
144 Any(
static_cast<void *
>(
nullptr), type) {}
156 inline Any & SAL_CALL operator = (
const Any & rAny );
158 #if defined LIBO_INTERNAL_ONLY
159 #if !defined(__COVERITY__)
160 inline Any(
Any && other) noexcept;
162 inline Any & operator =(
Any && other) noexcept;
170 {
return *
reinterpret_cast< const Type *
>( &pType ); }
191 {
return static_cast<TypeClass
>(pType->eTypeClass); }
197 inline ::rtl::OUString SAL_CALL getValueTypeName()
const;
225 template <
typename T>
226 inline T get()
const;
234 inline void SAL_CALL setValue(
const void * pData_,
const Type & rType );
250 #if defined LIBO_INTERNAL_ONLY
251 void setValue(
bool const *,
Type const &) =
delete;
258 void setValue(std::nullptr_t,
Type const & type)
259 { setValue(
static_cast<void *
>(
nullptr), type); }
261 { setValue(
static_cast<void *
>(
nullptr), type); }
263 { setValue(
static_cast<void *
>(
nullptr), type); }
269 inline void SAL_CALL clear();
277 inline bool SAL_CALL isExtractableTo(
const Type & rType )
const;
285 template <
typename T>
286 inline bool has()
const;
294 inline bool SAL_CALL
operator == (
const Any & rAny )
const;
301 inline bool SAL_CALL
operator != (
const Any & rAny )
const;
303 #if defined LIBO_INTERNAL_ONLY
307 template<
class interface_type>
inline Reference<interface_type> query()
const;
308 template<
class interface_type>
inline Reference<interface_type> queryThrow()
const;
312 #if !defined LIBO_INTERNAL_ONLY
320 #if !defined LIBO_INTERNAL_ONLY
328 #if !defined LIBO_INTERNAL_ONLY
341 inline Any SAL_CALL
makeAny(
const C & value );
343 template<>
inline Any SAL_CALL
makeAny(sal_uInt16
const & value);
355 template<
typename T>
inline Any toAny(T
const & value);
359 #if defined LIBO_INTERNAL_ONLY
378 template<
typename T>
inline bool fromAny(
Any const & any, T * value);
380 template<>
inline bool fromAny(
Any const & any,
Any * value);
422 inline bool SAL_CALL
operator == (
const Any & rAny,
const C & value );
434 inline bool SAL_CALL
operator != (
const Any & rAny,
const C & value );
445 inline bool SAL_CALL
operator == (
Any const & rAny,
bool const & value );
451 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_Int16 & value );
453 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_uInt16 & value );
456 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_Int32 & value );
458 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_uInt32 & value );
461 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_Int64 & value );
463 inline bool SAL_CALL
operator >>= (
const Any & rAny, sal_uInt64 & value );
469 inline bool SAL_CALL
operator >>= (
const Any & rAny,
double & value );
474 inline bool SAL_CALL
operator == (
const Any & rAny, const ::rtl::OUString & value );
475 #if defined LIBO_INTERNAL_ONLY
476 template<std::
size_t N>
477 inline bool SAL_CALL
operator == (
const Any& rAny,
const rtl::OUStringLiteral<N>& value);
485 #if !defined LIBO_INTERNAL_ONLY
513 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:492
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:396
#define SAL_UNUSED_PARAMETER
Annotate unused but required C++ function parameters.
Definition: types.h:592
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:611
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
@ typelib_TypeClass_VOID
type class of void
Definition: typeclass.h:32
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.
struct SAL_DLLPUBLIC_RTTI _uno_Any uno_Any
This is the binary specification of a UNO any.
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:511
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:649
Any makeAny(const C &value)
Template function to generically construct an any from a C++ value.
Definition: Any.hxx:234
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:660
bool operator>>=(const Any &rAny, C &value)
Template binary >>= operator to assign a value from an any.
Definition: Any.hxx:313
Any toAny(T const &value)
Wrap a value in an Any, if necessary.
Definition: Any.hxx:243
void operator<<=(Any &rAny, const C &value)
Template binary <<= operator to set the value of an any.
Definition: Any.hxx:275
This String class provides base functionality for C++ like Unicode character array handling.
Definition: ustring.hxx:172
C++ class representing an IDL any.
Definition: Any.h:62
void getValueTypeDescription(typelib_TypeDescription **ppTypeDescr) const
Gets the type description of the set value.
Definition: Any.h:183
bool hasValue() const
Tests if any contains a value.
Definition: Any.h:203
const void * getValue() const
Gets a pointer to the set value.
Definition: Any.h:210
const Type & getValueType() const
Gets the type of the set value.
Definition: Any.h:169
typelib_TypeDescriptionReference * getValueTypeRef() const
Gets the type of the set value.
Definition: Any.h:175
TypeClass getValueTypeClass() const
Gets the type class of the set value.
Definition: Any.h:190
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