qdoc: Data member name changes

In preparation for refactoring the Node class hierarchy,
several data member names and some getter and setter names
in the Node hierarchy have been changed to make them more
readable.

Change-Id: Id76ce21c960e4033673f5cf0684aa70e701957b1
Task-number: QTBUG-45450
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
This commit is contained in:
Martin Smith 2015-04-08 12:47:41 +02:00
parent e18111c1a3
commit 0b17d23285
8 changed files with 212 additions and 220 deletions

View File

@ -928,7 +928,7 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
"because its base function is private " "because its base function is private "
"or internal").arg(COMMAND_REIMP).arg(node->name())); "or internal").arg(COMMAND_REIMP).arg(node->name()));
} }
func->setReimp(true); func->setReimplemented(true);
} }
else { else {
doc.location().warning(tr("Ignored '\\%1' in %2") doc.location().warning(tr("Ignored '\\%1' in %2")
@ -1051,7 +1051,7 @@ void CppCodeParser::reset()
tokenizer = 0; tokenizer = 0;
tok = 0; tok = 0;
access = Node::Public; access = Node::Public;
metaness = FunctionNode::Plain; metaness_ = FunctionNode::Plain;
lastPath_.clear(); lastPath_.clear();
physicalModuleName.clear(); physicalModuleName.clear();
} }
@ -1373,7 +1373,7 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent,
} }
FunctionNode::Virtualness vir = FunctionNode::NonVirtual; FunctionNode::Virtualness vir = FunctionNode::NonVirtual;
if (match(Tok_virtual)) { if (match(Tok_virtual)) {
vir = FunctionNode::ImpureVirtual; vir = FunctionNode::NormalVirtual;
if (matchCompat()) if (matchCompat())
compat = true; compat = true;
} }
@ -1511,7 +1511,7 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent,
if (compat) if (compat)
func->setStatus(Node::Compat); func->setStatus(Node::Compat);
func->setMetaness(metaness); func->setMetaness(metaness_);
if (parent) { if (parent) {
if (name == parent->name()) { if (name == parent->name()) {
func->setMetaness(FunctionNode::Ctor); func->setMetaness(FunctionNode::Ctor);
@ -1658,13 +1658,13 @@ bool CppCodeParser::matchClassDecl(InnerNode *parent,
Node::Access outerAccess = access; Node::Access outerAccess = access;
access = isClass ? Node::Private : Node::Public; access = isClass ? Node::Private : Node::Public;
FunctionNode::Metaness outerMetaness = metaness; FunctionNode::Metaness outerMetaness = metaness_;
metaness = FunctionNode::Plain; metaness_ = FunctionNode::Plain;
bool matches = (matchDeclList(classe) && match(Tok_RightBrace) && bool matches = (matchDeclList(classe) && match(Tok_RightBrace) &&
match(Tok_Semicolon)); match(Tok_Semicolon));
access = outerAccess; access = outerAccess;
metaness = outerMetaness; metaness_ = outerMetaness;
return matches; return matches;
} }
@ -2025,28 +2025,28 @@ bool CppCodeParser::matchDeclList(InnerNode *parent)
case Tok_private: case Tok_private:
readToken(); readToken();
access = Node::Private; access = Node::Private;
metaness = FunctionNode::Plain; metaness_ = FunctionNode::Plain;
break; break;
case Tok_protected: case Tok_protected:
readToken(); readToken();
access = Node::Protected; access = Node::Protected;
metaness = FunctionNode::Plain; metaness_ = FunctionNode::Plain;
break; break;
case Tok_public: case Tok_public:
readToken(); readToken();
access = Node::Public; access = Node::Public;
metaness = FunctionNode::Plain; metaness_ = FunctionNode::Plain;
break; break;
case Tok_signals: case Tok_signals:
case Tok_Q_SIGNALS: case Tok_Q_SIGNALS:
readToken(); readToken();
access = Node::Public; access = Node::Public;
metaness = FunctionNode::Signal; metaness_ = FunctionNode::Signal;
break; break;
case Tok_slots: case Tok_slots:
case Tok_Q_SLOTS: case Tok_Q_SLOTS:
readToken(); readToken();
metaness = FunctionNode::Slot; metaness_ = FunctionNode::Slot;
break; break;
case Tok_Q_OBJECT: case Tok_Q_OBJECT:
readToken(); readToken();

View File

@ -155,7 +155,7 @@ protected:
Tokenizer *tokenizer; Tokenizer *tokenizer;
int tok; int tok;
Node::Access access; Node::Access access;
FunctionNode::Metaness metaness; FunctionNode::Metaness metaness_;
QString physicalModuleName; QString physicalModuleName;
QStringList lastPath_; QStringList lastPath_;
QRegExp varComment; QRegExp varComment;

View File

@ -702,7 +702,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
} }
} }
if (node->doc().isEmpty()) { if (node->doc().isEmpty()) {
if (!node->isWrapper() && !quiet && !node->isReimp()) { // ### might be unnecessary if (!node->isWrapper() && !quiet && !node->isReimplemented()) { // ### might be unnecessary
node->location().warning(tr("No documentation for '%1'").arg(node->plainFullName())); node->location().warning(tr("No documentation for '%1'").arg(node->plainFullName()));
} }
} }
@ -714,7 +714,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
} }
if (!generateText(node->doc().body(), node, marker)) { if (!generateText(node->doc().body(), node, marker)) {
if (node->isReimp()) if (node->isReimplemented())
return; return;
} }
@ -800,7 +800,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
} }
} }
} }
if (needWarning && !func->isReimp()) if (needWarning && !func->isReimplemented())
node->doc().location().warning( node->doc().location().warning(
tr("Undocumented parameter '%1' in %2") tr("Undocumented parameter '%1' in %2")
.arg(*a).arg(node->plainFullName())); .arg(*a).arg(node->plainFullName()));
@ -1191,7 +1191,8 @@ void Generator::generateStatus(const Node *node, CodeMarker *marker)
Text text; Text text;
switch (node->status()) { switch (node->status()) {
case Node::Commendable: case Node::Active:
// Do nothing.
break; break;
case Node::Preliminary: case Node::Preliminary:
text << Atom::ParaLeft text << Atom::ParaLeft

View File

@ -205,7 +205,7 @@ Node::Node(Type type, InnerNode *parent, const QString& name)
access_((unsigned char) Public), access_((unsigned char) Public),
safeness_((unsigned char) UnspecifiedSafeness), safeness_((unsigned char) UnspecifiedSafeness),
pageType_((unsigned char) NoPageType), pageType_((unsigned char) NoPageType),
status_((unsigned char) Commendable), status_((unsigned char) Active),
indexNodeFlag_(false), indexNodeFlag_(false),
parent_(parent), parent_(parent),
relatesTo_(0), relatesTo_(0),
@ -558,7 +558,7 @@ QString RelatedClass::accessString() const
*/ */
Node::Status Node::inheritedStatus() const Node::Status Node::inheritedStatus() const
{ {
Status parentStatus = Commendable; Status parentStatus = Active;
if (parent_) if (parent_)
parentStatus = parent_->inheritedStatus(); parentStatus = parent_->inheritedStatus();
return (Status)qMin((int)status_, (int)parentStatus); return (Status)qMin((int)status_, (int)parentStatus);
@ -852,14 +852,14 @@ QStringList InnerNode::secondaryKeys()
/*! /*!
*/ */
void InnerNode::setOverload(FunctionNode *func, bool overlode) void InnerNode::setOverload(FunctionNode *func, bool b)
{ {
Node *node = (Node *) func; Node *node = (Node *) func;
Node *&primary = primaryFunctionMap[func->name()]; Node *&primary = primaryFunctionMap[func->name()];
if (secondaryFunctionMap.contains(func->name())) { if (secondaryFunctionMap.contains(func->name())) {
NodeList& secs = secondaryFunctionMap[func->name()]; NodeList& secs = secondaryFunctionMap[func->name()];
if (overlode) { if (b) {
if (primary == node) { if (primary == node) {
primary = secs.first(); primary = secs.first();
secs.erase(secs.begin()); secs.erase(secs.begin());
@ -905,8 +905,7 @@ void InnerNode::normalizeOverloads()
while (p1 != primaryFunctionMap.end()) { while (p1 != primaryFunctionMap.end()) {
FunctionNode *primaryFunc = (FunctionNode *) *p1; FunctionNode *primaryFunc = (FunctionNode *) *p1;
if (secondaryFunctionMap.contains(primaryFunc->name()) && if (secondaryFunctionMap.contains(primaryFunc->name()) &&
(primaryFunc->status() != Commendable || (primaryFunc->status() != Active || primaryFunc->access() == Private)) {
primaryFunc->access() == Private)) {
NodeList& secs = secondaryFunctionMap[primaryFunc->name()]; NodeList& secs = secondaryFunctionMap[primaryFunc->name()];
NodeList::ConstIterator s = secs.constBegin(); NodeList::ConstIterator s = secs.constBegin();
@ -917,8 +916,7 @@ void InnerNode::normalizeOverloads()
// (i.e, visible functions) are preferable to the primary // (i.e, visible functions) are preferable to the primary
// function. // function.
if (secondaryFunc->status() == Commendable && if (secondaryFunc->status() == Active && secondaryFunc->access() != Private) {
secondaryFunc->access() != Private) {
*p1 = secondaryFunc; *p1 = secondaryFunc;
int index = secondaryFunctionMap[primaryFunc->name()].indexOf(secondaryFunc); int index = secondaryFunctionMap[primaryFunc->name()].indexOf(secondaryFunc);
@ -935,14 +933,14 @@ void InnerNode::normalizeOverloads()
while (p != primaryFunctionMap.constEnd()) { while (p != primaryFunctionMap.constEnd()) {
FunctionNode *primaryFunc = (FunctionNode *) *p; FunctionNode *primaryFunc = (FunctionNode *) *p;
if (primaryFunc->isOverload()) if (primaryFunc->isOverload())
primaryFunc->ove = false; primaryFunc->overload_ = false;
if (secondaryFunctionMap.contains(primaryFunc->name())) { if (secondaryFunctionMap.contains(primaryFunc->name())) {
NodeList& secs = secondaryFunctionMap[primaryFunc->name()]; NodeList& secs = secondaryFunctionMap[primaryFunc->name()];
NodeList::ConstIterator s = secs.constBegin(); NodeList::ConstIterator s = secs.constBegin();
while (s != secs.constEnd()) { while (s != secs.constEnd()) {
FunctionNode *secondaryFunc = (FunctionNode *) *s; FunctionNode *secondaryFunc = (FunctionNode *) *s;
if (!secondaryFunc->isOverload()) if (!secondaryFunc->isOverload())
secondaryFunc->ove = true; secondaryFunc->overload_ = true;
++s; ++s;
} }
} }
@ -1670,7 +1668,7 @@ QString DocumentNode::subTitle() const
has a \a parent class and an enum type \a name. has a \a parent class and an enum type \a name.
*/ */
EnumNode::EnumNode(InnerNode *parent, const QString& name) EnumNode::EnumNode(InnerNode *parent, const QString& name)
: LeafNode(Enum, parent, name), ft(0) : LeafNode(Enum, parent, name), flagsType_(0)
{ {
setGenus(Node::CPP); setGenus(Node::CPP);
} }
@ -1680,8 +1678,8 @@ EnumNode::EnumNode(InnerNode *parent, const QString& name)
*/ */
void EnumNode::addItem(const EnumItem& item) void EnumNode::addItem(const EnumItem& item)
{ {
itms.append(item); items_.append(item);
names.insert(item.name()); names_.insert(item.name());
} }
/*! /*!
@ -1701,7 +1699,7 @@ Node::Access EnumNode::itemAccess(const QString &name) const
*/ */
QString EnumNode::itemValue(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) if (item.name() == name)
return item.value(); return item.value();
} }
@ -1715,7 +1713,7 @@ QString EnumNode::itemValue(const QString &name) const
/*! /*!
*/ */
TypedefNode::TypedefNode(InnerNode *parent, const QString& name) TypedefNode::TypedefNode(InnerNode *parent, const QString& name)
: LeafNode(Typedef, parent, name), ae(0) : LeafNode(Typedef, parent, name), associatedEnum_(0)
{ {
setGenus(Node::CPP); setGenus(Node::CPP);
} }
@ -1724,7 +1722,7 @@ TypedefNode::TypedefNode(InnerNode *parent, const QString& name)
*/ */
void TypedefNode::setAssociatedEnum(const EnumNode *enume) void TypedefNode::setAssociatedEnum(const EnumNode *enume)
{ {
ae = enume; associatedEnum_ = enume;
} }
/*! /*!
@ -1745,7 +1743,7 @@ Parameter::Parameter(const QString& leftType,
const QString& rightType, const QString& rightType,
const QString& name, const QString& name,
const QString& defaultValue) 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. The standard copy constructor copies the strings from \a p.
*/ */
Parameter::Parameter(const Parameter& 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) Parameter& Parameter::operator=(const Parameter& p)
{ {
lef = p.lef; leftType_ = p.leftType_;
rig = p.rig; rightType_ = p.rightType_;
nam = p.nam; name_ = p.name_;
def = p.def; defaultValue_ = p.defaultValue_;
return *this; return *this;
} }
@ -1777,12 +1775,12 @@ Parameter& Parameter::operator=(const Parameter& p)
*/ */
QString Parameter::reconstruct(bool value) const QString Parameter::reconstruct(bool value) const
{ {
QString p = lef + rig; QString p = leftType_ + rightType_;
if (!p.endsWith(QChar('*')) && !p.endsWith(QChar('&')) && !p.endsWith(QChar(' '))) if (!p.endsWith(QChar('*')) && !p.endsWith(QChar('&')) && !p.endsWith(QChar(' ')))
p += QLatin1Char(' '); p += QLatin1Char(' ');
p += nam; p += name_;
if (value && !def.isEmpty()) if (value && !defaultValue_.isEmpty())
p += " = " + def; p += " = " + defaultValue_;
return p; return p;
} }
@ -1797,15 +1795,15 @@ QString Parameter::reconstruct(bool value) const
*/ */
FunctionNode::FunctionNode(InnerNode *parent, const QString& name) FunctionNode::FunctionNode(InnerNode *parent, const QString& name)
: LeafNode(Function, parent, name), : LeafNode(Function, parent, name),
met(Plain), metaness_(Plain),
vir(NonVirtual), virtualness_(NonVirtual),
con(false), const_(false),
sta(false), static_(false),
ove(false), overload_(false),
reimp(false), reimplemented_(false),
attached_(false), attached_(false),
rf(0), reimplementedFrom_(0),
ap(0) associatedProperty_(0)
{ {
setGenus(Node::CPP); setGenus(Node::CPP);
} }
@ -1817,15 +1815,15 @@ FunctionNode::FunctionNode(InnerNode *parent, const QString& name)
*/ */
FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bool attached) FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bool attached)
: LeafNode(type, parent, name), : LeafNode(type, parent, name),
met(Plain), metaness_(Plain),
vir(NonVirtual), virtualness_(NonVirtual),
con(false), const_(false),
sta(false), static_(false),
ove(false), overload_(false),
reimp(false), reimplemented_(false),
attached_(attached), attached_(attached),
rf(0), reimplementedFrom_(0),
ap(0) associatedProperty_(0)
{ {
setGenus(Node::QML); setGenus(Node::QML);
if (type == QmlMethod || type == QmlSignal) { if (type == QmlMethod || type == QmlSignal) {
@ -1841,32 +1839,31 @@ FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bo
is PureVirtual, and if the parent() is a ClassNode, set the parent's is PureVirtual, and if the parent() is a ClassNode, set the parent's
\e abstract flag to true. \e abstract flag to true.
*/ */
void FunctionNode::setVirtualness(Virtualness virtualness) void FunctionNode::setVirtualness(Virtualness v)
{ {
vir = virtualness; virtualness_ = v;
if ((virtualness == PureVirtual) && parent() && if ((v == PureVirtual) && parent() && (parent()->type() == Node::Class))
(parent()->type() == Node::Class))
parent()->setAbstract(true); parent()->setAbstract(true);
} }
/*! /*!
*/ */
void FunctionNode::setOverload(bool overlode) void FunctionNode::setOverload(bool b)
{ {
parent()->setOverload(this, overlode); parent()->setOverload(this, b);
ove = overlode; overload_ = b;
} }
/*! /*!
Sets the function node's reimplementation flag to \a r. Sets the function node's reimplementation flag to \a b.
When \a r is true, it is supposed to mean that this function When \a b is true, it is supposed to mean that this function
is a reimplementation of a virtual function in a base class, is a reimplementation of a virtual function in a base class,
but it really just means the \e reimp command was seen in the but it really just means the \e {\\reimp} command was seen in
qdoc comment. the qdoc comment.
*/ */
void FunctionNode::setReimp(bool r) void FunctionNode::setReimplemented(bool b)
{ {
reimp = r; reimplemented_ = b;
} }
/*! /*!
@ -1874,16 +1871,16 @@ void FunctionNode::setReimp(bool r)
*/ */
void FunctionNode::addParameter(const Parameter& parameter) void FunctionNode::addParameter(const Parameter& parameter)
{ {
params.append(parameter); parameters_.append(parameter);
} }
/*! /*!
*/ */
void FunctionNode::borrowParameterNames(const FunctionNode *source) void FunctionNode::borrowParameterNames(const FunctionNode *source)
{ {
QList<Parameter>::Iterator t = params.begin(); QList<Parameter>::Iterator t = parameters_.begin();
QList<Parameter>::ConstIterator s = source->params.constBegin(); QList<Parameter>::ConstIterator s = source->parameters_.constBegin();
while (s != source->params.constEnd() && t != params.end()) { while (s != source->parameters_.constEnd() && t != parameters_.end()) {
if (!(*s).name().isEmpty()) if (!(*s).name().isEmpty())
(*t).setName((*s).name()); (*t).setName((*s).name());
++s; ++s;
@ -1895,19 +1892,19 @@ void FunctionNode::borrowParameterNames(const FunctionNode *source)
If this function is a reimplementation, \a from points If this function is a reimplementation, \a from points
to the FunctionNode of the function being reimplemented. to the FunctionNode of the function being reimplemented.
*/ */
void FunctionNode::setReimplementedFrom(FunctionNode *from) void FunctionNode::setReimplementedFrom(FunctionNode *f)
{ {
rf = from; reimplementedFrom_ = f;
from->rb.append(this); f->reimplementedBy_.append(this);
} }
/*! /*!
Sets the "associated" property to \a property. The function Sets the "associated" property to \a property. The function
might be the setter or getter for a property, for example. 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;
} }
/*! /*!
@ -1955,15 +1952,15 @@ QString FunctionNode::rawParameters(bool names, bool values) const
Returns the list of reconstructed parameters. If \a values Returns the list of reconstructed parameters. If \a values
is true, the default values are included, if any are present. 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(); QList<Parameter>::ConstIterator p = parameters().constBegin();
while (p != parameters().constEnd()) { while (p != parameters().constEnd()) {
params << (*p).reconstruct(values); reconstructedParameters << (*p).reconstruct(values);
++p; ++p;
} }
return params; return reconstructedParameters;
} }
/*! /*!
@ -1977,11 +1974,11 @@ QString FunctionNode::signature(bool values) const
if (!returnType().isEmpty()) if (!returnType().isEmpty())
s = returnType() + QLatin1Char(' '); s = returnType() + QLatin1Char(' ');
s += name() + QLatin1Char('('); s += name() + QLatin1Char('(');
QStringList params = reconstructParams(values); QStringList reconstructedParameters = reconstructParameters(values);
int p = params.size(); int p = reconstructedParameters.size();
if (p > 0) { if (p > 0) {
for (int i=0; i<p; i++) { for (int i=0; i<p; i++) {
s += params[i]; s += reconstructedParameters[i];
if (i < (p-1)) if (i < (p-1))
s += ", "; s += ", ";
} }
@ -1995,8 +1992,8 @@ QString FunctionNode::signature(bool values) const
*/ */
void FunctionNode::debug() const void FunctionNode::debug() const
{ {
qDebug("QML METHOD %s rt %s pp %s", qDebug("QML METHOD %s returnType_ %s parentPath_ %s",
qPrintable(name()), qPrintable(rt), qPrintable(pp.join(' '))); qPrintable(name()), qPrintable(returnType_), qPrintable(parentPath_.join(' ')));
} }
/*! /*!
@ -2016,10 +2013,10 @@ PropertyNode::PropertyNode(InnerNode *parent, const QString& name)
scriptable_(FlagValueDefault), scriptable_(FlagValueDefault),
writable_(FlagValueDefault), writable_(FlagValueDefault),
user_(FlagValueDefault), user_(FlagValueDefault),
cst(false), const_(false),
fnl(false), final_(false),
rev(-1), revision_(-1),
overrides(0) overrides_(0)
{ {
setGenus(Node::CPP); setGenus(Node::CPP);
} }
@ -2037,8 +2034,8 @@ PropertyNode::PropertyNode(InnerNode *parent, const QString& name)
void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty) void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty)
{ {
for (int i = 0; i < NumFunctionRoles; ++i) { for (int i = 0; i < NumFunctionRoles; ++i) {
if (funcs[i].isEmpty()) if (functions_[i].isEmpty())
funcs[i] = baseProperty->funcs[i]; functions_[i] = baseProperty->functions_[i];
} }
if (stored_ == FlagValueDefault) if (stored_ == FlagValueDefault)
stored_ = baseProperty->stored_; stored_ = baseProperty->stored_;
@ -2050,7 +2047,7 @@ void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty)
writable_ = baseProperty->writable_; writable_ = baseProperty->writable_;
if (user_ == FlagValueDefault) if (user_ == FlagValueDefault)
user_ = baseProperty->user_; user_ = baseProperty->user_;
overrides = baseProperty; overrides_ = baseProperty;
} }
/*! /*!

View File

@ -115,7 +115,7 @@ public:
Obsolete, Obsolete,
Deprecated, Deprecated,
Preliminary, Preliminary,
Commendable, Active,
Internal, Internal,
Intermediate Intermediate
}; // don't reorder this enum }; // don't reorder this enum
@ -132,13 +132,7 @@ public:
NextLink, NextLink,
PreviousLink, PreviousLink,
ContentsLink, ContentsLink,
IndexLink /*, IndexLink
GlossaryLink,
CopyrightLink,
ChapterLink,
SectionLink,
SubsectionLink,
AppendixLink */
}; };
enum PageType { enum PageType {
@ -172,20 +166,20 @@ public:
Node::Genus genus() const { return (Genus) genus_; } Node::Genus genus() const { return (Genus) genus_; }
void setGenus(Genus t) { genus_ = (unsigned char) t; } void setGenus(Genus t) { genus_ = (unsigned char) t; }
void setAccess(Access access) { access_ = (unsigned char) access; } void setAccess(Access t) { access_ = (unsigned char) t; }
void setLocation(const Location& location) { loc_ = location; } void setLocation(const Location& location) { loc_ = location; }
void setDoc(const Doc& doc, bool replace = false); void setDoc(const Doc& doc, bool replace = false);
void setStatus(Status status) { void setStatus(Status t) {
if (status_ == (unsigned char) Obsolete && status == Deprecated) if (status_ == (unsigned char) Obsolete && t == Deprecated)
return; return;
status_ = (unsigned char) status; status_ = (unsigned char) t;
} }
void setThreadSafeness(ThreadSafeness safeness) { safeness_ = (unsigned char) safeness; } void setThreadSafeness(ThreadSafeness t) { safeness_ = (unsigned char) t; }
void setSince(const QString &since); void setSince(const QString &since);
void setRelates(InnerNode* pseudoParent); void setRelates(InnerNode* pseudoParent);
void setPhysicalModuleName(const QString &name) { physicalModuleName_ = name; } void setPhysicalModuleName(const QString &name) { physicalModuleName_ = name; }
void setUrl(const QString& url) { url_ = url; } void setUrl(const QString& url) { url_ = url; }
void setTemplateStuff(const QString &templateStuff) { templateStuff_ = templateStuff; } void setTemplateStuff(const QString &t) { templateStuff_ = t; }
void setReconstitutedBrief(const QString &t) { reconstitutedBrief_ = t; } void setReconstitutedBrief(const QString &t) { reconstitutedBrief_ = t; }
void setPageType(PageType t) { pageType_ = (unsigned char) t; } void setPageType(PageType t) { pageType_ = (unsigned char) t; }
void setPageType(const QString& t); void setPageType(const QString& t);
@ -212,7 +206,7 @@ public:
virtual bool isExampleFile() const { return false; } virtual bool isExampleFile() const { return false; }
virtual bool isHeaderFile() const { return false; } virtual bool isHeaderFile() const { return false; }
virtual bool isLeaf() const { return false; } virtual bool isLeaf() const { return false; }
virtual bool isReimp() const { return false; } virtual bool isReimplemented() const { return false; }
virtual bool isFunction() const { return false; } virtual bool isFunction() const { return false; }
virtual bool isNamespace() const { return false; } virtual bool isNamespace() const { return false; }
virtual bool isClass() const { return false; } virtual bool isClass() const { return false; }
@ -760,14 +754,14 @@ class EnumItem
public: public:
EnumItem() { } EnumItem() { }
EnumItem(const QString& name, const QString& value) EnumItem(const QString& name, const QString& value)
: nam(name), val(value) { } : name_(name), value_(value) { }
const QString& name() const { return nam; } const QString& name() const { return name_; }
const QString& value() const { return val; } const QString& value() const { return value_; }
private: private:
QString nam; QString name_;
QString val; QString value_;
}; };
class EnumNode : public LeafNode class EnumNode : public LeafNode
@ -778,17 +772,17 @@ public:
void addItem(const EnumItem& item); void addItem(const EnumItem& item);
void setFlagsType(TypedefNode* typedeff); void setFlagsType(TypedefNode* typedeff);
bool hasItem(const QString &name) const { return names.contains(name); } bool hasItem(const QString &name) const { return names_.contains(name); }
const QList<EnumItem>& items() const { return itms; } const QList<EnumItem>& items() const { return items_; }
Access itemAccess(const QString& name) const; Access itemAccess(const QString& name) const;
const TypedefNode* flagsType() const { return ft; } const TypedefNode* flagsType() const { return flagsType_; }
QString itemValue(const QString &name) const; QString itemValue(const QString &name) const;
private: private:
QList<EnumItem> itms; QList<EnumItem> items_;
QSet<QString> names; QSet<QString> names_;
const TypedefNode* ft; const TypedefNode* flagsType_;
}; };
class TypedefNode : public LeafNode class TypedefNode : public LeafNode
@ -797,20 +791,20 @@ public:
TypedefNode(InnerNode* parent, const QString& name); TypedefNode(InnerNode* parent, const QString& name);
virtual ~TypedefNode() { } virtual ~TypedefNode() { }
const EnumNode* associatedEnum() const { return ae; } const EnumNode* associatedEnum() const { return associatedEnum_; }
private: private:
void setAssociatedEnum(const EnumNode* enume); void setAssociatedEnum(const EnumNode* t);
friend class EnumNode; friend class EnumNode;
const EnumNode* ae; const EnumNode* associatedEnum_;
}; };
inline void EnumNode::setFlagsType(TypedefNode* typedeff) inline void EnumNode::setFlagsType(TypedefNode* t)
{ {
ft = typedeff; flagsType_ = t;
typedeff->setAssociatedEnum(this); t->setAssociatedEnum(this);
} }
@ -826,21 +820,21 @@ public:
Parameter& operator=(const Parameter& p); Parameter& operator=(const Parameter& p);
void setName(const QString& name) { nam = name; } void setName(const QString& name) { name_ = name; }
bool hasType() const { return lef.length() + rig.length() > 0; } bool hasType() const { return leftType_.length() + rightType_.length() > 0; }
const QString& leftType() const { return lef; } const QString& leftType() const { return leftType_; }
const QString& rightType() const { return rig; } const QString& rightType() const { return rightType_; }
const QString& name() const { return nam; } const QString& name() const { return name_; }
const QString& defaultValue() const { return def; } const QString& defaultValue() const { return defaultValue_; }
QString reconstruct(bool value = false) const; QString reconstruct(bool value = false) const;
private: private:
QString lef; QString leftType_;
QString rig; QString rightType_;
QString nam; QString name_;
QString def; QString defaultValue_;
}; };
class FunctionNode : public LeafNode class FunctionNode : public LeafNode
@ -855,35 +849,35 @@ public:
MacroWithParams, MacroWithParams,
MacroWithoutParams, MacroWithoutParams,
Native }; Native };
enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual }; enum Virtualness { NonVirtual, NormalVirtual, PureVirtual };
FunctionNode(InnerNode* parent, const QString &name); FunctionNode(InnerNode* parent, const QString &name);
FunctionNode(Type type, InnerNode* parent, const QString &name, bool attached); FunctionNode(Type type, InnerNode* parent, const QString &name, bool attached);
virtual ~FunctionNode() { } virtual ~FunctionNode() { }
void setReturnType(const QString& returnType) { rt = returnType; } void setReturnType(const QString& t) { returnType_ = t; }
void setParentPath(const QStringList& parentPath) { pp = parentPath; } void setParentPath(const QStringList& p) { parentPath_ = p; }
void setMetaness(Metaness metaness) { met = metaness; } void setMetaness(Metaness t) { metaness_ = t; }
void setVirtualness(Virtualness virtualness); void setVirtualness(Virtualness v);
void setConst(bool conste) { con = conste; } void setConst(bool b) { const_ = b; }
void setStatic(bool statique) { sta = statique; } void setStatic(bool b) { static_ = b; }
void setOverload(bool overlode); void setOverload(bool b);
void setReimp(bool r); void setReimplemented(bool b);
void addParameter(const Parameter& parameter); void addParameter(const Parameter& parameter);
inline void setParameters(const QList<Parameter>& parameters); inline void setParameters(const QList<Parameter>& parameters);
void borrowParameterNames(const FunctionNode* source); void borrowParameterNames(const FunctionNode* source);
void setReimplementedFrom(FunctionNode* from); void setReimplementedFrom(FunctionNode* from);
const QString& returnType() const { return rt; } const QString& returnType() const { return returnType_; }
Metaness metaness() const { return met; } Metaness metaness() const { return metaness_; }
bool isMacro() const { bool isMacro() const {
return met == MacroWithParams || met == MacroWithoutParams; return metaness_ == MacroWithParams || metaness_ == MacroWithoutParams;
} }
Virtualness virtualness() const { return vir; } Virtualness virtualness() const { return virtualness_; }
bool isConst() const { return con; } bool isConst() const { return const_; }
bool isStatic() const { return sta; } bool isStatic() const { return static_; }
bool isOverload() const { return ove; } bool isOverload() const { return overload_; }
bool isReimp() const Q_DECL_OVERRIDE { return reimp; } bool isReimplemented() const Q_DECL_OVERRIDE { return reimplemented_; }
bool isFunction() const Q_DECL_OVERRIDE { return true; } bool isFunction() const Q_DECL_OVERRIDE { return true; }
virtual bool isQmlSignal() const Q_DECL_OVERRIDE { virtual bool isQmlSignal() const Q_DECL_OVERRIDE {
return (type() == Node::QmlSignal) && (genus() == Node::QML); return (type() == Node::QmlSignal) && (genus() == Node::QML);
@ -904,16 +898,16 @@ public:
return (type() == Node::QmlMethod) && (genus() == Node::JS); return (type() == Node::QmlMethod) && (genus() == Node::JS);
} }
int overloadNumber() const; int overloadNumber() const;
const QList<Parameter>& parameters() const { return params; } const QList<Parameter>& parameters() const { return parameters_; }
void clearParams() { params.clear(); } void clearParams() { parameters_.clear(); }
QStringList parameterNames() const; QStringList parameterNames() const;
QString rawParameters(bool names = false, bool values = false) const; QString rawParameters(bool names = false, bool values = false) const;
const FunctionNode* reimplementedFrom() const { return rf; } const FunctionNode* reimplementedFrom() const { return reimplementedFrom_; }
const QList<FunctionNode*> &reimplementedBy() const { return rb; } const QList<FunctionNode*> &reimplementedBy() const { return reimplementedBy_; }
const PropertyNode* associatedProperty() const { return ap; } const PropertyNode* associatedProperty() const { return associatedProperty_; }
const QStringList& parentPath() const { return pp; } const QStringList& parentPath() const { return parentPath_; }
QStringList reconstructParams(bool values = false) const; QStringList reconstructParameters(bool values = false) const;
QString signature(bool values = false) const; QString signature(bool values = false) const;
virtual QString element() const Q_DECL_OVERRIDE { return parent()->name(); } virtual QString element() const Q_DECL_OVERRIDE { return parent()->name(); }
virtual bool isAttached() const Q_DECL_OVERRIDE { return attached_; } virtual bool isAttached() const Q_DECL_OVERRIDE { return attached_; }
@ -937,19 +931,19 @@ private:
friend class InnerNode; friend class InnerNode;
friend class PropertyNode; friend class PropertyNode;
QString rt; QString returnType_;
QStringList pp; QStringList parentPath_;
Metaness met; Metaness metaness_;
Virtualness vir; Virtualness virtualness_;
bool con : 1; bool const_ : 1;
bool sta : 1; bool static_ : 1;
bool ove : 1; bool overload_ : 1;
bool reimp: 1; bool reimplemented_: 1;
bool attached_: 1; bool attached_: 1;
QList<Parameter> params; QList<Parameter> parameters_;
const FunctionNode* rf; const FunctionNode* reimplementedFrom_;
const PropertyNode* ap; const PropertyNode* associatedProperty_;
QList<FunctionNode*> rb; QList<FunctionNode*> reimplementedBy_;
}; };
class PropertyNode : public LeafNode class PropertyNode : public LeafNode
@ -971,16 +965,16 @@ public:
void setWritable(bool writable) { writable_ = toFlagValue(writable); } void setWritable(bool writable) { writable_ = toFlagValue(writable); }
void setUser(bool user) { user_ = toFlagValue(user); } void setUser(bool user) { user_ = toFlagValue(user); }
void setOverriddenFrom(const PropertyNode* baseProperty); void setOverriddenFrom(const PropertyNode* baseProperty);
void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc = rdf; } void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc_ = rdf; }
void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc = scrf; } void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc_ = scrf; }
void setConstant() { cst = true; } void setConstant() { const_ = true; }
void setFinal() { fnl = true; } void setFinal() { final_ = true; }
void setRevision(int revision) { rev = revision; } void setRevision(int revision) { revision_ = revision; }
const QString &dataType() const { return type_; } const QString &dataType() const { return type_; }
QString qualifiedDataType() const; QString qualifiedDataType() const;
NodeList functions() const; NodeList functions() const;
NodeList functions(FunctionRole role) const { return funcs[(int)role]; } NodeList functions(FunctionRole role) const { return functions_[(int)role]; }
NodeList getters() const { return functions(Getter); } NodeList getters() const { return functions(Getter); }
NodeList setters() const { return functions(Setter); } NodeList setters() const { return functions(Setter); }
NodeList resetters() const { return functions(Resetter); } NodeList resetters() const { return functions(Resetter); }
@ -988,13 +982,13 @@ public:
bool isStored() const { return fromFlagValue(stored_, storedDefault()); } bool isStored() const { return fromFlagValue(stored_, storedDefault()); }
bool isDesignable() const { return fromFlagValue(designable_, designableDefault()); } bool isDesignable() const { return fromFlagValue(designable_, designableDefault()); }
bool isScriptable() const { return fromFlagValue(scriptable_, scriptableDefault()); } bool isScriptable() const { return fromFlagValue(scriptable_, scriptableDefault()); }
const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc; } const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc_; }
const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc; } const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc_; }
bool isWritable() const { return fromFlagValue(writable_, writableDefault()); } bool isWritable() const { return fromFlagValue(writable_, writableDefault()); }
bool isUser() const { return fromFlagValue(user_, userDefault()); } bool isUser() const { return fromFlagValue(user_, userDefault()); }
bool isConstant() const { return cst; } bool isConstant() const { return const_; }
bool isFinal() const { return fnl; } bool isFinal() const { return final_; }
const PropertyNode* overriddenFrom() const { return overrides; } const PropertyNode* overriddenFrom() const { return overrides_; }
bool storedDefault() const { return true; } bool storedDefault() const { return true; }
bool userDefault() const { return false; } bool userDefault() const { return false; }
@ -1004,34 +998,34 @@ public:
private: private:
QString type_; QString type_;
QString runtimeDesFunc; QString runtimeDesFunc_;
QString runtimeScrFunc; QString runtimeScrFunc_;
NodeList funcs[NumFunctionRoles]; NodeList functions_[NumFunctionRoles];
FlagValue stored_; FlagValue stored_;
FlagValue designable_; FlagValue designable_;
FlagValue scriptable_; FlagValue scriptable_;
FlagValue writable_; FlagValue writable_;
FlagValue user_; FlagValue user_;
bool cst; bool const_;
bool fnl; bool final_;
int rev; int revision_;
const PropertyNode* overrides; const PropertyNode* overrides_;
}; };
inline void FunctionNode::setParameters(const QList<Parameter> &parameters) inline void FunctionNode::setParameters(const QList<Parameter> &p)
{ {
params = parameters; parameters_ = p;
} }
inline void PropertyNode::addFunction(FunctionNode* function, FunctionRole role) inline void PropertyNode::addFunction(FunctionNode* function, FunctionRole role)
{ {
funcs[(int)role].append(function); functions_[(int)role].append(function);
function->setAssociatedProperty(this); function->setAssociatedProperty(this);
} }
inline void PropertyNode::addSignal(FunctionNode* function, FunctionRole role) inline void PropertyNode::addSignal(FunctionNode* function, FunctionRole role)
{ {
funcs[(int)role].append(function); functions_[(int)role].append(function);
function->setAssociatedProperty(this); function->setAssociatedProperty(this);
} }
@ -1039,7 +1033,7 @@ inline NodeList PropertyNode::functions() const
{ {
NodeList list; NodeList list;
for (int i = 0; i < NumFunctionRoles; ++i) for (int i = 0; i < NumFunctionRoles; ++i)
list += funcs[i]; list += functions_[i];
return list; return list;
} }
@ -1049,23 +1043,23 @@ public:
VariableNode(InnerNode* parent, const QString &name); VariableNode(InnerNode* parent, const QString &name);
virtual ~VariableNode() { } virtual ~VariableNode() { }
void setLeftType(const QString &leftType) { lt = leftType; } void setLeftType(const QString &leftType) { lrftType_ = leftType; }
void setRightType(const QString &rightType) { rt = rightType; } void setRightType(const QString &rightType) { rightType_ = rightType; }
void setStatic(bool statique) { sta = statique; } void setStatic(bool b) { static_ = b; }
const QString &leftType() const { return lt; } const QString &leftType() const { return lrftType_; }
const QString &rightType() const { return rt; } const QString &rightType() const { return rightType_; }
QString dataType() const { return lt + rt; } QString dataType() const { return lrftType_ + rightType_; }
bool isStatic() const { return sta; } bool isStatic() const { return static_; }
private: private:
QString lt; QString lrftType_;
QString rt; QString rightType_;
bool sta; bool static_;
}; };
inline VariableNode::VariableNode(InnerNode* parent, const QString &name) inline VariableNode::VariableNode(InnerNode* parent, const QString &name)
: LeafNode(Variable, parent, name), sta(false) : LeafNode(Variable, parent, name), static_(false)
{ {
setGenus(Node::CPP); setGenus(Node::CPP);
} }

