Class Scope

java.lang.Object
net.codecrete.windowsapi.writer.Scope

public class Scope extends Object
Manages a scope types, functions, and constants to generate.

Computes the transitive scope by adding indirectly used metadata to the initially specified scope.

  • Constructor Details

    • Scope

      public Scope(Metadata metadata, EventListener eventListener)
      Creates a new scope.
      Parameters:
      metadata - the metadata
      eventListener - an event listener to notify about events (in particular validation errors)
  • Method Details

    • hasInvalidArguments

      public boolean hasInvalidArguments()
      Indicates if some of the arguments that were set are invalid.
      Returns:
      true if arguments are invalid, false otherwise
    • addStructs

      public void addStructs(Set<String> structs)
      Adds structs and unions to this scope.

      For invalid struct names, error events are emitted. But no exception is thrown.

      Parameters:
      structs - names of structs and unions
    • addEnums

      public void addEnums(Set<String> enumerations)
      Adds enumerations to this scope.

      For invalid enumeration names, error events are emitted. But no exception is thrown.

      Parameters:
      enumerations - names of enumerations
    • addCallbackFunctions

      public void addCallbackFunctions(Set<String> callbackFunctions)
      Adds callback functions to this scope.

      For invalid callback function names, error events are emitted. But no exception is thrown.

      Parameters:
      callbackFunctions - names of callback functions
    • addComInterfaces

      public void addComInterfaces(Set<String> comInterfaces)
      Adds COM interfaces to this scope.

      For invalid COM interface names, error events are emitted. But no exception is thrown.

      Parameters:
      comInterfaces - names of COM interfaces
    • addConstants

      public void addConstants(Set<String> constants)
      Adds constants to this scope.

      For invalid constant names, error events are emitted. But no exception is thrown.

      Parameters:
      constants - names of constants
    • addFunctions

      public void addFunctions(Set<String> functions)
      Adds functions to this scope.

      For invalid function names, error events are emitted. But no exception is thrown.

      Parameters:
      functions - the functions
    • buildTransitiveScope

      public void buildTransitiveScope()
      Builds the transitive scope from the registered types and functions.

      Primitive types, pointers, type aliases, and arrays are excluded as they will not result in a Java file.