Made comment output nicer, now printing _someword_ instead of _someword _
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13576 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
342bff6ec9
commit
7178385d48
2 changed files with 25 additions and 4 deletions
|
|
@ -199,8 +199,15 @@ void JavaDocConverter::translateEntity(DoxygenEntity& tag, std::string& translat
|
||||||
}
|
}
|
||||||
|
|
||||||
void JavaDocConverter::handleTagHtml(DoxygenEntity& tag, std::string& translatedComment, std::string &arg) {
|
void JavaDocConverter::handleTagHtml(DoxygenEntity& tag, std::string& translatedComment, std::string &arg) {
|
||||||
if (tag.entityList.size()) // do not include empty tags
|
if (tag.entityList.size()) { // do not include empty tags
|
||||||
translatedComment += "<" + arg + ">" + translateSubtree(tag) + "</" + arg + ">";
|
std::string tagData = translateSubtree(tag);
|
||||||
|
// wrap the thing, ignoring whitespaces
|
||||||
|
size_t wsPos = tagData.find_last_not_of("\n\t ");
|
||||||
|
if (wsPos != std::string::npos)
|
||||||
|
translatedComment += "<" + arg + ">" + tagData.substr(0, wsPos + 1) + "</" + arg + ">" + tagData.substr(wsPos + 1);
|
||||||
|
else
|
||||||
|
translatedComment += "<" + arg + ">" + translateSubtree(tag) + "</" + arg + "> ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void JavaDocConverter::handleNewLine(DoxygenEntity&, std::string& translatedComment, std::string&) {
|
void JavaDocConverter::handleNewLine(DoxygenEntity&, std::string& translatedComment, std::string&) {
|
||||||
translatedComment += "\n * ";
|
translatedComment += "\n * ";
|
||||||
|
|
@ -434,6 +441,13 @@ String *JavaDocConverter::makeDocumentation(Node *node) {
|
||||||
|
|
||||||
std::string javaDocString = "/**\n * ";
|
std::string javaDocString = "/**\n * ";
|
||||||
|
|
||||||
|
// strip endlines at the beginning
|
||||||
|
while (entityList.begin()->typeOfEntity == "plainstd::endl")
|
||||||
|
entityList.pop_front();
|
||||||
|
// and at the end
|
||||||
|
while (entityList.rbegin()->typeOfEntity == "plainstd::endl")
|
||||||
|
entityList.pop_back();
|
||||||
|
|
||||||
// store the current node
|
// store the current node
|
||||||
// (currently just to handle params)
|
// (currently just to handle params)
|
||||||
currentNode = node;
|
currentNode = node;
|
||||||
|
|
|
||||||
|
|
@ -227,8 +227,15 @@ void PyDocConverter::handleTagParam(DoxygenEntity& tag, std::string& translatedC
|
||||||
translatedComment += paramNameEntity.data + " (" + paramType + ")" + paramDescription;
|
translatedComment += paramNameEntity.data + " (" + paramType + ")" + paramDescription;
|
||||||
}
|
}
|
||||||
void PyDocConverter::handleTagWrap(DoxygenEntity& tag, std::string& translatedComment, std::string &arg) {
|
void PyDocConverter::handleTagWrap(DoxygenEntity& tag, std::string& translatedComment, std::string &arg) {
|
||||||
if (tag.entityList.size()) // do not include empty tags
|
if (tag.entityList.size()) { // do not include empty tags
|
||||||
translatedComment += arg + translateSubtree(tag) + arg;
|
std::string tagData = translateSubtree(tag);
|
||||||
|
// wrap the thing, ignoring whitespaces
|
||||||
|
int wsPos = tagData.find_last_not_of("\n\t ");
|
||||||
|
if (wsPos != std::string::npos)
|
||||||
|
translatedComment += arg + tagData.substr(0, wsPos + 1) + arg + tagData.substr(wsPos + 1);
|
||||||
|
else
|
||||||
|
translatedComment += arg + tagData + arg + " ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void PyDocConverter::handleNewLine(DoxygenEntity&, std::string& translatedComment, std::string&) {
|
void PyDocConverter::handleNewLine(DoxygenEntity&, std::string& translatedComment, std::string&) {
|
||||||
translatedComment += "\n";
|
translatedComment += "\n";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue