Files
pylibbpf/src/utils/struct_parser.h
Pragyansh Chaturvedi 05d5bba4f7 Add StructParser utility
2025-10-19 22:02:19 +05:30

21 lines
447 B
C++

#ifndef PYLIBBPF_STRUCT_PARSER_H
#define PYLIBBPF_STRUCT_PARSER_H
#include <pybind11/pybind11.h>
#include <string>
#include <unordered_map>
namespace py = pybind11;
class StructParser {
private:
std::unordered_map<std::string, py::object> struct_types_;
public:
explicit StructParser(py::dict structs);
py::object parse(const std::string &struct_name, py::bytes data);
bool has_struct(const std::string &struct_name) const;
};
#endif