package ocaml-protoc
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=88533848ee8ad662bfb063f34932286405977fa3810515b997119b06f05105e4
sha512=df12c71f7181eafc94cd0fc400edf7f258cdd3740a5badafce097f771b7828fed9a9a9c0a457e7e118848a8b1ddd87fe3134a5bdf88d4adcb0d0e04ba6808c5f
doc/ocaml-protoc.compiler-lib/Ocaml_protoc_compiler_lib/Pb_codegen_util/index.html
Module Ocaml_protoc_compiler_lib.Pb_codegen_util
Common utility functions for OCaml code generation
val sp : ('a, unit, string) format -> 'asp x same as sprintf but prefixed with new line
let_decl_of_and and_ returns the function declaration "let" (when ?and_ is None), "and" otherwise.
val string_of_record_field_type :
with_option:bool ->
?module_prefix:string ->
Pb_codegen_ocaml_type.record_field_type ->
stringType of the field.
val string_of_basic_type :
?for_pp:bool ->
Pb_codegen_ocaml_type.basic_type ->
stringval string_of_field_type :
?for_pp:bool ->
?module_prefix:string ->
Pb_codegen_ocaml_type.field_type ->
stringval function_name_of_user_defined :
function_prefix:string ->
Pb_codegen_ocaml_type.user_defined_type ->
stringfunction_name_of_user_defined prefix user_defined returns the function name of the form `(module'.'?)<prefix>_(type_name)`.
This pattern is common since a generated function for a type (encode/decode/to_string) will call the same generated function for each user defined field type.
val module_type_name_of_service_client :
Pb_codegen_ocaml_type.service ->
stringName of the module type for this service (client)
val module_type_name_of_service_server :
Pb_codegen_ocaml_type.service ->
stringName of the module type for this service (server)
val function_name_of_rpc : Pb_codegen_ocaml_type.rpc -> stringName of the function for this RPC
caml_file_name_of_proto_file_name filename returns the OCaml file name from the protobuf file name
val string_of_payload_kind :
?capitalize:unit ->
Pb_codegen_ocaml_type.payload_kind ->
bool ->
stringstring_of_payload_kind ~capitalize:() payload_kind packed will return the string corresponding to the payload kind.
this function transforms a `lower_case_like_this` into an camlCaseLikeThis
this function transform an OCaml constructuror `Like_this` into a 'likeThis' case
val collect_modules_of_types : Pb_codegen_ocaml_type.type_ list -> string listcollect_modules_of_types ocaml_types return the list of all the modules that the ocaml_types depends on
Emit code for record._presence[idx] <- true