forked from qt-creator/qt-creator
CPlusPlus: Migrate Macro to FilePath
Change-Id: I94e8702e81e809e4d8318572cc070a0531edaefa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -68,13 +68,10 @@ public:
|
||||
void addFormal(const QByteArray &formal)
|
||||
{ _formals.append(formal); }
|
||||
|
||||
const QString &fileName() const
|
||||
const Utils::FilePath &filePath() const
|
||||
{ return _fileName; }
|
||||
|
||||
Utils::FilePath filePath() const
|
||||
{ return Utils::FilePath::fromString(_fileName); }
|
||||
|
||||
void setFileName(const QString &fileName)
|
||||
void setFilePath(const Utils::FilePath &fileName)
|
||||
{ _fileName = fileName; }
|
||||
|
||||
unsigned fileRevision() const
|
||||
@@ -145,7 +142,7 @@ private:
|
||||
QByteArray _definitionText;
|
||||
QVector<PPToken> _definitionTokens;
|
||||
QVector<QByteArray> _formals;
|
||||
QString _fileName;
|
||||
Utils::FilePath _fileName;
|
||||
unsigned _hashcode;
|
||||
unsigned _fileRevision;
|
||||
int _line;
|
||||
@@ -160,4 +157,4 @@ private:
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace CPlusPlus
|
||||
} // CPlusPlus
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
static unsigned hashCode(const char *str, int length)
|
||||
@@ -116,7 +118,7 @@ Macro *Environment::remove(const ByteArrayRef &name)
|
||||
Macro macro;
|
||||
macro.setName(name.toByteArray());
|
||||
macro.setHidden(true);
|
||||
macro.setFileName(currentFile);
|
||||
macro.setFilePath(FilePath::fromString(currentFile));
|
||||
macro.setLine(currentLine);
|
||||
return bind(macro);
|
||||
}
|
||||
@@ -246,4 +248,4 @@ void Environment::dump() const
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace CPlusPlus
|
||||
} // CPlusPlus
|
||||
|
||||
@@ -1703,7 +1703,7 @@ void Preprocessor::handleDefineDirective(PPToken *tk)
|
||||
return;
|
||||
|
||||
Macro macro;
|
||||
macro.setFileName(m_env->currentFile);
|
||||
macro.setFilePath(FilePath::fromString(m_env->currentFile));
|
||||
macro.setLine(tk->lineno);
|
||||
QByteArray macroName = tk->asByteArrayRef().toByteArray();
|
||||
macro.setName(macroName);
|
||||
|
||||
Reference in New Issue
Block a user