mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
59 lines
1.1 KiB
C#
59 lines
1.1 KiB
C#
using System;
|
|
#if SIMPLSHARP
|
|
using Crestron.SimplSharp.CrestronIO;
|
|
#else
|
|
using System.IO;
|
|
#endif
|
|
|
|
namespace ICD.Common.Utils.IO
|
|
{
|
|
public static class IcdPath
|
|
{
|
|
public static string GetFileNameWithoutExtension(string path)
|
|
{
|
|
if (path == null)
|
|
throw new ArgumentNullException("path");
|
|
|
|
return Path.GetFileNameWithoutExtension(path);
|
|
}
|
|
|
|
public static string GetDirectoryName(string path)
|
|
{
|
|
if (path == null)
|
|
throw new ArgumentNullException("path");
|
|
|
|
return Path.GetDirectoryName(path);
|
|
}
|
|
|
|
public static string GetExtension(string path)
|
|
{
|
|
if (path == null)
|
|
throw new ArgumentNullException("path");
|
|
|
|
return Path.GetExtension(path);
|
|
}
|
|
|
|
public static string Combine(string a, string b)
|
|
{
|
|
if (a == null)
|
|
throw new ArgumentNullException("a");
|
|
|
|
if (b == null)
|
|
throw new ArgumentNullException("b");
|
|
|
|
return Path.Combine(a, b);
|
|
}
|
|
|
|
public static string ChangeExtension(string path, string ext)
|
|
{
|
|
if (path == null)
|
|
throw new ArgumentNullException("path");
|
|
|
|
if (ext == null)
|
|
throw new ArgumentNullException("ext");
|
|
|
|
return Path.ChangeExtension(path, ext);
|
|
}
|
|
}
|
|
}
|