Qt Script for Applications · Home · Tutorial · Classes · Functions · Language · QSA Workbench · Qt Documentation · www.trolltech.com

# QSUtilFactory Class Reference

The QSUtilFactory class extends QSA with classes to allow file access, directory traversal and executing external processes. More...

    #include <QSUtilFactory>

Inherits QSObjectFactory.

- List of all members, including inherited members

### Public Types

- enum Utilities { None, File, Directory, Process, All }

### Public Functions

- QSUtilFactory ( uint enableFlags = All )
- QSInterpreter * interpreter () const

- 3 public functions inherited from QSObjectFactory

### Additional Inherited Members

- 1 protected function inherited from QSObjectFactory

## Detailed Description

The QSUtilFactory class extends QSA with classes to allow file access, directory traversal and executing external processes.

To extend the interpreter with the Utililty Framework you must create an instance of the QSUtilFactory class and add it to the interpreter using the function QSInterpreter::addObjectFactory(). For example:

        QSProject proj;
        QSInterpreter *ip = proj->interpreter();
        ip->addObjectFactory( new QSUtilFactory );

The script extensions provided by the QSUtilFactory are described in detail in QSA Utility Framework

## Member Type Documentation

### enum QSUtilFactory::Utilities

The Utilities enum can be used to enable and disable script access to the classes that the utility factory provides, thereby controlling the access that end users can have to the underlying system.

Constant | Value | Description
--- | --- | ---
`QSUtilFactory::None` | `0x0000` | No classes are available. If no access is required then there is no point in adding the QSUtilFactory to the interpreter at all.
`QSUtilFactory::File` | `0x0001` | Gives access to the File class.
`QSUtilFactory::Directory` | `0x0002` | Gives access to the Directory class.
`QSUtilFactory::Process` | `0x0004` | Gives access to Process class.
`QSUtilFactory::All` | `0xffff` | Gives access to all the classes in availble in the factory. This is the default.

## Member Function Documentation

### QSUtilFactory::QSUtilFactory ( uint enableFlags = All )

Instantiates the QSUtilFactory and enables the script classes specified in enableFlags. enableFlags is a bitmask of the Utilities enum.

The QSUtilityFactory must be added to an interpreter before its classes can be used

See also QSInterpreter::addObjectFactory() and Utilities.

### QSInterpreter * QSUtilFactory::interpreter () const