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)
     });
 }
Exemple #2
0
 internal static KotlinFile FromProtobuf(Package c, JvmNameResolver resolver)
 {
     return(new KotlinFile {
         Functions = c.Functions.ToList(resolver, KotlinFunction.FromProtobuf),
         Properties = c.Properties.ToList(resolver, KotlinProperty.FromProtobuf),
         TypeAliases = c.TypeAlias.ToList(resolver, KotlinTypeAlias.FromProtobuf),
         TypeTable = KotlinTypeTable.FromProtobuf(c.TypeTable, resolver),
         VersionRequirementTable = KotlinVersionRequirementTable.FromProtobuf(c.VersionRequirementTable, resolver)
     });
 }
Exemple #3
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)
     });
 }
Exemple #4
0
 internal static KotlinClass FromProtobuf(Class c, JvmNameResolver resolver)
 {
     return(new KotlinClass {
         CompanionObjectName = c.CompanionObjectName > 0 ? resolver.GetString(c.CompanionObjectName) : null,
         Constructors = c.Constructors.ToList(resolver, KotlinConstructor.FromProtobuf),
         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.ToList(resolver, KotlinFunction.FromProtobuf),
         Inheritability = (KotlinClassInheritability)((c.Flags & 0b110000) >> 4),
         NestedClassNames = c.NestedClassNames?.Select(n => resolver.GetString(n)).ToList() ?? new List <string> (),
         ObjectType = (KotlinClassType)((c.Flags & 0b111000000) >> 6),
         Properties = c.Properties.ToList(resolver, KotlinProperty.FromProtobuf),
         SealedSubclassFullyQualifiedNames = c.SealedSubclassFqNames?.Select(n => resolver.GetString(n)).ToList(),
         SuperTypeIds = c.SupertypeIds?.Select(n => resolver.GetString(n)).ToList(),
         SuperTypes = c.Supertypes.ToList(resolver, KotlinType.FromProtobuf),
         TypeAliases = c.TypeAlias.ToList(resolver, KotlinTypeAlias.FromProtobuf),
         TypeParameters = c.TypeParameters.ToList(resolver, KotlinTypeParameter.FromProtobuf),
         VersionRequirements = c.VersionRequirements,
         TypeTable = KotlinTypeTable.FromProtobuf(c.TypeTable, resolver),
         VersionRequirementTable = KotlinVersionRequirementTable.FromProtobuf(c.VersionRequirementTable, resolver),
         Visibility = (KotlinClassVisibility)((c.Flags & 0b1110) >> 1)
     });