mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 05:05:05 +00:00
Created S# .sln and moved project to src folder
This commit is contained in:
58
ICD.Common/Utils/IO/IcdPath.cs
Normal file
58
ICD.Common/Utils/IO/IcdPath.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user