stubs for Data

This commit is contained in:
David Renshaw 2014-05-27 17:29:23 -04:00
parent d461bc40e2
commit fc246671e4
5 changed files with 26 additions and 2 deletions

View file

@ -888,6 +888,8 @@ private:
} else if (kind == FieldKind::BLOB) {
kj::String blobKind = typeBody.which() == schema::Type::TEXT ? kj::str("Text") : kj::str("Data");
return FieldText {
kj::strTree(
kj::mv(unionDiscrim.readerIsDecl),
@ -898,7 +900,7 @@ private:
spaces(indent), " public ", type, ".Reader",
" get", titleCase, "() {\n",
spaces(indent), " return _reader.getPointerField(",
offset, ").getText();\n", // XXX
offset, ").get", blobKind, " ();\n", // XXX
spaces(indent), " }\n", "\n"),
kj::strTree(
@ -911,7 +913,7 @@ private:
spaces(indent), " }\n",
spaces(indent), " public final void set", titleCase, "(", type, ".Reader value) {\n",
unionDiscrim.set,
spaces(indent), " _builder.getPointerField(", offset, ").setText(value);\n",
spaces(indent), " _builder.getPointerField(", offset, ").set", blobKind, "(value);\n",
spaces(indent), " }\n",
spaces(indent), " public final ", type, ".Builder init", titleCase, "(int size) {\n",
spaces(indent), " throw new Error();\n",

View file

@ -29,6 +29,7 @@ struct TestAllTypes {
float32Field @10 : Float32;
float64Field @11 : Float64;
textField @12 : Text;
dataField @13 : Data;
# ...
}

View file

@ -0,0 +1,13 @@
package org.capnproto;
import java.nio.ByteBuffer;
public final class Data {
public static final class Reader {
}
public static final class Builder {
}
}

View file

@ -29,4 +29,8 @@ public final class PointerBuilder {
WireHelpers.setTextPointer(this.pointer, this.segment, value);
}
public final void setData(Data.Reader value) {
throw new Error("unimplemented");
}
}

View file

@ -46,4 +46,8 @@ public final class PointerReader {
return WireHelpers.readTextPointer(this.segment,
this.pointer);
}
public Data.Reader getData() {
throw new Error("unimplemented");
}
}