use of com.google.devtools.j2objc.types.Import in project j2objc by google.
the class ObjectiveCSegmentedHeaderGenerator method printTypeDeclaration.
@Override
protected void printTypeDeclaration(GeneratedType type) {
String typeName = type.getTypeName();
String code = type.getPublicDeclarationCode();
if (code.length() == 0) {
return;
}
newline();
printf("#if !defined (%s_) && (INCLUDE_ALL_%s || defined(INCLUDE_%s))\n", typeName, varPrefix, typeName);
printf("#define %s_\n", typeName);
Set<Import> forwardDeclarations = Sets.newHashSet(type.getHeaderForwardDeclarations());
for (Import imp : type.getHeaderIncludes()) {
// Verify this import isn't declared in this source file.
if (isLocalType(imp.getTypeName())) {
continue;
}
newline();
printf("#define RESTRICT_%s 1\n", getVarPrefix(imp.getImportFileName()));
printf("#define INCLUDE_%s 1\n", imp.getTypeName());
printf("#include \"%s\"\n", imp.getImportFileName());
forwardDeclarations.remove(imp);
}
printForwardDeclarations(forwardDeclarations);
print(code);
newline();
println("#endif");
}
Aggregations