Exemple #1
0
 public void Add(CLRTypeDefRow typeDef)
 {
     CppMangleBuilder builder = new CppMangleBuilder();
     if (typeDef.ContainerClass != null)
     {
         builder.Add(typeDef.ContainerClass);
         builder.Cycle();
     }
     builder.Add(typeDef.TypeNamespace);
     builder.Cycle();
     builder.Add(typeDef.TypeName);
     AddBytes(builder.FinishAsBytes());
 }
Exemple #2
0
 public void Add(CLRMethodSignatureInstance methodSig)
 {
     CppMangleBuilder builder = new CppMangleBuilder();
     builder.Add(methodSig.RetType);
     builder.Cycle();
     foreach (CLRMethodSignatureInstanceParam param in methodSig.ParamTypes)
     {
         builder.Add((int)param.TypeOfType);
         builder.Add(param.Type);
         builder.Cycle();
     }
     AddBytes(builder.FinishAsBytes());
 }
Exemple #3
0
 public void Add(CLRTypeSpec typeSpec)
 {
     CppMangleBuilder builder = new CppMangleBuilder();
     if (typeSpec is CLRTypeSpecClass)
     {
         CLRTypeSpecClass cls = (CLRTypeSpecClass)typeSpec;
         builder.Add("class");
         builder.Add(cls.TypeDef);
     }
     else if (typeSpec is CLRTypeSpecGenericInstantiation)
     {
         CLRTypeSpecGenericInstantiation gi = (CLRTypeSpecGenericInstantiation)typeSpec;
         builder.Add("gi");
         builder.Add(gi.GenericType);
         builder.Add(gi.ArgTypes.Length);
         foreach (CLRTypeSpec argType in gi.ArgTypes)
             builder.Add(argType);
     }
     else if (typeSpec is CLRTypeSpecVoid)
     {
         builder.Add("void");
     }
     else if (typeSpec is CLRTypeSpecSZArray)
     {
         builder.Add("szarray");
         builder.Add(((CLRTypeSpecSZArray)typeSpec).SubType);
     }
     else if (typeSpec is CLRTypeSpecComplexArray)
     {
         builder.Add("complexarray");
         CLRTypeSpecComplexArray cplxArray = (CLRTypeSpecComplexArray)typeSpec;
         builder.Add(cplxArray.SubType);
         builder.Add((int)cplxArray.Rank);
         for (uint i = 0; i < cplxArray.Rank; i++)
             builder.Add(cplxArray.LowBounds[i]);
     }
     else if (typeSpec is CLRTypeSpecVarOrMVar)
     {
         CLRTypeSpecVarOrMVar varOrMVar = (CLRTypeSpecVarOrMVar)typeSpec;
         builder.Add("varOrMVar");
         builder.Add((int)varOrMVar.ElementType);
         builder.Add((int)varOrMVar.Value);
     }
     else
         throw new ParseFailedException("Strange type spec");
     AddBytes(builder.FinishAsBytes());
 }
Exemple #4
0
 public void Add(string str)
 {
     CppMangleBuilder builder = new CppMangleBuilder();
     builder.AddBytes(System.Text.Encoding.UTF8.GetBytes(str));
     AddBytes(builder.FinishAsBytes());
 }