C# Class DSShared.PathInfo

Class to help pass around file paths
Mostrar archivo Open project: pmprog/OpenXCOM.Tools Class Usage Examples

Public Methods

Method Description
EnsureDirectoryExists ( ) : void

Calling this will create the directory if it does not exist

Exists ( ) : bool

First checks if the directory exists, than checks if file exists

PathInfo ( string fullPath ) : System

Initializes a new instance of the T:PathInfo class.

PathInfo ( string fullPath, bool parseFile ) : System

Initializes a new instance of the T:PathInfo class.

PathInfo ( string path, string file, string ext ) : System

Initializes a new instance of the T:PathInfo class.

ToString ( ) : string

Returns a that represents the current .

ToStringExt ( string newExt ) : string

String representation of this path, with the supplied extension added on instead of the one this object was constructed with

Method Details

EnsureDirectoryExists() public method

Calling this will create the directory if it does not exist
public EnsureDirectoryExists ( ) : void
return void

Exists() public method

First checks if the directory exists, than checks if file exists
public Exists ( ) : bool
return bool

PathInfo() public method

Initializes a new instance of the T:PathInfo class.
public PathInfo ( string fullPath ) : System
fullPath string The full path.
return System

PathInfo() public method

Initializes a new instance of the T:PathInfo class.
public PathInfo ( string fullPath, bool parseFile ) : System
fullPath string The full path.
parseFile bool if set to true the path will be broken down into filename and extension parts. You should pass false if the path string does not describe a file location
return System

PathInfo() public method

Initializes a new instance of the T:PathInfo class.
public PathInfo ( string path, string file, string ext ) : System
path string The path.
file string The file.
ext string The ext.
return System

ToString() public method

Returns a that represents the current .
public ToString ( ) : string
return string

ToStringExt() public method

String representation of this path, with the supplied extension added on instead of the one this object was constructed with
public ToStringExt ( string newExt ) : string
newExt string The extension that will replace the one in Ext
return string