Drag[en]gine Script Module DragonScript Script API  1.0
File Class Reference

File path. More...

Inheritance diagram for File:

Public Member Functions

bool equals (Object object)
 Files are equal. More...
 
String getName ()
 Name of path which is the last path component or the prefix if empty. More...
 
File getParent ()
 Parent directory of path or null if not present. More...
 
String getPath ()
 String representation of path. More...
 
int hashCode ()
 Hash code of File. More...
 
bool isAbsolute ()
 Path is absolute. More...
 
bool isRelative ()
 Path is relative. More...
 
File new ()
 Create File with root path. More...
 
File new (String filename)
 Create File from filename. More...
 
File new (File parent, String filename)
 Create File from filename appended to parent File. More...
 
File new (String parent, String filename)
 Create File from filename appended to parent File. More...
 
File new (File parent, File filename)
 Create File from filename appended to parent File. More...
 
File prependIfRelative (String baseDirectory)
 Prepend base directory if path is relative. More...
 
String toString ()
 String representation of this filename. More...
 

Detailed Description

File path.

This is not an open file but only an object for working with filenames. This object though can then be used with appropriate other objects to load files.

Author
Roland Pl├╝ss
Version
1.0

Member Function Documentation

§ equals()

bool equals ( Object  object)

Files are equal.

Parameters
objectObject to check.
Returns
True if both objects describe the same filename.

§ getName()

String getName ( )

Name of path which is the last path component or the prefix if empty.

§ getParent()

File getParent ( )

Parent directory of path or null if not present.

§ getPath()

String getPath ( )

String representation of path.

§ hashCode()

int hashCode ( )

Hash code of File.

§ isAbsolute()

bool isAbsolute ( )

Path is absolute.

Path is absolute if prefix is '/'.

§ isRelative()

bool isRelative ( )

Path is relative.

Path is relative if prefix is empty.

§ new() [1/5]

File new ( )

Create File with root path.

§ new() [2/5]

File new ( String  filename)

Create File from filename.

Parameters
filenameFilename to parse.

§ new() [3/5]

File new ( File  parent,
String  filename 
)

Create File from filename appended to parent File.

Parameters
parentPath to parse filename relative to.
filenameFilename to parse.

§ new() [4/5]

File new ( String  parent,
String  filename 
)

Create File from filename appended to parent File.

Parameters
parentPath to parse filename relative to.
filenameFilename to parse.

§ new() [5/5]

File new ( File  parent,
File  filename 
)

Create File from filename appended to parent File.

Parameters
parentPath to parse filename relative to.
filenameFilename to parse.
Exceptions
EInvalidParamfilename is absolute.

§ prependIfRelative()

File prependIfRelative ( String  baseDirectory)

Prepend base directory if path is relative.

Used for loading files relative to a base path where the file path can be absolute or relative.

Returns
This path if absolute otherwise new instance with this path appended to baseDirectory.

§ toString()

String toString ( )

String representation of this filename.

Same as getPath().


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