80 QString LinguistGenerator::format() |
80 QString LinguistGenerator::format() |
81 { |
81 { |
82 return "Linguist"; |
82 return "Linguist"; |
83 } |
83 } |
84 |
84 |
85 QString LinguistGenerator::fileExtension(const Node * /* node */) |
85 QString LinguistGenerator::fileExtension(const Node * /* node */) const |
86 { |
86 { |
87 return "ts"; |
87 return "ts"; |
88 } |
88 } |
89 |
89 |
90 void LinguistGenerator::generateClassLikeNode(const InnerNode *inner, CodeMarker *marker) |
90 void LinguistGenerator::generateClassLikeNode(const InnerNode *inner, CodeMarker *marker) |
91 { |
91 { |
92 out().setCodec("utf-8"); |
92 out().setCodec("UTF-8"); |
93 |
93 |
94 QDomDocument document("TS"); |
94 QDomDocument document("TS"); |
95 QDomElement documentElement = document.createElement("TS"); |
95 QDomElement documentElement = document.createElement("TS"); |
96 documentElement.setAttribute("version", "1.1"); |
96 documentElement.setAttribute("version", "1.1"); |
97 |
97 |
98 QList<QDomElement> contextElements = generateIndexSections(document, inner, marker); |
98 QList<QDomElement> contextElements = generateIndexSections(document, inner, marker); |
99 foreach (const QDomElement &element, contextElements) |
99 foreach (const QDomElement &element, contextElements) |
100 documentElement.appendChild(element); |
100 documentElement.appendChild(element); |
101 |
101 |
102 QDomProcessingInstruction process = document.createProcessingInstruction( |
102 QDomProcessingInstruction process = document.createProcessingInstruction( |
103 "xml", QString("version=\"1.0\" encoding=\"%1\"").arg("utf-8")); |
103 "xml", QString("version=\"1.0\" encoding=\"%1\"").arg("UTF-8")); |
104 document.appendChild(process); |
104 document.appendChild(process); |
105 document.appendChild(documentElement); |
105 document.appendChild(documentElement); |
106 |
106 |
107 out() << document; |
107 out() << document; |
108 out().flush(); |
108 out().flush(); |