KLayout 0.29.8 (2024-10-28 63dd591e5) [master]

API reference - Class QFileInfo

Notation used in Ruby API documentation

Module: QtCore

Description: Binding of QFileInfo

Public constructors

new QFileInfonewConstructor QFileInfo::QFileInfo()
new QFileInfonew(string file)Constructor QFileInfo::QFileInfo(const QString &file)
new QFileInfonew(const QFile file)Constructor QFileInfo::QFileInfo(const QFile &file)
new QFileInfonew(const QDir dir,
string file)
Constructor QFileInfo::QFileInfo(const QDir &dir, const QString &file)
new QFileInfonew(const QFileInfo fileinfo)Constructor QFileInfo::QFileInfo(const QFileInfo &fileinfo)

Public methods

[const]bool!=(const QFileInfo fileinfo)Method bool QFileInfo::operator!=(const QFileInfo &fileinfo)
[const]bool==(const QFileInfo fileinfo)Method bool QFileInfo::operator==(const QFileInfo &fileinfo)
void_assign(const QFileInfo other)Assigns another object to self
[const]QFileInfo ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
[const]QDirabsoluteDirMethod QDir QFileInfo::absoluteDir()
[const]stringabsoluteFilePathMethod QString QFileInfo::absoluteFilePath()
[const]stringabsolutePathMethod QString QFileInfo::absolutePath()
QFileInfoassign(const QFileInfo fileinfo)Method QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo)
[const]stringbaseNameMethod QString QFileInfo::baseName()
[const]QDateTimebirthTimeMethod QDateTime QFileInfo::birthTime()
[const]stringbundleNameMethod QString QFileInfo::bundleName()
[const]boolcachingMethod bool QFileInfo::caching()
voidcaching=(bool on)Method void QFileInfo::setCaching(bool on)
[const]stringcanonicalFilePathMethod QString QFileInfo::canonicalFilePath()
[const]stringcanonicalPathMethod QString QFileInfo::canonicalPath()
[const]stringcompleteBaseNameMethod QString QFileInfo::completeBaseName()
[const]stringcompleteSuffixMethod QString QFileInfo::completeSuffix()
[const]QDateTimecreatedMethod QDateTime QFileInfo::created()
[const]QDirdirMethod QDir QFileInfo::dir()
[const]new QFileInfo ptrdupCreates a copy of self
[const]boolexistsMethod bool QFileInfo::exists()
[const]stringfileNameMethod QString QFileInfo::fileName()
[const]stringfilePathMethod QString QFileInfo::filePath()
[const]QDateTimefileTime(const QFileDevice_FileTime time)Method QDateTime QFileInfo::fileTime(QFileDevice::FileTime time)
[const]stringgroupMethod QString QFileInfo::group()
[const]unsigned intgroupIdMethod unsigned int QFileInfo::groupId()
[const]boolisAbsolute?Method bool QFileInfo::isAbsolute()
[const]boolisBundle?Method bool QFileInfo::isBundle()
[const]boolisDir?Method bool QFileInfo::isDir()
[const]boolisExecutable?Method bool QFileInfo::isExecutable()
[const]boolisFile?Method bool QFileInfo::isFile()
[const]boolisHidden?Method bool QFileInfo::isHidden()
[const]boolisNativePath?Method bool QFileInfo::isNativePath()
[const]boolisReadable?Method bool QFileInfo::isReadable()
[const]boolisRelative?Method bool QFileInfo::isRelative()
[const]boolisRoot?Method bool QFileInfo::isRoot()
[const]boolisSymLink?Method bool QFileInfo::isSymLink()
[const]boolisWritable?Method bool QFileInfo::isWritable()
[const]QDateTimelastModifiedMethod QDateTime QFileInfo::lastModified()
[const]QDateTimelastReadMethod QDateTime QFileInfo::lastRead()
boolmakeAbsoluteMethod bool QFileInfo::makeAbsolute()
[const]QDateTimemetadataChangeTimeMethod QDateTime QFileInfo::metadataChangeTime()
[const]stringownerMethod QString QFileInfo::owner()
[const]unsigned intownerIdMethod unsigned int QFileInfo::ownerId()
[const]stringpathMethod QString QFileInfo::path()
[const]boolpermission(QFileDevice_QFlags_Permission permissions)Method bool QFileInfo::permission(QFlags<QFileDevice::Permission> permissions)
[const]QFileDevice_QFlags_PermissionpermissionsMethod QFlags<QFileDevice::Permission> QFileInfo::permissions()
[const]stringreadLinkMethod QString QFileInfo::readLink()
voidrefreshMethod void QFileInfo::refresh()
voidsetCaching(bool on)Method void QFileInfo::setCaching(bool on)
voidsetFile(string file)Method void QFileInfo::setFile(const QString &file)
voidsetFile(const QFile file)Method void QFileInfo::setFile(const QFile &file)
voidsetFile(const QDir dir,
string file)
Method void QFileInfo::setFile(const QDir &dir, const QString &file)
[const]long longsizeMethod qint64 QFileInfo::size()
[const]stringsuffixMethod QString QFileInfo::suffix()
voidswap(QFileInfo other)Method void QFileInfo::swap(QFileInfo &other)
[const]stringsymLinkTargetMethod QString QFileInfo::symLinkTarget()

