some cleanup
This commit is contained in:
parent
f0839b314e
commit
8cc6584d02
2 changed files with 43 additions and 41 deletions
|
@ -174,9 +174,9 @@ kj::String safeIdentifier(kj::StringPtr identifier) {
|
|||
|
||||
// =======================================================================================
|
||||
|
||||
class CapnpcCppMain {
|
||||
class CapnpcJavaMain {
|
||||
public:
|
||||
CapnpcCppMain(kj::ProcessContext& context): context(context) {}
|
||||
CapnpcJavaMain(kj::ProcessContext& context): context(context) {}
|
||||
|
||||
kj::MainFunc getMain() {
|
||||
return kj::MainBuilder(context, "Cap'n Proto loopback plugin version " VERSION,
|
||||
|
@ -270,9 +270,11 @@ private:
|
|||
return javaFullName(schemaLoader.get(type.getInterface().getTypeId()));
|
||||
|
||||
case schema::Type::LIST:
|
||||
{
|
||||
auto elemenType = type.getList().getElementType();
|
||||
// XXX
|
||||
return kj::strTree(" org.capnproto.StructList");
|
||||
|
||||
}
|
||||
case schema::Type::ANY_POINTER:
|
||||
// Not used.
|
||||
return kj::strTree();
|
||||
|
@ -1019,8 +1021,7 @@ private:
|
|||
|
||||
spaces(indent), " public final ", type, ".Reader<", elementReaderType, ">",
|
||||
" get", titleCase, "() {\n",
|
||||
spaces(indent), " return new ", type, ".Reader<",
|
||||
elementReaderType, ">(\n",
|
||||
spaces(indent), " return new ", type, ".Reader<", elementReaderType, ">(\n",
|
||||
spaces(indent), " ", elementReaderType, ".factory,\n",
|
||||
spaces(indent), " _reader.getPointerField(", offset, ").getList(",
|
||||
// XXX what about lists of non-structs?
|
||||
|
@ -1196,8 +1197,7 @@ private:
|
|||
structNode.getPointerCount();
|
||||
|
||||
return StructText {
|
||||
kj::strTree(
|
||||
" struct ", name, ";\n"),
|
||||
kj::strTree(" struct ", name, ";\n"),
|
||||
|
||||
kj::strTree(
|
||||
spaces(indent), "public static class ", name, " {\n",
|
||||
|
@ -1572,10 +1572,8 @@ private:
|
|||
kj::strTree(),
|
||||
kj::strTree(),
|
||||
kj::strTree(),
|
||||
|
||||
kj::strTree(),
|
||||
kj::strTree(),
|
||||
|
||||
kj::strTree(),
|
||||
};
|
||||
}
|
||||
|
@ -1718,4 +1716,4 @@ private:
|
|||
} // namespace
|
||||
} // namespace capnp
|
||||
|
||||
KJ_MAIN(capnp::CapnpcCppMain);
|
||||
KJ_MAIN(capnp::CapnpcJavaMain);
|
||||
|
|
|
@ -32,6 +32,10 @@ struct TestAllTypes {
|
|||
dataField @13 : Data;
|
||||
structField @14 : TestAllTypes;
|
||||
enumField @15 : TestEnum;
|
||||
interfaceField @16 : Void; # TODO
|
||||
|
||||
# voidList @17 : List(Void);
|
||||
# boolList @18 : List(Bool);
|
||||
# ...
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue