DzDir Class Reference
[File Input and Output Objects]

DAZ Script directory access class. More...

List of all members.

Enumerations

enum  FilterSpec {
  Dirs = 0x001, Files = 0x002, Drives = 0x004, NoSymLinks = 0x008,
  All = 0x007, TypeMask = 0x00F, Readable = 0x010, Writable = 0x020,
  Executable = 0x040, RWEMask = 0x070, Modified = 0x080, Hidden = 0x100,
  System = 0x200, AccessMask = 0x3F0
}
enum  SortSpec {
  Name = 0x00, Time = 0x01, Size = 0x02, Unsorted = 0x03,
  SortByMask = 0x03, DirsFirst = 0x04, Reversed = 0x08, IgnoreCase = 0x10
}

Methods

String absFilePath (String file) const
String absPath () const
String canonicalPath () const
Boolean cd (String dirName)
Boolean cdUp ()
Boolean copy (String srcFile, String destFile) const
String dirName () const
Array entryList (Array filters, Number filterSpec=-1, Number sortSpec=-1) const
Array entryList (String filter, Number filterSpec=-1, Number sortSpec=-1) const
Boolean exists () const
Boolean fileExists (String fileName) const
String filePath (String file) const
Boolean isAbsolute () const
Boolean isReadable () const
Boolean isRelative () const
Boolean isRoot () const
Boolean mkdir (String dirName="") const
Boolean mkdirs (String dirName="") const
Boolean mkpath (String dirName="") const
Boolean move (String srcFile, String destFile) const
String path () const
void refresh () const
String relativeFilePath (String file) const
Boolean remove (String fileName) const
Boolean rename (String oldName, String newName)
Boolean rmdir (String dirName="") const
Boolean rmdirs (String dirName="") const
Boolean rmpath (String dirName="") const
Boolean setCurrent () const
void setPath (String newPath)

Constructors

 DzDir (String path)


Detailed Description

DAZ Script directory access class.

This class provides access to the file system directory structure. It provides functions for creating, removing, traversing, and searching directories.


Member Enumeration Documentation

enum DzDir::FilterSpec

Filtering flags

Enumerator:
Dirs  Include Directories
Files  Include Files
Drives  Include Drives
NoSymLinks  Exclude Symbolic links
All  Include Directories, Files, and Drives
TypeMask  Type Mask
Readable  Include Readable items
Writable  Include Writable items
Executable  Include Executable items
RWEMask  Include Readable, Writable, and Executable items
Modified  Include Modified items
Hidden  Include Hidden items
System  Include System items
AccessMask  Access mask

enum DzDir::SortSpec

Filtering flags

Enumerator:
Name  Sort by name
Time  Sort by time
Size  Sort by size
Unsorted  Unsorted
SortByMask  Mask for Sort by
DirsFirst  Sort directories first
Reversed  Reverse the Sort
IgnoreCase  Ignore case


Constructor & Destructor Documentation

DzDir::DzDir ( String  path  ) 

Create a dir with the given path name


Member Function Documentation

String DzDir::absFilePath ( String  file  )  const

Returns:
The absolute path of a file in the directory with the given file name - does not check if the file actually exists.

QString DzDir::absPath (  )  const

Returns:
The absolute path of this directory

QString DzDir::canonicalPath (  )  const

Returns:
The canonical path of this directory

Boolean DzDir::cd ( String  dirName  ) 

Changes directory to the given relative path

bool DzDir::cdUp (  ) 

Changes directory to the parent directory. Equivalent to calling cd( ".." );

Boolean DzDir::copy ( String  srcFile,
String  destFile 
) const

Makes a copy of a file.

Parameters:
srcFile The path of the source file to copy.
destFile The path of the file that source will be copied to.

QString DzDir::dirName (  )  const

Returns:
The name of this directory (not the whole path, just the folder name)

Array DzDir::entryList ( Array  filters,
Number  filterSpec = -1,
Number  sortSpec = -1 
) const

Returns:
An Array of strings, of all files and folders in the directory that match filterSpec and sorted in the order specified by sortSpec.

Array DzDir::entryList ( String  filter,
Number  filterSpec = -1,
Number  sortSpec = -1 
) const

Returns:
An Array of strings, of all files and folders in the directory that match filterSpec and sorted in the order specified by sortSpec.

bool DzDir::exists (  )  const

Returns:
true if the directory exists

Boolean DzDir::fileExists ( String  fileName  )  const

Parameters:
fileName The relative name of the file to check for.
Returns:
true if the file exists

String DzDir::filePath ( String  file  )  const

Returns:
The path of a file in the directory with the given file name - does not check if the file actually exists.

bool DzDir::isAbsolute (  )  const

Returns:
true if the directory's path is absolute

bool DzDir::isReadable (  )  const

Returns:
true if the directory is readable

bool DzDir::isRelative (  )  const

Returns:
true if the directory's path is relative

bool DzDir::isRoot (  )  const

Returns:
true if the directory's path is the root directory

Boolean DzDir::mkdir ( String  dirName = ""  )  const

Creates a new directory.

Parameters:
dirName The relative name of the directory to create. If empty, this directory's path will be used.

Boolean DzDir::mkdirs ( String  dirName = ""  )  const

Deprecated:
Use mkpath() instead.

Boolean DzDir::mkpath ( String  dirName = ""  )  const

Creates all directories that do not already exist in the given path.

Parameters:
dirName The relative name of the directory to create. If empty, this directory's path will be used.

Boolean DzDir::move ( String  srcFile,
String  destFile 
) const

Moves a file to a new location.

Parameters:
srcFile The path of the source file to move.
destFile The new path of the file.

QString DzDir::path (  )  const

Returns:
The path of this directory

void DzDir::refresh (  )  const

Refresh the directory information

String DzDir::relativeFilePath ( String  file  )  const

Returns:
The path to file relative to the directory - does not check if the file actually exists.

Boolean DzDir::remove ( String  fileName  )  const

Removes a file from this directory.

Parameters:
fileName The relative name of the file to remove.

Boolean DzDir::rename ( String  oldName,
String  newName 
)

Renames a file or directory.

Parameters:
oldName The old relative name of the file/folder to rename.
newName The new relative name of the file/folder to rename.

Boolean DzDir::rmdir ( String  dirName = ""  )  const

Removes a directory.

Parameters:
dirName The relative name of the directory to remove. If empty, this directory's path will be used.

Boolean DzDir::rmdirs ( String  dirName = ""  )  const

Deprecated:
Use rmpath() instead.

Boolean DzDir::rmpath ( String  dirName = ""  )  const

Removes all directories that exist in the given path.

Parameters:
dirName The relative name of the directory to remove. If empty, this directory's path will be used.

bool DzDir::setCurrent (  )  const

Sets the current working directory of the application to be this directory.

Returns:
true if the current working directory was changed.

void DzDir::setPath ( String  newPath  ) 

Sets the path of this directory


Generated on Thu Sep 24 12:21:11 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.