io.qt.core.QDirIterator Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
/**
* Iterator for directory entrylists
* Java wrapper for Qt class QDirIterator
*/
public class QDirIterator extends io.qt.QtObject
implements Iterable, java.util.Iterator
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Java wrapper for Qt enum QDirIterator::IteratorFlag
*
* @see IteratorFlags
*/
public enum IteratorFlag implements io.qt.QtFlagEnumerator {
NoIteratorFlags(0),
FollowSymlinks(1),
Subdirectories(2);
private IteratorFlag(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public IteratorFlags asFlags() {
return new IteratorFlags(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public IteratorFlags combined(IteratorFlag e) {
return new IteratorFlags(this, e);
}
/**
* Creates a new {@link IteratorFlags} from the entries.
* @param values entries
* @return new flag
*/
public static IteratorFlags flags(IteratorFlag ... values) {
return new IteratorFlags(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static IteratorFlag resolve(int value) {
switch (value) {
case 0: return NoIteratorFlags;
case 1: return FollowSymlinks;
case 2: return Subdirectories;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* QFlags type for enum {@link IteratorFlag}
*/
public static final class IteratorFlags extends io.qt.QFlags implements Comparable {
private static final long serialVersionUID = 0x865c6d2218f00d2fL;
/**
* Creates a new IteratorFlags where the flags in args
are set.
* @param args enum entries
*/
public IteratorFlags(IteratorFlag ... 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 IteratorFlags combined(IteratorFlag e){
return new IteratorFlags(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final IteratorFlags setFlag(IteratorFlag e){
super.setFlag(e);
return this;
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
public final IteratorFlags setFlag(IteratorFlag e, boolean on){
super.setFlag(e, on);
return this;
}
/**
* Returns an array of flag objects represented by this IteratorFlags.
* @return array of enum entries
*/
@Override
public final IteratorFlag[] flags(){
return super.flags(IteratorFlag.values());
}
/**
* {@inheritDoc}
*/
@Override
public final IteratorFlags clone(){
return new IteratorFlags(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(IteratorFlags other){
return Integer.compare(value(), other.value());
}
}
/**
* Overloaded constructor for {@link #QDirIterator(io.qt.core.QDir, io.qt.core.QDirIterator.IteratorFlags)}.
*/
public QDirIterator(io.qt.core.QDir dir, io.qt.core.QDirIterator.IteratorFlag ... flags){
this(dir, new io.qt.core.QDirIterator.IteratorFlags(flags));
}
/**
* 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.QDir dir) {
this(dir, new io.qt.core.QDirIterator.IteratorFlags(0));
}
/**
* See QDirIterator::QDirIterator(QDir,IteratorFlags)
*/
public QDirIterator(io.qt.core.QDir dir, io.qt.core.QDirIterator.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);
/**
* Overloaded constructor for {@link #QDirIterator(java.lang.String, io.qt.core.QDir.Filters, io.qt.core.QDirIterator.IteratorFlags)}.
*/
public QDirIterator(java.lang.String path, io.qt.core.QDir.Filters filter, io.qt.core.QDirIterator.IteratorFlag ... flags){
this(path, filter, 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.String path, io.qt.core.QDir.Filters filter) {
this(path, filter, new io.qt.core.QDirIterator.IteratorFlags(0));
}
/**
* See QDirIterator::QDirIterator(QString,QDir::Filters,IteratorFlags)
*/
public QDirIterator(java.lang.String path, io.qt.core.QDir.Filters filter, io.qt.core.QDirIterator.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);
/**
* Overloaded constructor for {@link #QDirIterator(java.lang.String, io.qt.core.QDirIterator.IteratorFlags)}.
*/
public QDirIterator(java.lang.String path, io.qt.core.QDirIterator.IteratorFlag ... flags){
this(path, 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.String path) {
this(path, new io.qt.core.QDirIterator.IteratorFlags(0));
}
/**
* See QDirIterator::QDirIterator(QString,IteratorFlags)
*/
public QDirIterator(java.lang.String path, io.qt.core.QDirIterator.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);
/**
* 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.String path, java.util.Collection nameFilters, io.qt.core.QDir.Filters filters, io.qt.core.QDirIterator.IteratorFlag ... flags){
this(path, nameFilters, filters, 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.String path, java.util.Collection nameFilters, io.qt.core.QDir.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.String path, java.util.Collection nameFilters) {
this(path, nameFilters, new io.qt.core.QDir.Filters(-1), new io.qt.core.QDirIterator.IteratorFlags(0));
}
/**
* See QDirIterator::QDirIterator(QString,QStringList,QDir::Filters,IteratorFlags)
*/
public QDirIterator(java.lang.String path, java.util.Collection nameFilters, io.qt.core.QDir.Filters filters, io.qt.core.QDirIterator.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
*/
@io.qt.QtUninvokable
public final io.qt.core.QFileInfo fileInfo(){
return fileInfo_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QFileInfo fileInfo_native_constfct(long __this__nativeId);
/**
* See QDirIterator::fileName()const
*/
@io.qt.QtUninvokable
public final java.lang.String fileName(){
return fileName_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native java.lang.String fileName_native_constfct(long __this__nativeId);
/**
* See QDirIterator::filePath()const
*/
@io.qt.QtUninvokable
public final java.lang.String filePath(){
return filePath_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native java.lang.String filePath_native_constfct(long __this__nativeId);
/**
* See QDirIterator::hasNext()const
*/
@io.qt.QtUninvokable
public final boolean hasNext(){
return hasNext_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean hasNext_native_constfct(long __this__nativeId);
/**
*
*/
@io.qt.QtUninvokable
public final java.lang.String next(){
return next_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native java.lang.String next_native(long __this__nativeId);
/**
*
*/
@io.qt.QtUninvokable
public final java.lang.String path(){
return path_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native java.lang.String path_native_constfct(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
*/
@io.qt.NativeAccess
protected QDirIterator(QPrivateConstructor p) { super(p); }
// TEMPLATE - core.self_iterator - START
@Override
@io.qt.QtUninvokable
public final java.util.Iterator iterator() {
return this;
}
// TEMPLATE - core.self_iterator - END
}