mirror of https://github.com/WerWolv/ImHex.git
30 lines
812 B
C++
30 lines
812 B
C++
|
#pragma once
|
||
|
|
||
|
#include "test_pattern.hpp"
|
||
|
|
||
|
namespace hex::test {
|
||
|
|
||
|
class TestPatternPointers : public TestPattern {
|
||
|
public:
|
||
|
TestPatternPointers() : TestPattern("Pointers") {
|
||
|
// placementPointer
|
||
|
{
|
||
|
auto placementPointer = create<PatternDataPointer>("", "placementPointer", 0x0C, sizeof(u8));
|
||
|
auto pointedTo = create<PatternDataUnsigned>("u32", "", 0x49, sizeof(u32));
|
||
|
placementPointer->setPointedAtPattern(pointedTo);
|
||
|
addPattern(placementPointer);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
~TestPatternPointers() override = default;
|
||
|
|
||
|
[[nodiscard]]
|
||
|
std::string getSourceCode() const override {
|
||
|
return R"(
|
||
|
u32 *placementPointer : u8 @ 0x0C;
|
||
|
)";
|
||
|
}
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|