Added doxygen:notranslate feature, to prevent running of automatic comment translation

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13517 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dmitry Kabak 2012-08-05 14:16:57 +00:00
commit 346fdfcab7
4 changed files with 139 additions and 6 deletions

View file

@ -412,6 +412,16 @@ String *JavaDocConverter::makeDocumentation(Node *node) {
return NULL;
}
if (GetFlag(node, "feature:doxygen:notranslate")) {
String *comment = NewString("/**\n");
Append(comment, documentation);
// reformat the comment
Replaceall(comment, "\n *", "\n");
Replaceall(comment, "\n", "\n * ");
Append(comment, "\n */\n");
return comment;
}
std::list < DoxygenEntity > entityList = parser.createTree(Char(documentation), Char(Getfile(documentation)), Getline(documentation));
// entityList.sort(CompareDoxygenEntities()); sorting currently not used,

View file

@ -254,9 +254,18 @@ String *PyDocConverter::makeDocumentation(Node *n) {
documentation = getDoxygenComment(n);
if (!Swig_is_generated_overload(n) && documentation) {
currentNode = n;
std::list < DoxygenEntity > entityList = parser.createTree(Char(documentation), Char(Getfile(documentation)), Getline(documentation));
DoxygenEntity root("root", entityList);
allDocumentation.push_back(translateSubtree(root));
if (GetFlag(n, "feature:doxygen:notranslate")) {
String *comment = NewString("");
Append(comment, documentation);
Replaceall(comment, "\n *", "\n");
allDocumentation.push_back(Char(comment));
Delete(comment);
}
else {
std::list < DoxygenEntity > entityList = parser.createTree(Char(documentation), Char(Getfile(documentation)), Getline(documentation));
DoxygenEntity root("root", entityList);
allDocumentation.push_back(translateSubtree(root));
}
}
n = Getattr(n, "sym:nextSibling");
}
@ -279,9 +288,18 @@ String *PyDocConverter::makeDocumentation(Node *n) {
else {
documentation = getDoxygenComment(n);
if (documentation != NULL) {
std::list < DoxygenEntity > entityList = parser.createTree(Char(documentation), Char(Getfile(documentation)), Getline(documentation));
DoxygenEntity root("root", entityList);
pyDocString = translateSubtree(root);
if (GetFlag(n, "feature:doxygen:notranslate")) {
String *comment = NewString("");
Append(comment, documentation);
Replaceall(comment, "\n *", "\n");
pyDocString = Char(comment);
Delete(comment);
}
else {
std::list < DoxygenEntity > entityList = parser.createTree(Char(documentation), Char(Getfile(documentation)), Getline(documentation));
DoxygenEntity root("root", entityList);
pyDocString = translateSubtree(root);
}
}
}