/// Parse a COFF symbol name.
///
/// `strings` must be the string table used for symbols names.
Parse a COFF symbol name.
`strings` must be the string table used for symbols names.
Parse a COFF symbol name . ` strings ` must be the string table used for symbols names .
pub fn name<'data>(&'data self, strings: StringTable<'data>) -> Result<&'data [u8]> {
        if self.name[0] == 0 {
            // If the name starts with 0 then the last 4 bytes are a string table offset.
            let offset = u32::from_le_bytes(self.name[4..8].try_into().unwrap());
            strings
                .get(offset)
                .read_error("Invalid COFF symbol name offset")
        } else {
            // The name is inline and padded with nulls.
            Ok(match self.name.iter().position(|&x| x == 0) {
                Some(end) => &self.name[..end],
                None => &self.name[..],
            })
        }
    }
pub fn name < ' data > ( & ' data self , strings : StringTable < ' data > ) -> Result < & ' data [ u8 ] > { if self . name [ 0 ] == 0 { // If the name starts with 0 then the last 4 bytes are a string table offset. let offset = u32 :: from_le_bytes ( self . name [ 4 .. 8 ] . try_into ( ) . unwrap ( ) ) ; strings . get ( offset ) . read_error ( " " ) } else { // The name is inline and padded with nulls. Ok ( match self . name . iter ( ) . position ( | & x | x == 0 ) { Some ( end ) => & self . name [ .. end ] , None => & self . name [ .. ] , } ) } }
Parse a COFF symbol name.
Parse a COFF symbol name .
&'data self
strings
StringTable<'data>