mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
Adds a new "Import from Source..." menu item that opens a QScintilla editor dialog where users can paste C/C++ struct definitions. The parser tokenizes and parses the source using recursive descent, supporting stdint.h types, Windows types (BYTE/DWORD/PVOID/etc), multi-word C types, pointers, arrays, Vec2/3/4/Mat4x4 detection, unions (first member), padding fields, typedefs, forward declarations, static_assert size checks, and auto-detection of comment offset mode vs computed offsets. Also removes the flaky test_editor cursor shape tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
14 lines
466 B
C++
14 lines
466 B
C++
#pragma once
|
|
#include "core.h"
|
|
|
|
namespace rcx {
|
|
|
|
// Import C/C++ struct definitions from source code into a NodeTree.
|
|
// Supports two modes (auto-detected):
|
|
// 1. With comment offsets (// 0xNN) - trusts the offset values
|
|
// 2. Without comment offsets - computes offsets from type sizes
|
|
// Returns an empty NodeTree on failure; populates errorMsg if non-null.
|
|
NodeTree importFromSource(const QString& sourceCode, QString* errorMsg = nullptr);
|
|
|
|
} // namespace rcx
|