Changeset 561 for trunk/tools/qdoc3/codemarker.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/tools/qdoc3/codemarker.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 169 169 if (sizeof(const Node *) == sizeof(uint)) { 170 170 return reinterpret_cast<const Node *>(string.toUInt()); 171 } else { 171 } 172 else { 172 173 return reinterpret_cast<const Node *>(string.toULongLong()); 173 174 } … … 178 179 if (sizeof(const Node *) == sizeof(ulong)) { 179 180 return QString::number(reinterpret_cast<ulong>(node)); 180 } else { 181 } 182 else { 181 183 return QString::number(reinterpret_cast<qulonglong>(node)); 182 184 } … … 221 223 || ch == QLatin1Char(':')) { 222 224 pendingWord += ch; 223 } else { 225 } 226 else { 224 227 if (!pendingWord.isEmpty()) { 225 228 bool isProbablyType = (pendingWord != QLatin1String("const")); … … 252 255 } 253 256 254 QString CodeMarker::taggedNode(const Node *node)257 QString CodeMarker::taggedNode(const Nodenode) 255 258 { 256 259 QString tag; … … 277 280 default: 278 281 tag = QLatin1String("@unknown"); 282 279 283 } 280 284 return QLatin1Char('<') + tag + QLatin1Char('>') + protect(node->name()) 281 285 + QLatin1String("</") + tag + QLatin1Char('>'); 282 286 } 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 283 310 284 311 QString CodeMarker::linkTag(const Node *node, const QString& body) … … 309 336 if (func->metaness() == FunctionNode::Ctor) { 310 337 sortNo = QLatin1String("C"); 311 } else if (func->metaness() == FunctionNode::Dtor) { 338 } 339 else if (func->metaness() == FunctionNode::Dtor) { 312 340 sortNo = QLatin1String("D"); 313 } else { 341 } 342 else { 314 343 if (nodeName.startsWith(QLatin1String("operator")) 315 344 && nodeName.length() > 8 … … 332 361 } 333 362 334 void CodeMarker::insert(FastSection &fastSection, Node *node, SynopsisStyle style, Status status) 335 { 336 bool inheritedMember = (!node->relates() && 337 (node->parent() != (const InnerNode *)fastSection.innerNode)); 363 void CodeMarker::insert(FastSection &fastSection, 364 Node *node, 365 SynopsisStyle style, 366 Status status) 367 { 338 368 bool irrelevant = false; 369 370 371 372 373 374 375 339 376 340 377 if (node->access() == Node::Private) { 341 378 irrelevant = true; 342 } else if (node->type() == Node::Function) { 379 } 380 else if (node->type() == Node::Function) { 343 381 FunctionNode *func = (FunctionNode *) node; 344 382 irrelevant = (inheritedMember 345 383 && (func->metaness() == FunctionNode::Ctor || 346 384 func->metaness() == FunctionNode::Dtor)); 347 } else if (node->type() == Node::Class || node->type() == Node::Enum 385 } 386 else if (node->type() == Node::Class || node->type() == Node::Enum 348 387 || node->type() == Node::Typedef) { 349 388 irrelevant = (inheritedMember && style != SeparateList); … … 358 397 if (status == Compat) { 359 398 irrelevant = (node->status() != Node::Compat); 360 } else if (status == Obsolete) { 399 } 400 else if (status == Obsolete) { 361 401 irrelevant = (node->status() != Node::Obsolete); 362 } else { 402 } 403 else { 363 404 irrelevant = (node->status() == Node::Compat || 364 405 node->status() == Node::Obsolete); … … 371 412 if (!fastSection.memberMap.contains(key)) 372 413 fastSection.memberMap.insert(key, node); 373 } else { 414 } 415 else { 374 416 if (node->parent()->type() == Node::Class) { 375 417 if (fastSection.inherited.isEmpty() … … 384 426 } 385 427 386 void CodeMarker::append(QList<Section>& sectionList, 387 const FastSection& fastSection) 388 { 389 if (!fastSection.memberMap.isEmpty() || 390 !fastSection.inherited.isEmpty()) { 391 Section section(fastSection.name, 392 fastSection.singularMember, 393 fastSection.pluralMember); 394 section.members = fastSection.memberMap.values(); 395 section.inherited = fastSection.inherited; 428 /*! 429 Returns true if \a node represents a reimplemented member function. 430 If it is, then it is inserted in the reimplemented member map in the 431 section \a fs. And, the test is only performed if \a status is \e OK. 432 Otherwise, false is returned. 433 */ 434 bool CodeMarker::insertReimpFunc(FastSection& fs, Node* node, Status status) 435 { 436 if (node->access() == Node::Private) 437 return false; 438 439 const FunctionNode* fn = static_cast<const FunctionNode*>(node); 440 if ((fn->reimplementedFrom() != 0) && (status == Okay)) { 441 bool inherited = (!fn->relates() && (fn->parent() != (const InnerNode*)fs.innerNode)); 442 if (!inherited) { 443 QString key = sortName(fn); 444 if (!fs.reimpMemberMap.contains(key)) { 445 fs.reimpMemberMap.insert(key,node); 446 return true; 447 } 448 } 449 } 450 return false; 451 } 452 453 /*! 454 If \a fs is not empty, convert it to a Section and append 455 the new Section to \a sectionList. 456 */ 457 void CodeMarker::append(QList<Section>& sectionList, const FastSection& fs) 458 { 459 if (!fs.isEmpty()) { 460 Section section(fs.name,fs.singularMember,fs.pluralMember); 461 section.members = fs.memberMap.values(); 462 section.reimpMembers = fs.reimpMemberMap.values(); 463 section.inherited = fs.inherited; 396 464 sectionList.append(section); 397 465 } … … 429 497 if (!classe->templateStuff().isEmpty()) { 430 498 result += QLatin1String("tmplt/"); 431 } else 499 } 500 else 432 501 #endif 433 502 { … … 466 535 isMacro = true; 467 536 #if 0 468 } else if (!func->templateStuff().isEmpty()) { 537 } 538 else if (!func->templateStuff().isEmpty()) { 469 539 result += QLatin1String("ftmplt/"); 470 540 #endif 471 } else if (func->isStatic()) { 541 } 542 else if (func->isStatic()) { 472 543 result += QLatin1String("clm/"); 473 } else if (!func->parent()->name().isEmpty()) { 544 } 545 else if (!func->parent()->name().isEmpty()) { 474 546 result += QLatin1String("instm/"); 475 } else { 547 } 548 else { 476 549 result += QLatin1String("func/"); 477 550 } … … 487 560 const QList<Parameter> ¶ms = func->parameters(); 488 561 for (int i = 0; i < params.count(); ++i) { 489 QString type = params.at(i).leftType() + params.at(i).rightType(); 562 QString type = params.at(i).leftType() + 563 params.at(i).rightType(); 490 564 type = QLatin1String(QMetaObject::normalizedSignature(type.toLatin1().constData())); 491 565 if (i != 0) … … 529 603 530 604 if (node->name().isEmpty()) { 531 return QLatin1Char('/') + myName; 532 } else { 533 return plainFullName(node) + QLatin1Char('/') + myName; 534 } 535 } 536 605 return QLatin1Char('/') + protect(myName); 606 } 607 else { 608 return plainFullName(node) + QLatin1Char('/') + protect(myName); 609 } 610 } 611 612 #ifdef QDOC_QML 613 /*! 614 Get the list of documentation sections for the children of 615 the specified QmlClassNode. 616 */ 617 QList<Section> CodeMarker::qmlSections(const QmlClassNode* , SynopsisStyle ) 618 { 619 return QList<Section>(); 620 } 621 #endif 537 622 538 623 QT_END_NAMESPACE
Note:
See TracChangeset
for help on using the changeset viewer.