Public static methods and constants

boolexists(string file)Static method bool QFileInfo::exists(const QString &file)

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

!=

Signature: [const] bool != (const QFileInfo fileinfo)

Description: Method bool QFileInfo::operator!=(const QFileInfo &fileinfo)

==

Signature: [const] bool == (const QFileInfo fileinfo)

Description: Method bool QFileInfo::operator==(const QFileInfo &fileinfo)

_assign

Signature: void _assign (const QFileInfo other)

Description: Assigns another object to self

_const_cast

Signature: [const] QFileInfo ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

absoluteDir

Signature: [const] QDir absoluteDir

Description: Method QDir QFileInfo::absoluteDir()

absoluteFilePath

Signature: [const] string absoluteFilePath

Description: Method QString QFileInfo::absoluteFilePath()

absolutePath

Signature: [const] string absolutePath

Description: Method QString QFileInfo::absolutePath()

assign

Signature: QFileInfo assign (const QFileInfo fileinfo)

Description: Method QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo)

baseName

Signature: [const] string baseName

Description: Method QString QFileInfo::baseName()

birthTime

Signature: [const] QDateTime birthTime

Description: Method QDateTime QFileInfo::birthTime()

bundleName

Signature: [const] string bundleName

Description: Method QString QFileInfo::bundleName()

caching

Signature: [const] bool caching

Description: Method bool QFileInfo::caching()

Python specific notes:
The object exposes a readable attribute 'caching'. This is the getter.

caching=

Signature: void caching= (bool on)

Description: Method void QFileInfo::setCaching(bool on)

Python specific notes:
The object exposes a writable attribute 'caching'. This is the setter.

canonicalFilePath

Signature: [const] string canonicalFilePath

Description: Method QString QFileInfo::canonicalFilePath()

canonicalPath

Signature: [const] string canonicalPath

Description: Method QString QFileInfo::canonicalPath()

completeBaseName

Signature: [const] string completeBaseName

Description: Method QString QFileInfo::completeBaseName()

completeSuffix

Signature: [const] string completeSuffix

Description: Method QString QFileInfo::completeSuffix()

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

created

Signature: [const] QDateTime created

Description: Method QDateTime QFileInfo::created()

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

dir

Signature: [const] QDir dir

Description: Method QDir QFileInfo::dir()

dup

Signature: [const] new QFileInfo ptr dup

Description: Creates a copy of self

Python specific notes:
This method also implements '__copy__' and '__deepcopy__'.

exists

(1) Signature: [const] bool exists

Description: Method bool QFileInfo::exists()

Python specific notes:
This instance method is available as '_inst_exists' in Python.

(2) Signature: [static] bool exists (string file)

Description: Static method bool QFileInfo::exists(const QString &file)

This method is static and can be called without an instance.

Python specific notes:
This class method is available as '_class_exists' in Python.

fileName

Signature: [const] string fileName

Description: Method QString QFileInfo::fileName()

filePath

Signature: [const] string filePath

Description: Method QString QFileInfo::filePath()

fileTime

Signature: [const] QDateTime fileTime (const QFileDevice_FileTime time)

Description: Method QDateTime QFileInfo::fileTime(QFileDevice::FileTime time)

group

Signature: [const] string group

Description: Method QString QFileInfo::group()

groupId

Signature: [const] unsigned int groupId

Description: Method unsigned int QFileInfo::groupId()

isAbsolute?

Signature: [const] bool isAbsolute?

Description: Method bool QFileInfo::isAbsolute()

isBundle?

Signature: [const] bool isBundle?

Description: Method bool QFileInfo::isBundle()

isDir?

