-
-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathpattern_padding.hpp
More file actions
49 lines (36 loc) · 1.4 KB
/
pattern_padding.hpp
File metadata and controls
49 lines (36 loc) · 1.4 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include <pl/patterns/pattern.hpp>
namespace pl::ptrn {
class PatternPadding : public Pattern {
public:
PatternPadding(core::Evaluator *evaluator, u64 offset, size_t size, u32 line) : Pattern(evaluator, offset, size, line) { }
[[nodiscard]] std::shared_ptr<Pattern> clone() const override {
return std::shared_ptr<Pattern>(new PatternPadding(*this));
}
[[nodiscard]] std::string getFormattedName() const override {
return "";
}
[[nodiscard]] std::vector<std::pair<u64, Pattern*>> getChildren() override {
return { };
}
[[nodiscard]] bool operator==(const Pattern &other) const override { return compareCommonProperties<decltype(*this)>(other); }
void accept(PatternVisitor &v) override {
v.visit(*this);
}
std::string formatDisplayValue() override {
return "";
}
[[nodiscard]] std::string toString() override {
auto result = [this]{
if (this->getSize() == 0)
return std::string("null");
else
return fmt::format("padding[{}]", this->getSize());
}();
return Pattern::callUserFormatFunc(this->getValue(), true).value_or(result);
}
std::vector<u8> getRawBytes() override {
return { };
}
};
}