diff --git a/src/Rules.cpp b/src/Rules.cpp index c0352838..1a64677d 100644 --- a/src/Rules.cpp +++ b/src/Rules.cpp @@ -333,3 +333,13 @@ void Rules::parseRuleTag (const std::vector & 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; +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/Rules.h b/src/Rules.h index 15f9ada3..75e37dc1 100644 --- a/src/Rules.h +++ b/src/Rules.h @@ -61,6 +61,8 @@ private: void parseRuleExclusions (const std::vector &); void parseRuleTag (const std::vector &); + unsigned int getIndentation (const std::string&); + private: std::string _original_file {}; std::map _settings {};