Line data Source code
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 : #ifndef _IDLC_FEHELPER_HXX_
20 : #define _IDLC_FEHELPER_HXX_
21 :
22 : #include <idlc/asttype.hxx>
23 : #include <idlc/astinterface.hxx>
24 :
25 : #include <vector>
26 :
27 : class FeDeclarator
28 : {
29 : public:
30 : // Enum to denote types of declarators
31 : enum DeclaratorType
32 : {
33 : FD_simple, // Simple declarator
34 : FD_complex // Complex declarator (complex_part field used)
35 : };
36 :
37 : FeDeclarator(const ::rtl::OString& name, DeclaratorType declType, AstDeclaration* pComplPart);
38 : virtual ~FeDeclarator();
39 :
40 : AstDeclaration* getComplexPart()
41 : { return m_pComplexPart; }
42 157967 : const ::rtl::OString& getName()
43 157967 : { return m_name; }
44 : DeclaratorType getDeclType()
45 : { return m_declType; }
46 :
47 : sal_Bool checkType(AstDeclaration const * pType);
48 : AstType const * compose(AstDeclaration const * pDecl);
49 : private:
50 : AstDeclaration* m_pComplexPart;
51 : ::rtl::OString m_name;
52 : DeclaratorType m_declType;
53 : };
54 :
55 : typedef ::std::list< FeDeclarator* > FeDeclList;
56 :
57 : class FeInheritanceHeader
58 : {
59 : public:
60 : FeInheritanceHeader(
61 : NodeType nodeType, ::rtl::OString* pName, ::rtl::OString* pInherits,
62 : std::vector< rtl::OString > * typeParameters);
63 :
64 100918 : virtual ~FeInheritanceHeader()
65 100918 : {
66 50459 : if ( m_pName )
67 50459 : delete m_pName;
68 100918 : }
69 :
70 34440 : NodeType getNodeType()
71 34440 : { return m_nodeType; }
72 50459 : ::rtl::OString* getName()
73 50459 : { return m_pName; }
74 50459 : AstDeclaration* getInherits()
75 50459 : { return m_pInherits; }
76 :
77 11405 : std::vector< rtl::OString > const & getTypeParameters() const
78 11405 : { return m_typeParameters; }
79 :
80 : private:
81 : void initializeInherits(::rtl::OString* pinherits);
82 :
83 : NodeType m_nodeType;
84 : ::rtl::OString* m_pName;
85 : AstDeclaration* m_pInherits;
86 : std::vector< rtl::OString > m_typeParameters;
87 : };
88 :
89 : #endif // _IDLC_FEHELPER_HXX_
90 :
91 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|