in scrooge-generator/src/main/scala/com/twitter/scrooge/backend/CocoaGenerator.scala [276:317]
def genList(list: ListRHS, fieldType: Option[FieldType] = None): CodeFragment =
throw new Exception("not implemented")
def genSet(set: SetRHS, fieldType: Option[FieldType]): CodeFragment =
throw new Exception("not implemented")
def genMap(map: MapRHS, fieldType: Option[FieldType] = None): CodeFragment =
throw new Exception("not implemented")
def genEnum(enum: EnumRHS, fieldType: Option[FieldType] = None): CodeFragment =
throw new Exception("not implemented")
def genStruct(struct: StructRHS, fieldType: Option[FieldType] = None): CodeFragment =
throw new Exception("not implemented")
def genUnion(struct: UnionRHS, fieldType: Option[FieldType] = None): CodeFragment =
throw new Exception("not implemented")
// For mutability/immutability support, not implemented
def genToImmutable(t: FieldType): CodeFragment = v("")
def genToImmutable(f: Field): CodeFragment = v("")
def toMutable(t: FieldType): (String, String) = ("", "")
def toMutable(f: Field): (String, String) = ("", "")
def genType(t: FunctionType, immutable: Boolean = false): CodeFragment = {
@scala.annotation.tailrec
def getCode(t: FunctionType): String = t match {
case at: AnnotatedFieldType => getCode(at.unwrap)
case Void => "void"
case OnewayVoid => "void"
case TBool => "BOOL"
case TByte => "int8_t"
case TI16 => "int16_t"
case TI32 => "int32_t"
case TI64 => "int64_t"
case TDouble => "double"
case TString => "NSString *"
case TBinary => "NSData *"
case MapType(k, v, _) => "NSDictionary *"
case SetType(x, _) => "NSSet *"
case ListType(x, _) => "NSArray *"
case n: NamedType => genID(qualifyNamedType(n).toTitleCase).toData
case r: ReferenceType =>
throw new ScroogeInternalException("ReferenceType should not appear in backend")
}
v(getCode(t))
}