1 /*
2     SPDX-License-Identifier: GPL-2.0-or-later
3 
4     SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
5     SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
6 */
7 
8 #include "xmlcodecomment.h"
9 
XMLCodeComment(CodeDocument * doc,const QString & text)10 XMLCodeComment::XMLCodeComment (CodeDocument * doc, const QString & text)
11   : CodeComment (doc, text)
12 {
13 }
14 
~XMLCodeComment()15 XMLCodeComment::~XMLCodeComment ()
16 {
17 }
18 
toString() const19 QString XMLCodeComment::toString () const
20 {
21     QString output;
22 
23     // simple output method
24     if (getWriteOutText())
25     {
26         QString indent = getIndentationString();
27         QString endLine = getNewLineEndingChars();
28         QString body = getText();
29         output.append(indent + QLatin1String("<!-- "));
30         if (!body.isEmpty()) {
31             output.append(formatMultiLineText (body, indent, endLine));
32         }
33         output.append(indent + QLatin1String("-->") + endLine);
34     }
35 
36     return output;
37 }
38