/* ----------------------------------------------------------------------------- * This file is part of SWIG, which is licensed as a whole under version 3 * (or any later version) of the GNU General Public License. Some additional * terms also apply to certain portions of SWIG. The full details of the SWIG * license and copyrights can be found in the LICENSE and COPYRIGHT files * included with the SWIG source code as distributed by the SWIG developers * and at https://www.swig.org/legal.html. * * javadoc.h * * Module to return documentation for nodes formatted for JavaDoc * ----------------------------------------------------------------------------- */ #ifndef SWIG_JAVADOC_H #define SWIG_JAVADOC_H #include "doxytranslator.h" #include /* * A class to translate doxygen comments into JavaDoc style comments. */ class JavaDocConverter : public DoxygenTranslator { public: JavaDocConverter(int flags = 0); String *makeDocumentation(Node *node); protected: /* * Used to properly format JavaDoc-style command */ std::string formatCommand(std::string unformattedLine, int indent); /* * Translate every entity in a tree. */ std::string translateSubtree(DoxygenEntity &doxygenEntity); /* * Translate one entity with the appropriate handler, according * to the tagHandlers */ void translateEntity(DoxygenEntity &tag, std::string &translatedComment); /* * Fix all endlines location, etc */ int shiftEndlinesUpTree(DoxygenEntity &root, int level = 0); /* * Convert params in link-objects and references */ std::string convertLink(std::string linkObject); /* * Typedef for the function that handles one tag * arg - some string argument to easily pass it through lookup table */ typedef void (JavaDocConverter::*tagHandler) (DoxygenEntity &tag, std::string &translatedComment, std::string &arg); /** * Copies verbatim args of the tag to output, used for commands like \f$, ... */ void handleTagVerbatim(DoxygenEntity &tag, std::string &translatedComment, std::string &arg); /** Creates anchor link. */ void handleTagAnchor(DoxygenEntity &tag, std::string &translatedComment, std::string &arg); /* * Wrap the command data with the html tag * arg - html tag, with no braces */ void handleTagHtml(DoxygenEntity &tag, std::string &translatedComment, std::string &arg); /* Handles HTML tags recognized by Doxygen, like ,