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

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

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

import io.qt.*;


/**
 * 

Interface for reading from and writing to open files

*

Java wrapper for Qt class QFileDevice

*/ public class QFileDevice extends io.qt.core.QIODevice { /** * This variable stores the meta-object for the class. */ public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QFileDevice.class); /** *

Java wrapper for Qt enum QFileDevice::FileError

*/ @QtUnlistedEnum public enum FileError implements QtEnumerator { /** *

Representing QFileDevice::NoError

*/ NoError(0), /** *

Representing QFileDevice::ReadError

*/ ReadError(1), /** *

Representing QFileDevice::WriteError

*/ WriteError(2), /** *

Representing QFileDevice::FatalError

*/ FatalError(3), /** *

Representing QFileDevice::ResourceError

*/ ResourceError(4), /** *

Representing QFileDevice::OpenError

*/ OpenError(5), /** *

Representing QFileDevice::AbortError

*/ AbortError(6), /** *

Representing QFileDevice::TimeOutError

*/ TimeOutError(7), /** *

Representing QFileDevice::UnspecifiedError

*/ UnspecifiedError(8), /** *

Representing QFileDevice::RemoveError

*/ RemoveError(9), /** *

Representing QFileDevice::RenameError

*/ RenameError(10), /** *

Representing QFileDevice::PositionError

*/ PositionError(11), /** *

Representing QFileDevice::ResizeError

*/ ResizeError(12), /** *

Representing QFileDevice::PermissionsError

*/ PermissionsError(13), /** *

Representing QFileDevice::CopyError

*/ CopyError(14); static { QtJambi_LibraryUtilities.initialize(); } private FileError(int value) { this.value = value; } /** * {@inheritDoc} */ @Override public int value() { return value; } /** * Returns the corresponding enum entry for the given value. * @param value * @return enum entry */ public static @NonNull FileError resolve(int value) { switch (value) { case 0: return NoError; case 1: return ReadError; case 2: return WriteError; case 3: return FatalError; case 4: return ResourceError; case 5: return OpenError; case 6: return AbortError; case 7: return TimeOutError; case 8: return UnspecifiedError; case 9: return RemoveError; case 10: return RenameError; case 11: return PositionError; case 12: return ResizeError; case 13: return PermissionsError; case 14: return CopyError; default: throw new QNoSuchEnumValueException(value); } } private final int value; } /** *

Java wrapper for Qt enum QFileDevice::FileHandleFlag

* * @see FileHandleFlags */ public enum FileHandleFlag implements QtFlagEnumerator { /** *

Representing QFileDevice::AutoCloseHandle

*/ AutoCloseHandle(1), /** *

Representing QFileDevice::DontCloseHandle

*/ DontCloseHandle(0); static { QtJambi_LibraryUtilities.initialize(); } private FileHandleFlag(int value) { this.value = value; } /** * {@inheritDoc} */ @Override public int value() { return value; } /** * Create a QFlags of the enum entry. * @return QFlags */ @Override public @NonNull FileHandleFlags asFlags() { return new FileHandleFlags(value); } /** * Combines this entry with other enum entry. * @param e enum entry * @return new flag */ public @NonNull FileHandleFlags combined(@NonNull FileHandleFlag 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 FileHandleFlags cleared(@NonNull FileHandleFlag e) { return asFlags().setFlag(e, false); } /** * Creates a new {@link FileHandleFlags} from the entries. * @param values entries * @return new flag */ public static @NonNull FileHandleFlags flags(@Nullable FileHandleFlag @NonNull... values) { return new FileHandleFlags(values); } /** * Returns the corresponding enum entry for the given value. * @param value * @return enum entry */ public static @NonNull FileHandleFlag resolve(int value) { switch (value) { case 1: return AutoCloseHandle; case 0: return DontCloseHandle; default: throw new QNoSuchEnumValueException(value); } } private final int value; } /** * {@link QFlags} type for enum {@link FileHandleFlag} */ public static final class FileHandleFlags extends QFlags implements Comparable { private static final long serialVersionUID = 0x16a492cebc911dceL; static { QtJambi_LibraryUtilities.initialize(); } /** * Creates a new FileHandleFlags where the flags in args are set. * @param args enum entries */ public FileHandleFlags(@Nullable FileHandleFlag @NonNull... args){ super(args); } /** * Creates a new FileHandleFlags with given value. * @param value */ public FileHandleFlags(int value) { super(value); } /** * Combines this flags with enum entry. * @param e enum entry * @return new FileHandleFlags */ @Override public final @NonNull FileHandleFlags combined(@StrictNonNull FileHandleFlag e){ return new FileHandleFlags(value() | e.value()); } /** * Sets the flag e * @param e enum entry * @return this */ @Override public final @NonNull FileHandleFlags setFlag(@Nullable FileHandleFlag 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 FileHandleFlags setFlag(@Nullable FileHandleFlag 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 FileHandleFlags. * @return array of enum entries */ @Override public final @NonNull FileHandleFlag @NonNull[] flags(){ return super.flags(FileHandleFlag.values()); } /** * {@inheritDoc} */ @Override public final @NonNull FileHandleFlags clone(){ return new FileHandleFlags(value()); } /** * {@inheritDoc} */ @Override public final int compareTo(@StrictNonNull FileHandleFlags other){ return Integer.compare(value(), other.value()); } } /** *

Java wrapper for Qt enum QFileDevice::FileTime

*/ @QtUnlistedEnum public enum FileTime implements QtEnumerator { /** *

Representing QFileDevice::FileAccessTime

*/ FileAccessTime(0), /** *

Representing QFileDevice::FileBirthTime

*/ FileBirthTime(1), /** *

Representing QFileDevice::FileMetadataChangeTime

*/ FileMetadataChangeTime(2), /** *

Representing QFileDevice::FileModificationTime

*/ FileModificationTime(3); static { QtJambi_LibraryUtilities.initialize(); } private FileTime(int value) { this.value = value; } /** * {@inheritDoc} */ @Override public int value() { return value; } /** * Returns the corresponding enum entry for the given value. * @param value * @return enum entry */ public static @NonNull FileTime resolve(int value) { switch (value) { case 0: return FileAccessTime; case 1: return FileBirthTime; case 2: return FileMetadataChangeTime; case 3: return FileModificationTime; default: throw new QNoSuchEnumValueException(value); } } private final int value; } /** *

Java wrapper for Qt enum QFileDevice::MemoryMapFlag

* * @see MemoryMapFlags */ public enum MemoryMapFlag implements QtFlagEnumerator { /** *

Representing QFileDevice::NoOptions

*/ NoOptions(0), /** *

Representing QFileDevice::MapPrivateOption

*/ MapPrivateOption(1); static { QtJambi_LibraryUtilities.initialize(); } private MemoryMapFlag(int value) { this.value = value; } /** * {@inheritDoc} */ @Override public int value() { return value; } /** * Create a QFlags of the enum entry. * @return QFlags */ @Override public @NonNull MemoryMapFlags asFlags() { return new MemoryMapFlags(value); } /** * Combines this entry with other enum entry. * @param e enum entry * @return new flag */ public @NonNull MemoryMapFlags combined(@NonNull MemoryMapFlag 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 MemoryMapFlags cleared(@NonNull MemoryMapFlag e) { return asFlags().setFlag(e, false); } /** * Creates a new {@link MemoryMapFlags} from the entries. * @param values entries * @return new flag */ public static @NonNull MemoryMapFlags flags(@Nullable MemoryMapFlag @NonNull... values) { return new MemoryMapFlags(values); } /** * Returns the corresponding enum entry for the given value. * @param value * @return enum entry */ public static @NonNull MemoryMapFlag resolve(int value) { switch (value) { case 0: return NoOptions; case 1: return MapPrivateOption; default: throw new QNoSuchEnumValueException(value); } } private final int value; } /** * {@link QFlags} type for enum {@link MemoryMapFlag} */ public static final class MemoryMapFlags extends QFlags implements Comparable { private static final long serialVersionUID = 0xbc441f9cb881eefbL; static { QtJambi_LibraryUtilities.initialize(); } /** * Creates a new MemoryMapFlags where the flags in args are set. * @param args enum entries */ public MemoryMapFlags(@Nullable MemoryMapFlag @NonNull... args){ super(args); } /** * Creates a new MemoryMapFlags with given value. * @param value */ public MemoryMapFlags(int value) { super(value); } /** * Combines this flags with enum entry. * @param e enum entry * @return new MemoryMapFlags */ @Override public final @NonNull MemoryMapFlags combined(@StrictNonNull MemoryMapFlag e){ return new MemoryMapFlags(value() | e.value()); } /** * Sets the flag e * @param e enum entry * @return this */ @Override public final @NonNull MemoryMapFlags setFlag(@Nullable MemoryMapFlag 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 MemoryMapFlags setFlag(@Nullable MemoryMapFlag 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 MemoryMapFlags. * @return array of enum entries */ @Override public final @NonNull MemoryMapFlag @NonNull[] flags(){ return super.flags(MemoryMapFlag.values()); } /** * {@inheritDoc} */ @Override public final @NonNull MemoryMapFlags clone(){ return new MemoryMapFlags(value()); } /** * {@inheritDoc} */ @Override public final int compareTo(@StrictNonNull MemoryMapFlags other){ return Integer.compare(value(), other.value()); } } /** *

Java wrapper for Qt enum QFileDevice::Permission

* * @see Permissions */ public enum Permission implements QtFlagEnumerator { /** *

Representing QFileDevice::ReadOwner

*/ ReadOwner(16384), /** *

Representing QFileDevice::WriteOwner

*/ WriteOwner(8192), /** *

Representing QFileDevice::ExeOwner

*/ ExeOwner(4096), /** *

Representing QFileDevice::ReadUser

*/ ReadUser(1024), /** *

Representing QFileDevice::WriteUser

*/ WriteUser(512), /** *

Representing QFileDevice::ExeUser

*/ ExeUser(256), /** *

Representing QFileDevice::ReadGroup

*/ ReadGroup(64), /** *

Representing QFileDevice::WriteGroup

*/ WriteGroup(32), /** *

Representing QFileDevice::ExeGroup

*/ ExeGroup(16), /** *

Representing QFileDevice::ReadOther

*/ ReadOther(4), /** *

Representing QFileDevice::WriteOther

*/ WriteOther(2), /** *

Representing QFileDevice::ExeOther

*/ ExeOther(1); static { QtJambi_LibraryUtilities.initialize(); } private Permission(int value) { this.value = value; } /** * {@inheritDoc} */ @Override public int value() { return value; } /** * Create a QFlags of the enum entry. * @return QFlags */ @Override public @NonNull Permissions asFlags() { return new Permissions(value); } /** * Combines this entry with other enum entry. * @param e enum entry * @return new flag */ public @NonNull Permissions combined(@NonNull Permission 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 Permissions cleared(@NonNull Permission e) { return asFlags().setFlag(e, false); } /** * Creates a new {@link Permissions} from the entries. * @param values entries * @return new flag */ public static @NonNull Permissions flags(@Nullable Permission @NonNull... values) { return new Permissions(values); } /** * Returns the corresponding enum entry for the given value. * @param value * @return enum entry */ public static @NonNull Permission resolve(int value) { switch (value) { case 16384: return ReadOwner; case 8192: return WriteOwner; case 4096: return ExeOwner; case 1024: return ReadUser; case 512: return WriteUser; case 256: return ExeUser; case 64: return ReadGroup; case 32: return WriteGroup; case 16: return ExeGroup; case 4: return ReadOther; case 2: return WriteOther; case 1: return ExeOther; default: throw new QNoSuchEnumValueException(value); } } private final int value; } /** * {@link QFlags} type for enum {@link Permission} */ public static final class Permissions extends QFlags implements Comparable { private static final long serialVersionUID = 0xd4f58fe6ba34a0ecL; static { QtJambi_LibraryUtilities.initialize(); } /** * Creates a new Permissions where the flags in args are set. * @param args enum entries */ public Permissions(@Nullable Permission @NonNull... args){ super(args); } /** * Creates a new Permissions with given value. * @param value */ public Permissions(int value) { super(value); } /** * Combines this flags with enum entry. * @param e enum entry * @return new Permissions */ @Override public final @NonNull Permissions combined(@StrictNonNull Permission e){ return new Permissions(value() | e.value()); } /** * Sets the flag e * @param e enum entry * @return this */ @Override public final @NonNull Permissions setFlag(@Nullable Permission 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 Permissions setFlag(@Nullable Permission 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 Permissions. * @return array of enum entries */ @Override public final @NonNull Permission @NonNull[] flags(){ return super.flags(Permission.values()); } /** * {@inheritDoc} */ @Override public final @NonNull Permissions clone(){ return new Permissions(value()); } /** * {@inheritDoc} */ @Override public final int compareTo(@StrictNonNull Permissions other){ return Integer.compare(value(), other.value()); } } /** *

See QFileDevice::QFileDevice()

*/ protected QFileDevice(){ super((QPrivateConstructor)null); initialize_native(this); } private native static void initialize_native(QFileDevice instance); /** *

See QFileDevice::QFileDevice(QObject*)

*/ protected QFileDevice(io.qt.core.@Nullable QObject parent){ super((QPrivateConstructor)null); initialize_native(this, parent); } private native static void initialize_native(QFileDevice instance, io.qt.core.QObject parent); /** *

See QFileDevice::error()const

*/ @QtUninvokable public final io.qt.core.QFileDevice.@NonNull FileError error(){ return io.qt.core.QFileDevice.FileError.resolve(error_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this))); } @QtUninvokable private native int error_native_constfct(long __this__nativeId); /** *

See QFileDevice::fileTime(QFileDevice::FileTime)const

*/ @QtUninvokable public final io.qt.core.@NonNull QDateTime fileTime(io.qt.core.QFileDevice.@NonNull FileTime time){ return fileTime_native_QFileDevice_FileTime_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), time.value()); } @QtUninvokable private native io.qt.core.QDateTime fileTime_native_QFileDevice_FileTime_constfct(long __this__nativeId, int time); /** *

See QFileDevice::flush()

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

See QFileDevice::handle()const

*/ @QtUninvokable public final int handle(){ return handle_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native int handle_native_constfct(long __this__nativeId); /** *

See QFileDevice::map(qint64,qint64,QFileDevice::MemoryMapFlags)

*/ @QtUninvokable public final java.nio.@Nullable ByteBuffer map(long offset, long size, io.qt.core.QFileDevice.@NonNull MemoryMapFlags flags){ return map_native_qint64_qint64_QFileDevice_MemoryMapFlags(QtJambi_LibraryUtilities.internal.nativeId(this), offset, size, flags.value()); } @QtUninvokable private native java.nio.ByteBuffer map_native_qint64_qint64_QFileDevice_MemoryMapFlags(long __this__nativeId, long offset, long size, int flags); /** *

See QFileDevice::setFileTime(QDateTime,QFileDevice::FileTime)

*/ @QtUninvokable public final boolean setFileTime(io.qt.core.@NonNull QDateTime newDate, io.qt.core.QFileDevice.@NonNull FileTime fileTime){ return setFileTime_native_cref_QDateTime_QFileDevice_FileTime(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(newDate), fileTime.value()); } @QtUninvokable private native boolean setFileTime_native_cref_QDateTime_QFileDevice_FileTime(long __this__nativeId, long newDate, int fileTime); /** *

See QFileDevice::unmap(uchar*)

*/ @QtUninvokable public final boolean unmap(java.nio.@Nullable ByteBuffer address){ boolean __qt_return_value = unmap_native_uchar_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), address); if(__qt_return_value && address!=null) ((java.nio.Buffer)address).limit(0); return __qt_return_value; } @QtUninvokable private native boolean unmap_native_uchar_ptr(long __this__nativeId, java.nio.ByteBuffer address); /** *

See QFileDevice::unsetError()

*/ @QtUninvokable public final void unsetError(){ unsetError_native(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native void unsetError_native(long __this__nativeId); /** *

See QIODevice::atEnd()const

*/ @QtUninvokable @Override public boolean atEnd(){ return atEnd_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native boolean atEnd_native_constfct(long __this__nativeId); /** *

See QIODevice::close()

*/ @QtUninvokable @Override public void close(){ close_native(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native void close_native(long __this__nativeId); /** *

See QFileDevice::fileName()const

*/ @QtUninvokable public 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 QIODevice::isSequential()const

*/ @QtUninvokable @Override public boolean isSequential(){ return isSequential_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native boolean isSequential_native_constfct(long __this__nativeId); /** *

See QFileDevice::permissions()const

*/ @QtUninvokable public io.qt.core.QFileDevice.@NonNull Permissions permissions(){ return new io.qt.core.QFileDevice.Permissions(permissions_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this))); } @QtUninvokable private native int permissions_native_constfct(long __this__nativeId); /** *

See QIODevice::pos()const

*/ @QtUninvokable @Override public long pos(){ return pos_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native long pos_native_constfct(long __this__nativeId); /** *

See QIODevice::readData(char*,qint64)

*/ @QtUninvokable @Override protected int readData(java.nio.@Nullable ByteBuffer data){ return readData_native_char_ptr_qint64(QtJambi_LibraryUtilities.internal.nativeId(this), data); } @QtUninvokable private native int readData_native_char_ptr_qint64(long __this__nativeId, java.nio.ByteBuffer data); /** *

See QIODevice::readLineData(char*,qint64)

*/ @QtUninvokable @Override protected int readLineData(java.nio.@Nullable ByteBuffer data){ return readLineData_native_char_ptr_qint64(QtJambi_LibraryUtilities.internal.nativeId(this), data); } @QtUninvokable private native int readLineData_native_char_ptr_qint64(long __this__nativeId, java.nio.ByteBuffer data); /** *

See QFileDevice::resize(qint64)

*/ @QtUninvokable public boolean resize(long sz){ return resize_native_qint64(QtJambi_LibraryUtilities.internal.nativeId(this), sz); } @QtUninvokable private native boolean resize_native_qint64(long __this__nativeId, long sz); /** *

See QIODevice::seek(qint64)

*/ @QtUninvokable @Override public boolean seek(long offset){ return seek_native_qint64(QtJambi_LibraryUtilities.internal.nativeId(this), offset); } @QtUninvokable private native boolean seek_native_qint64(long __this__nativeId, long offset); /** *

See QFileDevice::setPermissions(QFileDevice::Permissions)

*/ @QtUninvokable public boolean setPermissions(io.qt.core.QFileDevice.@NonNull Permissions permissionSpec){ return setPermissions_native_QFileDevice_Permissions(QtJambi_LibraryUtilities.internal.nativeId(this), permissionSpec.value()); } @QtUninvokable private native boolean setPermissions_native_QFileDevice_Permissions(long __this__nativeId, int permissionSpec); /** *

See QIODevice::size()const

*/ @QtUninvokable @Override public long size(){ return size_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native long size_native_constfct(long __this__nativeId); /** *

See QIODevice::writeData(const char*,qint64)

*/ @QtUninvokable @Override protected int writeData(java.nio.@Nullable ByteBuffer data){ return writeData_native_const_char_ptr_qint64(QtJambi_LibraryUtilities.internal.nativeId(this), data); } @QtUninvokable private native int writeData_native_const_char_ptr_qint64(long __this__nativeId, java.nio.ByteBuffer data); /** * Constructor for internal use only. * @param p expected to be null. * @hidden */ @NativeAccess protected QFileDevice(QPrivateConstructor p) { super(p); } /** * Constructor for internal use only. * It is not allowed to call the declarative constructor from inside Java. * @hidden */ @NativeAccess protected QFileDevice(QDeclarativeConstructor constructor) { super((QPrivateConstructor)null); initialize_native(this, constructor); } @QtUninvokable private static native void initialize_native(QFileDevice instance, QDeclarativeConstructor constructor); /** *

Overloaded function for {@link #map(long, long, io.qt.core.QFileDevice.MemoryMapFlags)} * with flags = new io.qt.core.QFileDevice.MemoryMapFlags(0).

*/ @QtUninvokable public final java.nio.@Nullable ByteBuffer map(long offset, long size) { return map(offset, size, new io.qt.core.QFileDevice.MemoryMapFlags(0)); } /** *

Overloaded function for {@link #map(long, long, io.qt.core.QFileDevice.MemoryMapFlags)}.

*/ @QtUninvokable public final java.nio.@Nullable ByteBuffer map(long offset, long size, io.qt.core.QFileDevice.@NonNull MemoryMapFlag @NonNull... flags) { return map(offset, size, new io.qt.core.QFileDevice.MemoryMapFlags(flags)); } /** *

Overloaded function for {@link #setPermissions(io.qt.core.QFileDevice.Permissions)}.

*/ @QtUninvokable public final boolean setPermissions(io.qt.core.QFileDevice.@NonNull Permission @NonNull... permissionSpec) { return setPermissions(new io.qt.core.QFileDevice.Permissions(permissionSpec)); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy