1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
24 #pragma clang diagnostic push
25 #pragma clang diagnostic ignored "-Wall"
26 #pragma clang diagnostic ignored "-Wextra"
27 #pragma clang diagnostic ignored "-Wignored-attributes"
28 #pragma clang diagnostic ignored "-Wint-to-pointer-cast"
29 #pragma clang diagnostic ignored "-Winvalid-noreturn"
30 #pragma clang diagnostic ignored "-Wmicrosoft"
31 #pragma clang diagnostic ignored "-Wnon-pod-varargs"
37 #pragma clang diagnostic pop
40 #include <osl/diagnose.h>
45 VARDESC
* operator = (const VarDesc
*);
46 VarDesc(const VarDesc
&);
49 CComPtr
< ITypeInfo
> m_pTypeInfo
;
52 explicit VarDesc(ITypeInfo
* pTypeInfo
) :
53 m_pTypeInfo(pTypeInfo
),
56 OSL_ASSERT(pTypeInfo
);
60 if (m_pVarDesc
!= nullptr)
62 m_pTypeInfo
->ReleaseVarDesc(m_pVarDesc
);
82 //Wrapper for FUNCDESC structure
85 FUNCDESC
* operator = (const FuncDesc
&);
86 FuncDesc(const FuncDesc
&);
87 CComPtr
<ITypeInfo
> m_pTypeInfo
;
88 FUNCDESC
* m_pFuncDesc
;
92 explicit FuncDesc(ITypeInfo
* pTypeInfo
) :
93 m_pTypeInfo(pTypeInfo
),
96 OSL_ASSERT(pTypeInfo
);
103 FUNCDESC
* operator -> ()
108 FUNCDESC
** operator & ()
110 return & m_pFuncDesc
;
113 operator FUNCDESC
* ()
118 FUNCDESC
* operator = (FUNCDESC
* pDesc
)
126 FUNCDESC
* pDesc
= m_pFuncDesc
;
127 m_pFuncDesc
= nullptr;
131 void ReleaseFUNCDESC()
133 if (m_pFuncDesc
!= nullptr)
135 m_pTypeInfo
->ReleaseFuncDesc(m_pFuncDesc
);
137 m_pFuncDesc
= nullptr;
140 //Wrapper for EXCEPINFO structure
141 class ExcepInfo
: public EXCEPINFO
143 EXCEPINFO
* operator = (const ExcepInfo
& );
144 ExcepInfo(const ExcepInfo
&);
152 if (bstrSource
!= nullptr)
153 ::SysFreeString(bstrSource
);
154 if (bstrDescription
!= nullptr)
155 ::SysFreeString(bstrDescription
);
156 if (bstrHelpFile
!= nullptr)
157 ::SysFreeString(bstrHelpFile
);
161 //Wrapper for TYPEATTR
164 TYPEATTR
* operator = (const TypeAttr
&);
165 TypeAttr(const TypeAttr
&);
167 CComPtr
< ITypeInfo
> m_pTypeInfo
;
168 TYPEATTR
* m_pTypeAttr
;
170 explicit TypeAttr(ITypeInfo
* pTypeInfo
) :
171 m_pTypeInfo( pTypeInfo
),
172 m_pTypeAttr( nullptr )
174 OSL_ASSERT(pTypeInfo
);
178 if (m_pTypeAttr
!= nullptr)
180 m_pTypeInfo
->ReleaseTypeAttr(m_pTypeAttr
);
184 TYPEATTR
** operator&() noexcept
189 TYPEATTR
* operator->() noexcept
195 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */