LibreOffice Module cppu (master) 1
cppu_opt.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <com/sun/star/uno/Any.hxx>
23#include <typelib/typedescription.h>
24#include <uno/any2.h>
25#include <rtl/ustring.hxx>
26
27
28using namespace ::rtl;
29
30
31extern "C" rtl_uString * SAL_CALL cppu_unsatisfied_iquery_msg(
32 typelib_TypeDescriptionReference * pType )
34{
35 OUString ret = "unsatisfied query for interface of type "
36 + OUString::unacquired( &pType->pTypeName ) + "!";
37 rtl_uString_acquire( ret.pData );
38 return ret.pData;
39}
40
41
42extern "C" rtl_uString * SAL_CALL cppu_unsatisfied_iset_msg(
43 typelib_TypeDescriptionReference * pType )
45{
46 OUString ret = "invalid attempt to assign an empty interface of type "
47 + OUString::unacquired( &pType->pTypeName ) + "!";
48 rtl_uString_acquire( ret.pData );
49 return ret.pData;
50}
51
52
53extern "C" rtl_uString * SAL_CALL cppu_Any_extraction_failure_msg(
54 uno_Any const * pAny, typelib_TypeDescriptionReference * pType )
56{
57 OUString ret = "Cannot extract an Any(" +
58 OUString::unacquired(&pAny->pType->pTypeName) +
59 ") to " +
60 OUString::unacquired(&pType->pTypeName) +
61 "!";
62 rtl_uString_acquire( ret.pData );
63 return ret.pData;
64}
65
66/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl_uString *SAL_CALL cppu_unsatisfied_iset_msg(typelib_TypeDescriptionReference *pType) SAL_THROW_EXTERN_C()
Definition: cppu_opt.cxx:42
rtl_uString *SAL_CALL cppu_unsatisfied_iquery_msg(typelib_TypeDescriptionReference *pType) SAL_THROW_EXTERN_C()
Definition: cppu_opt.cxx:31
rtl_uString *SAL_CALL cppu_Any_extraction_failure_msg(uno_Any const *pAny, typelib_TypeDescriptionReference *pType) SAL_THROW_EXTERN_C()
Definition: cppu_opt.cxx:53
struct _uno_Any uno_Any
#define SAL_THROW_EXTERN_C()