- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions

# QFile Class Reference

Search for all occurrences

## Detailed Description

Examples:

  ImageIOHandlerRAW/ImageIOHandlerRAW.cpp, PLYImport/Importer.cpp, and STLExport/STLExporter.cpp.

Definition at line 62 of file qfile.h.

`#include <qfile.h>`

Inheritance diagram for QFile:
[legend]

List of all members.

## Public Types
enum | FileError { NoError = 0, ReadError = 1, WriteError = 2, FatalError = 3, ResourceError = 4, OpenError = 5, AbortError = 6, TimeOutError = 7, UnspecifiedError = 8, RemoveError = 9, RenameError = 10, PositionError = 11, ResizeError = 12, PermissionsError = 13, CopyError = 14 }
enum | Permission { ReadOwner = 0x4000, WriteOwner = 0x2000, ExeOwner = 0x1000, ReadUser = 0x0400, WriteUser = 0x0200, ExeUser = 0x0100, ReadGroup = 0x0040, WriteGroup = 0x0020, ExeGroup = 0x0010, ReadOther = 0x0004, WriteOther = 0x0002, ExeOther = 0x0001 }
enum | MemoryMapFlags { NoOptions = 0 }
typedef QByteArray(* | EncoderFn )(const QString &fileName)
typedef QString(* | DecoderFn )(const QByteArray &localfileName)
## Public Member Functions
| QFile ()
| QFile (const QString &name)
| QFile (QObject *parent)
| QFile (const QString &name, QObject *parent)
| ~QFile ()
FileError | error () const
void | unsetError ()
QString | fileName () const
void | setFileName (const QString &name)
bool | exists () const
QString | readLink () const
QString | symLinkTarget () const
bool | remove ()
bool | rename (const QString &newName)
bool | link (const QString &newName)
bool | copy (const QString &newName)
bool | isSequential () const
bool | open (OpenMode flags)
bool | open (FILE *f, OpenMode flags)
bool | open (int fd, OpenMode flags)
virtual void | close ()
qint64 | size () const
qint64 | pos () const
bool | seek (qint64 offset)
bool | atEnd () const
bool | flush ()
bool | resize (qint64 sz)
Permissions | permissions () const
bool | setPermissions (Permissions permissionSpec)
int | handle () const
uchar * | map (qint64 offset, qint64 size, MemoryMapFlags flags=NoOptions)
bool | unmap (uchar *address)
virtual QAbstractFileEngine * | fileEngine () const
## Static Public Member Functions
static QByteArray | encodeName (const QString &fileName)
static QString | decodeName (const QByteArray &localFileName)
static QString | decodeName (const char *localFileName)
static void | setEncodingFunction (EncoderFn)
static void | setDecodingFunction (DecoderFn)
static bool | exists (const QString &fileName)
static QString | readLink (const QString &fileName)
static QString | symLinkTarget (const QString &fileName)
static bool | remove (const QString &fileName)
static bool | rename (const QString &oldName, const QString &newName)
static bool | link (const QString &oldname, const QString &newName)
static bool | copy (const QString &fileName, const QString &newName)
static bool | resize (const QString &filename, qint64 sz)
static Permissions | permissions (const QString &filename)
static bool | setPermissions (const QString &filename, Permissions permissionSpec)
## Protected Member Functions
| QFile (QFilePrivate &dd, QObject *parent=0)
qint64 | readData (char *data, qint64 maxlen)
qint64 | writeData (const char *data, qint64 len)
qint64 | readLineData (char *data, qint64 maxlen)

## Member Typedef Documentation

typedef QByteArray(* EncoderFn)(const QString &fileName)

Search for all occurrences

Definition at line 114 of file qfile.h.

typedef QString(* DecoderFn)(const QByteArray &localfileName)

Search for all occurrences

Definition at line 115 of file qfile.h.

## Member Enumeration Documentation

enum FileError

Search for all occurrences

Enumerator:

  NoError | Search for all occurrences
  ReadError | Search for all occurrences
  WriteError | Search for all occurrences
  FatalError | Search for all occurrences
  ResourceError | Search for all occurrences
  OpenError | Search for all occurrences
  AbortError | Search for all occurrences
  TimeOutError | Search for all occurrences
  UnspecifiedError | Search for all occurrences
  RemoveError | Search for all occurrences
  RenameError | Search for all occurrences
  PositionError | Search for all occurrences
  ResizeError | Search for all occurrences
  PermissionsError | Search for all occurrences
  CopyError | Search for all occurrences

Definition at line 71 of file qfile.h.

                       {
            NoError = 0,
            ReadError = 1,
            WriteError = 2,
            FatalError = 3,
            ResourceError = 4,
            OpenError = 5,
            AbortError = 6,
            TimeOutError = 7,
            UnspecifiedError = 8,
            RemoveError = 9,
            RenameError = 10,
            PositionError = 11,
            ResizeError = 12,
            PermissionsError = 13,
            CopyError = 14
    #ifdef QT3_SUPPORT
            , ConnectError = 30
    #endif
        };

enum Permission

Search for all occurrences

Enumerator:

  ReadOwner | Search for all occurrences
  WriteOwner | Search for all occurrences
  ExeOwner | Search for all occurrences
  ReadUser | Search for all occurrences
  WriteUser | Search for all occurrences
  ExeUser | Search for all occurrences
  ReadGroup | Search for all occurrences
  WriteGroup | Search for all occurrences
  ExeGroup | Search for all occurrences
  ReadOther | Search for all occurrences
  WriteOther | Search for all occurrences
  ExeOther | Search for all occurrences

