io.qt.core.QFile Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* Interface for reading from and writing to files
* Java wrapper for Qt class QFile
*/
public class QFile extends io.qt.core.QFileDevice
{
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QFile.class);
/**
* See QFile:: QFile()
*/
public QFile(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QFile instance);
/**
*
*/
public QFile(io.qt.core.@Nullable QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, parent);
}
private native static void initialize_native(QFile instance, io.qt.core.QObject parent);
/**
*
*/
public QFile(java.lang.@NonNull String name){
super((QPrivateConstructor)null);
initialize_native(this, name);
}
private native static void initialize_native(QFile instance, java.lang.String name);
/**
* See QFile:: QFile(QString, QObject*)
*/
public QFile(java.lang.@NonNull String name, io.qt.core.@Nullable QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, name, parent);
}
private native static void initialize_native(QFile instance, java.lang.String name, io.qt.core.QObject parent);
/**
*
*/
@QtUninvokable
public final boolean copy(java.lang.@NonNull String newName){
return copy_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), newName);
}
@QtUninvokable
private native boolean copy_native_cref_QString(long __this__nativeId, java.lang.String newName);
/**
*
*/
@QtUninvokable
public final boolean exists(){
return exists_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean exists_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final boolean link(java.lang.@NonNull String newName){
return link_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), newName);
}
@QtUninvokable
private native boolean link_native_cref_QString(long __this__nativeId, java.lang.String newName);
/**
*
*/
@QtUninvokable
public final boolean moveToTrash(){
return moveToTrash_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean moveToTrash_native(long __this__nativeId);
/**
* See QFile:: open(QIODeviceBase::OpenMode, QFileDevice::Permissions)
*/
@QtUninvokable
public final boolean open(io.qt.core.QIODeviceBase.@NonNull OpenMode flags, io.qt.core.QFileDevice.@NonNull Permissions permissions){
return open_native_QIODeviceBase_OpenMode_QFileDevice_Permissions(QtJambi_LibraryUtilities.internal.nativeId(this), flags.value(), permissions.value());
}
@QtUninvokable
private native boolean open_native_QIODeviceBase_OpenMode_QFileDevice_Permissions(long __this__nativeId, int flags, int permissions);
/**
* See QFile:: open(int, QIODeviceBase::OpenMode, QFileDevice::FileHandleFlags)
*/
@QtUninvokable
public final boolean open(int fd, io.qt.core.QIODeviceBase.@NonNull OpenMode ioFlags, io.qt.core.QFileDevice.@NonNull FileHandleFlags handleFlags){
return open_native_int_QIODeviceBase_OpenMode_QFileDevice_FileHandleFlags(QtJambi_LibraryUtilities.internal.nativeId(this), fd, ioFlags.value(), handleFlags.value());
}
@QtUninvokable
private native boolean open_native_int_QIODeviceBase_OpenMode_QFileDevice_FileHandleFlags(long __this__nativeId, int fd, int ioFlags, int handleFlags);
/**
* See QFile:: remove()
*/
@QtUninvokable
public final boolean remove(){
return remove_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean remove_native(long __this__nativeId);
/**
*
*/
@QtDeclaredFinal
@QtUninvokable
public boolean rename(java.lang.@NonNull String newName){
return rename_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), newName);
}
@QtUninvokable
private native boolean rename_native_cref_QString(long __this__nativeId, java.lang.String newName);
/**
* See QFile:: setFileName(QString)
*/
@QtUninvokable
public final void setFileName(java.lang.@NonNull String name){
setFileName_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), name);
}
@QtUninvokable
private native void setFileName_native_cref_QString(long __this__nativeId, java.lang.String name);
/**
* See QFile:: symLinkTarget()const
*/
@QtUninvokable
public final java.lang.@NonNull String symLinkTarget(){
return symLinkTarget_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String symLinkTarget_native_constfct(long __this__nativeId);
/**
* See QFileDevice:: fileName()const
*/
@QtUninvokable
@Override
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:: open(QIODeviceBase::OpenMode)
*/
@QtUninvokable
@Override
public boolean open(io.qt.core.QIODeviceBase.@NonNull OpenMode flags){
return open_native_QIODeviceBase_OpenMode(QtJambi_LibraryUtilities.internal.nativeId(this), flags.value());
}
@QtUninvokable
private native boolean open_native_QIODeviceBase_OpenMode(long __this__nativeId, int flags);
/**
* See QFileDevice:: permissions()const
*/
@QtUninvokable
@Override
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 QFileDevice:: resize(qint64)
*/
@QtUninvokable
@Override
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 QFileDevice:: setPermissions(QFileDevice::Permissions)
*/
@QtUninvokable
@Override
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);
/**
*
*/
@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 QFile:: copy(QString, QString)
*/
public native static boolean copy(java.lang.@NonNull String fileName, java.lang.@NonNull String newName);
/**
* See QFile:: decodeName(QByteArray)
*/
public static java.lang.@NonNull String decodeName(io.qt.core.@NonNull QByteArray localFileName){
return decodeName_native_cref_QByteArray(QtJambi_LibraryUtilities.internal.checkedNativeId(localFileName));
}
private native static java.lang.String decodeName_native_cref_QByteArray(long localFileName);
/**
* See QFile:: decodeName(const char*)
*/
public native static java.lang.@NonNull String decodeName(java.lang.@Nullable String localFileName);
/**
* See QFile:: encodeName(QString)
*/
public native static io.qt.core.@NonNull QByteArray encodeName(java.lang.@NonNull String fileName);
/**
*
*/
public native static boolean exists(java.lang.@NonNull String fileName);
/**
* See QFile:: link(QString, QString)
*/
public native static boolean link(java.lang.@NonNull String fileName, java.lang.@NonNull String newName);
/**
* See QFile:: moveToTrash(QString, QString*)
*/
public static io.qt.core.QFile.@StrictNonNull TrashResult moveToTrash(java.lang.@NonNull String fileName){
return moveToTrash_native_cref_QString_QString_ptr(fileName);
}
private native static io.qt.core.QFile.TrashResult moveToTrash_native_cref_QString_QString_ptr(java.lang.String fileName);
/**
* See QFile:: permissions(QString)
*/
public static io.qt.core.QFileDevice.@NonNull Permissions permissions(java.lang.@NonNull String filename){
return new io.qt.core.QFileDevice.Permissions(permissions_native_cref_QString(filename));
}
private native static int permissions_native_cref_QString(java.lang.String filename);
/**
*
*/
public native static boolean remove(java.lang.@NonNull String fileName);
/**
* See QFile:: rename(QString, QString)
*/
public native static boolean rename(java.lang.@NonNull String oldName, java.lang.@NonNull String newName);
/**
* See QFile:: resize(QString, qint64)
*/
public native static boolean resize(java.lang.@NonNull String filename, long sz);
/**
* See QFile:: setPermissions(QString, QFileDevice::Permissions)
*/
public static boolean setPermissions(java.lang.@NonNull String filename, io.qt.core.QFileDevice.@NonNull Permissions permissionSpec){
return setPermissions_native_cref_QString_QFileDevice_Permissions(filename, permissionSpec.value());
}
private native static boolean setPermissions_native_cref_QString_QFileDevice_Permissions(java.lang.String filename, int permissionSpec);
/**
* See QFile:: symLinkTarget(QString)
*/
public native static java.lang.@NonNull String symLinkTarget(java.lang.@NonNull String fileName);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QFile(QPrivateConstructor p) { super(p); }
/**
* Constructor for internal use only.
* It is not allowed to call the declarative constructor from inside Java.
* @hidden
*/
@NativeAccess
protected QFile(QDeclarativeConstructor constructor) {
super((QPrivateConstructor)null);
initialize_native(this, constructor);
}
@QtUninvokable
private static native void initialize_native(QFile instance, QDeclarativeConstructor constructor);
/**
* Result class for {@link #moveToTrash(java.lang.String)}
*/
public static class TrashResult{
public final boolean success;
public final @NonNull String pathInTrash;
private TrashResult(boolean success, String pathInTrash) {
super();
this.success = success;
this.pathInTrash = pathInTrash;
}
}
/**
* Overloaded function for {@link #open(io.qt.core.QIODeviceBase.OpenMode, io.qt.core.QFileDevice.Permissions)}.
*/
@QtUninvokable
public final boolean open(io.qt.core.QIODeviceBase.@NonNull OpenMode flags, io.qt.core.QFileDevice.@NonNull Permission @NonNull... permissions) {
return open(flags, new io.qt.core.QFileDevice.Permissions(permissions));
}
/**
* Overloaded function for {@link #open(int, io.qt.core.QIODeviceBase.OpenMode, io.qt.core.QFileDevice.FileHandleFlags)}
* with handleFlags = new io.qt.core.QFileDevice.FileHandleFlags(0)
.
*/
@QtUninvokable
public final boolean open(int fd, io.qt.core.QIODeviceBase.@NonNull OpenMode ioFlags) {
return open(fd, ioFlags, new io.qt.core.QFileDevice.FileHandleFlags(0));
}
/**
* Overloaded function for {@link #open(int, io.qt.core.QIODeviceBase.OpenMode, io.qt.core.QFileDevice.FileHandleFlags)}.
*/
@QtUninvokable
public final boolean open(int fd, io.qt.core.QIODeviceBase.@NonNull OpenMode ioFlags, io.qt.core.QFileDevice.@NonNull FileHandleFlag @NonNull... handleFlags) {
return open(fd, ioFlags, new io.qt.core.QFileDevice.FileHandleFlags(handleFlags));
}
/**
* Overloaded function for {@link #decodeName(io.qt.core.QByteArray)}.
*/
public static java.lang.@NonNull String decodeName(byte @NonNull[] localFileName) {
return decodeName(new io.qt.core.QByteArray(localFileName));
}
/**
* Overloaded function for {@link #setPermissions(java.lang.String, io.qt.core.QFileDevice.Permissions)}.
*/
public static boolean setPermissions(java.lang.@NonNull String filename, io.qt.core.QFileDevice.@NonNull Permission @NonNull... permissionSpec) {
return setPermissions(filename, new io.qt.core.QFileDevice.Permissions(permissionSpec));
}
}