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

# Class TargetProtocolDescriptor

java.lang.Object
ghidra.app.util.bin.format.swift.types.TargetContextDescriptor
ghidra.app.util.bin.format.swift.types.TargetProtocolDescriptor

All Implemented Interfaces:
  `SwiftStructure`, `StructConverter`

public final class TargetProtocolDescriptor extends TargetContextDescriptor
Represents a Swift TargetProtocolDescriptor structure

See Also:
  - swift/ABI/Metadata.h

- ## Field Summary

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

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

  ### Fields inherited from interface ghidra.app.util.bin.format.swift.SwiftStructure

  `DATA_TYPE_CATEGORY`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getAssociatedTypeNames()`
  Gets the associated type names
  `String`
  `getDescription()`
  Gets a short description of the `SwiftStructure`
  `String`
  `getName()`
  Gets the name of the protocol
  `int`
  `getNumRequirements()`
  Gets the number of requirements in the protocol
  `int`
  `getNumRequirementsInSignature()`
  Gets the number of generic requirements in the requirement signature of the protocol
  `String`
  `getStructureName()`
  Gets the name of the `SwiftStructure`
  `DataType`
  `toDataType()`
  Returns a structure datatype representing the contents of the implementor of this interface.
  `String`
  `toString()`

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

  `getFlags, getParent`

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

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

- ## Constructor Details

  - ### TargetProtocolDescriptor

    public TargetProtocolDescriptor(BinaryReader reader) throws IOException
    Creates a new `TargetProtocolDescriptor`
    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

  - ### getName

    public String getName()
    Gets the name of the protocol
    Returns:
      The name of the protocol

  - ### getNumRequirementsInSignature

    public int getNumRequirementsInSignature()
    Gets the number of generic requirements in the requirement signature of the protocol
    Returns:
      The number of generic requirements in the requirement signature of the protocol

  - ### getNumRequirements

    public int getNumRequirements()
    Gets the number of requirements in the protocol
    Returns:
      The number of requirements in the protocol

  - ### getAssociatedTypeNames

    public int getAssociatedTypeNames()
    Gets the associated type names
    Returns:
      The associated type names

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getStructureName

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

  - ### getDescription

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

  - ### 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.

    Specified by:
      `toDataType` in interface `StructConverter`
    Overrides:
      `toDataType` in class `TargetContextDescriptor`
    Returns:
      returns a structure datatype representing the implementor of this interface
    Throws:
      `DuplicateNameException` - when a datatype of the same name already exists
      `IOException`
    See Also:
      - `StructureDataType`