forked from qt-creator/qt-creator
Utils: Iterate environment via callback
Iterators expose the underlying datastructure and get in the way of moving towards "env as stack of changes" Task-number: QTCREATORBUG-28357 Change-Id: I69e3b53e62ed4c9ab394779e97afbc6fd1986838 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -24,6 +24,12 @@ NameValueItems Environment::diff(const Environment &other, bool checkAppendPrepe
|
||||
return m_dict.diff(other.m_dict, checkAppendPrepend);
|
||||
}
|
||||
|
||||
void Environment::forEachEntry(const std::function<void(const QString &, const QString &, bool)> &callBack) const
|
||||
{
|
||||
for (auto it = m_dict.m_values.constBegin(); it != m_dict.m_values.constEnd(); ++it)
|
||||
callBack(it.key().name, it.value().first, it.value().second);
|
||||
}
|
||||
|
||||
bool Environment::hasChanges() const
|
||||
{
|
||||
return m_dict.size() != 0;
|
||||
|
||||
Reference in New Issue
Block a user