View File

@ -486,8 +486,8 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
QString t = element.attribute("virtual"); QString t = element.attribute("virtual");
if (t == "non") if (t == "non")
virt = FunctionNode::NonVirtual; virt = FunctionNode::NonVirtual;
else if (t == "impure") else if (t == "virtual")
virt = FunctionNode::ImpureVirtual; virt = FunctionNode::NormalVirtual;
else if (t == "pure") else if (t == "pure")
virt = FunctionNode::PureVirtual; virt = FunctionNode::PureVirtual;
else else
@ -613,12 +613,12 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
node->setStatus(Node::Obsolete); node->setStatus(Node::Obsolete);
else if (status == "preliminary") else if (status == "preliminary")
node->setStatus(Node::Preliminary); node->setStatus(Node::Preliminary);
else if (status == "commendable") else if (status == "active")
node->setStatus(Node::Commendable); node->setStatus(Node::Active);
else if (status == "internal") else if (status == "internal")
node->setStatus(Node::Internal); node->setStatus(Node::Internal);
else else
node->setStatus(Node::Commendable); node->setStatus(Node::Active);
QString physicalModuleName = element.attribute("module"); QString physicalModuleName = element.attribute("module");
if (!physicalModuleName.isEmpty()) if (!physicalModuleName.isEmpty())
@ -885,8 +885,8 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
case Node::Preliminary: case Node::Preliminary:
status = "preliminary"; status = "preliminary";
break; break;
case Node::Commendable: case Node::Active:
status = "commendable"; status = "active";
break; break;
case Node::Internal: case Node::Internal:
status = "internal"; status = "internal";
@ -1139,8 +1139,8 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
case FunctionNode::NonVirtual: case FunctionNode::NonVirtual:
writer.writeAttribute("virtual", "non"); writer.writeAttribute("virtual", "non");
break; break;
case FunctionNode::ImpureVirtual: case FunctionNode::NormalVirtual:
writer.writeAttribute("virtual", "impure"); writer.writeAttribute("virtual", "virtual");
break; break;
case FunctionNode::PureVirtual: case FunctionNode::PureVirtual:
writer.writeAttribute("virtual", "pure"); writer.writeAttribute("virtual", "pure");

View File

@ -268,7 +268,7 @@ void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter& writer, const InnerN
case FunctionNode::NonVirtual: case FunctionNode::NonVirtual:
writer.writeAttribute("virtualness", "non"); writer.writeAttribute("virtualness", "non");
break; break;
case FunctionNode::ImpureVirtual: case FunctionNode::NormalVirtual:
writer.writeAttribute("virtualness", "virtual"); writer.writeAttribute("virtualness", "virtual");
break; break;
case FunctionNode::PureVirtual: case FunctionNode::PureVirtual:

View File

@ -421,7 +421,7 @@ void Tree::resolveInheritanceHelper(int pass, ClassNode* cn)
FunctionNode* from = findVirtualFunctionInBaseClasses(cn, func); FunctionNode* from = findVirtualFunctionInBaseClasses(cn, func);
if (from != 0) { if (from != 0) {
if (func->virtualness() == FunctionNode::NonVirtual) if (func->virtualness() == FunctionNode::NonVirtual)
func->setVirtualness(FunctionNode::ImpureVirtual); func->setVirtualness(FunctionNode::NormalVirtual);
func->setReimplementedFrom(from); func->setReimplementedFrom(from);
} }
} }