Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 1888

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<class name="QAbstractFileEngineIterator" doc="/**
&lt;p&gt;The &lt;a href=&quot;QAbstractFileEngineIterator.html#QAbstractFileEngineIterator(com.trolltech.qt.core.QDir.Filters, java.util.List&lt;java.lang.String&gt;)&quot;&gt;&lt;tt&gt;QAbstractFileEngineIterator&lt;/tt&gt;&lt;/a&gt; class provides an iterator interface for custom file engines.&lt;/p&gt;
&lt;p&gt;If all you want is to iterate over entries in a directory, see &lt;a href=&quot;QDirIterator.html&quot;&gt;&lt;tt&gt;QDirIterator&lt;/tt&gt;&lt;/a&gt; instead. This class is only for custom file engine authors.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QAbstractFileEngineIterator.html#QAbstractFileEngineIterator(com.trolltech.qt.core.QDir.Filters, java.util.List&lt;java.lang.String&gt;)&quot;&gt;&lt;tt&gt;QAbstractFileEngineIterator&lt;/tt&gt;&lt;/a&gt; is a unidirectional single-use virtual iterator that plugs into &lt;a href=&quot;QDirIterator.html&quot;&gt;&lt;tt&gt;QDirIterator&lt;/tt&gt;&lt;/a&gt;, providing transparent proxy iteration for custom file engines.&lt;/p&gt;
&lt;p&gt;You can subclass &lt;a href=&quot;QAbstractFileEngineIterator.html#QAbstractFileEngineIterator(com.trolltech.qt.core.QDir.Filters, java.util.List&lt;java.lang.String&gt;)&quot;&gt;&lt;tt&gt;QAbstractFileEngineIterator&lt;/tt&gt;&lt;/a&gt; to provide an iterator when writing your own file engine. To plug the iterator into your file system, you simply return an instance of this subclass from a reimplementation of QAbstractFileEngine::beginEntryList().&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;    QAbstractFileEngineIterator *
    CustomFileEngine::beginEntryList(QDir::Filters filters, const QStringList &amp;amp;filterNames)
    {
        return new CustomFileEngineIterator(filters, filterNames);
    }&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;QAbstractFileEngineIterator.html#QAbstractFileEngineIterator(com.trolltech.qt.core.QDir.Filters, java.util.List&lt;java.lang.String&gt;)&quot;&gt;&lt;tt&gt;QAbstractFileEngineIterator&lt;/tt&gt;&lt;/a&gt; is associated with a path, name filters, and entry filters. The path is the directory that the iterator lists entries in. The name filters and entry filters are provided for file engines that can optimize directory listing at the iterator level (e.g&amp;#x2e;, network file systems that need to minimize network traffic), but they can also be ignored by the iterator subclass; &lt;a href=&quot;QAbstractFileEngineIterator.html#QAbstractFileEngineIterator(com.trolltech.qt.core.QDir.Filters, java.util.List&lt;java.lang.String&gt;)&quot;&gt;&lt;tt&gt;QAbstractFileEngineIterator&lt;/tt&gt;&lt;/a&gt; already provides the required filtering logics in the matchesFilters() function. You can call dirName() to get the directory name, &lt;a href=&quot;QAbstractFileEngineIterator.html#nameFilters()&quot;&gt;&lt;tt&gt;nameFilters&lt;/tt&gt;&lt;/a&gt; to get a stringlist of name filters, and &lt;a href=&quot;QAbstractFileEngineIterator.html#filters()&quot;&gt;&lt;tt&gt;filters&lt;/tt&gt;&lt;/a&gt; to get the entry filters.&lt;/p&gt;
&lt;p&gt;The pure virual function &lt;a href=&quot;QAbstractFileEngineIterator.html#hasNext()&quot;&gt;&lt;tt&gt;hasNext&lt;/tt&gt;&lt;/a&gt; returns true if the current directory has at least one more entry (i.e&amp;#x2e;, the directory name is valid and accessible, and we have not reached the end of the entry list), and false otherwise. Reimplement &lt;a href=&quot;QAbstractFileEngineIterator.html#next()&quot;&gt;&lt;tt&gt;next&lt;/tt&gt;&lt;/a&gt; to seek to the next entry.&lt;/p&gt;
&lt;p&gt;The pure virtual function &lt;a href=&quot;QAbstractFileEngineIterator.html#currentFileName()&quot;&gt;&lt;tt&gt;currentFileName&lt;/tt&gt;&lt;/a&gt; returns the name of the current entry without advancing the iterator. The &lt;a href=&quot;QAbstractFileEngineIterator.html#currentFilePath()&quot;&gt;&lt;tt&gt;currentFilePath&lt;/tt&gt;&lt;/a&gt; function is provided for convenience; it returns the full path of the current entry.&lt;/p&gt;
&lt;p&gt;Here is an example of how to implement an interator that returns each of three fixed entries in sequence.&lt;/p&gt;
&lt;pre&gt;    class CustomIterator : public QAbstractFileEngineIterator
    {
    public:
        CustomIterator(const QStringList &amp;amp;nameFilters, QDir::Filters filters)
            : QAbstractFileEngineIterator(nameFilters, filters), index(0)
        {
            &lt;span class=&quot;comment&quot;&gt;// In a real iterator, these entries are fetched from the&lt;/span&gt;
            &lt;span class=&quot;comment&quot;&gt;// file system based on the value of path().&lt;/span&gt;
            entries &amp;lt;&amp;lt; &amp;quot;entry1&amp;quot; &amp;lt;&amp;lt; &amp;quot;entry2&amp;quot; &amp;lt;&amp;lt; &amp;quot;entry3&amp;quot;;
        }

        bool hasNext() const
        {
            return index &amp;lt; entries.size() - 1;
        }

        QString next()
        {
           if (!hasNext())
               return QString();
           ++index;
           return currentFilePath();
        }

        QString currentFilePath()
        {
            return entries.at(index);
        }

    private:
        QStringList entries;
        int index;
    };&lt;/pre&gt;
&lt;p&gt;Note: &lt;a href=&quot;QAbstractFileEngineIterator.html#QAbstractFileEngineIterator(com.trolltech.qt.core.QDir.Filters, java.util.List&lt;java.lang.String&gt;)&quot;&gt;&lt;tt&gt;QAbstractFileEngineIterator&lt;/tt&gt;&lt;/a&gt; does not deal with QDir::IteratorFlags; it simply returns entries for a single directory.&lt;/p&gt;

@see &lt;a href=&quot;QDirIterator.html&quot;&gt;&lt;tt&gt;QDirIterator&lt;/tt&gt;&lt;/a&gt; */">
    <method name="public QAbstractFileEngineIterator(com.trolltech.qt.core.QDir.Filters filters, java.util.List&lt;java.lang.String&gt; nameFilters)" doc="/**
&lt;p&gt;Constructs a &lt;a href=&quot;QAbstractFileEngineIterator.html#QAbstractFileEngineIterator(com.trolltech.qt.core.QDir.Filters, java.util.List&lt;java.lang.String&gt;)&quot;&gt;&lt;tt&gt;QAbstractFileEngineIterator&lt;/tt&gt;&lt;/a&gt;, using the entry filters &lt;tt&gt;filters&lt;/tt&gt;, and wildcard name filters &lt;tt&gt;nameFilters&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public final java.lang.String currentFilePath()" doc="/**
&lt;p&gt;Returns the path to the current directory entry. It's the same as prepending &lt;a href=&quot;QAbstractFileEngineIterator.html#path()&quot;&gt;&lt;tt&gt;path&lt;/tt&gt;&lt;/a&gt; to the return value of &lt;a href=&quot;QAbstractFileEngineIterator.html#currentFileName()&quot;&gt;&lt;tt&gt;currentFileName&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractFileEngineIterator.html#currentFileName()&quot;&gt;&lt;tt&gt;currentFileName&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.core.QDir.Filters filters()" doc="/**
&lt;p&gt;Returns the entry filters for this iterator.&lt;/p&gt;

