Line data Source code
1 : use lief_ffi as ffi;
2 :
3 : use crate::common::FromFFI;
4 : use crate::dwarf::editor::types::EditorType;
5 :
6 : /// This structure represents a typedef (`DW_TAG_typedef`).
7 : pub struct Typedef {
8 : ptr: cxx::UniquePtr<ffi::DWARF_editor_TypeDef>,
9 : }
10 :
11 : impl FromFFI<ffi::DWARF_editor_TypeDef> for Typedef {
12 0 : fn from_ffi(cmd: cxx::UniquePtr<ffi::DWARF_editor_TypeDef>) -> Self {
13 0 : Self { ptr: cmd }
14 0 : }
15 : }
16 :
17 : impl EditorType for Typedef {
18 0 : fn get_base(&self) -> &ffi::DWARF_editor_Type {
19 0 : self.ptr.as_ref().unwrap().as_ref()
20 0 : }
21 : }
|