All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.qt.core.QDirIterator Maven / Gradle / Ivy

There is a newer version: 6.8.0
Show newest version
package io.qt.core;

import io.qt.*;


/**
 * 

Iterator for directory entrylists

*

Java wrapper for Qt class QDirIterator

*/ public class QDirIterator extends QtObject implements Iterable, java.util.Iterator { static { QtJambi_LibraryUtilities.initialize(); } /** *

Java wrapper for Qt enum QDirIterator::IteratorFlag

* * @see IteratorFlags */ public enum IteratorFlag implements QtFlagEnumerator { /** *

Representing QDirIterator::NoIteratorFlags

*/ NoIteratorFlags(0), /** *

Representing QDirIterator::FollowSymlinks

*/ FollowSymlinks(1), /** *

Representing QDirIterator::Subdirectories

*/ Subdirectories(2); static { QtJambi_LibraryUtilities.initialize(); } private IteratorFlag(int value) { this.value = value; } /** * {@inheritDoc} */ public int value() { return value; } /** * Create a QFlags of the enum entry. * @return QFlags */ public @NonNull IteratorFlags asFlags() { return new IteratorFlags(value); } /** * Combines this entry with other enum entry. * @param e enum entry * @return new flag */ public @NonNull IteratorFlags combined(@NonNull IteratorFlag e) { return asFlags().setFlag(e, true); } /** * Excludes other enum entry from a flag of this entry. * @param e enum entry * @return new flag */ public @NonNull IteratorFlags cleared(@NonNull IteratorFlag e) { return asFlags().setFlag(e, false); } /** * Creates a new {@link IteratorFlags} from the entries. * @param values entries * @return new flag */ public static @NonNull IteratorFlags flags(@Nullable IteratorFlag @NonNull... values) { return new IteratorFlags(values); } /** * Returns the corresponding enum entry for the given value. * @param value * @return enum entry */ public static @NonNull IteratorFlag resolve(int value) { switch (value) { case 0: return NoIteratorFlags; case 1: return FollowSymlinks; case 2: return Subdirectories; default: throw new QNoSuchEnumValueException(value); } } private final int value; } /** * {@link QFlags} type for enum {@link IteratorFlag} */ public static final class IteratorFlags extends QFlags implements Comparable { private static final long serialVersionUID = 0x865c6d2218f00d2fL; static { QtJambi_LibraryUtilities.initialize(); } /** * Creates a new IteratorFlags where the flags in args are set. * @param args enum entries */ public IteratorFlags(@Nullable IteratorFlag @NonNull... args){ super(args); } /** * Creates a new IteratorFlags with given value. * @param value */ public IteratorFlags(int value) { super(value); } /** * Combines this flags with enum entry. * @param e enum entry * @return new IteratorFlags */ @Override public final @NonNull IteratorFlags combined(@StrictNonNull IteratorFlag e){ return new IteratorFlags(value() | e.value()); } /** * Sets the flag e * @param e enum entry * @return this */ public final @NonNull IteratorFlags setFlag(@Nullable IteratorFlag e){ return setFlag(e, true); } /** * Sets or clears the flag flag * @param e enum entry * @param on set (true) or clear (false) * @return this */ public final @NonNull IteratorFlags setFlag(@Nullable IteratorFlag e, boolean on){ if (on) { setValue(value() | e.value()); }else { setValue(value() & ~e.value()); } return this; } /** * Returns an array of flag objects represented by this IteratorFlags. * @return array of enum entries */ @Override public final @NonNull IteratorFlag @NonNull[] flags(){ return super.flags(IteratorFlag.values()); } /** * {@inheritDoc} */ @Override public final @NonNull IteratorFlags clone(){ return new IteratorFlags(value()); } /** * {@inheritDoc} */ @Override public final int compareTo(@StrictNonNull IteratorFlags other){ return Integer.compare(value(), other.value()); } } /** *

See QDirIterator::QDirIterator(QDir,QDirIterator::IteratorFlags)

*/ public QDirIterator(io.qt.core.@NonNull QDir dir, io.qt.core.QDirIterator.@NonNull IteratorFlags flags){ super((QPrivateConstructor)null); initialize_native(this, dir, flags); } private native static void initialize_native(QDirIterator instance, io.qt.core.QDir dir, io.qt.core.QDirIterator.IteratorFlags flags); /** *

See QDirIterator::QDirIterator(QString,QDir::Filters,QDirIterator::IteratorFlags)

*/ public QDirIterator(java.lang.@NonNull String path, io.qt.core.QDir.@NonNull Filters filter, io.qt.core.QDirIterator.@NonNull IteratorFlags flags){ super((QPrivateConstructor)null); initialize_native(this, path, filter, flags); } private native static void initialize_native(QDirIterator instance, java.lang.String path, io.qt.core.QDir.Filters filter, io.qt.core.QDirIterator.IteratorFlags flags); /** *

See QDirIterator::QDirIterator(QString,QDirIterator::IteratorFlags)

*/ public QDirIterator(java.lang.@NonNull String path, io.qt.core.QDirIterator.@NonNull IteratorFlags flags){ super((QPrivateConstructor)null); initialize_native(this, path, flags); } private native static void initialize_native(QDirIterator instance, java.lang.String path, io.qt.core.QDirIterator.IteratorFlags flags); /** *

See QDirIterator::QDirIterator(QString,QStringList,QDir::Filters,QDirIterator::IteratorFlags)

*/ public QDirIterator(java.lang.@NonNull String path, java.util.@NonNull Collection nameFilters, io.qt.core.QDir.@NonNull Filters filters, io.qt.core.QDirIterator.@NonNull IteratorFlags flags){ super((QPrivateConstructor)null); initialize_native(this, path, nameFilters, filters, flags); } private native static void initialize_native(QDirIterator instance, java.lang.String path, java.util.Collection nameFilters, io.qt.core.QDir.Filters filters, io.qt.core.QDirIterator.IteratorFlags flags); /** *

See QDirIterator::fileInfo()const

*/ @QtUninvokable public final io.qt.core.@NonNull QFileInfo fileInfo(){ return fileInfo_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native io.qt.core.QFileInfo fileInfo_native_constfct(long __this__nativeId); /** *

See QDirIterator::fileName()const

*/ @QtUninvokable public final java.lang.@NonNull String fileName(){ return fileName_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native java.lang.String fileName_native_constfct(long __this__nativeId); /** *

See QDirIterator::filePath()const

*/ @QtUninvokable public final java.lang.@NonNull String filePath(){ return filePath_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native java.lang.String filePath_native_constfct(long __this__nativeId); /** *

See QDirIterator::hasNext()const

*/ @QtUninvokable public final boolean hasNext(){ return hasNext_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native boolean hasNext_native_constfct(long __this__nativeId); /** *

See QDirIterator::next()

*/ @QtUninvokable public final java.lang.@NonNull String next(){ return next_native(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native java.lang.String next_native(long __this__nativeId); /** *

See QDirIterator::nextFileInfo()

*/ @QtUninvokable public final io.qt.core.@NonNull QFileInfo nextFileInfo(){ return nextFileInfo_native(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native io.qt.core.QFileInfo nextFileInfo_native(long __this__nativeId); /** *

See QDirIterator::path()const

*/ @QtUninvokable public final java.lang.@NonNull String path(){ return path_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native java.lang.String path_native_constfct(long __this__nativeId); /** * Constructor for internal use only. * @param p expected to be null. * @hidden */ @NativeAccess protected QDirIterator(QPrivateConstructor p) { super(p); } // TEMPLATE - core.self_iterator - START @Override @QtUninvokable public final java.util.Iterator iterator() { return this; } // TEMPLATE - core.self_iterator - END /** *

Overloaded constructor for {@link #QDirIterator(io.qt.core.QDir, io.qt.core.QDirIterator.IteratorFlags)} * with flags = new io.qt.core.QDirIterator.IteratorFlags(0).

*/ public QDirIterator(io.qt.core.@NonNull QDir dir) { this(dir, new io.qt.core.QDirIterator.IteratorFlags(0)); } /** *

Overloaded constructor for {@link #QDirIterator(io.qt.core.QDir, io.qt.core.QDirIterator.IteratorFlags)}.

*/ public QDirIterator(io.qt.core.@NonNull QDir dir, io.qt.core.QDirIterator.@NonNull IteratorFlag @NonNull... flags) { this(dir, new io.qt.core.QDirIterator.IteratorFlags(flags)); } /** *

Overloaded constructor for {@link #QDirIterator(java.lang.String, io.qt.core.QDir.Filters, io.qt.core.QDirIterator.IteratorFlags)} * with flags = new io.qt.core.QDirIterator.IteratorFlags(0).

*/ public QDirIterator(java.lang.@NonNull String path, io.qt.core.QDir.@NonNull Filters filter) { this(path, filter, new io.qt.core.QDirIterator.IteratorFlags(0)); } /** *

Overloaded constructor for {@link #QDirIterator(java.lang.String, io.qt.core.QDir.Filters, io.qt.core.QDirIterator.IteratorFlags)}.

*/ public QDirIterator(java.lang.@NonNull String path, io.qt.core.QDir.@NonNull Filters filter, io.qt.core.QDirIterator.@NonNull IteratorFlag @NonNull... flags) { this(path, filter, new io.qt.core.QDirIterator.IteratorFlags(flags)); } /** *

Overloaded constructor for {@link #QDirIterator(java.lang.String, io.qt.core.QDirIterator.IteratorFlags)} * with flags = new io.qt.core.QDirIterator.IteratorFlags(0).

*/ public QDirIterator(java.lang.@NonNull String path) { this(path, new io.qt.core.QDirIterator.IteratorFlags(0)); } /** *

Overloaded constructor for {@link #QDirIterator(java.lang.String, io.qt.core.QDirIterator.IteratorFlags)}.

*/ public QDirIterator(java.lang.@NonNull String path, io.qt.core.QDirIterator.@NonNull IteratorFlag @NonNull... flags) { this(path, new io.qt.core.QDirIterator.IteratorFlags(flags)); } /** *

Overloaded constructor for {@link #QDirIterator(java.lang.String, java.util.Collection, io.qt.core.QDir.Filters, io.qt.core.QDirIterator.IteratorFlags)} * with flags = new io.qt.core.QDirIterator.IteratorFlags(0).

*/ public QDirIterator(java.lang.@NonNull String path, java.util.@NonNull Collection nameFilters, io.qt.core.QDir.@NonNull Filters filters) { this(path, nameFilters, filters, new io.qt.core.QDirIterator.IteratorFlags(0)); } /** *

Overloaded constructor for {@link #QDirIterator(java.lang.String, java.util.Collection, io.qt.core.QDir.Filters, io.qt.core.QDirIterator.IteratorFlags)}

*

with:

    *
  • filters = new io.qt.core.QDir.Filters(-1)
  • *
  • flags = new io.qt.core.QDirIterator.IteratorFlags(0)
  • *
*/ public QDirIterator(java.lang.@NonNull String path, java.util.@NonNull Collection nameFilters) { this(path, nameFilters, new io.qt.core.QDir.Filters(-1), new io.qt.core.QDirIterator.IteratorFlags(0)); } /** *

Overloaded constructor for {@link #QDirIterator(java.lang.String, java.util.Collection, io.qt.core.QDir.Filters, io.qt.core.QDirIterator.IteratorFlags)}.

*/ public QDirIterator(java.lang.@NonNull String path, java.util.@NonNull Collection nameFilters, io.qt.core.QDir.@NonNull Filters filters, io.qt.core.QDirIterator.@NonNull IteratorFlag @NonNull... flags) { this(path, nameFilters, filters, new io.qt.core.QDirIterator.IteratorFlags(flags)); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy