PLCnext API Documentation 25.0.2.69
Static Public Member Functions | List of all members
Arp::System::Commons::Io::Path Class Reference

Static Public Member Functions

static String GetDirectoryName (const String &path)
 Get the directory name of a path. More...
 
static String GetFileTitle (const String &path)
 Get title of a file. More...
 
static String GetFileName (const String &path)
 Get name of a file. More...
 
static String GetExtension (const String &path)
 Get extension of a file. More...
 
static String ChangeExtension (const String &path, const String &newExtension)
 Change extension of a file. More...
 
static String GetFullPath (const String &path)
 Get name of a path. More...
 
static String GetPathRoot (const String &path)
 Get root of a file path. More...
 
static String Combine (const String &path1, const String &path2)
 Combines two paths. More...
 
static String GetCanonicalPath (const String &path)
 Get the canonical path. More...
 
static bool AreEqual (const String &path1, const String &path2)
 Checks whether two paths are equal. More...
 
static bool IsRelative (const String &path)
 Checks whether a path is relative. More...
 
static bool IsAbsolute (const String &path)
 Checks whether a path is absolute. More...
 

Member Function Documentation

◆ AreEqual()

bool Arp::System::Commons::Io::Path::AreEqual ( const String path1,
const String path2 
)
static

Checks whether two paths are equal.

Parameters
path1First path to compare.
path2Second path to compare.
Returns
True, if both paths are equal. Otherwise false.

◆ ChangeExtension()

String Arp::System::Commons::Io::Path::ChangeExtension ( const String path,
const String newExtension 
)
static

Change extension of a file.

Parameters
pathFully qualified path of the file.
newExtensionNew extension of the file including the dot.
Returns
The name of the file including the new extension.

Examples: ChangeExtension("/opt/plcnext/my.dir/file.a.txt", ".b") returns "/opt/plcnext/my.dir/file.a.b". ChangeExtension("/opt/plcnext/my.dir/file", ".b") returns "/opt/plcnext/my.dir/file.b".

◆ Combine()

String Arp::System::Commons::Io::Path::Combine ( const String path1,
const String path2 
)
static

Combines two paths.

Parameters
path1First path.
path2Second path.
Returns
Combination of path1 and path2.

Example: Combine("/opt/plcnext/my.dir", "file.a.txt") returns "/opt/plcnext/my.dir/file.a.txt".

◆ GetCanonicalPath()

String Arp::System::Commons::Io::Path::GetCanonicalPath ( const String path)
static

Get the canonical path.

Parameters
pathFully qualified path.
Returns
Canonical path without symbolic links or dots.

Example: GetCanonicalPath("/etc/../opt/plcnext/./my.dir/file.a.txt") returns "/opt/plcnext/my.dir/file.a.txt".

◆ GetDirectoryName()

String Arp::System::Commons::Io::Path::GetDirectoryName ( const String path)
static

Get the directory name of a path.

Parameters
pathFully qualified path.
Returns
Name of the directory.

Example: GetDirectoryName("/opt/plcnext/my.dir/file.a.txt") returns "/opt/plcnext/my.dir".

◆ GetExtension()

String Arp::System::Commons::Io::Path::GetExtension ( const String path)
static

Get extension of a file.

Parameters
pathFully qualified path of the file.
Returns
Extension of the file incldung the dot.

Examples: GetExtension("/opt/plcnext/my.dir/file.a.txt") returns ".txt". GetExtension("/opt/plcnext/my.dir/file") returns an empty String.

◆ GetFileName()

String Arp::System::Commons::Io::Path::GetFileName ( const String path)
static

Get name of a file.

Parameters
pathFully qualified path of the file.
Returns
Name of the file including the extension.

Examples: GetFileName("/opt/plcnext/my.dir/file.a.txt") returns "file.a.txt". GetFileName("/opt/plcnext/my.dir/file") returns "file".

◆ GetFileTitle()

String Arp::System::Commons::Io::Path::GetFileTitle ( const String path)
static

Get title of a file.

Parameters
pathFully qualified path of the file.
Returns
Name of the file without extension.

Examples: GetFileTitle("/opt/plcnext/my.dir/file.a.txt") returns "file.a". GetFileTitle("/opt/plcnext/my.dir/file") returns "file".

◆ GetFullPath()

String Arp::System::Commons::Io::Path::GetFullPath ( const String path)
static

Get name of a path.

Parameters
pathFully qualified path.
Returns
The name of the path.

Example: GetFullPath("/opt/plcnext/my.dir/file.a.txt") returns "/opt/plcnext/my.dir/file.a.txt".

◆ GetPathRoot()

String Arp::System::Commons::Io::Path::GetPathRoot ( const String path)
static

Get root of a file path.

Parameters
pathFully qualified path.
Returns
Root of the path.

Example: GetFullPath("/opt/plcnext/my.dir/file.a.txt") returns "/".

◆ IsAbsolute()

bool Arp::System::Commons::Io::Path::IsAbsolute ( const String path)
static

Checks whether a path is absolute.

Parameters
pathFully qualified path.
Returns
True, if the path is absolute, otherwise false.

◆ IsRelative()

bool Arp::System::Commons::Io::Path::IsRelative ( const String path)
static

Checks whether a path is relative.

Parameters
pathFully qualified path.
Returns
True, if the path is relative, otherwise false.

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