Script
Public Slots | Public Member Functions | Properties | Private Attributes | List of all members
Dir Class Reference

Interface to operating system Dir operations, ie, mkdir, rmdir, rename, etc. More...

#include <qsUtil.h>

Inheritance diagram for Dir:
Inheritance graph
[legend]
Collaboration diagram for Dir:
Collaboration graph
[legend]

Public Slots

String filePath (String &file=String::null)
 Get file path form current directory from filename give in parameter.
 
String absFilePath (String &file=String::null)
 Get absolute file path form filename give in parameter.
 
void cd (String &dirName)
 change directory to the given direcotry name
 
void cdUp ()
 Go up in directory hierarchy.
 
StringList entryList (String &filter, int filterSpec=-1, int sortSpec=-1)
 Returns a list of the names of all the files and directories in the directory, ordered according to the name and attribute filters.
 
void mkdir (String &dirName=String::null)
 Create a directory with given name.
 
void rmdir (String &dirName=String::null)
 Remove a directory with given name.
 
void mkdirs (String &dirName=String::null)
 Create directory recursively if a path of directory not created is given.
 
void rmdirs (String &dirName=String::null)
 Remove directory recursively if a path of directory is given.
 
void remove (String &fileName)
 Remove a file with the given name.
 
void rename (String &oldName, String &newName)
 Rename a file/folder with the name given to the new name.
 
bool fileExists (String &fileName)
 Check if the file/folder exist.
 
void setCurrent ()
 Sets the application's current working directory to path.
 

Public Member Functions

 Dir (String &path, QScriptContext *ct)
 
String name ()
 
String path ()
 
void setPath (String &newPath)
 
String absPath ()
 
String canonicalPath ()
 
bool isReadable ()
 
bool exists ()
 

Properties

String name
 Name of the directory.
 
String path
 Path of the directory.
 
String absPath
 Absolute path of the directory.
 
String canonicalPath
 Canonical path of the directory.
 
bool readable
 Say if the directory is readable.
 
bool exists
 Say if the directory exist.
 

Private Attributes

QDir * dir
 
QScriptContext * context
 

Detailed Description

Interface to operating system Dir operations, ie, mkdir, rmdir, rename, etc.

You can use it in Script Editor only.

var dir = new Dir;
dir.path = this._exportDir;
dir.mkdirs();

Constructor & Destructor Documentation

Dir::Dir ( String &  path,
QScriptContext *  ct 
)
inline

Member Function Documentation

String Dir::absFilePath ( String &  file = String::null)
slot

Get absolute file path form filename give in parameter.

String Dir::absPath ( )
inline
String Dir::canonicalPath ( )
inline
void Dir::cd ( String &  dirName)
slot

change directory to the given direcotry name

void Dir::cdUp ( )
slot

Go up in directory hierarchy.

StringList Dir::entryList ( String &  filter,
int  filterSpec = -1,
int  sortSpec = -1 
)
slot

Returns a list of the names of all the files and directories in the directory, ordered according to the name and attribute filters.

bool Dir::exists ( )
inline
bool Dir::fileExists ( String &  fileName)
inlineslot

Check if the file/folder exist.

String Dir::filePath ( String &  file = String::null)
slot

Get file path form current directory from filename give in parameter.

bool Dir::isReadable ( )
inline
void Dir::mkdir ( String &  dirName = String::null)
slot

Create a directory with given name.

void Dir::mkdirs ( String &  dirName = String::null)
slot

Create directory recursively if a path of directory not created is given.

String Dir::name ( )
inline
String Dir::path ( )
inline
void Dir::remove ( String &  fileName)
slot

Remove a file with the given name.

void Dir::rename ( String &  oldName,
String &  newName 
)
slot

Rename a file/folder with the name given to the new name.

void Dir::rmdir ( String &  dirName = String::null)
slot

Remove a directory with given name.

void Dir::rmdirs ( String &  dirName = String::null)
slot

Remove directory recursively if a path of directory is given.

void Dir::setCurrent ( )
slot

Sets the application's current working directory to path.

void Dir::setPath ( String &  newPath)
inline

Member Data Documentation

QScriptContext* Dir::context
private
QDir* Dir::dir
private

Property Documentation

String Dir::absPath
read

Absolute path of the directory.

String Dir::canonicalPath
read

Canonical path of the directory.

bool Dir::exists
read

Say if the directory exist.

String Dir::name
read

Name of the directory.

String Dir::path
readwrite

Path of the directory.

bool Dir::readable
read

Say if the directory is readable.


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