Class Metadata
java.lang.Object
net.codecrete.windowsapi.metadata.Metadata
Windows API metadata.
An instance of this class contains the entire Windows API metadata.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a method to this metadata.voidAdds a type to this metadata.Gets all constants.createNamespace(String name) Creates a new namespace with the given name.findComInterfaces(Set<String> names) Finds the COM interfaces with the given names.findConstants(Set<String> names) Finds the constants with the given names.findDelegates(Set<String> names) Finds the delegates with the given names.Finds the enums with the given names.findEnumWithMember(String memberName) Finds enumerations containing a member with the given name.findFunctions(Set<String> names) Finds the functions with the given names.findStructs(Set<String> names) Finds the structs with the given names.getEnumType(String name) Gets the enumeration type with the given namegetOrCreateNamespace(String name) Gets the namespace with the given name or creates it if it does not yet exist.getPrimitive(PrimitiveKind kind) Gets the primitive type for the given kind.Gets the type with the specified name.getTypeByTypeDefIndex(int typeDefIndex) Gets the type with the specifiedTypeDefindex.makeAliasFor(int typeDefIndex, String name, Namespace namespace) Creates an alias for the specifiedTypeDefindex.makePointerFor(Type type) Creates a pointer referencing the specified type.methods()Gets all methods.Gets a map of all namespaces.voidremoveType(Type type, boolean nameExists) Removes a type from this metadata.types()Gets all types.
-
Constructor Details
-
Metadata
public Metadata()Creates a new instance.
-
-
Method Details
-
namespaces
-
createNamespace
-
getOrCreateNamespace
-
types
-
getEnumType
Gets the enumeration type with the given name- Parameters:
name- the enumeration name- Returns:
- the enumeration type
- Throws:
NoSuchElementException- thrown if the enumeration type does not exist
-
getType
-
getPrimitive
Gets the primitive type for the given kind.- Parameters:
kind- the primitive type kind- Returns:
- the primitive
-
getTypeByTypeDefIndex
Gets the type with the specifiedTypeDefindex.- Parameters:
typeDefIndex- theTypeDefindex- Returns:
- the type, or
nullif it is not found
-
addType
Adds a type to this metadata.- Parameters:
type- the typenameIsUnique- iftrue, checks that the type does not exist yet
-
removeType
Removes a type from this metadata.- Parameters:
type- the typenameExists- iftrue, checks that the type actually exists
-
methods
-
addMethod
Adds a method to this metadata.- Parameters:
method- the method
-
constants
-
makePointerFor
-
makeAliasFor
Creates an alias for the specifiedTypeDefindex.It will reuse an exising alias type if available.
- Parameters:
typeDefIndex- theTypeDefindex of the aliasname- the alias namenamespace- the alias namespace- Returns:
- the alias
-
findStructs
-
findEnums
-
findEnumWithMember
-
findDelegates
-
findComInterfaces
-
findFunctions
Finds the functions with the given names.The names are without the namespace, they are case-sensitive, and they are compared to the native Windows name. If a name is not found, it is ignored.
- Parameters:
names- the set of names- Returns:
- the found functions (as a list)
-
findConstants
Finds the constants with the given names.The names are without the namespace, and they are case-sensitive. If a name is not found, it is ignored.
- Parameters:
names- set of names- Returns:
- the found constants (as a list)
-