io.qt.core.QDirListing Maven / Gradle / Ivy
package io.qt.core;
import io.qt.*;
/**
* STL-style iterator for directory entries
* Java wrapper for Qt class QDirListing
* @since This class was introduced in Qt 6.8.
*/
public class QDirListing extends QtObject
implements Iterable
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Java wrapper for Qt enum QDirListing::IteratorFlag
*
* @see IteratorFlags
*/
public enum IteratorFlag implements QtFlagEnumerator {
/**
* Representing QDirListing:: IteratorFlag:: Default
*/
Default(0),
/**
* Representing QDirListing:: IteratorFlag:: ExcludeFiles
*/
ExcludeFiles(4),
/**
* Representing QDirListing:: IteratorFlag:: ExcludeDirs
*/
ExcludeDirs(8),
/**
* Representing QDirListing:: IteratorFlag:: ExcludeSpecial
*/
ExcludeSpecial(16),
/**
* Representing QDirListing:: IteratorFlag:: ResolveSymlinks
*/
ResolveSymlinks(32),
/**
* Representing QDirListing:: IteratorFlag:: FilesOnly
*/
FilesOnly(24),
/**
* Representing QDirListing:: IteratorFlag:: DirsOnly
*/
DirsOnly(20),
/**
* Representing QDirListing:: IteratorFlag:: IncludeHidden
*/
IncludeHidden(64),
/**
* Representing QDirListing:: IteratorFlag:: IncludeDotAndDotDot
*/
IncludeDotAndDotDot(128),
/**
* Representing QDirListing:: IteratorFlag:: CaseSensitive
*/
CaseSensitive(256),
/**
* Representing QDirListing:: IteratorFlag:: Recursive
*/
Recursive(1024),
/**
* Representing QDirListing:: IteratorFlag:: FollowDirSymlinks
*/
FollowDirSymlinks(2048);
static {
QtJambi_LibraryUtilities.initialize();
}
private IteratorFlag(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
@Override
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 Default;
case 4: return ExcludeFiles;
case 8: return ExcludeDirs;
case 16: return ExcludeSpecial;
case 32: return ResolveSymlinks;
case 24: return FilesOnly;
case 20: return DirsOnly;
case 64: return IncludeHidden;
case 128: return IncludeDotAndDotDot;
case 256: return CaseSensitive;
case 1024: return Recursive;
case 2048: return FollowDirSymlinks;
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
*/
@Override
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
*/
@Override
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());
}
}
/**
* Java wrapper for Qt class QDirListing::DirEntry
*/
public static class DirEntry extends QtObject
implements java.lang.Cloneable
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* See QDirListing::DirEntry:: DirEntry()
*/
public DirEntry(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(DirEntry instance);
/**
* See QDirListing::DirEntry:: DirEntry(QDirListing::DirEntry)
* @param other
*/
public DirEntry(io.qt.core.QDirListing.@StrictNonNull DirEntry other){
super((QPrivateConstructor)null);
java.util.Objects.requireNonNull(other, "Argument 'other': null not expected.");
initialize_native(this, other);
}
private native static void initialize_native(DirEntry instance, io.qt.core.QDirListing.DirEntry other);
/**
* See QDirListing::DirEntry:: absoluteFilePath()const
* @return
*/
@QtUninvokable
public final java.lang.@NonNull String absoluteFilePath(){
return absoluteFilePath_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String absoluteFilePath_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: absolutePath()const
* @return
*/
@QtUninvokable
public final java.lang.@NonNull String absolutePath(){
return absolutePath_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String absolutePath_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: baseName()const
* @return
*/
@QtUninvokable
public final java.lang.@NonNull String baseName(){
return baseName_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String baseName_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: birthTime(QTimeZone)const
* @param tz
* @return
*/
@QtUninvokable
public final io.qt.core.@NonNull QDateTime birthTime(io.qt.core.@NonNull QTimeZone tz){
return birthTime_native_cref_QTimeZone_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(tz));
}
@QtUninvokable
private native io.qt.core.QDateTime birthTime_native_cref_QTimeZone_constfct(long __this__nativeId, long tz);
/**
* See QDirListing::DirEntry:: bundleName()const
* @return
*/
@QtUninvokable
public final java.lang.@NonNull String bundleName(){
return bundleName_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String bundleName_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: canonicalFilePath()const
* @return
*/
@QtUninvokable
public final java.lang.@NonNull String canonicalFilePath(){
return canonicalFilePath_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String canonicalFilePath_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: completeBaseName()const
* @return
*/
@QtUninvokable
public final java.lang.@NonNull String completeBaseName(){
return completeBaseName_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String completeBaseName_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: completeSuffix()const
* @return
*/
@QtUninvokable
public final java.lang.@NonNull String completeSuffix(){
return completeSuffix_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String completeSuffix_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: exists()const
* @return
*/
@QtUninvokable
public final boolean exists(){
return exists_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean exists_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: fileInfo()const
* @return
*/
@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 QDirListing::DirEntry:: fileName()const
* @return
*/
@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 QDirListing::DirEntry:: filePath()const
* @return
*/
@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 QDirListing::DirEntry:: fileTime(QFileDevice::FileTime, QTimeZone)const
* @param type
* @param tz
* @return
*/
@QtUninvokable
public final io.qt.core.@NonNull QDateTime fileTime(io.qt.core.QFileDevice.@NonNull FileTime type, io.qt.core.@NonNull QTimeZone tz){
return fileTime_native_QFileDevice_FileTime_cref_QTimeZone_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), type.value(), QtJambi_LibraryUtilities.internal.checkedNativeId(tz));
}
@QtUninvokable
private native io.qt.core.QDateTime fileTime_native_QFileDevice_FileTime_cref_QTimeZone_constfct(long __this__nativeId, int type, long tz);
/**
* See QDirListing::DirEntry:: isDir()const
* @return
*/
@QtUninvokable
public final boolean isDir(){
return isDir_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isDir_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: isExecutable()const
* @return
*/
@QtUninvokable
public final boolean isExecutable(){
return isExecutable_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isExecutable_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: isFile()const
* @return
*/
@QtUninvokable
public final boolean isFile(){
return isFile_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isFile_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: isHidden()const
* @return
*/
@QtUninvokable
public final boolean isHidden(){
return isHidden_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isHidden_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: isReadable()const
* @return
*/
@QtUninvokable
public final boolean isReadable(){
return isReadable_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isReadable_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: isSymLink()const
* @return
*/
@QtUninvokable
public final boolean isSymLink(){
return isSymLink_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isSymLink_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: isWritable()const
* @return
*/
@QtUninvokable
public final boolean isWritable(){
return isWritable_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isWritable_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: lastModified(QTimeZone)const
* @param tz
* @return
*/
@QtUninvokable
public final io.qt.core.@NonNull QDateTime lastModified(io.qt.core.@NonNull QTimeZone tz){
return lastModified_native_cref_QTimeZone_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(tz));
}
@QtUninvokable
private native io.qt.core.QDateTime lastModified_native_cref_QTimeZone_constfct(long __this__nativeId, long tz);
/**
* See QDirListing::DirEntry:: lastRead(QTimeZone)const
* @param tz
* @return
*/
@QtUninvokable
public final io.qt.core.@NonNull QDateTime lastRead(io.qt.core.@NonNull QTimeZone tz){
return lastRead_native_cref_QTimeZone_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(tz));
}
@QtUninvokable
private native io.qt.core.QDateTime lastRead_native_cref_QTimeZone_constfct(long __this__nativeId, long tz);
/**
* See QDirListing::DirEntry:: metadataChangeTime(QTimeZone)const
* @param tz
* @return
*/
@QtUninvokable
public final io.qt.core.@NonNull QDateTime metadataChangeTime(io.qt.core.@NonNull QTimeZone tz){
return metadataChangeTime_native_cref_QTimeZone_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(tz));
}
@QtUninvokable
private native io.qt.core.QDateTime metadataChangeTime_native_cref_QTimeZone_constfct(long __this__nativeId, long tz);
/**
* See QDirListing::DirEntry:: size()const
* @return
*/
@QtUninvokable
public final long size(){
return size_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long size_native_constfct(long __this__nativeId);
/**
* See QDirListing::DirEntry:: suffix()const
* @return
*/
@QtUninvokable
public final java.lang.@NonNull String suffix(){
return suffix_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String suffix_native_constfct(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected DirEntry(QPrivateConstructor p) { super(p); }
/**
* Creates and returns a copy of this object.
See QDirListing::DirEntry:: DirEntry(QDirListing::DirEntry)
*/
@QtUninvokable
@Override
public DirEntry clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native DirEntry clone_native(long __this_nativeId);
}
/**
* See QDirListing:: QDirListing(QString, QDirListing::IteratorFlags)
* @param path
* @param flags
*/
public QDirListing(java.lang.@NonNull String path, io.qt.core.QDirListing.@NonNull IteratorFlags flags){
super((QPrivateConstructor)null);
initialize_native(this, path, flags);
}
private native static void initialize_native(QDirListing instance, java.lang.String path, io.qt.core.QDirListing.IteratorFlags flags);
/**
* See QDirListing:: QDirListing(QString, QStringList, QDirListing::IteratorFlags)
* @param path
* @param nameFilters
* @param flags
*/
public QDirListing(java.lang.@NonNull String path, java.util.@NonNull Collection nameFilters, io.qt.core.QDirListing.@NonNull IteratorFlags flags){
super((QPrivateConstructor)null);
initialize_native(this, path, nameFilters, flags);
}
private native static void initialize_native(QDirListing instance, java.lang.String path, java.util.Collection nameFilters, io.qt.core.QDirListing.IteratorFlags flags);
/**
* See QDirListing:: constBegin()const
* @return
*/
@QtUninvokable
protected final io.qt.core.@NonNull QSequentialConstIterator constBegin(){
return constBegin_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QSequentialConstIterator constBegin_native_constfct(long __this__nativeId);
/**
* See QDirListing:: iteratorFlags()const
* @return
*/
@QtUninvokable
public final io.qt.core.QDirListing.@NonNull IteratorFlags iteratorFlags(){
return new io.qt.core.QDirListing.IteratorFlags(iteratorFlags_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int iteratorFlags_native_constfct(long __this__nativeId);
/**
* See QDirListing:: iteratorPath()const
* @return
*/
@QtUninvokable
public final java.lang.@NonNull String iteratorPath(){
return iteratorPath_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String iteratorPath_native_constfct(long __this__nativeId);
/**
* See QDirListing:: nameFilters()const
* @return
*/
@QtUninvokable
public final io.qt.core.@NonNull QStringList nameFilters(){
return nameFilters_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QStringList nameFilters_native_constfct(long __this__nativeId);
/**
* See QDirListing:: swap(QDirListing&)
* @param other
*/
@QtUninvokable
public final void swap(io.qt.core.@StrictNonNull QDirListing other){
java.util.Objects.requireNonNull(other, "Argument 'other': null not expected.");
swap_native_ref_QDirListing(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@QtUninvokable
private native void swap_native_ref_QDirListing(long __this__nativeId, long other);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QDirListing(QPrivateConstructor p) { super(p); }
@Override
@QtUninvokable
public final java.util.@NonNull Iterator iterator() {
return new java.util.Iterator(){
final QSequentialConstIterator current = constBegin();
private DirEntry next;
@Override
public boolean hasNext() {
if(!isEnd(QtJambi_LibraryUtilities.internal.nativeId(current))) {
if(next!=null) {
current.increment();
if(!isEnd(QtJambi_LibraryUtilities.internal.nativeId(current)))
next = current._value();
else
next = null;
}else {
next = current._value();
}
}else{
next = null;
}
return next!=null;
}
@Override
public DirEntry next() {
return next;
}
};
}
@QtUninvokable
private static native boolean isEnd(long __iter);
/**
* Overloaded constructor for {@link #QDirListing(java.lang.String, io.qt.core.QDirListing.IteratorFlags)}
* with flags = new io.qt.core.QDirListing.IteratorFlags(0)
.
*/
public QDirListing(java.lang.@NonNull String path) {
this(path, new io.qt.core.QDirListing.IteratorFlags(0));
}
/**
* Overloaded constructor for {@link #QDirListing(java.lang.String, io.qt.core.QDirListing.IteratorFlags)}.
*/
public QDirListing(java.lang.@NonNull String path, io.qt.core.QDirListing.@NonNull IteratorFlag @NonNull... flags) {
this(path, new io.qt.core.QDirListing.IteratorFlags(flags));
}
/**
* Overloaded constructor for {@link #QDirListing(java.lang.String, java.util.Collection, io.qt.core.QDirListing.IteratorFlags)}
* with flags = new io.qt.core.QDirListing.IteratorFlags(0)
.
*/
public QDirListing(java.lang.@NonNull String path, java.util.@NonNull Collection nameFilters) {
this(path, nameFilters, new io.qt.core.QDirListing.IteratorFlags(0));
}
/**
* Overloaded constructor for {@link #QDirListing(java.lang.String, java.util.Collection, io.qt.core.QDirListing.IteratorFlags)}.
*/
public QDirListing(java.lang.@NonNull String path, java.util.@NonNull Collection nameFilters, io.qt.core.QDirListing.@NonNull IteratorFlag @NonNull... flags) {
this(path, nameFilters, new io.qt.core.QDirListing.IteratorFlags(flags));
}
}