TriLib  1.9.0
TriLib Unity Package
TriLib.FileUtils Class Reference

Contains file helper functions. More...

Static Public Member Functions

static string GetShortFilename (string filename)
 Gets the short filename from a full filename. More...
 
static string GetFileDirectory (string filename)
 Gets the file directory. More...
 
static string GetFilenameWithoutExtension (string filename)
 Gets the filename without extension. More...
 
static string GetFileExtension (string filename)
 Gets the filename extension. More...
 
static string GetFilename (string path)
 Gets the path filename. More...
 
static byte [] LoadFileData (string filename)
 Synchronously loads the file data. More...
 
static string SanitizePath (string path)
 Sanitizes a path. More...
 
static FileStream LoadFileStream (string filename)
 Creates a file stream for given filename. More...
 
static string GetRelativePath (string root, string path)
 Gets the path relative to given root. More...
 

Detailed Description

Contains file helper functions.

Member Function Documentation

◆ GetFileDirectory()

static string TriLib.FileUtils.GetFileDirectory ( string  filename)
static

Gets the file directory.

Returns
The file directory.
Parameters
filenameFull filename.

◆ GetFileExtension()

static string TriLib.FileUtils.GetFileExtension ( string  filename)
static

Gets the filename extension.

Returns
The filename extension.
Parameters
filenameFull filename.

◆ GetFilename()

static string TriLib.FileUtils.GetFilename ( string  path)
static

Gets the path filename.

Returns
The filename.
Parameters
pathPath.

◆ GetFilenameWithoutExtension()

static string TriLib.FileUtils.GetFilenameWithoutExtension ( string  filename)
static

Gets the filename without extension.

Returns
The filename without extension.
Parameters
filenameFull filename.

◆ GetRelativePath()

static string TriLib.FileUtils.GetRelativePath ( string  root,
string  path 
)
static

Gets the path relative to given root.

Parameters
rootRoot path.
pathAbsolute path.
Returns
The path relative to the root.

◆ GetShortFilename()

static string TriLib.FileUtils.GetShortFilename ( string  filename)
static

Gets the short filename from a full filename.

Returns
The short filename.
Parameters
filenameFull filename.

◆ LoadFileData()

static byte [] TriLib.FileUtils.LoadFileData ( string  filename)
static

Synchronously loads the file data.

Returns
The file data.
Parameters
filenameFilename.

◆ LoadFileStream()

static FileStream TriLib.FileUtils.LoadFileStream ( string  filename)
static

Creates a file stream for given filename.

Returns
The created FileStream.
Parameters
filenameFilename.

◆ SanitizePath()

static string TriLib.FileUtils.SanitizePath ( string  path)
static

Sanitizes a path.

Parameters
pathPath.
Returns
Sanizited path.

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