Renamed private member directives

This commit is contained in:
Daniel Marjamäki 2018-06-17 08:45:45 +02:00
parent c102638970
commit de0e22a1fb
2 changed files with 9 additions and 9 deletions

View File

@ -134,7 +134,7 @@ void Preprocessor::inlineSuppressions(const simplecpp::TokenList &tokens)
void Preprocessor::setDirectives(const simplecpp::TokenList &tokens)
{
// directive list..
directives.clear();
mDirectives.clear();
std::vector<const simplecpp::TokenList *> list;
list.reserve(1U + tokenlists.size());
@ -160,7 +160,7 @@ void Preprocessor::setDirectives(const simplecpp::TokenList &tokens)
else
directive.str += tok2->str();
}
directives.push_back(directive);
mDirectives.push_back(directive);
}
}
}
@ -789,7 +789,7 @@ bool Preprocessor::validateCfg(const std::string &cfg, const std::list<simplecpp
if (mu.macroName != macroName)
continue;
bool directiveLocation = false;
for (const Directive &dir : directives) {
for (const Directive &dir : mDirectives) {
if (mu.useLocation.file() == dir.file && mu.useLocation.line == dir.linenr) {
directiveLocation = true;
break;
@ -834,13 +834,13 @@ void Preprocessor::dump(std::ostream &out) const
// data dump that 3rd party tools could load and get useful info from.
out << " <directivelist>" << std::endl;
for (std::list<Directive>::const_iterator it = directives.begin(); it != directives.end(); ++it) {
for (const Directive &dir : mDirectives) {
out << " <directive "
<< "file=\"" << ErrorLogger::toxml(it->file) << "\" "
<< "linenr=\"" << it->linenr << "\" "
<< "file=\"" << ErrorLogger::toxml(dir.file) << "\" "
<< "linenr=\"" << dir.linenr << "\" "
// str might contain characters such as '"', '<' or '>' which
// could result in invalid XML, so run it through toxml().
<< "str=\"" << ErrorLogger::toxml(it->str) << "\"/>" << std::endl;
<< "str=\"" << ErrorLogger::toxml(dir.str) << "\"/>" << std::endl;
}
out << " </directivelist>" << std::endl;
}

View File

@ -93,7 +93,7 @@ public:
/** list of all directives met while preprocessing file */
const std::list<Directive> &getDirectives() const {
return directives;
return mDirectives;
}
std::set<std::string> getConfigs(const simplecpp::TokenList &tokens) const;
@ -210,7 +210,7 @@ private:
ErrorLogger *mErrorLogger;
/** list of all directives met while preprocessing file */
std::list<Directive> directives;
std::list<Directive> mDirectives;
std::map<std::string, simplecpp::TokenList *> tokenlists;