update dev300-m58
[ooovba.git] / cppu / source / uno / any.cxx
blob506d409d84de69567c4edd29340ee2d33e90ccf7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: any.cxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_cppu.hxx"
34 #include "copy.hxx"
35 #include "destr.hxx"
37 using namespace cppu;
40 extern "C"
42 //##################################################################################################
43 void SAL_CALL uno_type_any_assign(
44 uno_Any * pDest, void * pSource,
45 typelib_TypeDescriptionReference * pType,
46 uno_AcquireFunc acquire, uno_ReleaseFunc release )
47 SAL_THROW_EXTERN_C()
49 _destructAny( pDest, release );
50 if (pType)
52 _copyConstructAny( pDest, pSource, pType, 0, acquire, 0 );
54 else
56 CONSTRUCT_EMPTY_ANY( pDest );
59 //##################################################################################################
60 void SAL_CALL uno_any_assign(
61 uno_Any * pDest, void * pSource,
62 typelib_TypeDescription * pTypeDescr,
63 uno_AcquireFunc acquire, uno_ReleaseFunc release )
64 SAL_THROW_EXTERN_C()
66 _destructAny( pDest, release );
67 if (pTypeDescr)
69 _copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, 0 );
71 else
73 CONSTRUCT_EMPTY_ANY( pDest );
76 //##################################################################################################
77 void SAL_CALL uno_type_any_construct(
78 uno_Any * pDest, void * pSource,
79 typelib_TypeDescriptionReference * pType,
80 uno_AcquireFunc acquire )
81 SAL_THROW_EXTERN_C()
83 if (pType)
85 _copyConstructAny( pDest, pSource, pType, 0, acquire, 0 );
87 else
89 CONSTRUCT_EMPTY_ANY( pDest );
92 //##################################################################################################
93 void SAL_CALL uno_any_construct(
94 uno_Any * pDest, void * pSource,
95 typelib_TypeDescription * pTypeDescr,
96 uno_AcquireFunc acquire )
97 SAL_THROW_EXTERN_C()
99 if (pTypeDescr)
101 _copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, 0 );
103 else
105 CONSTRUCT_EMPTY_ANY( pDest );
108 //##################################################################################################
109 void SAL_CALL uno_type_any_constructAndConvert(
110 uno_Any * pDest, void * pSource,
111 typelib_TypeDescriptionReference * pType,
112 uno_Mapping * mapping )
113 SAL_THROW_EXTERN_C()
115 if (pType)
117 _copyConstructAny( pDest, pSource, pType, 0, 0, mapping );
119 else
121 CONSTRUCT_EMPTY_ANY( pDest );
124 //##################################################################################################
125 void SAL_CALL uno_any_constructAndConvert(
126 uno_Any * pDest, void * pSource,
127 typelib_TypeDescription * pTypeDescr,
128 uno_Mapping * mapping )
129 SAL_THROW_EXTERN_C()
131 if (pTypeDescr)
133 _copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, 0, mapping );
135 else
137 CONSTRUCT_EMPTY_ANY( pDest );
140 //##################################################################################################
141 void SAL_CALL uno_any_destruct( uno_Any * pValue, uno_ReleaseFunc release )
142 SAL_THROW_EXTERN_C()
144 _destructAny( pValue, release );
146 //##################################################################################################
147 void SAL_CALL uno_any_clear( uno_Any * pValue, uno_ReleaseFunc release )
148 SAL_THROW_EXTERN_C()
150 _destructAny( pValue, release );
151 CONSTRUCT_EMPTY_ANY( pValue );