AssemblyDef

Usually one would not construct an AssemblyDef object directly either through the AssemblyDef class or with the Allocator class.   Instead the object would be constructed as part of processing in the PELib class, or when loading an external assembly's members.   But the constructor allows for giving the AssemblyDef a name, indicating whether it is external, and setting the public name token.

        AssemblyDef(std::string Name, bool External, Byte * KeyToken = nullptr) ;

It is possible to set version info for an assembly.  Usually, one wouldn't explicitly set the version except on the assembly for which code is being generated, as it would be loaded from the assembly's file.

        void SetVersion(int major, int minor, int build, int revision);

Assigning an SNK file sets strong name key signing into motion.   If the file is valid, the generated assembly will be signed.

        const std::string& SNKFile() const { return snkFile_; }

        void SNKFile(std::string file) { snkFile_ = file; }

If you have a referencer to an assembly, you can look up a class within that assembly

        Class *LookupClass(PELib &lib, std::string nameSpace, std::string name);
               
It is possible to get the custom attributes associated with an assembly, in order to examine them if necessary.   At present it is not possible to add custom attributes to a generated assembly.

        const CustomAttributeContainer &CustomAttributes() const { return customAttributes_;  }

The following function returns true if this is an external assembly (usually a loaded assembly such as mscorlib).  It returns false if it is the assembly being generated.

        virtual bool InAssemblyRef() const { return external_; }