protocolbuffer 0.0.0

A backend library for the implementation of a ProtocolBuffer compiler.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Protocol Buffer

This is an implementation of Google's Protocol Buffers for the D programming language. Protocol Buffer is a binary wire transfer format.

Source code generated using this library has the proto file comments transferred as documentation comments. Important accessors which do not have comments are given an empty documentation comment so generated docs will mention their existence.

Status

This is an incomplete implementation of the spec. It is expanded on an as needed basis, pull requests and bug reports welcome.

This library supports output for version 1 and version 2 of dlang, the version 1 output is compatible with both compilers, while version 2 output provides an interface more natural to the language.

  • Supports basic types (message, enum, extension)
  • Supports options: packed, deprecated and default.

Todo

  • Expose unknown options to runtime
  • Finalize on interface for D2
  • Support services
  • Support C style multi-line comments

D Interface

The source output for D is meant to feel more natural than the official compiler provides to other languages.

A message is translated into a struct and provides a static opCall to deserialize a ubyte[]. A Serialize function is provided to turn the message into a ubyte[]. And all message fields are fields of the struct wrapped in Nullable!().

D v1 Interface

The interface provided for version 1 of the language (also usable in version 2) provides a slightly different structure.

A message is translated into a class and provides a constructor to deserialize a ubyte[]. A Serialize function is provided to turn the message into a ubyte[]. And all message fields are accessors.

For repeated types use add_fieldName() to add elements.

Dependencies:
none
Versions:
0.0.0 2016-Jul-21
~master 2016-Jul-30
Show all 2 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 0 downloads total

Score:
1.6
Short URL:
protocolbuffer.dub.pm