Rules: Added ::getIndentation

This commit is contained in:
Paul Beckingham 2016-03-25 23:52:28 -04:00
parent a864ae01e2
commit 321bddba74
2 changed files with 12 additions and 0 deletions

View file

@ -333,3 +333,13 @@ void Rules::parseRuleTag (const std::vector <std::string>& lines)
}
////////////////////////////////////////////////////////////////////////////////
unsigned int Rules::getIndentation (const std::string& line)
{
auto indent = line.find_first_not_of (" ");
if (indent == std::string::npos)
indent = 0;
return indent;
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -61,6 +61,8 @@ private:
void parseRuleExclusions (const std::vector <std::string>&);
void parseRuleTag (const std::vector <std::string>&);
unsigned int getIndentation (const std::string&);
private:
std::string _original_file {};
std::map <std::string, std::string> _settings {};