stubs for Data
This commit is contained in:
parent
d461bc40e2
commit
fc246671e4
5 changed files with 26 additions and 2 deletions
|
@ -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",
|
||||
|
|
|
@ -29,6 +29,7 @@ struct TestAllTypes {
|
|||
float32Field @10 : Float32;
|
||||
float64Field @11 : Float64;
|
||||
textField @12 : Text;
|
||||
dataField @13 : Data;
|
||||
# ...
|
||||
}
|
||||
|
||||
|
|
13
runtime/src/main/java/org/capnproto/Data.java
Normal file
13
runtime/src/main/java/org/capnproto/Data.java
Normal 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 {
|
||||
}
|
||||
|
||||
}
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,4 +46,8 @@ public final class PointerReader {
|
|||
return WireHelpers.readTextPointer(this.segment,
|
||||
this.pointer);
|
||||
}
|
||||
|
||||
public Data.Reader getData() {
|
||||
throw new Error("unimplemented");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue