Merge pull request #52 from gogoprog/patch-1
[lqt/mk.git] / cpptoxml / parser / rpp / preprocessor.h
blob448fd7b96043661156c67890ed088d4643501822
1 /****************************************************************************
2 **
3 ** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
4 ** Copyright 2005 Harald Fernengel <harry@kdevelop.org>
5 **
6 ** This file is part of $PRODUCT$.
7 **
8 ** $CPP_LICENSE$
9 **
10 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13 ****************************************************************************/
15 #ifndef PREPROCESSOR_H
16 #define PREPROCESSOR_H
18 #include <QtCore/qglobal.h>
19 #include <QtCore/qstring.h>
20 #include <QtCore/qstringlist.h>
22 class QByteArray;
23 class PreprocessorPrivate;
25 class Preprocessor
27 public:
28 Preprocessor();
29 ~Preprocessor();
31 void processFile(const QString &fileName);
32 void processString(const QByteArray &str);
34 void addIncludePaths(const QStringList &includePaths);
36 QByteArray result() const;
38 QStringList macroNames() const;
40 struct MacroItem
42 QString name;
43 QStringList parameters;
44 QString definition;
45 bool isFunctionLike;
46 #ifdef PP_WITH_MACRO_POSITION
47 QString fileName;
48 #endif
50 QList<MacroItem> macros() const;
52 private:
53 Q_DISABLE_COPY(Preprocessor)
54 PreprocessorPrivate *d;
57 #endif