mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Rules: Added ::getIndentation
This commit is contained in:
parent
a864ae01e2
commit
321bddba74
2 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -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 {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue