-
Notifications
You must be signed in to change notification settings - Fork 5
/
rule.h
33 lines (25 loc) · 791 Bytes
/
rule.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// Created by Vavaldi on 14-8-2021.
//
#ifndef FIRSTPROJECT_RULE_H
#define FIRSTPROJECT_RULE_H
#include <string>
#include <functional>
#include <algorithm>
class Rule {
public:
char rule;
std::string rule_value_1;
std::string rule_value_2;
std::function<void(std::string &)> rule_processor;
bool invalid_rule;
Rule(char input_rule, const std::string &input_rule_value_1, const std::string &input_rule_value_2);
std::string print(int output_channel=0, bool hashcat_output = false);
void process(std::string& plaintext);
std::function<void(std::string&)> build_rule_processor();
bool operator==(const Rule& rhs) const;
static int rule_identify(char);
private:
[[nodiscard]] bool validate_rule() const;
};
#endif //FIRSTPROJECT_RULE_H