summaryrefslogtreecommitdiffstats
path: root/src/dbusxmlscanner.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2012-04-08 14:16:03 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2012-04-08 14:16:03 (GMT)
commitc02e23403ebac29078e51df54f796ee71c0e8c3e (patch)
treeffd092e761289b417363c0562ceb9b93b88f19a4 /src/dbusxmlscanner.cpp
parent4126eaa26d354ddd0e9aad8183f140f8f911442e (diff)
downloadDoxygen-c02e23403ebac29078e51df54f796ee71c0e8c3e.zip
Doxygen-c02e23403ebac29078e51df54f796ee71c0e8c3e.tar.gz
Doxygen-c02e23403ebac29078e51df54f796ee71c0e8c3e.tar.bz2
Release-1.8.0-20120408
Diffstat (limited to 'src/dbusxmlscanner.cpp')
-rw-r--r--src/dbusxmlscanner.cpp106
1 files changed, 53 insertions, 53 deletions
diff --git a/src/dbusxmlscanner.cpp b/src/dbusxmlscanner.cpp
index 51b0a59..f116d5e 100644
--- a/src/dbusxmlscanner.cpp
+++ b/src/dbusxmlscanner.cpp
@@ -43,7 +43,7 @@
while (0)
#define DOC_ERROR(msg) \
- warn_doc_error(m_fileName.utf8().data(), lineNumber(), msg.utf8().data())
+ warn_doc_error(m_fileName.data(), lineNumber(), msg.data())
#define COND_DOC_ERROR(cond, msg) \
do {\
@@ -106,7 +106,7 @@ public:
const QXmlAttributes &attributes)
{
// add to elements stack:
- m_elementStack.append(new ElementData(qName));
+ m_elementStack.append(new ElementData(qName.utf8()));
// First we need a node.
if (DBUS("node"))
@@ -114,9 +114,9 @@ public:
CONDITION(!m_currentNode.isEmpty(), "Node inside a node.");
const int idx(indexOf(attributes, "name"));
- COND_DOC_ERROR(idx < 0, QString("Anonymous node found."));
+ COND_DOC_ERROR(idx < 0, QCString("Anonymous node found."));
- m_currentNode = attributes.value(idx);
+ m_currentNode = attributes.value(idx).utf8();
// A node is actually of little interest, so do nothing here.
return true;
}
@@ -137,7 +137,7 @@ public:
m_currentInterface->section = Entry::CLASS_SEC;
m_currentInterface->spec |= Entry::Interface;
m_currentInterface->type = "Interface";
- m_currentInterface->name = substitute(attributes.value(idx), ".", "::");
+ m_currentInterface->name = substitute(attributes.value(idx).utf8(), ".", "::");
openScopes(m_currentInterface);
@@ -159,7 +159,7 @@ public:
m_currentMethod = createEntry();
m_currentMethod->section = Entry::FUNCTION_SEC;
- m_currentMethod->name = attributes.value(idx);
+ m_currentMethod->name = attributes.value(idx).utf8();
m_currentMethod->mtype = Method;
m_currentMethod->type = "void";
@@ -192,10 +192,10 @@ public:
}
m_currentArgument = new Argument;
- m_currentArgument->type = getType(attributes);
- m_currentArgument->name = attributes.value(name_idx);
+ m_currentArgument->type = getType(attributes).utf8();
+ m_currentArgument->name = attributes.value(name_idx).utf8();
if (direction_idx >= 0)
- { m_currentArgument->attrib = attributes.value(direction_idx); }
+ { m_currentArgument->attrib = attributes.value(direction_idx).utf8(); }
else
{
if (m_currentMethod->mtype == Signal)
@@ -237,9 +237,9 @@ public:
attributes.value(access_idx) == "readwrite")
{ m_currentProperty->spec |= Entry::Writable; }
- m_currentProperty->name = attributes.value(name_idx);
+ m_currentProperty->name = attributes.value(name_idx).utf8();
m_currentProperty->mtype = Property;
- m_currentProperty->type = getType(attributes);
+ m_currentProperty->type = getType(attributes).utf8();
}
if (EXTENSION("namespace"))
@@ -266,7 +266,7 @@ public:
Entry * current_struct = createEntry();
current_struct->section = Entry::CLASS_SEC;
current_struct->spec = Entry::Struct;
- current_struct->name = attributes.value(idx);
+ current_struct->name = attributes.value(idx).utf8();
openScopes(current_struct);
@@ -286,11 +286,11 @@ public:
createEntry();
m_currentEntry->section = Entry::VARIABLE_SEC;
- m_currentEntry->name = attributes.value(name_idx);
- m_currentEntry->type = getType(attributes);
+ m_currentEntry->name = attributes.value(name_idx).utf8();
+ m_currentEntry->type = getType(attributes).utf8();
QString type(getDBusType(m_currentEntry->type));
- m_structStack.last()->type.append(type);
+ m_structStack.last()->type.append(type.utf8());
}
if (EXTENSION("enum") || EXTENSION("flagset"))
@@ -310,13 +310,13 @@ public:
m_currentEnum = createEntry();
m_currentEnum->section = Entry::ENUM_SEC;
- m_currentEnum->name = attributes.value(name_idx);
+ m_currentEnum->name = attributes.value(name_idx).utf8();
openScopes(m_currentEnum);
m_currentEnum->type = m_currentEntry->name + " enum";
- addNamedType(type);
+ addNamedType(type.utf8());
}
if (EXTENSION("value"))
@@ -331,10 +331,10 @@ public:
createEntry();
m_currentEntry->section = Entry::VARIABLE_SEC;
- m_currentEntry->name = attributes.value(name_idx);
+ m_currentEntry->name = attributes.value(name_idx).utf8();
m_currentEntry->type = m_currentEnum->name; // "@"; // enum marker!
if (value_idx >= 0)
- { m_currentEntry->initializer = attributes.value(value_idx); }
+ { m_currentEntry->initializer = attributes.value(value_idx).utf8(); }
}
return true;
@@ -347,9 +347,9 @@ public:
// Clean up elements stack:
// Since we made sure to get the elements in the proper order when
// adding we do not need to do so again here.
- COND_DOC_ERROR(m_elementStack.last()->element != qName,
+ COND_DOC_ERROR(m_elementStack.last()->element != qName.utf8(),
QString("Malformed XML: Unexpected closing element found.").
- arg(m_elementStack.last()->element));
+ arg(m_elementStack.last()->element).utf8());
m_elementStack.removeLast();
// Interface:
@@ -408,7 +408,7 @@ public:
current_type.append(data->type);
current_type.append(QString(")"));
- addNamedType(current_type);
+ addNamedType(current_type.utf8());
closeScopes();
@@ -450,7 +450,7 @@ public:
if (m_currentComment)
{ handleComment(); }
- m_currentComment = new CommentData(m_fileName, lineNumber(), comment_);
+ m_currentComment = new CommentData(m_fileName, lineNumber(), comment_.utf8());
if (m_currentComment->shouldIgnore)
{
@@ -483,7 +483,7 @@ public:
while (parseCommentBlock(m_parser,
m_currentEntry,
- text, m_fileName.utf8().data(),
+ text, m_fileName.data(),
lineNr,
brief, m_currentComment->isJavaStyle,
false,
@@ -510,7 +510,7 @@ public:
Entry * current = createEntry();
current->reset();
- current->name = m_fileName.utf8();
+ current->name = m_fileName;
current->section = Entry::SOURCE_SEC;
// Open/Close the scope to do the bookkeeping:
@@ -551,20 +551,20 @@ private:
const int type_idx(indexOf(attributes, "type"));
const int named_type_idx(indexOf(attributes, "named-type"));
- QString type;
+ QCString type;
if (named_type_idx >= 0)
{
- type = attributes.value(named_type_idx);
- if (!type.startsWith("::"))
- { type = getCurrentScope(attributes.value(named_type_idx)); }
+ type = attributes.value(named_type_idx).utf8();
+ if (type.left(2)!="::")
+ { type = getCurrentScope(attributes.value(named_type_idx).utf8()); }
else
{ type = type.mid(2); }
if (m_namedTypeMap.contains(type))
{
if (type_idx >= 0)
{
- const QString dbus_type(attributes.value(type_idx));
+ const QCString dbus_type(attributes.value(type_idx).utf8());
if (dbus_type != m_namedTypeMap[type])
{
DOC_ERROR(QString("Type \"%1\" does not match up with "
@@ -582,7 +582,7 @@ private:
if (type_idx >= 0)
{
- type = attributes.value(type_idx);
+ type = attributes.value(type_idx).utf8();
QRegExp reg_exp(QCString("(a?[ybnqiuxdtsogv]|a[{]sv[}])"));
if (reg_exp.match(type.data()))
@@ -594,9 +594,9 @@ private:
return QString();
}
- QString getDBusType(const QString & type)
+ QString getDBusType(const QCString & type)
{
- QString scoped_type = type;
+ QCString scoped_type = type;
if (!scoped_type.contains("::"))
{ scoped_type = getCurrentScope(type); }
@@ -606,9 +606,9 @@ private:
{ return type; }
}
- void addNamedType(const QString type)
+ void addNamedType(const QCString &type)
{
- QString scoped_name(getCurrentScope());
+ QCString scoped_name(getCurrentScope());
if (m_namedTypeMap.contains(scoped_name))
{
@@ -619,9 +619,9 @@ private:
m_namedTypeMap.insert(scoped_name, type);
}
- QString getCurrentScope(const QString & type = QString())
+ QCString getCurrentScope(const QCString & type = QCString())
{
- QString scoped_name;
+ QCString scoped_name;
if (!m_scopeStack.isEmpty())
{
scoped_name = m_scopeStack.last()->scope->name;
@@ -690,7 +690,7 @@ private:
m_scopeStack.append(new ScopeData(current_namespace, m_scopeCount));
}
- QString scoped_name(getCurrentScope());
+ QCString scoped_name(getCurrentScope());
if (!scoped_name.isEmpty())
{ scoped_name.append("::"); }
scoped_name.append(object->name.mid(last_scope_separator_pos));
@@ -707,10 +707,10 @@ private:
Entry * openNamespace(const QString & name)
{
Entry * current_namespace = createEntry();
- QString scoped_name(getCurrentScope());
+ QCString scoped_name(getCurrentScope());
if (!scoped_name.isEmpty())
{ scoped_name.append("::"); }
- scoped_name.append(name);
+ scoped_name.append(name.utf8());
current_namespace->name = scoped_name;
current_namespace->section = Entry::NAMESPACE_SEC;
current_namespace->type = "namespace" ;
@@ -733,17 +733,17 @@ private:
ParserInterface * m_parser;
QXmlLocator m_locator;
- QString m_currentNode; // Nodes can not be nested, no entry necessary.
+ QCString m_currentNode; // Nodes can not be nested, no entry necessary.
struct ElementData
{
- ElementData(const QString & e) :
+ ElementData(const QCString & e) :
element(e)
{ }
~ElementData() { }
- QString element; //*< The element name
- QString text; //*< The actual xml code.
+ QCString element; //*< The element name
+ QCString text; //*< The actual xml code.
};
QList<ElementData> m_elementStack;
@@ -761,7 +761,7 @@ private:
StructData(Entry * e) : entry(e) { }
~StructData() { }
- QString type;
+ QCString type;
Entry * entry;
};
QList<StructData> m_structStack; // Structs can be nested.
@@ -779,20 +779,20 @@ private:
};
QList<ScopeData> m_scopeStack; // Scopes are nested.
- QString m_fileName;
+ QCString m_fileName;
struct CommentData
{
- CommentData(const QString & f, const int l, const QString & t) :
+ CommentData(const QCString & f, const int l, const QCString & t) :
isJavaStyle(false),
isQtStyle(false),
line(l),
fileName(f)
{
- isJavaStyle = t.startsWith(QChar('*'));
- isQtStyle = t.startsWith(QChar('!'));
+ isJavaStyle = t.length()>0 && t.at(0)=='*';
+ isQtStyle = t.length()>0 && t.at(0)=='!';
shouldIgnore = (!isJavaStyle && !isQtStyle);
- associateWithPrevious = (t.at(1) == QChar('<'));
+ associateWithPrevious = (t.length()>1 && t.at(1)=='<');
if (associateWithPrevious)
{ text = t.mid(2); }
else
@@ -800,13 +800,13 @@ private:
}
~CommentData() { }
- QString text;
+ QCString text;
bool isJavaStyle;
bool isQtStyle;
bool shouldIgnore;
bool associateWithPrevious;
int line;
- QString fileName;
+ QCString fileName;
};
CommentData * m_currentComment;
@@ -814,7 +814,7 @@ private:
QString m_errorString;
- QMap<QString, QString> m_namedTypeMap;
+ QMap<QCString, QCString> m_namedTypeMap;
};
// -----------------------------------------------------------------------