Signature: [const] bool isDir?

Description: Method bool QFileInfo::isDir()

isExecutable?

Signature: [const] bool isExecutable?

Description: Method bool QFileInfo::isExecutable()

isFile?

Signature: [const] bool isFile?

Description: Method bool QFileInfo::isFile()

isHidden?

Signature: [const] bool isHidden?

Description: Method bool QFileInfo::isHidden()

isNativePath?

Signature: [const] bool isNativePath?

Description: Method bool QFileInfo::isNativePath()

isReadable?

Signature: [const] bool isReadable?

Description: Method bool QFileInfo::isReadable()

isRelative?

Signature: [const] bool isRelative?

Description: Method bool QFileInfo::isRelative()

isRoot?

Signature: [const] bool isRoot?

Description: Method bool QFileInfo::isRoot()

isSymLink?

Signature: [const] bool isSymLink?

Description: Method bool QFileInfo::isSymLink()

isWritable?

Signature: [const] bool isWritable?

Description: Method bool QFileInfo::isWritable()

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

lastModified

Signature: [const] QDateTime lastModified

Description: Method QDateTime QFileInfo::lastModified()

lastRead

Signature: [const] QDateTime lastRead

Description: Method QDateTime QFileInfo::lastRead()

makeAbsolute

Signature: bool makeAbsolute

Description: Method bool QFileInfo::makeAbsolute()

metadataChangeTime

Signature: [const] QDateTime metadataChangeTime

Description: Method QDateTime QFileInfo::metadataChangeTime()

new

(1) Signature: [static] new QFileInfo new

Description: Constructor QFileInfo::QFileInfo()

This method creates an object of class QFileInfo.

Python specific notes:
This method is the default initializer of the object.

(2) Signature: [static] new QFileInfo new (string file)

Description: Constructor QFileInfo::QFileInfo(const QString &file)

This method creates an object of class QFileInfo.

Python specific notes:
This method is the default initializer of the object.

(3) Signature: [static] new QFileInfo new (const QFile file)

Description: Constructor QFileInfo::QFileInfo(const QFile &file)

This method creates an object of class QFileInfo.

Python specific notes:
This method is the default initializer of the object.

(4) Signature: [static] new QFileInfo new (const QDir dir, string file)

Description: Constructor QFileInfo::QFileInfo(const QDir &dir, const QString &file)

This method creates an object of class QFileInfo.

Python specific notes:
This method is the default initializer of the object.

(5) Signature: [static] new QFileInfo new (const QFileInfo fileinfo)

Description: Constructor QFileInfo::QFileInfo(const QFileInfo &fileinfo)

This method creates an object of class QFileInfo.

Python specific notes:
This method is the default initializer of the object.

owner

Signature: [const] string owner

Description: Method QString QFileInfo::owner()

ownerId

Signature: [const] unsigned int ownerId

Description: Method unsigned int QFileInfo::ownerId()

path

Signature: [const] string path

Description: Method QString QFileInfo::path()

permission

Signature: [const] bool permission (QFileDevice_QFlags_Permission permissions)

Description: Method bool QFileInfo::permission(QFlags<QFileDevice::Permission> permissions)

permissions

Signature: [const] QFileDevice_QFlags_Permission permissions

Description: Method QFlags<QFileDevice::Permission> QFileInfo::permissions()

readLink

Signature: [const] string readLink

Description: Method QString QFileInfo::readLink()

refresh

Signature: void refresh

Description: Method void QFileInfo::refresh()

setCaching

Signature: void setCaching (bool on)

Description: Method void QFileInfo::setCaching(bool on)

Python specific notes:
The object exposes a writable attribute 'caching'. This is the setter.

setFile

(1) Signature: void setFile (string file)

Description: Method void QFileInfo::setFile(const QString &file)

(2) Signature: void setFile (const QFile file)

Description: Method void QFileInfo::setFile(const QFile &file)

(3) Signature: void setFile (const QDir dir, string file)

Description: Method void QFileInfo::setFile(const QDir &dir, const QString &file)

size

Signature: [const] long long size

Description: Method qint64 QFileInfo::size()

Python specific notes:
This method is also available as 'len(object)'.

suffix

Signature: [const] string suffix

Description: Method QString QFileInfo::suffix()

swap

Signature: void swap (QFileInfo other)

Description: Method void QFileInfo::swap(QFileInfo &other)

symLinkTarget

Signature: [const] string symLinkTarget

Description: Method QString QFileInfo::symLinkTarget()