Exemplo n.º 1
0
 internal static KotlinFile FromProtobuf(Package c, JvmNameResolver resolver)
 {
     return(new KotlinFile {
         Functions = c.Functions?.Select(f => KotlinFunction.FromProtobuf(f, resolver)).ToList(),
         Properties = c.Properties?.Select(p => KotlinProperty.FromProtobuf(p, resolver)).ToList(),
         TypeAliases = c.TypeAlias?.Select(tp => KotlinTypeAlias.FromProtobuf(tp, resolver)).ToList(),
         TypeTable = KotlinTypeTable.FromProtobuf(c.TypeTable, resolver),
         VersionRequirementTable = KotlinVersionRequirementTable.FromProtobuf(c.VersionRequirementTable, resolver)
     });
 }
Exemplo n.º 2
0
 internal static KotlinClass FromProtobuf(Class c, JvmNameResolver resolver)
 {
     return(new KotlinClass {
         CompanionObjectName = c.CompanionObjectName > 0 ? resolver.GetString(c.CompanionObjectName) : null,
         Constructors = c.Constructors?.Select(ctor => KotlinConstructor.FromProtobuf(ctor, resolver)).ToList(),
         EnumEntries = c.EnumEntries?.Select(e => resolver.GetString(e.Name)).ToList(),
         Flags = (KotlinClassFlags)c.Flags,
         FullyQualifiedName = c.FqName > 0 ? resolver.GetString(c.FqName) : null,
         Functions = c.Functions?.Select(f => KotlinFunction.FromProtobuf(f, resolver)).ToList(),
         NestedClassNames = c.NestedClassNames?.Select(n => resolver.GetString(n)).ToList(),
         Properties = c.Properties?.Select(p => KotlinProperty.FromProtobuf(p, resolver)).ToList(),
         SealedSubclassFullyQualifiedNames = c.SealedSubclassFqNames?.Select(n => resolver.GetString(n)).ToList(),
         SuperTypeIds = c.SupertypeIds?.Select(n => resolver.GetString(n)).ToList(),
         SuperTypes = c.Supertypes?.Select(st => KotlinType.FromProtobuf(st, resolver)).ToList(),
         TypeAliases = c.TypeAlias?.Select(tp => KotlinTypeAlias.FromProtobuf(tp, resolver)).ToList(),
         TypeParameters = c.TypeParameters?.Select(tp => KotlinTypeParameter.FromProtobuf(tp, resolver)).ToList(),
         VersionRequirements = c.VersionRequirements,
         TypeTable = KotlinTypeTable.FromProtobuf(c.TypeTable, resolver),
         VersionRequirementTable = KotlinVersionRequirementTable.FromProtobuf(c.VersionRequirementTable, resolver)
     });
 }