All Implemented Interfaces:
IGenericDocument, ITextDocument, IEventSource

public class CDocument extends CodeDocument
C AST document used to render a decompiled piece of native code. These documents are provided by the INativeDecompilerUnit or generated by INativeSourceUnit.
  • Field Details

  • Constructor Details

  • Method Details

    • buildPDM

      public static void buildPDM(IPropertyDefinitionManager unitPDM)
    • dispose

      public void dispose()
      Description copied from class: AbstractTextDocument
      The default implementation does nothing.
      Specified by:
      dispose in interface IGenericDocument
      Overrides:
      dispose in class AbstractTextDocument
    • getUnit

      public IUnit getUnit()
      Description copied from interface: IGenericDocument
      If available, retrieve the unit that backs up this document.
      Returns:
      an optional unit reference (may be null)
    • getAnchorCount

      public long getAnchorCount()
      Description copied from interface: ITextDocument
      Get the range of anchor points in the document. Returning 1 means that the document returns a single part, holding the entire contents.

      Note that the anchor at "ITextDocument.getFirstAnchor() + ITextDocument.getAnchorCount()" is the "end" anchor (one after the last), and lies outside the document. It is not a valid anchor.

      Returns:
      the count/range of anchors in this document, must be greater than zero
    • getDocumentPart

      public COutputSink getDocumentPart(long anchorId, int linesAfter, int linesBefore)
      Description copied from interface: ITextDocument
      Retrieve a document part. Clients call this method to retrieve a document part starting at a specific anchor, and containing the given amount of lines after and before the anchor. It is the responsibility of the implementor to sanitize the input (eg, negative number of lines, invalid anchor, etc.) and provide appropriate response (eg, truncating). It is recommended that implementors try not to raise an exception on error. In the worst case scenario, an empty document can be returned.
      Parameters:
      anchorId - the anchor identifier
      linesAfter - hint lines count to return after the given anchor, could be more or less
      linesBefore - hint lines count to return before the given anchor, could be more or less
      Returns:
      a document part containing as many anchors as required to honor the client requests. If linesAfter is non-null, the first anchor within the document part may not be anchorId, but one anchor before that. THis method should return null if an invalid anchor was provided
    • coordinatesToAddress

      public String coordinatesToAddress(ICoordinates coordinates, AddressConversionPrecision precision)
      Description copied from interface: ITextDocument
      Convert document-specific text coordinates to a unit-specific address.

      Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.

      Specified by:
      coordinatesToAddress in interface ITextDocument
      Overrides:
      coordinatesToAddress in class AbstractTextDocument
      Parameters:
      coordinates - the coordinates
      precision - indicate the precision of the address ( AddressConversionPrecision.COARSE will return a raw address, with a faster result while AddressConversionPrecision.FINE will return a more precise address that can be a bit longer). If AddressConversionPrecision.COARSE can not be retrieved, it may return a null result, and the user will need to recall this method with another precision.
      Returns:
      the address, null on error
    • addressToCoordinates

      public ICoordinates addressToCoordinates(String address, CoordinatesConversionPrecision precision)
      Description copied from class: AbstractTextDocument
      Precision is not used - Use an exact address
      Specified by:
      addressToCoordinates in interface ITextDocument
      Overrides:
      addressToCoordinates in class AbstractTextDocument
      Parameters:
      address - a textual address
      Returns:
      the text coordinates, null on error