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

View File

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

View File

@ -702,7 +702,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
}
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()));
}
}
@ -714,7 +714,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
if (!generateText(node->doc().body(), node, marker)) {
if (node->isReimp())
if (node->isReimplemented())
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(
tr("Undocumented parameter '%1' in %2")
.arg(*a).arg(node->plainFullName()));
@ -1191,7 +1191,8 @@ void Generator::generateStatus(const Node *node, CodeMarker *marker)
Text text;
switch (node->status()) {
case Node::Commendable:
case Node::Active:
// Do nothing.
break;
case Node::Preliminary:
text << Atom::ParaLeft

View File

@ -205,7 +205,7 @@ Node::Node(Type type, InnerNode *parent, const QString& name)
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),
@ -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);
@ -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 *&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());
@ -905,8 +905,7 @@ void InnerNode::normalizeOverloads()
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;
}
}
@ -1670,7 +1668,7 @@ QString DocumentNode::subTitle() const
has a \a parent class and an enum type \a name.
*/
EnumNode::EnumNode(InnerNode *parent, const QString& name)
: LeafNode(Enum, parent, name), ft(0)
: 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();
}
@ -1715,7 +1713,7 @@ QString EnumNode::itemValue(const QString &name) const
/*!
*/
TypedefNode::TypedefNode(InnerNode *parent, const QString& name)
: LeafNode(Typedef, parent, name), ae(0)
: 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;
}
@ -1797,15 +1795,15 @@ QString Parameter::reconstruct(bool value) const
*/
FunctionNode::FunctionNode(InnerNode *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),
rf(0),
ap(0)
reimplementedFrom_(0),
associatedProperty_(0)
{
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)
: 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),
rf(0),
ap(0)
reimplementedFrom_(0),
associatedProperty_(0)
{
setGenus(Node::QML);
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
\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;
}
/*!
@ -1874,16 +1871,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;
@ -1895,19 +1892,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;
}
/*!
@ -1955,15 +1952,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;
}
/*!
@ -1977,11 +1974,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 += ", ";
}
@ -1995,8 +1992,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(' ')));
}
/*!
@ -2016,10 +2013,10 @@ PropertyNode::PropertyNode(InnerNode *parent, const QString& name)
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);
}
@ -2037,8 +2034,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_;
@ -2050,7 +2047,7 @@ void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty)
writable_ = baseProperty->writable_;
if (user_ == FlagValueDefault)
user_ = baseProperty->user_;
overrides = baseProperty;
overrides_ = baseProperty;
}
/*!

View File

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

View File

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

View File

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

View File

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