office-gobmx/cppu/source/uno/any.cxx

154 lines
4.7 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2000-09-18 09:29:57 -05:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 09:29:57 -05:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 09:29:57 -05:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 09:29:57 -05:00
*
* This file is part of OpenOffice.org.
2000-09-18 09:29:57 -05:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 09:29:57 -05:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 09:29:57 -05:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 09:29:57 -05:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_cppu.hxx"
2000-09-18 09:29:57 -05:00
#include "copy.hxx"
#include "destr.hxx"
using namespace cppu;
extern "C"
{
//##################################################################################################
void SAL_CALL uno_type_any_assign(
uno_Any * pDest, void * pSource,
typelib_TypeDescriptionReference * pType,
uno_AcquireFunc acquire, uno_ReleaseFunc release )
2001-03-09 05:10:57 -06:00
SAL_THROW_EXTERN_C()
{
2002-08-21 03:19:40 -05:00
_destructAny( pDest, release );
if (pType)
{
2002-08-21 03:19:40 -05:00
_copyConstructAny( pDest, pSource, pType, 0, acquire, 0 );
}
else
{
2002-08-21 03:19:40 -05:00
CONSTRUCT_EMPTY_ANY( pDest );
}
}
//##################################################################################################
void SAL_CALL uno_any_assign(
uno_Any * pDest, void * pSource,
typelib_TypeDescription * pTypeDescr,
uno_AcquireFunc acquire, uno_ReleaseFunc release )
2001-03-09 05:10:57 -06:00
SAL_THROW_EXTERN_C()
{
2002-08-21 03:19:40 -05:00
_destructAny( pDest, release );
if (pTypeDescr)
{
2002-08-21 03:19:40 -05:00
_copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, 0 );
}
else
{
2002-08-21 03:19:40 -05:00
CONSTRUCT_EMPTY_ANY( pDest );
}
}
//##################################################################################################
void SAL_CALL uno_type_any_construct(
2000-09-18 09:29:57 -05:00
uno_Any * pDest, void * pSource,
typelib_TypeDescriptionReference * pType,
uno_AcquireFunc acquire )
2001-03-09 05:10:57 -06:00
SAL_THROW_EXTERN_C()
2000-09-18 09:29:57 -05:00
{
if (pType)
{
2002-08-21 03:19:40 -05:00
_copyConstructAny( pDest, pSource, pType, 0, acquire, 0 );
2000-09-18 09:29:57 -05:00
}
else
{
2002-08-21 03:19:40 -05:00
CONSTRUCT_EMPTY_ANY( pDest );
2000-09-18 09:29:57 -05:00
}
}
//##################################################################################################
void SAL_CALL uno_any_construct(
2000-09-18 09:29:57 -05:00
uno_Any * pDest, void * pSource,
typelib_TypeDescription * pTypeDescr,
uno_AcquireFunc acquire )
2001-03-09 05:10:57 -06:00
SAL_THROW_EXTERN_C()
2000-09-18 09:29:57 -05:00
{
if (pTypeDescr)
{
2002-08-21 03:19:40 -05:00
_copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, 0 );
2000-09-18 09:29:57 -05:00
}
else
{
2002-08-21 03:19:40 -05:00
CONSTRUCT_EMPTY_ANY( pDest );
2000-09-18 09:29:57 -05:00
}
}
//##################################################################################################
void SAL_CALL uno_type_any_constructAndConvert(
2000-09-18 09:29:57 -05:00
uno_Any * pDest, void * pSource,
typelib_TypeDescriptionReference * pType,
uno_Mapping * mapping )
2001-03-09 05:10:57 -06:00
SAL_THROW_EXTERN_C()
2000-09-18 09:29:57 -05:00
{
if (pType)
{
2002-08-21 03:19:40 -05:00
_copyConstructAny( pDest, pSource, pType, 0, 0, mapping );
2000-09-18 09:29:57 -05:00
}
else
{
2002-08-21 03:19:40 -05:00
CONSTRUCT_EMPTY_ANY( pDest );
2000-09-18 09:29:57 -05:00
}
}
//##################################################################################################
void SAL_CALL uno_any_constructAndConvert(
2000-09-18 09:29:57 -05:00
uno_Any * pDest, void * pSource,
typelib_TypeDescription * pTypeDescr,
uno_Mapping * mapping )
2001-03-09 05:10:57 -06:00
SAL_THROW_EXTERN_C()
2000-09-18 09:29:57 -05:00
{
if (pTypeDescr)
{
2002-08-21 03:19:40 -05:00
_copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, 0, mapping );
2000-09-18 09:29:57 -05:00
}
else
{
2002-08-21 03:19:40 -05:00
CONSTRUCT_EMPTY_ANY( pDest );
2000-09-18 09:29:57 -05:00
}
}
//##################################################################################################
void SAL_CALL uno_any_destruct( uno_Any * pValue, uno_ReleaseFunc release )
2001-03-09 05:10:57 -06:00
SAL_THROW_EXTERN_C()
2000-09-18 09:29:57 -05:00
{
2002-08-21 03:19:40 -05:00
_destructAny( pValue, release );
2000-09-18 09:29:57 -05:00
}
2001-09-06 04:25:51 -05:00
//##################################################################################################
void SAL_CALL uno_any_clear( uno_Any * pValue, uno_ReleaseFunc release )
SAL_THROW_EXTERN_C()
{
2002-08-21 03:19:40 -05:00
_destructAny( pValue, release );
CONSTRUCT_EMPTY_ANY( pValue );
2001-09-06 04:25:51 -05:00
}
2000-09-18 09:29:57 -05:00
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */