Simple .gitignore pattern matcher. More...
#include <file_browser.h>
Classes | |
| struct | Pattern |
Public Member Functions | |
| void | LoadFromFile (const std::string &gitignore_path) |
| void | AddPattern (const std::string &pattern) |
| bool | IsIgnored (const std::string &path, bool is_directory) const |
| void | Clear () |
Private Member Functions | |
| bool | MatchPattern (const std::string &path, const Pattern &pattern) const |
| bool | MatchGlob (const std::string &text, const std::string &pattern) const |
Private Attributes | |
| std::vector< Pattern > | patterns_ |
Simple .gitignore pattern matcher.
Supports basic gitignore patterns:
Definition at line 51 of file file_browser.h.
| void yaze::editor::GitignoreParser::LoadFromFile | ( | const std::string & | gitignore_path | ) |
Definition at line 23 of file file_browser.cc.
References AddPattern().
Referenced by yaze::editor::FileBrowser::SetRootPath().

| void yaze::editor::GitignoreParser::AddPattern | ( | const std::string & | pattern | ) |
Definition at line 50 of file file_browser.cc.
References yaze::editor::GitignoreParser::Pattern::directory_only, yaze::editor::GitignoreParser::Pattern::is_negation, yaze::editor::GitignoreParser::Pattern::pattern, and patterns_.
Referenced by LoadFromFile(), and yaze::editor::FileBrowser::SetRootPath().
| bool yaze::editor::GitignoreParser::IsIgnored | ( | const std::string & | path, |
| bool | is_directory ) const |
Definition at line 74 of file file_browser.cc.
References MatchPattern(), and patterns_.
Referenced by yaze::editor::FileBrowser::ScanDirectory().

| void yaze::editor::GitignoreParser::Clear | ( | ) |
Definition at line 96 of file file_browser.cc.
References patterns_.
Referenced by yaze::editor::FileBrowser::SetRootPath().
|
private |
Definition at line 98 of file file_browser.cc.
References MatchGlob(), and yaze::editor::GitignoreParser::Pattern::pattern.
Referenced by IsIgnored().

|
private |
Definition at line 103 of file file_browser.cc.
Referenced by MatchPattern().
|
private |
Definition at line 65 of file file_browser.h.
Referenced by AddPattern(), Clear(), and IsIgnored().