Definition at line 92 of file qfile.h.

                        {
            ReadOwner = 0x4000, WriteOwner = 0x2000, ExeOwner = 0x1000,
            ReadUser  = 0x0400, WriteUser  = 0x0200, ExeUser  = 0x0100,
            ReadGroup = 0x0040, WriteGroup = 0x0020, ExeGroup = 0x0010,
            ReadOther = 0x0004, WriteOther = 0x0002, ExeOther = 0x0001
        };

enum MemoryMapFlags

Search for all occurrences

Enumerator:

  NoOptions | Search for all occurrences

Definition at line 166 of file qfile.h.

                            {
            NoOptions = 0
        };

## Constructor & Destructor Documentation

QFile | ( |  | ) |

QFile | ( | const QString & | name | ) |

QFile | ( | QObject * | parent | ) | `[explicit]`

QFile | ( | const QString & | name,
|  | QObject * | parent
| ) |  |

~QFile | ( |  | ) |

QFile | ( | QFilePrivate & | dd,
|  | QObject * | parent = `0`
| ) |  | `[protected]`

## Member Function Documentation

FileError error | ( |  | ) | const

Search for all occurrences

void unsetError | ( |  | ) |

Search for all occurrences

QString fileName | ( |  | ) | const

Search for all occurrences

Reimplemented in QTemporaryFile.

void setFileName | ( | const QString & | name | ) |

Search for all occurrences

static QByteArray encodeName | ( | const QString & | fileName | ) | `[static]`

Search for all occurrences

Examples:
  PLYImport/Importer.cpp, PtexExtractor/PtexPaintExporter.cpp, PtexExtractor/PtexUtilizer.cpp, PtexImporter/PtexImporter.cpp, SampleViewportFilter/SampleViewportFilter.cpp, and ToonMaterial/ToonMaterial.cpp.

static QString decodeName | ( | const QByteArray & | localFileName | ) | `[static]`

Search for all occurrences

static QString decodeName | ( | const char * | localFileName | ) | `[inline, static]`

Search for all occurrences

Definition at line 118 of file qfile.h.

            { return decodeName(QByteArray(localFileName)); }

static void setEncodingFunction | ( | EncoderFn |  | ) | `[static]`

Search for all occurrences

static void setDecodingFunction | ( | DecoderFn |  | ) | `[static]`

Search for all occurrences

bool exists | ( |  | ) | const

Search for all occurrences

static bool exists | ( | const QString & | fileName | ) | `[static]`

Search for all occurrences

QString readLink | ( |  | ) | const

Search for all occurrences

static QString readLink | ( | const QString & | fileName | ) | `[static]`

Search for all occurrences

QString symLinkTarget | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 128 of file qfile.h.

    { return readLink(); }

static QString symLinkTarget | ( | const QString & | fileName | ) | `[inline, static]`

Search for all occurrences

Definition at line 129 of file qfile.h.

    { return readLink(fileName); }

bool remove | ( |  | ) |

Search for all occurrences

static bool remove | ( | const QString & | fileName | ) | `[static]`

Search for all occurrences

bool rename | ( | const QString & | newName | ) |

Search for all occurrences

static bool rename | ( | const QString & | oldName,
|  | const QString & | newName
| ) |  | `[static]`

Search for all occurrences

bool link | ( | const QString & | newName | ) |

Search for all occurrences

static bool link | ( | const QString & | oldname,
|  | const QString & | newName
| ) |  | `[static]`

Search for all occurrences

bool copy | ( | const QString & | newName | ) |

Search for all occurrences

static bool copy | ( | const QString & | fileName,
|  | const QString & | newName
| ) |  | `[static]`

Search for all occurrences

bool isSequential | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

bool open | ( | OpenMode | flags | ) | `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

Reimplemented in QTemporaryFile.

Examples:
  STLExport/STLExporter.cpp.

bool open | ( | FILE * | f,
|  | OpenMode | flags
| ) |  |

Search for all occurrences

bool open | ( | int | fd,
|  | OpenMode | flags
| ) |  |

Search for all occurrences

virtual void close | ( |  | ) | `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

Examples:
  STLExport/STLExporter.cpp.

qint64 size | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

qint64 pos | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

bool seek | ( | qint64 | offset | ) | `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

bool atEnd | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

bool flush | ( |  | ) |

Search for all occurrences

bool resize | ( | qint64 | sz | ) |

Search for all occurrences

static bool resize | ( | const QString & | filename,
|  | qint64 | sz
| ) |  | `[static]`

Search for all occurrences

Permissions permissions | ( |  | ) | const

Search for all occurrences

static Permissions permissions | ( | const QString & | filename | ) | `[static]`

Search for all occurrences

bool setPermissions | ( | Permissions | permissionSpec | ) |

Search for all occurrences

static bool setPermissions | ( | const QString & | filename,
|  | Permissions | permissionSpec
| ) |  | `[static]`

Search for all occurrences

int handle | ( |  | ) | const

Search for all occurrences

uchar* map | ( | qint64 | offset,
|  | qint64 | size,
|  | MemoryMapFlags | flags = `NoOptions`
| ) |  |

Search for all occurrences

bool unmap | ( | uchar * | address | ) |

Search for all occurrences

virtual QAbstractFileEngine* fileEngine | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented in QTemporaryFile.

qint64 readData | ( | char * | data,
|  | qint64 | maxlen
| ) |  | `[protected, virtual]`

Search for all occurrences

Implements QIODevice.

qint64 writeData | ( | const char * | data,
|  | qint64 | len
| ) |  | `[protected, virtual]`

Search for all occurrences

Implements QIODevice.

qint64 readLineData | ( | char * | data,
|  | qint64 | maxlen
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QIODevice.

The documentation for this class was generated from the following file:

- QtCore/qfile.h

QFile QFile QFile QFile QFile QFile QFile QFile QFile QFile
QFile QFile QFile QFile QFile QFile QFile QFile QFile QFile