Created
May 1, 2016 17:34
-
-
Save harrishancock/a850274d3c99aa7219107b631345e889 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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