diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-05-02 18:25:24 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-07-04 12:05:15 +0200 |
commit | ed633945ba2004c3b688f8be005e8ee4cce8db59 (patch) | |
tree | 6c64cae3861c516bac6dbca562a17044db889030 /src/shared/proparser/proitems.h | |
parent | 888c187dd52e2feac7c27ab1b82c141cf7b2c8d8 (diff) | |
download | qt-creator-ed633945ba2004c3b688f8be005e8ee4cce8db59.tar.gz |
FunctionDef(s) => ProFunctionDef(s), plus move to proitems.h
Change-Id: I7bdde81c1913237f11dbfbe7491e0fe750181cd5
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Diffstat (limited to 'src/shared/proparser/proitems.h')
-rw-r--r-- | src/shared/proparser/proitems.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/shared/proparser/proitems.h b/src/shared/proparser/proitems.h index 986cafe512..c9092e8c34 100644 --- a/src/shared/proparser/proitems.h +++ b/src/shared/proparser/proitems.h @@ -36,6 +36,7 @@ #include "qmake_global.h" #include <QString> #include <QVector> +#include <QHash> QT_BEGIN_NAMESPACE @@ -217,6 +218,35 @@ private: bool m_ok; }; +class ProFunctionDef { +public: + ProFunctionDef(ProFile *pro, int offset) : m_pro(pro), m_offset(offset) { m_pro->ref(); } + ProFunctionDef(const ProFunctionDef &o) : m_pro(o.m_pro), m_offset(o.m_offset) { m_pro->ref(); } + ~ProFunctionDef() { m_pro->deref(); } + ProFunctionDef &operator=(const ProFunctionDef &o) + { + if (this != &o) { + m_pro->deref(); + m_pro = o.m_pro; + m_pro->ref(); + m_offset = o.m_offset; + } + return *this; + } + ProFile *pro() const { return m_pro; } + const ushort *tokPtr() const { return m_pro->tokPtr() + m_offset; } +private: + ProFile *m_pro; + int m_offset; +}; + +Q_DECLARE_TYPEINFO(ProFunctionDef, Q_MOVABLE_TYPE); + +struct ProFunctionDefs { + QHash<ProString, ProFunctionDef> testFunctions; + QHash<ProString, ProFunctionDef> replaceFunctions; +}; + QT_END_NAMESPACE #endif // PROITEMS_H |