filetree.h Example File
xmlpatterns/filetree/filetree.h
#include <QtCore/QFileInfo>
#include <QtCore/QDir>
#include <QtCore/QVector>
#include <QtXmlPatterns/QSimpleXmlNodeModel>
class FileTree : public QSimpleXmlNodeModel
{
public:
FileTree(const QXmlNamePool &namePool);
QXmlNodeModelIndex nodeFor(const QString &fileName) const;
virtual QXmlNodeModelIndex::DocumentOrder compareOrder(const QXmlNodeModelIndex&,
const QXmlNodeModelIndex&) const;
virtual QXmlName name(const QXmlNodeModelIndex &node) const;
virtual QUrl documentUri(const QXmlNodeModelIndex &node) const;
virtual QXmlNodeModelIndex::NodeKind kind(const QXmlNodeModelIndex &node) const;
virtual QXmlNodeModelIndex root(const QXmlNodeModelIndex &node) const;
virtual QVariant typedValue(const QXmlNodeModelIndex &node) const;
virtual QVector<QXmlNodeModelIndex> attributes(const QXmlNodeModelIndex &element) const;
protected:
virtual QXmlNodeModelIndex nextFromSimpleAxis(SimpleAxis, const QXmlNodeModelIndex&) const;
private:
enum Type {
File,
Directory,
AttributeFileName,
AttributeFilePath,
AttributeSize,
AttributeMIMEType,
AttributeSuffix
};
inline QXmlNodeModelIndex nextSibling(const QXmlNodeModelIndex &nodeIndex,
const QFileInfo &from,
qint8 offset) const;
inline const QFileInfo &toFileInfo(const QXmlNodeModelIndex &index) const;
inline QXmlNodeModelIndex toNodeIndex(const QFileInfo &index,
Type attributeName) const;
inline QXmlNodeModelIndex toNodeIndex(const QFileInfo &index) const;
mutable QVector<QFileInfo> m_fileInfos;
QVector<QXmlName> m_names;
const QDir::Filters m_filterAllowAll;
const QDir::SortFlags m_sortFlags;
};
Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies) |
Trademarks |
Qt 4.4.3 |