Line data Source code
1 : use lief_ffi as ffi;
2 :
3 : use crate::common::FromFFI;
4 : use std::marker::PhantomData;
5 : use crate::dwarf::types::DwarfType;
6 :
7 : /// This structure represents a `DW_TAG_file_type`
8 : pub struct File<'a> {
9 : ptr: cxx::UniquePtr<ffi::DWARF_types_File>,
10 : _owner: PhantomData<&'a ()>,
11 : }
12 :
13 : impl FromFFI<ffi::DWARF_types_File> for File<'_> {
14 0 : fn from_ffi(ptr: cxx::UniquePtr<ffi::DWARF_types_File>) -> Self {
15 0 : Self {
16 0 : ptr,
17 0 : _owner: PhantomData,
18 0 : }
19 0 : }
20 : }
21 :
22 : impl DwarfType for File<'_> {
23 0 : fn get_base(&self) -> &ffi::DWARF_Type {
24 0 : self.ptr.as_ref().unwrap().as_ref()
25 0 : }
26 : }
|