Menu

Home

TimoM

Proto2cpp is a Python script intended to be used as a Doxygen filter for Google Protocol Buffers files (.proto).
The script is released under GNU Lesser General Public License version 2.1.

How to enable this filter in Doxygen:

  1. Generate Doxygen configuration file with command doxygen -g <filename>
    • e.g. doxygen -g doxyfile
  2. In the Doxygen configuration file, find JAVADOC_AUTOBRIEF and set it enabled (this is required since version 0.6-beta)
    • JAVADOC_AUTOBRIEF = YES
  3. In the Doxygen configuration file, find FILE_PATTERNS and add *.proto
    • FILE_PATTERNS = *.proto
  4. In the Doxygen configuration file, find EXTENSION_MAPPING and add proto=C
    • EXTENSION_MAPPING = proto=C
  5. In the Doxygen configuration file, find INPUT_FILTER and add proto2cpp.py script
    • INPUT_FILTER = "python proto2cpp.py"
  6. Run Doxygen with the modified configuration
    • doxygen doxyfile

If Doxygen output for the script itself is wanted, FULL_PATH_NAMES in the Doxygen configuration should have value YES since the script will skip the files named proto2cpp.py.

The tarball available as well as Code section contains the filter (proto2cpp.py), an example .proto file, an example Doxygen configuration file, and a copy of GNU Lesser General Public License version 2.1.

The script has been tested on the following environments:

  • Ubuntu Desktop 12.04 LTS (32 bit)

    • Doxygen version 1.8.1.1
    • Python version 2.7.3
  • Debian 6.0.4-i386

    • Doxygen version 1.8.1.1
    • Python version 2.6.6
  • Ubuntu Desktop 12.10 (32 bit)

    • Doxygen version 1.8.1.2
    • Python version 2.7.3
  • Windows 7 Home Premium (64 bit)

    • Doxygen version 1.8.3.1
    • Python version 3.3.1 (64 bit)
  • Windows 7 Home Premium (64 bit)

    • Doxygen version 1.8.6
    • Python version 3.3.1 (64 bit)
  • Windows 7 Home Premium (64 bit)

    • Doxygen version 1.8.7
    • Python version 3.3.1 (64 bit)
  • Windows 7 Home Premium (64 bit)

    • Doxygen version 1.8.8
    • Python version 3.3.1 (64 bit)
  • Windows 7 Home Premium (64 bit)

    • Doxygen version 1.8.9
    • Python version 3.3.1 (64 bit)
  • Windows 7 Home Premium (64 bit)

    • Doxygen version 1.8.9.1
    • Python version 3.3.1 (64 bit)
  • Windows 7 Home Premium (64 bit)

    • Doxygen version 1.8.10
    • Python version 3.3.1 (64 bit)
  • Ubuntu 10.04 LTS (32 bit)

    • Doxygen version 1.8.10
    • Python version 2.6.5

Project Admins:


Discussion

  • FlorianWolters

    FlorianWolters - 2015-04-23

    I can't get the example provided in the download file to work with Doxygen v1.8.9.1 and proto2cpp v0.5-beta. If i open the file html/index.html I can not see any documentation. I've enabled logging and pasted the output of the generated proto2cpp.log file here. Did something change regarding input filtering in Doxygen? Do you know how-to fix it? It's working with v1.8.1.1 for me, as stated.

     

    Last edit: FlorianWolters 2015-04-23
    • TimoM

      TimoM - 2015-04-26

      Hi,
      Thanks for your feedback.
      Indeed it seems that the filter doesn't work with Doxygen v1.8.9.1. Unfortunately I don't have a quick-fix to provide, I'll have to take a deeper look at what has changed in Doxygen.

       
      • TimoM

        TimoM - 2015-09-06

        Forgot to reply to this discussion that a resolution to the problem was found and I fixed the instructions in Wiki page. Apparently there was a change in Doxygen's internal behaviour in v1.8.8 - since then one needs to add
        EXTENSION_MAPPING = proto=C
        That way Doxygen will use C language parser for .proto files and combined with this filter the files get proper Doxygen output.

         

Log in to post a comment.