diff options
Diffstat (limited to 'src/tools/qdoc/node.cpp')
-rw-r--r-- | src/tools/qdoc/node.cpp | 297 |
1 files changed, 147 insertions, 150 deletions
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index 230ce50df8..ec721aee64 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -44,16 +44,16 @@ QT_BEGIN_NAMESPACE int Node::propertyGroupCount_ = 0; QStringMap Node::operators_; -QMap<QString,Node::Type> Node::goals_; +QMap<QString,Node::NodeType> Node::goals_; /*! Initialize the map of search goals. This is called once by QDocDatabase::initializeDB(). The map key is a string - representing a value in the enum Node::Type. The map value + representing a value in the enum Node::NodeType. The map value is the enum value. There should be an entry in the map for each value in the - Type enum. + NodeType enum. */ void Node::initialize() { @@ -160,8 +160,8 @@ QString Node::fullName(const Node* relative) const match is found, return false. \a types is a list of type/subtype pairs, where the first - value in the pair is a Node::Type, and the second value is - a Node::SubType. The second value is used in the match if + value in the pair is a Node::NodeType, and the second value is + a Node::DocSubtype. The second value is used in the match if this node's type is Node::Document. */ bool Node::match(const NodeTypeList& types) const @@ -169,7 +169,7 @@ bool Node::match(const NodeTypeList& types) const for (int i=0; i<types.size(); ++i) { if (type() == types.at(i).first) { if (type() == Node::Document) { - if (subType() == types.at(i).second) + if (docSubtype() == types.at(i).second) return true; } else @@ -200,12 +200,12 @@ void Node::setDoc(const Doc& doc, bool replace) given \a parent and \a name. The new node is added to the parent's child list. */ -Node::Node(Type type, InnerNode *parent, const QString& name) +Node::Node(NodeType type, Aggregate *parent, const QString& name) : nodeType_((unsigned char) type), access_((unsigned char) Public), safeness_((unsigned char) UnspecifiedSafeness), pageType_((unsigned char) NoPageType), - status_((unsigned char) Commendable), + status_((unsigned char) Active), indexNodeFlag_(false), parent_(parent), relatesTo_(0), @@ -320,7 +320,7 @@ QString Node::nodeTypeString() const */ QString Node::nodeTypeString(unsigned char t) { - switch ((Type)t) { + switch ((NodeType)t) { case Namespace: return "namespace"; case Class: @@ -370,7 +370,7 @@ QString Node::nodeTypeString(unsigned char t) */ QString Node::nodeSubtypeString() const { - return nodeSubtypeString(subType()); + return nodeSubtypeString(docSubtype()); } /*! @@ -380,7 +380,7 @@ QString Node::nodeSubtypeString() const */ QString Node::nodeSubtypeString(unsigned char t) { - switch ((SubType)t) { + switch ((DocSubtype)t) { case Example: return "example"; case HeaderFile: @@ -395,7 +395,7 @@ QString Node::nodeSubtypeString(unsigned char t) return "external page"; case DitaMap: return "ditamap"; - case NoSubType: + case NoSubtype: default: break; } @@ -460,7 +460,7 @@ bool Node::fromFlagValue(FlagValue fv, bool defaultValue) /*! Sets the pointer to the node that this node relates to. */ -void Node::setRelates(InnerNode *pseudoParent) +void Node::setRelates(Aggregate *pseudoParent) { if (relatesTo_) { relatesTo_->removeRelated(this); @@ -558,7 +558,7 @@ QString RelatedClass::accessString() const */ Node::Status Node::inheritedStatus() const { - Status parentStatus = Commendable; + Status parentStatus = Active; if (parent_) parentStatus = parent_->inheritedStatus(); return (Status)qMin((int)status_, (int)parentStatus); @@ -683,14 +683,14 @@ const Node* Node::root() const } /*! - \class InnerNode + \class Aggregate */ /*! The inner node destructor deletes the children and removes this node from its related nodes. */ -InnerNode::~InnerNode() +Aggregate::~Aggregate() { deleteChildren(); removeFromRelated(); @@ -706,7 +706,7 @@ InnerNode::~InnerNode() find all this node's children that have the given \a name, and return the one that satisfies the \a genus requirement. */ -Node *InnerNode::findChildNode(const QString& name, Node::Genus genus) const +Node *Aggregate::findChildNode(const QString& name, Node::Genus genus) const { if (genus == Node::DontCare) { Node *node = childMap.value(name); @@ -716,7 +716,7 @@ Node *InnerNode::findChildNode(const QString& name, Node::Genus genus) const for (int i=0; i<children_.size(); ++i) { Node* n = children_.at(i); if (n->isQmlPropertyGroup() || isJsPropertyGroup()) { - node = static_cast<InnerNode*>(n)->findChildNode(name, genus); + node = static_cast<Aggregate*>(n)->findChildNode(name, genus); if (node) return node; } @@ -740,7 +740,7 @@ Node *InnerNode::findChildNode(const QString& name, Node::Genus genus) const Find all the child nodes of this node that are named \a name and return them in \a nodes. */ -void InnerNode::findChildren(const QString& name, NodeList& nodes) const +void Aggregate::findChildren(const QString& name, NodeList& nodes) const { nodes = childMap.values(name); Node* n = primaryFunctionMap.value(name); @@ -773,7 +773,7 @@ void InnerNode::findChildren(const QString& name, NodeList& nodes) const with the specified \a name is found but it is not of the specified \a type, 0 is returned. */ -Node* InnerNode::findChildNode(const QString& name, Type type) +Node* Aggregate::findChildNode(const QString& name, NodeType type) { if (type == Function) return primaryFunctionMap.value(name); @@ -792,7 +792,7 @@ Node* InnerNode::findChildNode(const QString& name, Type type) Find a function node that is a child of this nose, such that the function node has the specified \a name. */ -FunctionNode *InnerNode::findFunctionNode(const QString& name) const +FunctionNode *Aggregate::findFunctionNode(const QString& name) const { return static_cast<FunctionNode *>(primaryFunctionMap.value(name)); } @@ -802,7 +802,7 @@ FunctionNode *InnerNode::findFunctionNode(const QString& name) const that the function has the same name and signature as the \a clone node. */ -FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) const +FunctionNode *Aggregate::findFunctionNode(const FunctionNode *clone) const { QMap<QString,Node*>::ConstIterator c = primaryFunctionMap.constFind(clone->name()); if (c != primaryFunctionMap.constEnd()) { @@ -825,7 +825,7 @@ FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) const /*! Returns the list of keys from the primary function map. */ -QStringList InnerNode::primaryKeys() +QStringList Aggregate::primaryKeys() { QStringList t; QMap<QString, Node*>::iterator i = primaryFunctionMap.begin(); @@ -839,7 +839,7 @@ QStringList InnerNode::primaryKeys() /*! Returns the list of keys from the secondary function map. */ -QStringList InnerNode::secondaryKeys() +QStringList Aggregate::secondaryKeys() { QStringList t; QMap<QString, NodeList>::iterator i = secondaryFunctionMap.begin(); @@ -852,14 +852,14 @@ QStringList InnerNode::secondaryKeys() /*! */ -void InnerNode::setOverload(FunctionNode *func, bool overlode) +void Aggregate::setOverload(FunctionNode *func, bool b) { Node *node = (Node *) func; Node *&primary = primaryFunctionMap[func->name()]; if (secondaryFunctionMap.contains(func->name())) { NodeList& secs = secondaryFunctionMap[func->name()]; - if (overlode) { + if (b) { if (primary == node) { primary = secs.first(); secs.erase(secs.begin()); @@ -887,7 +887,7 @@ void InnerNode::setOverload(FunctionNode *func, bool overlode) Intermediate status, meaning that they should be ignored, but not their children. */ -void InnerNode::makeUndocumentedChildrenInternal() +void Aggregate::makeUndocumentedChildrenInternal() { foreach (Node *child, childNodes()) { if (child->doc().isEmpty() && child->status() != Node::Intermediate) { @@ -899,14 +899,13 @@ void InnerNode::makeUndocumentedChildrenInternal() /*! */ -void InnerNode::normalizeOverloads() +void Aggregate::normalizeOverloads() { QMap<QString, Node *>::Iterator p1 = primaryFunctionMap.begin(); while (p1 != primaryFunctionMap.end()) { FunctionNode *primaryFunc = (FunctionNode *) *p1; if (secondaryFunctionMap.contains(primaryFunc->name()) && - (primaryFunc->status() != Commendable || - primaryFunc->access() == Private)) { + (primaryFunc->status() != Active || primaryFunc->access() == Private)) { NodeList& secs = secondaryFunctionMap[primaryFunc->name()]; NodeList::ConstIterator s = secs.constBegin(); @@ -917,8 +916,7 @@ void InnerNode::normalizeOverloads() // (i.e, visible functions) are preferable to the primary // function. - if (secondaryFunc->status() == Commendable && - secondaryFunc->access() != Private) { + if (secondaryFunc->status() == Active && secondaryFunc->access() != Private) { *p1 = secondaryFunc; int index = secondaryFunctionMap[primaryFunc->name()].indexOf(secondaryFunc); @@ -935,14 +933,14 @@ void InnerNode::normalizeOverloads() while (p != primaryFunctionMap.constEnd()) { FunctionNode *primaryFunc = (FunctionNode *) *p; if (primaryFunc->isOverload()) - primaryFunc->ove = false; + primaryFunc->overload_ = false; if (secondaryFunctionMap.contains(primaryFunc->name())) { NodeList& secs = secondaryFunctionMap[primaryFunc->name()]; NodeList::ConstIterator s = secs.constBegin(); while (s != secs.constEnd()) { FunctionNode *secondaryFunc = (FunctionNode *) *s; if (!secondaryFunc->isOverload()) - secondaryFunc->ove = true; + secondaryFunc->overload_ = true; ++s; } } @@ -951,15 +949,15 @@ void InnerNode::normalizeOverloads() NodeList::ConstIterator c = childNodes().constBegin(); while (c != childNodes().constEnd()) { - if ((*c)->isInnerNode()) - ((InnerNode *) *c)->normalizeOverloads(); + if ((*c)->isAggregate()) + ((Aggregate *) *c)->normalizeOverloads(); ++c; } } /*! */ -void InnerNode::removeFromRelated() +void Aggregate::removeFromRelated() { while (!related_.isEmpty()) { Node *p = static_cast<Node *>(related_.takeFirst()); @@ -971,13 +969,13 @@ void InnerNode::removeFromRelated() /*! Deletes all this node's children. */ -void InnerNode::deleteChildren() +void Aggregate::deleteChildren() { NodeList childrenCopy = children_; // `children_` will be changed in ~Node() qDeleteAll(childrenCopy); } -/*! \fn bool InnerNode::isInnerNode() const +/*! \fn bool Aggregate::isAggregate() const Returns \c true because this is an inner node. */ @@ -997,7 +995,7 @@ bool Node::isWrapper() const no enum type node is found that has \a enumValue as one of its values. */ -const EnumNode *InnerNode::findEnumNodeForValue(const QString &enumValue) const +const EnumNode *Aggregate::findEnumNodeForValue(const QString &enumValue) const { foreach (const Node *node, enumChildren_) { const EnumNode *en = static_cast<const EnumNode *>(node); @@ -1012,7 +1010,7 @@ const EnumNode *InnerNode::findEnumNodeForValue(const QString &enumValue) const in the list of overloaded functions for a class, such that all the functions have the same name as the \a func. */ -int InnerNode::overloadNumber(const FunctionNode *func) const +int Aggregate::overloadNumber(const FunctionNode *func) const { Node *node = const_cast<FunctionNode *>(func); if (primaryFunctionMap[func->name()] == node) { @@ -1027,7 +1025,7 @@ int InnerNode::overloadNumber(const FunctionNode *func) const Returns a node list containing all the member functions of some class such that the functions overload the name \a funcName. */ -NodeList InnerNode::overloads(const QString &funcName) const +NodeList Aggregate::overloads(const QString &funcName) const { NodeList result; Node *primary = primaryFunctionMap.value(funcName); @@ -1042,7 +1040,7 @@ NodeList InnerNode::overloads(const QString &funcName) const Construct an inner node (i.e., not a leaf node) of the given \a type and having the given \a parent and \a name. */ -InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name) +Aggregate::Aggregate(NodeType type, Aggregate *parent, const QString& name) : Node(type, parent, name) { switch (type) { @@ -1059,7 +1057,7 @@ InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name) /*! Appends an \a include file to the list of include files. */ -void InnerNode::addInclude(const QString& include) +void Aggregate::addInclude(const QString& include) { includes_.append(include); } @@ -1067,7 +1065,7 @@ void InnerNode::addInclude(const QString& include) /*! Sets the list of include files to \a includes. */ -void InnerNode::setIncludes(const QStringList& includes) +void Aggregate::setIncludes(const QStringList& includes) { includes_ = includes; } @@ -1075,7 +1073,7 @@ void InnerNode::setIncludes(const QStringList& includes) /*! f1 is always the clone */ -bool InnerNode::isSameSignature(const FunctionNode *f1, const FunctionNode *f2) +bool Aggregate::isSameSignature(const FunctionNode *f1, const FunctionNode *f2) { if (f1->parameters().count() != f2->parameters().count()) return false; @@ -1113,7 +1111,7 @@ bool InnerNode::isSameSignature(const FunctionNode *f1, const FunctionNode *f2) be necessary to update this node's internal collections and the child's parent pointer and output subdirectory. */ -void InnerNode::addChild(Node *child) +void Aggregate::addChild(Node *child) { children_.append(child); if ((child->type() == Function) || (child->type() == QmlMethod)) { @@ -1143,7 +1141,7 @@ void InnerNode::addChild(Node *child) again, because it is presumed to already be there. We just want to be able to find the child by its \a title. */ -void InnerNode::addChild(Node* child, const QString& title) +void Aggregate::addChild(Node* child, const QString& title) { childMap.insertMulti(title, child); } @@ -1154,7 +1152,7 @@ void InnerNode::addChild(Node* child, const QString& title) pointer is set to 0, but its output subdirectory is not changed. */ -void InnerNode::removeChild(Node *child) +void Aggregate::removeChild(Node *child) { children_.removeAll(child); enumChildren_.removeAll(child); @@ -1198,7 +1196,7 @@ void InnerNode::removeChild(Node *child) /*! Recursively sets the output subdirectory for children */ -void InnerNode::setOutputSubdirectory(const QString &t) +void Aggregate::setOutputSubdirectory(const QString &t) { Node::setOutputSubdirectory(t); for (int i = 0; i < childNodes().size(); ++i) @@ -1261,7 +1259,7 @@ QString Node::physicalModuleName() const /*! */ -void InnerNode::removeRelated(Node *pseudoChild) +void Aggregate::removeRelated(Node *pseudoChild) { related_.removeAll(pseudoChild); } @@ -1270,7 +1268,7 @@ void InnerNode::removeRelated(Node *pseudoChild) If this node has a child that is a QML property named \a n, return the pointer to that child. */ -QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n) const +QmlPropertyNode* Aggregate::hasQmlProperty(const QString& n) const { foreach (Node* child, childNodes()) { if (child->type() == Node::QmlProperty) { @@ -1291,7 +1289,7 @@ QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n) const whose type (attached or normal property) matches \a attached, return the pointer to that child. */ -QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n, bool attached) const +QmlPropertyNode* Aggregate::hasQmlProperty(const QString& n, bool attached) const { foreach (Node* child, childNodes()) { if (child->type() == Node::QmlProperty) { @@ -1311,7 +1309,7 @@ QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n, bool attached) cons \class LeafNode */ -/*! \fn bool LeafNode::isInnerNode() const +/*! \fn bool LeafNode::isAggregate() const Returns \c false because this is a LeafNode. */ @@ -1319,7 +1317,7 @@ QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n, bool attached) cons Constructs a leaf node named \a name of the specified \a type. The new leaf node becomes a child of \a parent. */ -LeafNode::LeafNode(Type type, InnerNode *parent, const QString& name) +LeafNode::LeafNode(NodeType type, Aggregate *parent, const QString& name) : Node(type, parent, name) { switch (type) { @@ -1346,7 +1344,7 @@ LeafNode::LeafNode(Type type, InnerNode *parent, const QString& name) documentation case where a \e{qmlproperty} command is used to override the QML definition of a QML property. */ -LeafNode::LeafNode(InnerNode* parent, Type type, const QString& name) +LeafNode::LeafNode(Aggregate* parent, NodeType type, const QString& name) : Node(type, 0, name) { setParent(parent); @@ -1374,8 +1372,8 @@ LeafNode::LeafNode(InnerNode* parent, Type type, const QString& name) /*! Constructs a namespace node. */ -NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name) - : InnerNode(Namespace, parent, name), seen_(false), tree_(0) +NamespaceNode::NamespaceNode(Aggregate *parent, const QString& name) + : Aggregate(Namespace, parent, name), seen_(false), tree_(0) { setGenus(Node::CPP); setPageType(ApiPage); @@ -1389,8 +1387,8 @@ NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name) /*! Constructs a class node. A class node will generate an API page. */ -ClassNode::ClassNode(InnerNode *parent, const QString& name) - : InnerNode(Class, parent, name) +ClassNode::ClassNode(Aggregate *parent, const QString& name) + : Aggregate(Class, parent, name) { abstract_ = false; wrapper_ = false; @@ -1584,8 +1582,8 @@ QmlTypeNode* ClassNode::findQmlBaseNode() which specifies the type of DocumentNode. The page type for the page index is set here. */ -DocumentNode::DocumentNode(InnerNode* parent, const QString& name, SubType subtype, Node::PageType ptype) - : InnerNode(Document, parent, name), nodeSubtype_(subtype) +DocumentNode::DocumentNode(Aggregate* parent, const QString& name, DocSubtype subtype, Node::PageType ptype) + : Aggregate(Document, parent, name), nodeSubtype_(subtype) { setGenus(Node::DOC); switch (subtype) { @@ -1618,7 +1616,7 @@ void DocumentNode::setTitle(const QString &title) /*! Returns the document node's full title, which is usually - just title(), but for some SubType values is different + just title(), but for some DocSubtype values is different from title() */ QString DocumentNode::fullTitle() const @@ -1669,8 +1667,8 @@ QString DocumentNode::subTitle() const The constructor for the node representing an enum type has a \a parent class and an enum type \a name. */ -EnumNode::EnumNode(InnerNode *parent, const QString& name) - : LeafNode(Enum, parent, name), ft(0) +EnumNode::EnumNode(Aggregate *parent, const QString& name) + : LeafNode(Enum, parent, name), flagsType_(0) { setGenus(Node::CPP); } @@ -1680,8 +1678,8 @@ EnumNode::EnumNode(InnerNode *parent, const QString& name) */ void EnumNode::addItem(const EnumItem& item) { - itms.append(item); - names.insert(item.name()); + items_.append(item); + names_.insert(item.name()); } /*! @@ -1701,7 +1699,7 @@ Node::Access EnumNode::itemAccess(const QString &name) const */ QString EnumNode::itemValue(const QString &name) const { - foreach (const EnumItem &item, itms) { + foreach (const EnumItem &item, items_) { if (item.name() == name) return item.value(); } @@ -1714,8 +1712,8 @@ QString EnumNode::itemValue(const QString &name) const /*! */ -TypedefNode::TypedefNode(InnerNode *parent, const QString& name) - : LeafNode(Typedef, parent, name), ae(0) +TypedefNode::TypedefNode(Aggregate *parent, const QString& name) + : LeafNode(Typedef, parent, name), associatedEnum_(0) { setGenus(Node::CPP); } @@ -1724,7 +1722,7 @@ TypedefNode::TypedefNode(InnerNode *parent, const QString& name) */ void TypedefNode::setAssociatedEnum(const EnumNode *enume) { - ae = enume; + associatedEnum_ = enume; } /*! @@ -1745,7 +1743,7 @@ Parameter::Parameter(const QString& leftType, const QString& rightType, const QString& name, const QString& defaultValue) - : lef(leftType), rig(rightType), nam(name), def(defaultValue) + : leftType_(leftType), rightType_(rightType), name_(name), defaultValue_(defaultValue) { } @@ -1753,7 +1751,7 @@ Parameter::Parameter(const QString& leftType, The standard copy constructor copies the strings from \a p. */ Parameter::Parameter(const Parameter& p) - : lef(p.lef), rig(p.rig), nam(p.nam), def(p.def) + : leftType_(p.leftType_), rightType_(p.rightType_), name_(p.name_), defaultValue_(p.defaultValue_) { } @@ -1763,10 +1761,10 @@ Parameter::Parameter(const Parameter& p) */ Parameter& Parameter::operator=(const Parameter& p) { - lef = p.lef; - rig = p.rig; - nam = p.nam; - def = p.def; + leftType_ = p.leftType_; + rightType_ = p.rightType_; + name_ = p.name_; + defaultValue_ = p.defaultValue_; return *this; } @@ -1777,12 +1775,12 @@ Parameter& Parameter::operator=(const Parameter& p) */ QString Parameter::reconstruct(bool value) const { - QString p = lef + rig; + QString p = leftType_ + rightType_; if (!p.endsWith(QChar('*')) && !p.endsWith(QChar('&')) && !p.endsWith(QChar(' '))) p += QLatin1Char(' '); - p += nam; - if (value && !def.isEmpty()) - p += " = " + def; + p += name_; + if (value && !defaultValue_.isEmpty()) + p += " = " + defaultValue_; return p; } @@ -1795,18 +1793,18 @@ QString Parameter::reconstruct(bool value) const Construct a function node for a C++ function. It's parent is \a parent, and it's name is \a name. */ -FunctionNode::FunctionNode(InnerNode *parent, const QString& name) +FunctionNode::FunctionNode(Aggregate *parent, const QString& name) : LeafNode(Function, parent, name), - met(Plain), - vir(NonVirtual), - con(false), - sta(false), - ove(false), - reimp(false), + metaness_(Plain), + virtualness_(NonVirtual), + const_(false), + static_(false), + overload_(false), + reimplemented_(false), attached_(false), privateSignal_(false), - rf(0), - ap(0) + reimplementedFrom_(0), + associatedProperty_(0) { setGenus(Node::CPP); } @@ -1816,18 +1814,18 @@ FunctionNode::FunctionNode(InnerNode *parent, const QString& name) by \a type. It's parent is \a parent, and it's name is \a name. If \a attached is true, it is an attached method or signal. */ -FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bool attached) +FunctionNode::FunctionNode(NodeType type, Aggregate *parent, const QString& name, bool attached) : LeafNode(type, parent, name), - met(Plain), - vir(NonVirtual), - con(false), - sta(false), - ove(false), - reimp(false), + metaness_(Plain), + virtualness_(NonVirtual), + const_(false), + static_(false), + overload_(false), + reimplemented_(false), attached_(attached), privateSignal_(false), - rf(0), - ap(0) + reimplementedFrom_(0), + associatedProperty_(0) { setGenus(Node::QML); if (type == QmlMethod || type == QmlSignal) { @@ -1843,32 +1841,31 @@ FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bo is PureVirtual, and if the parent() is a ClassNode, set the parent's \e abstract flag to true. */ -void FunctionNode::setVirtualness(Virtualness virtualness) +void FunctionNode::setVirtualness(Virtualness v) { - vir = virtualness; - if ((virtualness == PureVirtual) && parent() && - (parent()->type() == Node::Class)) + virtualness_ = v; + if ((v == PureVirtual) && parent() && (parent()->type() == Node::Class)) parent()->setAbstract(true); } /*! */ -void FunctionNode::setOverload(bool overlode) +void FunctionNode::setOverload(bool b) { - parent()->setOverload(this, overlode); - ove = overlode; + parent()->setOverload(this, b); + overload_ = b; } /*! - Sets the function node's reimplementation flag to \a r. - When \a r is true, it is supposed to mean that this function + Sets the function node's reimplementation flag to \a b. + When \a b is true, it is supposed to mean that this function is a reimplementation of a virtual function in a base class, - but it really just means the \e reimp command was seen in the - qdoc comment. + but it really just means the \e {\\reimp} command was seen in + the qdoc comment. */ -void FunctionNode::setReimp(bool r) +void FunctionNode::setReimplemented(bool b) { - reimp = r; + reimplemented_ = b; } /*! @@ -1876,16 +1873,16 @@ void FunctionNode::setReimp(bool r) */ void FunctionNode::addParameter(const Parameter& parameter) { - params.append(parameter); + parameters_.append(parameter); } /*! */ void FunctionNode::borrowParameterNames(const FunctionNode *source) { - QList<Parameter>::Iterator t = params.begin(); - QList<Parameter>::ConstIterator s = source->params.constBegin(); - while (s != source->params.constEnd() && t != params.end()) { + QList<Parameter>::Iterator t = parameters_.begin(); + QList<Parameter>::ConstIterator s = source->parameters_.constBegin(); + while (s != source->parameters_.constEnd() && t != parameters_.end()) { if (!(*s).name().isEmpty()) (*t).setName((*s).name()); ++s; @@ -1897,19 +1894,19 @@ void FunctionNode::borrowParameterNames(const FunctionNode *source) If this function is a reimplementation, \a from points to the FunctionNode of the function being reimplemented. */ -void FunctionNode::setReimplementedFrom(FunctionNode *from) +void FunctionNode::setReimplementedFrom(FunctionNode *f) { - rf = from; - from->rb.append(this); + reimplementedFrom_ = f; + f->reimplementedBy_.append(this); } /*! Sets the "associated" property to \a property. The function might be the setter or getter for a property, for example. */ -void FunctionNode::setAssociatedProperty(PropertyNode *property) +void FunctionNode::setAssociatedProperty(PropertyNode *p) { - ap = property; + associatedProperty_ = p; } /*! @@ -1957,15 +1954,15 @@ QString FunctionNode::rawParameters(bool names, bool values) const Returns the list of reconstructed parameters. If \a values is true, the default values are included, if any are present. */ -QStringList FunctionNode::reconstructParams(bool values) const +QStringList FunctionNode::reconstructParameters(bool values) const { - QStringList params; + QStringList reconstructedParameters; QList<Parameter>::ConstIterator p = parameters().constBegin(); while (p != parameters().constEnd()) { - params << (*p).reconstruct(values); + reconstructedParameters << (*p).reconstruct(values); ++p; } - return params; + return reconstructedParameters; } /*! @@ -1979,11 +1976,11 @@ QString FunctionNode::signature(bool values) const if (!returnType().isEmpty()) s = returnType() + QLatin1Char(' '); s += name() + QLatin1Char('('); - QStringList params = reconstructParams(values); - int p = params.size(); + QStringList reconstructedParameters = reconstructParameters(values); + int p = reconstructedParameters.size(); if (p > 0) { for (int i=0; i<p; i++) { - s += params[i]; + s += reconstructedParameters[i]; if (i < (p-1)) s += ", "; } @@ -1997,8 +1994,8 @@ QString FunctionNode::signature(bool values) const */ void FunctionNode::debug() const { - qDebug("QML METHOD %s rt %s pp %s", - qPrintable(name()), qPrintable(rt), qPrintable(pp.join(' '))); + qDebug("QML METHOD %s returnType_ %s parentPath_ %s", + qPrintable(name()), qPrintable(returnType_), qPrintable(parentPath_.join(' '))); } /*! @@ -2011,17 +2008,17 @@ void FunctionNode::debug() const The constructor sets the \a parent and the \a name, but everything else is set to default values. */ -PropertyNode::PropertyNode(InnerNode *parent, const QString& name) +PropertyNode::PropertyNode(Aggregate *parent, const QString& name) : LeafNode(Property, parent, name), stored_(FlagValueDefault), designable_(FlagValueDefault), scriptable_(FlagValueDefault), writable_(FlagValueDefault), user_(FlagValueDefault), - cst(false), - fnl(false), - rev(-1), - overrides(0) + const_(false), + final_(false), + revision_(-1), + overrides_(0) { setGenus(Node::CPP); } @@ -2039,8 +2036,8 @@ PropertyNode::PropertyNode(InnerNode *parent, const QString& name) void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty) { for (int i = 0; i < NumFunctionRoles; ++i) { - if (funcs[i].isEmpty()) - funcs[i] = baseProperty->funcs[i]; + if (functions_[i].isEmpty()) + functions_[i] = baseProperty->functions_[i]; } if (stored_ == FlagValueDefault) stored_ = baseProperty->stored_; @@ -2052,7 +2049,7 @@ void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty) writable_ = baseProperty->writable_; if (user_ == FlagValueDefault) user_ = baseProperty->user_; - overrides = baseProperty; + overrides_ = baseProperty; } /*! @@ -2084,8 +2081,8 @@ QMultiMap<QString,Node*> QmlTypeNode::inheritedBy; Constructs a Qml class node. The new node has the given \a parent and \a name. */ -QmlTypeNode::QmlTypeNode(InnerNode *parent, const QString& name) - : InnerNode(QmlType, parent, name), +QmlTypeNode::QmlTypeNode(Aggregate *parent, const QString& name) + : Aggregate(QmlType, parent, name), abstract_(false), cnodeRequired_(false), wrapper_(false), @@ -2199,9 +2196,9 @@ QString QmlTypeNode::logicalModuleIdentifier() const Constructs a Qml basic type node. The new node has the given \a parent and \a name. */ -QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent, +QmlBasicTypeNode::QmlBasicTypeNode(Aggregate *parent, const QString& name) - : InnerNode(QmlBasicType, parent, name) + : Aggregate(QmlBasicType, parent, name) { setTitle(name); setGenus(Node::QML); @@ -2212,7 +2209,7 @@ QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent, always a QmlTypeNode. */ QmlPropertyGroupNode::QmlPropertyGroupNode(QmlTypeNode* parent, const QString& name) - : InnerNode(QmlPropertyGroup, parent, name) + : Aggregate(QmlPropertyGroup, parent, name) { idNumber_ = -1; setGenus(Node::QML); @@ -2235,7 +2232,7 @@ QString QmlPropertyGroupNode::idNumber() /*! Constructor for the QML property node. */ -QmlPropertyNode::QmlPropertyNode(InnerNode* parent, +QmlPropertyNode::QmlPropertyNode(Aggregate* parent, const QString& name, const QString& type, bool attached) @@ -2574,7 +2571,7 @@ QString Node::idForNode() const str = "js-method-" + parent_->name().toLower() + "-" + func->name(); else if (parent_->type() == Document) { qDebug() << "qdoc internal error: Node subtype not handled:" - << parent_->subType() << func->name(); + << parent_->docSubtype() << func->name(); } else qDebug() << "qdoc internal error: Node type not handled:" @@ -2599,7 +2596,7 @@ QString Node::idForNode() const break; case Node::Document: { - switch (subType()) { + switch (docSubtype()) { case Node::Page: case Node::HeaderFile: str = title(); @@ -2620,7 +2617,7 @@ QString Node::idForNode() const break; default: qDebug() << "ERROR: A case was not handled in Node::idForNode():" - << "subType():" << subType() << "type():" << type(); + << "docSubtype():" << docSubtype() << "type():" << type(); break; } } @@ -2690,12 +2687,12 @@ QString Node::idForNode() const break; default: qDebug() << "ERROR: A case was not handled in Node::idForNode():" - << "type():" << type() << "subType():" << subType(); + << "type():" << type() << "docSubtype():" << docSubtype(); break; } if (str.isEmpty()) { qDebug() << "ERROR: A link text was empty in Node::idForNode():" - << "type():" << type() << "subType():" << subType() + << "type():" << type() << "docSubtype():" << docSubtype() << "name():" << name() << "title():" << title(); } @@ -2709,7 +2706,7 @@ QString Node::idForNode() const Prints the inner node's list of children. For debugging only. */ -void InnerNode::printChildren(const QString& title) +void Aggregate::printChildren(const QString& title) { qDebug() << title << name() << children_.size(); if (children_.size() > 0) { |