forked from qt-creator/qt-creator
Utils: Merge Abstract{Qtc,}MacroExpander classes
Change-Id: Id78fb47a9b8059684b8b4fc77d9aaaaf23b11bae Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -115,7 +115,7 @@ QTCREATOR_UTILS_EXPORT QString withTildeHomePath(const QString &path)
|
||||
return outPath;
|
||||
}
|
||||
|
||||
int AbstractQtcMacroExpander::findMacro(const QString &str, int *pos, QString *ret)
|
||||
int AbstractMacroExpander::findMacro(const QString &str, int *pos, QString *ret)
|
||||
{
|
||||
forever {
|
||||
int openPos = str.indexOf(QLatin1String("%{"), *pos);
|
||||
|
@@ -55,7 +55,8 @@ QTCREATOR_UTILS_EXPORT QString commonPath(const QStringList &files);
|
||||
// If path is not sub of home path, or when running on Windows, returns the input
|
||||
QTCREATOR_UTILS_EXPORT QString withTildeHomePath(const QString &path);
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT AbstractMacroExpander {
|
||||
class QTCREATOR_UTILS_EXPORT AbstractMacroExpander
|
||||
{
|
||||
public:
|
||||
virtual ~AbstractMacroExpander() {}
|
||||
// Not const, as it may change the state of the expander.
|
||||
@@ -64,11 +65,6 @@ public:
|
||||
//! \param pos Position to start scan on input, found position on output
|
||||
//! \param ret Replacement string on output
|
||||
//! \return Length of string part to replace, zero if no (further) matches found
|
||||
virtual int findMacro(const QString &str, int *pos, QString *ret) = 0;
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT AbstractQtcMacroExpander : public AbstractMacroExpander {
|
||||
public:
|
||||
virtual int findMacro(const QString &str, int *pos, QString *ret);
|
||||
//! Provide a replacement string for an expando
|
||||
//! \param name The name of the expando
|
||||
|
@@ -43,7 +43,7 @@ static const char kFileBaseNamePostfix[] = ":FileBaseName";
|
||||
|
||||
namespace Core {
|
||||
|
||||
class VMMapExpander : public Utils::AbstractQtcMacroExpander
|
||||
class VMMapExpander : public Utils::AbstractMacroExpander
|
||||
{
|
||||
public:
|
||||
virtual bool resolveMacro(const QString &name, QString *ret)
|
||||
|
@@ -55,7 +55,8 @@ static const char BUILDDIRECTORY_KEY[] = "ProjectExplorer.BuildConfiguration.Bui
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
class BuildConfigMacroExpander : public Utils::AbstractQtcMacroExpander {
|
||||
class BuildConfigMacroExpander : public Utils::AbstractMacroExpander
|
||||
{
|
||||
public:
|
||||
explicit BuildConfigMacroExpander(const BuildConfiguration *bc) : m_bc(bc) {}
|
||||
virtual bool resolveMacro(const QString &name, QString *ret);
|
||||
|
@@ -41,7 +41,9 @@
|
||||
namespace ProjectExplorer {
|
||||
|
||||
namespace Internal {
|
||||
class FallBackMacroExpander : public Utils::AbstractQtcMacroExpander {
|
||||
|
||||
class FallBackMacroExpander : public Utils::AbstractMacroExpander
|
||||
{
|
||||
public:
|
||||
explicit FallBackMacroExpander(const Target *target) : m_target(target) {}
|
||||
virtual bool resolveMacro(const QString &name, QString *ret);
|
||||
|
@@ -37,7 +37,7 @@
|
||||
namespace ProjectExplorer {
|
||||
class Kit;
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ProjectMacroExpander : public Utils::AbstractQtcMacroExpander
|
||||
class PROJECTEXPLORER_EXPORT ProjectMacroExpander : public Utils::AbstractMacroExpander
|
||||
{
|
||||
public:
|
||||
ProjectMacroExpander(const QString &projectFilePath, const QString &projectName, const Kit *k, const QString &bcName);
|
||||
|
Reference in New Issue
Block a user