Package ghidra.app.util.bin.format.swift.types

# Class FieldDescriptor

java.lang.Object
ghidra.app.util.bin.format.swift.SwiftTypeMetadataStructure
ghidra.app.util.bin.format.swift.types.FieldDescriptor

All Implemented Interfaces:
  `StructConverter`

public final class FieldDescriptor extends SwiftTypeMetadataStructure
Represents a Swift FieldDescriptor structure

See Also:
  - swift/RemoteInspection/Records.h

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `SIZE`
  The size (in bytes) of a `FieldDescriptor` structure

  ### Fields inherited from class ghidra.app.util.bin.format.swift.SwiftTypeMetadataStructure

  `DATA_TYPE_CATEGORY`

  ### Fields inherited from interface ghidra.app.util.bin.StructConverter

  `ASCII, BYTE, DWORD, IBO32, IBO64, POINTER, QWORD, SLEB128, STRING, ULEB128, UTF16, UTF8, VOID, WORD`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FieldDescriptor(BinaryReader reader)`
  Creates a new `FieldDescriptor`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getDescription()`
  Gets a short description of the `SwiftTypeMetadataStructure`
  `List<FieldRecord>`
  `getFieldRecords()`
  Gets the `List` of `FieldRecord`s
  `int`
  `getFieldRecordSize()`
  Gets the field record size
  `int`
  `getKind()`
  Gets the kind
  `String`
  `getMangledTypeName()`
  Gets the mangled type name
  `int`
  `getNumFields()`
  Gets the number of fields
  `String`
  `getStructureName()`
  Gets the name of the `SwiftTypeMetadataStructure`
  `int`
  `getSuperclass()`
  Gets the superclass
  `DataType`
  `toDataType()`
  Returns a structure datatype representing the contents of the implementor of this interface.

  ### Methods inherited from class ghidra.app.util.bin.format.swift.SwiftTypeMetadataStructure

  `getBase`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### SIZE

    public static final int SIZE
    The size (in bytes) of a `FieldDescriptor` structure
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### FieldDescriptor

    public FieldDescriptor(BinaryReader reader) throws IOException
    Creates a new `FieldDescriptor`
    Parameters:
      `reader` - A `BinaryReader` positioned at the start of the structure
    Throws:
      `IOException` - if there was an IO-related problem creating the structure

- ## Method Details

  - ### getMangledTypeName

    public String getMangledTypeName()
    Gets the mangled type name
    Returns:
      The mangled type name

  - ### getSuperclass

    public int getSuperclass()
    Gets the superclass
    Returns:
      The superclass

  - ### getKind

    public int getKind()
    Gets the kind
    Returns:
      The kind

  - ### getFieldRecordSize

    public int getFieldRecordSize()
    Gets the field record size
    Returns:
      The field record size

  - ### getNumFields

    public int getNumFields()
    Gets the number of fields
    Returns:
      The number of fields

  - ### getFieldRecords

    public List<FieldRecord> getFieldRecords()
    Gets the `List` of `FieldRecord`s
    Returns:
      The `List` of `FieldRecord`s

  - ### getStructureName

    public String getStructureName()
    Description copied from class: `SwiftTypeMetadataStructure`
    Gets the name of the `SwiftTypeMetadataStructure`
    Specified by:
      `getStructureName` in class `SwiftTypeMetadataStructure`
    Returns:
      The name of the `SwiftTypeMetadataStructure`

  - ### getDescription

    public String getDescription()
    Description copied from class: `SwiftTypeMetadataStructure`
    Gets a short description of the `SwiftTypeMetadataStructure`
    Specified by:
      `getDescription` in class `SwiftTypeMetadataStructure`
    Returns:
      A short description of the `SwiftTypeMetadataStructure`

  - ### toDataType

    public DataType toDataType() throws DuplicateNameException, IOException
    Description copied from interface: `StructConverter`
    Returns a structure datatype representing the contents of the implementor of this interface.

    For example, given:

         class A {
             int foo;
             double bar;
         }

    The return value should be a structure data type with two data type components; an INT and a DOUBLE. The structure should contain field names and, if possible, field comments.

    Returns:
      returns a structure datatype representing the implementor of this interface
    Throws:
      `DuplicateNameException` - when a datatype of the same name already exists
      `IOException` - if an IO-related error occurs
    See Also:
      - `StructureDataType`