@see &lt;tt&gt;QDir::filter&lt;/tt&gt;
@see &lt;a href=&quot;QAbstractFileEngineIterator.html#nameFilters()&quot;&gt;&lt;tt&gt;nameFilters&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractFileEngineIterator.html#path()&quot;&gt;&lt;tt&gt;path&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final java.util.List&lt;java.lang.String&gt; nameFilters()" doc="/**
&lt;p&gt;Returns the name filters for this iterator.&lt;/p&gt;

@see &lt;tt&gt;QDir::nameFilters&lt;/tt&gt;
@see &lt;a href=&quot;QAbstractFileEngineIterator.html#filters()&quot;&gt;&lt;tt&gt;filters&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractFileEngineIterator.html#path()&quot;&gt;&lt;tt&gt;path&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final java.lang.String path()" doc="/**
&lt;p&gt;Returns the path for this iterator. &lt;a href=&quot;QDirIterator.html&quot;&gt;&lt;tt&gt;QDirIterator&lt;/tt&gt;&lt;/a&gt; is responsible for assigning this path; it cannot change during the iterator's lifetime.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractFileEngineIterator.html#nameFilters()&quot;&gt;&lt;tt&gt;nameFilters&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractFileEngineIterator.html#filters()&quot;&gt;&lt;tt&gt;filters&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public com.trolltech.qt.core.QFileInfo currentFileInfo()" doc="/**
&lt;p&gt;The virtual function returns a &lt;a href=&quot;QFileInfo.html&quot;&gt;&lt;tt&gt;QFileInfo&lt;/tt&gt;&lt;/a&gt; for the current directory entry. This function is provided for convenience. It can also be slightly faster that creating a &lt;a href=&quot;QFileInfo.html&quot;&gt;&lt;tt&gt;QFileInfo&lt;/tt&gt;&lt;/a&gt; object yourself, as the object returned by this function might contain cached information that &lt;a href=&quot;QFileInfo.html&quot;&gt;&lt;tt&gt;QFileInfo&lt;/tt&gt;&lt;/a&gt; otherwise would have to access through the file engine.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractFileEngineIterator.html#currentFileName()&quot;&gt;&lt;tt&gt;currentFileName&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public abstract java.lang.String currentFileName()" doc="/**
&lt;p&gt;This pure virtual function returns the name of the current directory entry, excluding the path.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractFileEngineIterator.html#currentFilePath()&quot;&gt;&lt;tt&gt;currentFilePath&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public abstract boolean hasNext()" doc="/**
&lt;p&gt;This pure virtual function returns true if there is at least one more entry in the current directory (i.e&amp;#x2e;, the iterator path is valid and accessible, and the iterator has not reached the end of the entry list).&lt;/p&gt;

@see &lt;tt&gt;QDirIterator::hasNext&lt;/tt&gt; */"/>
    <method name="public abstract java.lang.String next()" doc="/**
&lt;p&gt;This pure virtual function advances the iterator to the next directory entry, and returns the file path to the current entry.&lt;/p&gt;
&lt;p&gt;This function can optionally make use of &lt;a href=&quot;QAbstractFileEngineIterator.html#nameFilters()&quot;&gt;&lt;tt&gt;nameFilters&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QAbstractFileEngineIterator.html#filters()&quot;&gt;&lt;tt&gt;filters&lt;/tt&gt;&lt;/a&gt; to optimize its performance.&lt;/p&gt;
&lt;p&gt;Reimplement this function in a subclass to advance the iterator.&lt;/p&gt;

@see &lt;tt&gt;QDirIterator::next&lt;/tt&gt; */"/>
</class>