Major refactoring: translation now takes a node and returns a translated comment if there is one.

This is to allow for situations where you need to use several nodes to create a comment, for example where there are multiple overloads for the same function but the target language doesnt support overloading: in this case we want to combine comments to explain the possible overloads.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-cherylfoil@10843 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Jamie Kirkpatrick 2008-09-12 11:20:58 +00:00
commit 01695a3128
10 changed files with 324 additions and 201 deletions

View file

@ -1,18 +1,34 @@
/* -----------------------------------------------------------------------------
* See the LICENSE file for information on copyright, usage and redistribution
* of SWIG, and the README file for authors - http://www.swig.org/release.html.
*
* JavaDocConverter.h
*
* Module to return documentation for nodes formatted for JavaDoc
* ----------------------------------------------------------------------------- */
#ifndef JAVADOCCONVERTER_H_
#define JAVADOCCONVERTER_H_
#include <list>
#include <string>
#include "swig.h"
#include "DoxygenEntity.h"
#include "DoxygenTranslator.h"
class JavaDocConverter
/*
* A class to translate doxygen comments into JavaDoc style comments.
*/
class JavaDocConverter : public DoxygenTranslator
{
public:
JavaDocConverter();
std::string convertToJavaDoc(Node *n, std::list <DoxygenEntity> entityList);
~JavaDocConverter();
void printSortedTree(std::list <DoxygenEntity> &entityList);
JavaDocConverter() : debug( true ){}
virtual bool getDocumentation(Node *node, String *&documentation);
protected:
std::string formatCommand(std::string unformattedLine, int indent);
std::string translateEntity(DoxygenEntity &doxyEntity);
std::string javaDocFormat(DoxygenEntity &doxygenEntity);
std::string translateSubtree( DoxygenEntity &doxygenEntity);
private:
bool debug;
};
#endif /*JAVADOCCONVERTER_H_*/