static QString encode(const QString &string)
{
-#if 0
- QString result = string;
-
- for (int i = string.size() - 1; i >= 0; --i) {
- uint ch = string.at(i).unicode();
- if (ch > 0xFF)
- ch = '?';
- if ((ch - '0') >= 10 && (ch - 'a') >= 26 && (ch - 'A') >= 26
- && ch != '/' && ch != '(' && ch != ')' && ch != ',' && ch != '*'
- && ch != '&' && ch != '_' && ch != '<' && ch != '>' && ch != ':'
- && ch != '~')
- result.replace(i, 1, QString("%") + QString("%1").arg(ch, 2, 16));
- }
- return result;
-#else
return string;
-#endif
}
QStringList CodeMarker::macRefsForNode(Node *node)
case Node::Class:
{
const ClassNode *classe = static_cast<const ClassNode *>(node);
-#if 0
- if (!classe->templateStuff().isEmpty()) {
- result += QLatin1String("tmplt/");
- }
- else
-#endif
{
result += QLatin1String("cl/");
}
if (func->metaness() == FunctionNode::MacroWithParams
|| func->metaness() == FunctionNode::MacroWithoutParams) {
result += QLatin1String("macro/");
-#if 0
- }
- else if (!func->templateStuff().isEmpty()) {
- result += QLatin1String("ftmplt/");
-#endif
}
else if (func->isStatic()) {
result += QLatin1String("clm/");
result += macName(func);
if (result.endsWith(QLatin1String("()")))
result.chop(2);
-#if 0
- // this code is too clever for the Xcode documentation
- // browser and/or pbhelpindexer
- if (!isMacro) {
- result += QLatin1Char('/') + QLatin1String(QMetaObject::normalizedSignature(func->returnType().toLatin1().constData())) + "/(";
- const QList<Parameter> ¶ms = func->parameters();
- for (int i = 0; i < params.count(); ++i) {
- QString type = params.at(i).leftType() +
- params.at(i).rightType();
- type = QLatin1String(QMetaObject::normalizedSignature(type.toLatin1().constData()));
- if (i != 0)
- result += QLatin1Char(',');
- result += type;
- }
- result += QLatin1Char(')');
- }
-#endif
}
break;
case Node::Variable:
QMap<QString, QString>::const_iterator i = name2guidMap.constFind(text);
if (i != name2guidMap.constEnd())
return i.value();
-#if 0
- QString t = QUuid::createUuid().toString();
- QString guid = "id-" + t.mid(1,t.length()-2);
-#endif
QString guid = Node::cleanId(text);
name2guidMap.insert(text,guid);
return guid;
GuidMap::const_iterator i = gm->constFind(text);
if (i != gm->constEnd())
return i.value();
-#if 0
- QString t = QUuid::createUuid().toString();
- QString guid = "id-" + t.mid(1,t.length()-2);
-#endif
QString guid = Node::cleanId(text);
gm->insert(text,guid);
return guid;
static bool in_para = false;
QString guid, hc, attr;
-#if 0
- // Leave this here for debugging.
- if (outFileName() == "modules.dita") {
- QString comment = "ATOM:" + atom->typeString();
- xmlWriter().writeComment(comment);
- }
-#endif
switch (atom->type()) {
case Atom::AbstractLeft:
break;
}
break;
case Atom::SectionLeft:
-#if 0
- if (inApiDesc) {
- writeEndTag(); // </apiDesc>
- inApiDesc = false;
- }
-#endif
enterSection("details",QString());
- //writeGuidAttribute(Doc::canonicalTitle(Text::sectionHeading(atom).toString()));
break;
case Atom::SectionRight:
leaveSection();
writeEndTag(); // <cxxClassDefinition>
enterDesc(DT_apiDesc,QString(),title);
-#if 0
- // To be removed, if really not needed.
- Text brief = nsn->doc().briefText(); // zzz
- if (!brief.isEmpty()) {
- writeStartTag(DT_p);
- generateText(brief, nsn, marker);
- writeEndTag(); // </p>
- }
-#endif
generateStatus(nsn, marker);
generateThreadSafeness(nsn, marker);
generateSince(nsn, marker);
writeEndTag(); // <cxxClassDefinition>
enterDesc(DT_apiDesc,QString(),title);
-#if 0
- // To be removed, if really not needed.
- Text brief = cn->doc().briefText(); // zzz
- if (!brief.isEmpty()) {
- writeStartTag(DT_p);
- generateText(brief, cn, marker);
- writeEndTag(); // </p>
- }
-#endif
generateStatus(cn, marker);
generateInherits(cn, marker);
generateInheritedBy(cn, marker);
writeStartTag(DT_cxxClassDetail);
enterDesc(DT_apiDesc,QString(),title);
-#if 0
- // To be removed, if really not needed.
- Text brief = fn->doc().briefText(); // zzz
- if (!brief.isEmpty()) {
- writeStartTag(DT_p);
- generateText(brief, fn, marker);
- writeEndTag(); // </p>
- }
-#endif
generateStatus(fn, marker);
generateThreadSafeness(fn, marker);
generateSince(fn, marker);
generateQmlSince(qcn);
enterDesc(DT_apiDesc,QString(),title);
-#if 0
- // To be removed, if really not needed.
- Text brief = qcn->doc().briefText(); // zzz
- if (!brief.isEmpty()) {
- writeStartTag(DT_p);
- generateText(brief, qcn, marker);
- writeEndTag(); // </p>
- }
-#endif
enterSection(QString(), QString());
generateBody(qcn, marker);
if (cn) {
QChar common(idx);
commonPrefix = common;
commonPrefixLen = 1;
-
-#if 0
- /*
- The algorithm below eventually failed, so it was replaced
- with the simple (perhaps too simple) algorithm above.
-
- The caller didn't pass in a common prefix, so get the common
- prefix by looking at the class names of the first and last
- classes in the class map. Discard any namespace names and
- just use the bare class names. For Qt, the prefix is "Q".
-
- Note that the algorithm used here to derive the common prefix
- from the first and last classes in alphabetical order (QAccel
- and QXtWidget in Qt 2.1), fails if either class name does not
- begin with Q.
- */
- QString first;
- QString last;
- NodeMap::const_iterator iter = classMap.constBegin();
- while (iter != classMap.constEnd()) {
- if (!iter.key().contains("::")) {
- first = iter.key();
- break;
- }
- ++iter;
- }
-
- if (first.isEmpty())
- first = classMap.constBegin().key();
-
- iter = classMap.constEnd();
- while (iter != classMap.constBegin()) {
- --iter;
- if (!iter.key().contains("::")) {
- last = iter.key();
- break;
- }
- }
-
- if (last.isEmpty())
- last = classMap.constBegin().key();
-
- if (classMap.size() > 1) {
- while (commonPrefixLen < first.length() + 1 &&
- commonPrefixLen < last.length() + 1 &&
- first[commonPrefixLen] == last[commonPrefixLen])
- ++commonPrefixLen;
- }
-
- commonPrefix = first.left(commonPrefixLen);
-#endif
}
/*
}
marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])</@param>"),
"<i>\\1<sub>\\2</sub></i>");
-#if 0
- marked.replace("<@param>", "<i>");
- marked.replace("</@param>", "</i>");
-
- marked.replace("<@extra>", "<tt>");
- marked.replace("</@extra>", "</tt>");
-#endif
if (summary) {
marked.remove("<@type>");
marked.remove("</@type>");
}
marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])</@param>"),
"<i> \\1<sub>\\2</sub></i>");
-#if 0
- marked.replace("<@param>","<i>");
- marked.replace("</@param>","</i>");
-#endif
if (style == CodeMarker::Summary) {
marked.remove("<@name>"); // was "<b>"
marked.remove("</@name>"); // was "</b>"
extraRegExp.setMinimal(true);
marked.remove(extraRegExp);
}
-#if 0
- else {
- marked.replace("<@extra>","<tt>");
- marked.replace("</@extra>","</tt>");
- }
-#endif
if (style != CodeMarker::Detailed) {
marked.remove("<@type>");
else if (ch == QLatin1Char('"')) {
APPEND(""");
}
-#if 0
- else if ((outputEncoding == "ISO-8859-1" && ch.unicode() > 0x007F) ||
- (ch == QLatin1Char('*') && i + 1 < n && string.at(i) == QLatin1Char('/')) ||
- (ch == QLatin1Char('.') && i > 2 && string.at(i - 2) == QLatin1Char('.'))) {
- // we escape '*/' and the last dot in 'e.g.' and 'i.e.' for the Javadoc generator
- APPEND("&#x");
- xml += QString::number(ch.unicode(), 16);
- xml += QLatin1Char(';');
- }
-#endif
else {
if (!xml.isEmpty())
xml += ch;
{
QString result;
result = Generator::fileBase(node);
-#if 0
- if (!node->isInnerNode()) {
- switch (node->status()) {
- case Node::Compat:
- result += "-qt3";
- break;
- case Node::Obsolete:
- result += "-obsolete";
- break;
- default:
- ;
- }
- }
-#endif
return result;
}