• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

2 Appendix (examples)
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • Google's Protocol Buffers Library
        • Appendix (examples)
          • Example directories
          • Example: A Simple XML Like Structure
          • Example: Vectors of Numbers
          • Example: Heterogeneous Collections

2.1 Example directories

The examples are in‘/usr/share/swi-prolog/doc/packages/examples/protobufs`, which is part of the swi-prolog-doc package. Each directory has a README. To run these, you will need to copy them to a writeable directory.

  • bootstrap - This contains the file common.mk file, which is used by the demo and interop Makefiles.
  • demo - the test goal runs some examples.
  • interop - used for testing interoperability with C++ and Python Additional tests are in test\_protobufs.pl.

    See also Addressbook example (section 1.3.3).

    The protobuf compiler (protoc) uses two protobuf formats to communicate with the plugin:

  • plugin.proto
  • descriptor.proto The Prolog code that were generated from these, as part of the bootstrap process, are:
  • plugin\_pb.pl
  • descriptor\_pb.pl

ClioPatria (version V3.1.1-51-ga0b30a5)