Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save harrishancock/b70ca38a15d7adb63995fc625aaca7a5 to your computer and use it in GitHub Desktop.
Save harrishancock/b70ca38a15d7adb63995fc625aaca7a5 to your computer and use it in GitHub Desktop.
#include <capnp/test.capnp.h>
// ...
using ::capnproto_test::capnp::test::TestInterface
class TestCapabilityHandler: public JsonCodec::Handler<TestInterface> {
public:
void encode(const JsonCodec& codec, TestInterface::Client input,
JsonValue::Builder output) const override {
KJ_UNIMPLEMENTED("TestCapabilityHandler::encode");
}
TestInterface::Client decode(const JsonCodec& codec, JsonValue::Reader input) const override {
return nullptr;
}
};
KJ_TEST("register capability handler") {
TestCapabilityHandler handler;
JsonCodec json;
json.addTypeHandler(handler);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment