C# Class Fanx.Emit.Emitter

Emitter.
Show file Open project: xored/f4 Class Usage Examples

Public Methods

Method Description
Emitter ( ) : System

Uninitialized Emitter - must call init().

Emitter ( string assemblyName ) : System

Convenience for init().

Emitter ( string assemblyName, string stubFileName ) : System
addToMethodMap ( string className, string name, string paramTypes, MethodDef def ) : void

Add a MethodDef into the lookup table.

commit ( ) : byte[]

Commit the current definition to the PE file.

emitClass ( string baseQName, string qname, string interfaces, TypeAttr attr ) : void

Define a new class to emit for this assembly. This class becomes the 'current' class, where subsequent EmitMethod and EmitField calls will popuate this class.

emitField ( string name, string type, FieldAttr attr ) : void

Define a new field to emit for the current class.

emitMethod ( string name, string retType, string paramNames, string paramTypes, MethAttr attr, string localNames, string localTypes ) : CILInstructions

Define a new method to emit for the current class.

init ( string assemblyName ) : void

Initialize an Emitter to generate types for an assembly with the given name.

init ( string assemblyName, string stubName ) : void

Private Methods

Method Description
findField ( string qname, string fieldName, string fieldType ) : Field

Find the Field for this field on the given type.

findMethod ( string qname, string methodName, string paramTypes, string returnType ) : Method

Find the Method for this method on the given type.

findType ( string qname ) : Type

Find the Type instance for this fully qualified type name.

getMethodKey ( string qname, string methodName, string paramTypes ) : string

Return the key for this method in the method lookup table.

Method Details

Emitter() public method

Uninitialized Emitter - must call init().
public Emitter ( ) : System
return System

Emitter() public method

Convenience for init().
public Emitter ( string assemblyName ) : System
assemblyName string
return System

Emitter() public method

public Emitter ( string assemblyName, string stubFileName ) : System
assemblyName string
stubFileName string
return System

addToMethodMap() public method

Add a MethodDef into the lookup table.
public addToMethodMap ( string className, string name, string paramTypes, MethodDef def ) : void
className string
name string
paramTypes string
def PERWAPI.MethodDef
return void

commit() public method

Commit the current definition to the PE file.
public commit ( ) : byte[]
return byte[]

emitClass() public method

Define a new class to emit for this assembly. This class becomes the 'current' class, where subsequent EmitMethod and EmitField calls will popuate this class.
public emitClass ( string baseQName, string qname, string interfaces, TypeAttr attr ) : void
baseQName string
qname string
interfaces string
attr TypeAttr
return void

emitField() public method

Define a new field to emit for the current class.
public emitField ( string name, string type, FieldAttr attr ) : void
name string
type string
attr FieldAttr
return void

emitMethod() public method

Define a new method to emit for the current class.
public emitMethod ( string name, string retType, string paramNames, string paramTypes, MethAttr attr, string localNames, string localTypes ) : CILInstructions
name string
retType string
paramNames string
paramTypes string
attr MethAttr
localNames string
localTypes string
return PERWAPI.CILInstructions

init() public method

Initialize an Emitter to generate types for an assembly with the given name.
public init ( string assemblyName ) : void
assemblyName string
return void

init() public method

public init ( string assemblyName, string stubName ) : void
assemblyName string
stubName string
return void