/** * @return QString */ QString JavaCodeDocumentation::toString ( ) { QString output = ""; // simple output method if(getWriteOutText()) { bool useDoubleDashOutput = true; // need to figure out output type from java policy CodeGenerationPolicy *p = UMLApp::app()->getCommonPolicy(); if(p->getCommentStyle() == CodeGenerationPolicy::MultiLine) useDoubleDashOutput = false; QString indent = getIndentationString(); QString endLine = getNewLineEndingChars(); QString body = getText(); if(useDoubleDashOutput) { if(!body.isEmpty()) output.append(formatMultiLineText (body, indent +"// ", endLine)); } else { output.append(indent+"/**"+endLine); output.append(formatMultiLineText (body, indent +" * ", endLine)); output.append(indent+" */"+endLine); } } return output; }
QString DCodeDocumentation::toString() const { QString output; // simple output method if(getWriteOutText()) { bool useDoubleDashOutput = true; // need to figure out output type from d policy CodeGenerationPolicy * p = UMLApp::app()->commonPolicy(); if(p->getCommentStyle() == CodeGenerationPolicy::MultiLine) useDoubleDashOutput = false; QString indent = getIndentationString(); QString endLine = getNewLineEndingChars(); QString body = getText(); if(useDoubleDashOutput) { if(!body.isEmpty()) { output += (formatMultiLineText (body, indent + QLatin1String("// "), endLine)); } } else { output += indent + QLatin1String("/**") + endLine; output += formatMultiLineText (body, indent + QLatin1String(" * "), endLine); output += indent + QLatin1String(" */") + endLine; } } return output; }
/** * Return the text in the right format. Returned string is empty * if m_writeOutText is false. * @return QString */ QString TextBlock::toString() const { // simple output method if (m_writeOutText && !m_text.isEmpty()) { QString endLine = UMLApp::app()->commonPolicy()->getNewLineEndingChars(); return formatMultiLineText(m_text, getIndentationString(), endLine); } else { return QString(); } }
QString DCodeComment::toString () const { QString output; // simple output method if(getWriteOutText()) { QString indent = getIndentationString(); QString endLine = getNewLineEndingChars(); QString body = getText(); // check the need for multiline comments if (body.indexOf(QRegExp(endLine)) >= 0) { output += indent + QLatin1String("/**") + endLine; output += formatMultiLineText (body, indent + QLatin1String(" * "), endLine); output += indent + QLatin1String(" */") + endLine; } else { output += formatMultiLineText (body, indent + QLatin1String("// "), endLine); } } return output; }
/** * @return QString */ QString CPPCodeComment::toString ( ) { QString output = ""; // simple output method if(getWriteOutText()) { QString indent = getIndentationString(); QString endLine = getNewLineEndingChars(); output.append(formatMultiLineText (getText()+endLine, indent +"// ", endLine)); } return output; }