Qt 4.8
Classes | Public Types | Static Public Functions | Private Functions | List of all members
QDBusIntrospection Class Reference

Information about introspected objects and interfaces on D-Bus. More...

#include <qdbusintrospection_p.h>

Classes

class  Argument
 One argument to a D-Bus method or signal. More...
 
class  Interface
 Information about one interface on the bus. More...
 
class  Method
 Information about one method. More...
 
class  Object
 Information about one object on the bus. More...
 
class  ObjectTree
 Complete information about one object node and its descendency. More...
 
class  Property
 Information about one property. More...
 
class  Signal
 Information about one signal. More...
 

Public Types

typedef QMap< QString, QStringAnnotations
 Contains a QMap of an annotation pair. More...
 
typedef QList< ArgumentArguments
 Contains a list of arguments to either a Method or a Signal. More...
 
typedef QMap< QString, QSharedDataPointer< Interface > > Interfaces
 Contains a QMap of interfaces and their names. More...
 
typedef QMultiMap< QString, MethodMethods
 Contains a QMap of methods and their names. More...
 
typedef QMap< QString, QSharedDataPointer< ObjectTree > > Objects
 Contains a QMap of objects and their paths relative to their immediate parent. More...
 
typedef QMap< QString, PropertyProperties
 Contains a QMap of properties and their names. More...
 
typedef QMultiMap< QString, SignalSignals
 Contains a QMap of signals and their names. More...
 

Static Public Functions

static Interface parseInterface (const QString &xml)
 Parses the XML document fragment (given by xml) containing one interface. More...
 
static Interfaces parseInterfaces (const QString &xml)
 Parses the XML document fragment (given by xml) containing several interfaces. More...
 
static Object parseObject (const QString &xml, const QString &service=QString(), const QString &path=QString())
 Parses the XML document fragment (given by xml) containing one object, found at the service service and path path. More...
 
static ObjectTree parseObjectTree (const QString &xml, const QString &service, const QString &path)
 Parses the XML document fragment (given by xml) containing one object node and returns all the information about the interfaces and sub-objects, found at the service service and path path. More...
 

Private Functions

 QDBusIntrospection ()
 

Detailed Description

Information about introspected objects and interfaces on D-Bus.

Warning
This function is not part of the public interface.

This class provides structures and methods for parsing the XML introspection data for D-Bus. Normally, you don't have to use the methods provided here: QDBusInterface and QDBusObject will do that for you.

But they may prove useful if the XML data was obtained through other means (like parsing a file).

Definition at line 66 of file qdbusintrospection_p.h.

Typedefs

◆ Annotations

Contains a QMap of an annotation pair.

The annotation's name is stored in the QMap key and must be unique. The annotation's value is stored in the QMap's value and is arbitrary.

Definition at line 76 of file qdbusintrospection_p.h.

◆ Arguments

Contains a list of arguments to either a Method or a Signal.

The arguments' order is important.

Definition at line 80 of file qdbusintrospection_p.h.

◆ Interfaces

Contains a QMap of interfaces and their names.

Each interface has a unique name.

Definition at line 84 of file qdbusintrospection_p.h.

◆ Methods

Contains a QMap of methods and their names.

The method's name is stored in the map's key and is not necessarily unique. The order in which multiple methods with the same name are stored in this map is undefined.

Definition at line 81 of file qdbusintrospection_p.h.

◆ Objects

Contains a QMap of objects and their paths relative to their immediate parent.

See also
parseObjectTree()

Definition at line 85 of file qdbusintrospection_p.h.

◆ Properties

Contains a QMap of properties and their names.

Each property must have a unique name.

Definition at line 83 of file qdbusintrospection_p.h.

◆ Signals

Contains a QMap of signals and their names.

The signal's name is stored in the map's key and is not necessarily unique. The order in which multiple signals with the same name are stored in this map is undefined.

Definition at line 82 of file qdbusintrospection_p.h.

Constructors and Destructors

◆ QDBusIntrospection()

QDBusIntrospection::QDBusIntrospection ( )
private

Functions

◆ parseInterface()

QDBusIntrospection::Interface QDBusIntrospection::parseInterface ( const QString xml)
static

Parses the XML document fragment (given by xml) containing one interface.

The first element tag in this XML data must be either <node> or <interface>. If it is <node>, then the <interface> tag must be a child tag of the <node> one.

If there are multiple interfaces in this XML data, it is undefined which one will be returned.

Definition at line 501 of file qdbusintrospection.cpp.

502 {
503  // be lazy
504  Interfaces ifs = parseInterfaces(xml);
505  if (ifs.isEmpty())
506  return Interface();
507 
508  // return the first in map order (probably alphabetical order)
509  return *ifs.constBegin().value();
510 }
QMap< QString, QSharedDataPointer< Interface > > Interfaces
Contains a QMap of interfaces and their names.
static Interfaces parseInterfaces(const QString &xml)
Parses the XML document fragment (given by xml) containing several interfaces.

◆ parseInterfaces()

QDBusIntrospection::Interfaces QDBusIntrospection::parseInterfaces ( const QString xml)
static

Parses the XML document fragment (given by xml) containing several interfaces.

If the first element tag in this document fragment is <node>, the interfaces parsed will be those found as child elements of the <node> tag.

Definition at line 519 of file qdbusintrospection.cpp.

Referenced by QDBusMetaObject::createMetaObject(), and parseInterface().

520 {
521  QString null;
522  QDBusXmlParser parser(null, null, xml);
523  return parser.interfaces();
524 }
The QString class provides a Unicode character string.
Definition: qstring.h:83

◆ parseObject()

QDBusIntrospection::Object QDBusIntrospection::parseObject ( const QString xml,
const QString service = QString(),
const QString path = QString() 
)
static

Parses the XML document fragment (given by xml) containing one object, found at the service service and path path.

The first element tag in this document must be <node>. If that tag does not contain a name attribute, the path argument will be used to determine the path of this object node.

This function does not parse the interfaces contained in the node, nor sub-object's contents. It will only list their names. If you need to know their contents, use parseObjectTree.

Definition at line 538 of file qdbusintrospection.cpp.

539 {
540  QDBusXmlParser parser(service, path, xml);
541  QSharedDataPointer<QDBusIntrospection::Object> retval = parser.object();
542  if (!retval)
544  return *retval;
545 }
The QSharedDataPointer class represents a pointer to an implicitly shared object. ...
Definition: qshareddata.h:54

◆ parseObjectTree()

QDBusIntrospection::ObjectTree QDBusIntrospection::parseObjectTree ( const QString xml,
const QString service,
const QString path 
)
static

Parses the XML document fragment (given by xml) containing one object node and returns all the information about the interfaces and sub-objects, found at the service service and path path.

The Objects map returned will contain the absolute path names in the key.

Definition at line 555 of file qdbusintrospection.cpp.

556 {
557  QDBusXmlParser parser(service, path, xml);
558  QSharedDataPointer<QDBusIntrospection::ObjectTree> retval = parser.objectTree();
559  if (!retval)
561  return *retval;
562 }
Complete information about one object node and its descendency.
The QSharedDataPointer class represents a pointer to an implicitly shared object. ...
Definition: qshareddata.h:54

The documentation for this class was generated from the following files: