1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
33 Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
35 Permission to use, copy, modify, distribute, and sell this software and its
36 documentation for any purpose is hereby granted without fee, provided that
37 the above copyright notice appear in all copies and that both that
38 copyright notice and this permission notice appear in supporting
41 The above copyright notice and this permission notice shall be included in
42 all copies or substantial portions of the Software.
44 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
46 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
47 KDEVELOP TEAM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
48 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
49 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
52 #ifndef CPLUSPLUS_PP_MACRO_H
53 #define CPLUSPLUS_PP_MACRO_H
55 #include <CPlusPlusForwardDeclarations.h>
57 #include <QtCore/QByteArray>
58 #include <QtCore/QVector>
59 #include <QtCore/QString>
63 class CPLUSPLUS_EXPORT Macro
68 QByteArray name() const
71 void setName(const QByteArray &name)
74 QByteArray definition() const
75 { return _definition; }
77 void setDefinition(const QByteArray &definition)
78 { _definition = definition; }
80 QVector<QByteArray> formals() const
83 void addFormal(const QByteArray &formal)
84 { _formals.append(formal); }
86 QString fileName() const
89 void setFileName(const QString &fileName)
90 { _fileName = fileName; }
95 void setLine(unsigned line)
98 unsigned offset() const
101 void setOffset(unsigned offset)
102 { _offset = offset; }
104 unsigned length() const
107 void setLength(unsigned length)
108 { _length = length; }
110 bool isHidden() const
111 { return f._hidden; }
113 void setHidden(bool isHidden)
114 { f._hidden = isHidden; }
116 bool isFunctionLike() const
117 { return f._functionLike; }
119 void setFunctionLike(bool isFunctionLike)
120 { f._functionLike = isFunctionLike; }
122 bool isVariadic() const
123 { return f._variadic; }
125 void setVariadic(bool isVariadic)
126 { f._variadic = isVariadic; }
128 QString toString() const;
138 unsigned _functionLike: 1;
139 unsigned _variadic: 1;
143 QByteArray _definition;
144 QVector<QByteArray> _formals;
157 } // namespace CPlusPlus
159 #endif // CPLUSPLUS_PP_MACRO_H