Skip to content

Instantly share code, notes, and snippets.

@harrishancock
Created May 1, 2016 17:41
Show Gist options
  • Save harrishancock/e16293723ece14910bc7e41ab2a6bdb4 to your computer and use it in GitHub Desktop.
Save harrishancock/e16293723ece14910bc7e41ab2a6bdb4 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