merged tag ooo/DEV300_m102
[LibreOffice.git] / cppu / source / uno / any.cxx
blob29be833dfb864ba5041bdc8ea9b9ee19a66f125c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_cppu.hxx"
31 #include "copy.hxx"
32 #include "destr.hxx"
34 using namespace cppu;
37 extern "C"
39 //##################################################################################################
40 void SAL_CALL uno_type_any_assign(
41 uno_Any * pDest, void * pSource,
42 typelib_TypeDescriptionReference * pType,
43 uno_AcquireFunc acquire, uno_ReleaseFunc release )
44 SAL_THROW_EXTERN_C()
46 _destructAny( pDest, release );
47 if (pType)
49 _copyConstructAny( pDest, pSource, pType, 0, acquire, 0 );
51 else
53 CONSTRUCT_EMPTY_ANY( pDest );
56 //##################################################################################################
57 void SAL_CALL uno_any_assign(
58 uno_Any * pDest, void * pSource,
59 typelib_TypeDescription * pTypeDescr,
60 uno_AcquireFunc acquire, uno_ReleaseFunc release )
61 SAL_THROW_EXTERN_C()
63 _destructAny( pDest, release );
64 if (pTypeDescr)
66 _copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, 0 );
68 else
70 CONSTRUCT_EMPTY_ANY( pDest );
73 //##################################################################################################
74 void SAL_CALL uno_type_any_construct(
75 uno_Any * pDest, void * pSource,
76 typelib_TypeDescriptionReference * pType,
77 uno_AcquireFunc acquire )
78 SAL_THROW_EXTERN_C()
80 if (pType)
82 _copyConstructAny( pDest, pSource, pType, 0, acquire, 0 );
84 else
86 CONSTRUCT_EMPTY_ANY( pDest );
89 //##################################################################################################
90 void SAL_CALL uno_any_construct(
91 uno_Any * pDest, void * pSource,
92 typelib_TypeDescription * pTypeDescr,
93 uno_AcquireFunc acquire )
94 SAL_THROW_EXTERN_C()
96 if (pTypeDescr)
98 _copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, 0 );
100 else
102 CONSTRUCT_EMPTY_ANY( pDest );
105 //##################################################################################################
106 void SAL_CALL uno_type_any_constructAndConvert(
107 uno_Any * pDest, void * pSource,
108 typelib_TypeDescriptionReference * pType,
109 uno_Mapping * mapping )
110 SAL_THROW_EXTERN_C()
112 if (pType)
114 _copyConstructAny( pDest, pSource, pType, 0, 0, mapping );
116 else
118 CONSTRUCT_EMPTY_ANY( pDest );
121 //##################################################################################################
122 void SAL_CALL uno_any_constructAndConvert(
123 uno_Any * pDest, void * pSource,
124 typelib_TypeDescription * pTypeDescr,
125 uno_Mapping * mapping )
126 SAL_THROW_EXTERN_C()
128 if (pTypeDescr)
130 _copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, 0, mapping );
132 else
134 CONSTRUCT_EMPTY_ANY( pDest );
137 //##################################################################################################
138 void SAL_CALL uno_any_destruct( uno_Any * pValue, uno_ReleaseFunc release )
139 SAL_THROW_EXTERN_C()
141 _destructAny( pValue, release );
143 //##################################################################################################
144 void SAL_CALL uno_any_clear( uno_Any * pValue, uno_ReleaseFunc release )
145 SAL_THROW_EXTERN_C()
147 _destructAny( pValue, release );
148 CONSTRUCT_EMPTY_ANY( pValue );