Ai
20 Star 43 Fork 13

GiteeStudio/git-analyze

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
engine.hpp 757 Bytes
一键复制 编辑 原始数据 按行查看 历史
江二十三 提交于 2019-03-27 18:06 +08:00 . When rules empty, update hook not check.
///////
#ifndef ENGINE_HPP
#define ENGINE_HPP
#include <cstdio>
#include <vector>
#include <string_view>
#include <re2/re2.h>
// https://github.com/google/re2/wiki/Syntax
class RulesEngine {
public:
RulesEngine() = default;
RulesEngine(const RulesEngine &) = delete;
RulesEngine &operator=(const RulesEngine &) = delete;
~RulesEngine() {
for (auto c : rules) {
delete c;
}
rules.clear();
}
bool AddPrefix(std::string_view path);
bool AddRegex(std::string_view rx);
bool FullMatch(std::string_view path);
bool PreInitialize(std::string_view jf, std::string_view branch);
bool Empty() const { return prefix.empty() && rules.empty(); }
private:
std::vector<std::string> prefix;
std::vector<RE2 *> rules;
};
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/oscstudio/git-analyze.git
git@gitee.com:oscstudio/git-analyze.git
oscstudio
git-analyze
git-analyze
master

搜索帮助