Copyright © 2013, Andreas Stenius
Authors: Andreas Stenius (kaos@astekk.se).
The Erlang Cap'n Proto Compiler plugin.
This module takes a CodeGeneratorRequest
message and compiles the requested schema files into Erlang header
files.
Thus, a my_schema.capnp
will be compiled to
my_schema.capnp.hrl
, implementing my_schema/N
functions for
reading and writing Cap'n Proto messages using my_schema
.
fun((root, schema_type(), message()) -> {ok, object()})
fun((root, schema_type()) -> {ok, object()})
fun((get, field_name(), object()) -> field_value())
fun((get, object()) -> (field_name() | {field_name(), field_value()}))
fun((set, field_name(), field_value(), object()) -> ok)
fun((set, {field_name(), field_value()} | field_name(), object()) -> ok)
fun((to_struct, schema_type(), object()) -> object())
fun((to_list, schema_type(), object()) -> list())
fun((to_text | to_data, object()) -> binary())
fun((schema) -> schema())
fun
is named after the basename of the schema file (refer
to the my_schema.capnp
example in the Description section).
message() = ecapnp:message()
compile_data/1 | Compile the CodeGeneratorRequest message (unpacked) in
Data . |
compile_file/1 | Read a CodeGeneratorRequest message (unpacked) from
FileName and compile it. |
compile_message/1 | Compile the CodeGeneratorRequest message. |
compile_data(Data::binary()) -> ok
Compile the CodeGeneratorRequest
message (unpacked) in
Data
.
compile_file(FileName::file:name_all()) -> ok
Read a CodeGeneratorRequest
message (unpacked) from
FileName
and compile it.
compile_message(Message::message()) -> ok
Compile the CodeGeneratorRequest
message. The Message
argument holds the raw segments data to process, no futher
processing on the message itself will be carried out prior to the
compilation step.
Generated by EDoc, May 30 2014, 12:56:29.