20#include <typelib/typedescription.h>
27using namespace css::lang;
28using namespace css::reflection;
29using namespace css::uno;
38 TypeClass
eTC = rArray.getValueTypeClass();
39 if (
eTC != TypeClass_SEQUENCE)
41 throw IllegalArgumentException(
42 "expected sequence, but found " + rArray.getValueType().getTypeName(),
47 throw IllegalArgumentException(
48 "negative length given!",
52 uno_Sequence ** ppSeq =
const_cast<uno_Sequence **
>(
static_cast<uno_Sequence *
const *
>(rArray.getValue()));
55 reinterpret_cast< uno_AcquireFunc
>(cpp_acquire),
56 reinterpret_cast< uno_ReleaseFunc
>(cpp_release) );
62 TypeClass
eTC = rArray.getValueTypeClass();
63 if (
eTC != TypeClass_SEQUENCE)
65 throw IllegalArgumentException(
66 "expected sequence, but found " + rArray.getValueType().getTypeName(),
70 return (*
static_cast<uno_Sequence *
const *
>(rArray.getValue()))->nElements;
75 TypeClass
eTC = rArray.getValueTypeClass();
76 if (
eTC != TypeClass_SEQUENCE)
78 throw IllegalArgumentException(
79 "expected sequence, but found " + rArray.getValueType().getTypeName(),
83 uno_Sequence * pSeq = *
static_cast<uno_Sequence *
const *
>(rArray.getValue());
84 if (pSeq->nElements <=
nIndex)
86 throw ArrayIndexOutOfBoundsException(
87 "illegal index given, index " + OUString::number(
nIndex) +
" is < " + OUString::number(pSeq->nElements),
93 TYPELIB_DANGER_GET( &pElemTypeDescr,
getTypeDescr()->pType );
97 reinterpret_cast< uno_AcquireFunc
>(cpp_acquire) );
98 TYPELIB_DANGER_RELEASE( pElemTypeDescr );
105 TypeClass
eTC = rArray.getValueTypeClass();
106 if (
eTC != TypeClass_SEQUENCE)
108 throw IllegalArgumentException(
109 "expected sequence, but found " + rArray.getValueType().getTypeName(),
113 uno_Sequence * pSeq = *
static_cast<uno_Sequence *
const *
>(rArray.getValue());
114 if (pSeq->nElements <=
nIndex)
116 throw ArrayIndexOutOfBoundsException(
117 "illegal index given, index " + OUString::number(
nIndex) +
" is < " + OUString::number(pSeq->nElements),
121 uno_Sequence ** ppSeq =
const_cast<uno_Sequence **
>(
static_cast<uno_Sequence *
const *
>(rArray.getValue()));
124 reinterpret_cast< uno_AcquireFunc
>(cpp_acquire),
125 reinterpret_cast< uno_ReleaseFunc
>(cpp_release) );
126 rArray.pData = ppSeq;
130 TYPELIB_DANGER_GET( &pElemTypeDescr,
getTypeDescr()->pType );
133 pElemTypeDescr, rNewValue, getReflection() ))
135 TYPELIB_DANGER_RELEASE( pElemTypeDescr );
136 throw IllegalArgumentException(
137 "sequence element is not assignable by given value!",
140 TYPELIB_DANGER_RELEASE( pElemTypeDescr );
147 return (xType.is() &&
155 return getReflection()->forType(
getTypeDescr()->pType );
void SAL_CALL uno_any_construct(uno_Any *pDest, void *pSource, typelib_TypeDescription *pTypeDescr, uno_AcquireFunc acquire) SAL_THROW_EXTERN_C()
void SAL_CALL uno_any_destruct(uno_Any *pValue, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
virtual css::uno::Any SAL_CALL get(const css::uno::Any &rArray, sal_Int32 nIndex) override
virtual void SAL_CALL set(css::uno::Any &rArray, sal_Int32 nIndex, const css::uno::Any &rNewValue) override
typelib_IndirectTypeDescription * getTypeDescr() const
virtual sal_Int32 SAL_CALL getLen(const css::uno::Any &rArray) override
virtual void SAL_CALL realloc(css::uno::Any &rArray, sal_Int32 nLen) override
virtual sal_Bool SAL_CALL isAssignableFrom(const css::uno::Reference< css::reflection::XIdlClass > &xType) override
virtual css::uno::Reference< css::reflection::XIdlClass > SAL_CALL getComponentType() override
virtual css::uno::Reference< css::reflection::XIdlArray > SAL_CALL getArray() override
struct _typelib_TypeDescription typelib_TypeDescription
PyRef getTypeClass(const Runtime &)
bool coerce_assign(void *pDest, typelib_TypeDescription *pTD, const css::uno::Any &rSource, IdlReflectionServiceImpl *pRefl)
sal_Bool SAL_CALL uno_sequence_realloc(uno_Sequence **ppSequence, typelib_TypeDescription *pTypeDescr, sal_Int32 nSize, uno_AcquireFunc acquire, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
sal_Bool SAL_CALL uno_sequence_reference2One(uno_Sequence **ppSequence, typelib_TypeDescription *pTypeDescr, uno_AcquireFunc acquire, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()