Harmony
Scripting Interface Documentation
Dir Class Reference

The Dir JavaScript class. Interface to operating system Dir operations, e.g. mkdir, rmdir, rename, etc. More...

Public Slots

String filePath (String &file=String::null)
 Get file path form current directory from filename give in parameter. More...
 
String absFilePath (String &file=String::null)
 Get absolute file path form filename give in parameter. More...
 
void cd (String &dirName)
 change directory to the given directory name More...
 
void cdUp ()
 Go up in directory hierarchy. More...
 
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. More...
 
void mkdir (String &dirName=String::null)
 Create a directory with given name. More...
 
void rmdir (String &dirName=String::null)
 Remove a directory with given name. More...
 
void mkdirs (String &dirName=String::null)
 Create directory recursively if a path of directory not created is given. More...
 
void rmdirs (String &dirName=String::null)
 Remove directory recursively if a path of directory is given. More...
 
void remove (String &fileName)
 Remove a file with the given name. More...
 
void rename (String &oldName, String &newName)
 Rename a file/folder with the name given to the new name. More...
 
bool fileExists (String &fileName)
 Check if the file/folder exist. More...
 
void setCurrent ()
 Sets the application's current working directory to path. More...
 

Public Member Functions

 Dir (String &path)
 Construct a Dir from a directory path. More...
 

Properties

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

Detailed Description

The Dir JavaScript class. Interface to operating system Dir operations, e.g. mkdir, rmdir, rename, etc.

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

Constructor & Destructor Documentation

◆ Dir()

Dir::Dir ( String &  path)
inline

Construct a Dir from a directory path.

Parameters
pathThe path of a directory.

Member Function Documentation

◆ absFilePath

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

Get absolute file path form filename give in parameter.

◆ cd

void Dir::cd ( String &  dirName)
slot

change directory to the given directory name

◆ cdUp

void Dir::cdUp ( )
slot

Go up in directory hierarchy.

◆ entryList

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.

◆ fileExists

bool Dir::fileExists ( String &  fileName)
inlineslot

Check if the file/folder exist.

◆ filePath

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

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

◆ mkdir

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

Create a directory with given name.

◆ mkdirs

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

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

◆ remove

void Dir::remove ( String &  fileName)
slot

Remove a file with the given name.

◆ rename

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

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

◆ rmdir

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

Remove a directory with given name.

◆ rmdirs

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

Remove directory recursively if a path of directory is given.

◆ setCurrent

void Dir::setCurrent ( )
slot

Sets the application's current working directory to path.

Property Documentation

◆ absPath

String Dir::absPath
read

Absolute path of the directory.

◆ canonicalPath

String Dir::canonicalPath
read

Canonical path of the directory.

◆ exists

bool Dir::exists
read

Say if the directory exist.

◆ name

String Dir::name
read

Name of the directory.

◆ path

String Dir::path
readwrite

Path of the directory.

◆ readable

bool Dir::readable
read

Say if the directory is readable.