summaryrefslogtreecommitdiff
path: root/cppu/inc/com/sun/star/uno/Any.h
diff options
context:
space:
mode:
Diffstat (limited to 'cppu/inc/com/sun/star/uno/Any.h')
-rw-r--r--cppu/inc/com/sun/star/uno/Any.h102
1 files changed, 51 insertions, 51 deletions
diff --git a/cppu/inc/com/sun/star/uno/Any.h b/cppu/inc/com/sun/star/uno/Any.h
index eb29273c16aa..e4d1a559b574 100644
--- a/cppu/inc/com/sun/star/uno/Any.h
+++ b/cppu/inc/com/sun/star/uno/Any.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,13 +36,13 @@
namespace com
-{
+{
namespace sun
-{
+{
namespace star
-{
+{
namespace uno
-{
+{
/** C++ class representing an IDL any.
This class is used to transport any type defined in IDL. The class inherits from the
@@ -68,101 +68,101 @@ public:
/** @internal */
inline static void SAL_CALL operator delete ( void *, void * ) SAL_THROW( () )
{}
-
+
/** Default constructor: Any holds no value; its type is void.
*/
inline Any() SAL_THROW( () );
-
+
/** Templated ctor. Sets a copy of the given value.
-
+
@param value value of the Any
*/
template <typename T>
explicit inline Any( T const & value );
/// Ctor support for C++ bool.
explicit inline Any( bool value );
-
+
/** Copy constructor: Sets value of the given any.
-
+
@param rAny another any
*/
inline Any( const Any & rAny ) SAL_THROW( () );
-
+
/** Constructor: Sets a copy of the given data.
-
+
@param pData_ value
@param rType type of value
*/
inline Any( const void * pData_, const Type & rType ) SAL_THROW( () );
-
+
/** Constructor: Sets a copy of the given data.
-
+
@param pData_ value
@param pTypeDescr type of value
*/
inline Any( const void * pData_, typelib_TypeDescription * pTypeDescr ) SAL_THROW( () );
-
+
/** Constructor: Sets a copy of the given data.
-
+
@param pData_ value
@param pType type of value
*/
inline Any( const void * pData_, typelib_TypeDescriptionReference * pType ) SAL_THROW( () );
-
+
/** Destructor: Destructs any content and frees memory.
*/
inline ~Any() SAL_THROW( () );
-
+
/** Assignment operator: Sets the value of the given any.
-
+
@param rAny another any (right side)
@return this any
*/
inline Any & SAL_CALL operator = ( const Any & rAny ) SAL_THROW( () );
-
+
/** Gets the type of the set value.
-
+
@return a Type object of the set value
*/
inline const Type & SAL_CALL getValueType() const SAL_THROW( () )
{ return * reinterpret_cast< const Type * >( &pType ); }
/** Gets the type of the set value.
-
+
@return the UNacquired type description reference of the set value
*/
inline typelib_TypeDescriptionReference * SAL_CALL getValueTypeRef() const SAL_THROW( () )
{ return pType; }
-
+
/** Gets the type description of the set value. Provides ownership of the type description!
Call an explicit typelib_typedescription_release() to release afterwards.
-
+
@param a pointer to type description pointer
*/
inline void SAL_CALL getValueTypeDescription( typelib_TypeDescription ** ppTypeDescr ) const SAL_THROW( () )
{ ::typelib_typedescriptionreference_getDescription( ppTypeDescr, pType ); }
-
+
/** Gets the type class of the set value.
-
+
@return the type class of the set value
*/
inline TypeClass SAL_CALL getValueTypeClass() const SAL_THROW( () )
{ return (TypeClass)pType->eTypeClass; }
-
+
/** Gets the type name of the set value.
-
+
@return the type name of the set value
*/
inline ::rtl::OUString SAL_CALL getValueTypeName() const SAL_THROW( () );
-
+
/** Tests if any contains a value.
-
+
@return true if any has a value, false otherwise
*/
inline sal_Bool SAL_CALL hasValue() const SAL_THROW( () )
{ return (typelib_TypeClass_VOID != pType->eTypeClass); }
-
+
/** Gets a pointer to the set value.
-
+
@return a pointer to the set value
*/
inline const void * SAL_CALL getValue() const SAL_THROW( () )
@@ -185,66 +185,66 @@ public:
template <typename T>
inline T get() const;
#endif // ! defined(EXCEPTIONS_OFF)
-
+
/** Sets a value. If the any already contains a value, that value will be destructed
and its memory freed.
-
+
@param pData_ pointer to value
@param rType type of value
*/
inline void SAL_CALL setValue( const void * pData_, const Type & rType ) SAL_THROW( () );
/** Sets a value. If the any already contains a value, that value will be destructed
and its memory freed.
-
+
@param pData_ pointer to value
@param pType type of value
*/
inline void SAL_CALL setValue( const void * pData_, typelib_TypeDescriptionReference * pType ) SAL_THROW( () );
/** Sets a value. If the any already contains a value, that value will be destructed
and its memory freed.
-
+
@param pData_ pointer to value
@param pTypeDescr type description of value
*/
inline void SAL_CALL setValue( const void * pData_, typelib_TypeDescription * pTypeDescr ) SAL_THROW( () );
-
+
/** Clears this any. If the any already contains a value, that value will be destructed
and its memory freed. After this has been called, the any does not contain a value.
*/
inline void SAL_CALL clear() SAL_THROW( () );
-
+
/** Tests whether this any is extractable to a value of given type.
Widening conversion without data loss is taken into account.
-
+
@param rType destination type
@return true if this any is extractable to value of given type (e.g. using >>= operator)
*/
inline sal_Bool SAL_CALL isExtractableTo( const Type & rType ) const SAL_THROW( () );
-
+
/** Tests whether this any can provide a value of specified type.
Widening conversion without data loss is taken into account.
-
+
@return true if this any can provide a value of specified type
(e.g. using >>= operator)
*/
template <typename T>
inline bool has() const;
-
+
/** Equality operator: compares two anys.
The values need not be of equal type, e.g. a short integer is compared to a long integer.
-
+
@param rAny another any (right side)
@return true if both any contains equal values
*/
inline sal_Bool SAL_CALL operator == ( const Any & rAny ) const SAL_THROW( () );
/** Unequality operator: compares two anys.
The values need not be of equal type, e.g. a short integer is compared to a long integer.
-
+
@param rAny another any (right side)
@return true if both any contains unequal values
*/
inline sal_Bool SAL_CALL operator != ( const Any & rAny ) const SAL_THROW( () );
-
+
private:
// not impl: forbid use with ambiguous type (sal_Unicode, sal_uInt16)
explicit Any( sal_uInt16 );
@@ -293,7 +293,7 @@ inline void SAL_CALL operator <<= ( Any & rAny, bool const & value )
/** Template binary >>= operator to assign a value from an any.
If the any does not contain a value that can be assigned without data loss, then this
operation will fail returning false.
-
+
@tplparam C value type
@param rAny source any (left side)
@param value destination value (right side)
@@ -301,12 +301,12 @@ inline void SAL_CALL operator <<= ( Any & rAny, bool const & value )
*/
template< class C >
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, C & value ) SAL_THROW( () );
-
+
/** Template equality operator: compares set value of left side any to right side value.
The values need not be of equal type, e.g. a short integer is compared to a long integer.
This operator can be implemented as template member function, if all supported compilers
can cope with template member functions.
-
+
@tplparam C value type
@param rAny another any (left side)
@param value a value (right side)
@@ -318,7 +318,7 @@ inline sal_Bool SAL_CALL operator == ( const Any & rAny, const C & value ) SAL_T
The values need not be of equal type, e.g. a short integer is compared to a long integer.
This operator can be implemented as template member function, if all supported compilers
can cope with template member functions.
-
+
@tplparam C value type
@param rAny another any (left side)
@param value a value (right side)
@@ -369,10 +369,10 @@ inline sal_Bool SAL_CALL operator == ( const Any & rAny, const BaseReference & v
}
/** Gets the meta type of IDL type any.
-
+
There are cases (involving templates) where uses of getCppuType are known to
not compile. Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
-
+
@param dummy typed pointer for function signature
@return type of IDL type any
*/