wasSharp
/IO.cs |
@@ -15,20 +15,7 @@ |
{ |
public static class IO |
{ |
/////////////////////////////////////////////////////////////////////////// |
// Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
/////////////////////////////////////////////////////////////////////////// |
/// <summary> |
/// Combine multiple paths. |
/// </summary> |
/// <param name="paths">an array of paths</param> |
/// <returns>a combined path</returns> |
public static string PathCombine(string separator = @"\", params string[] paths) |
{ |
return string.Join(separator, paths); |
} |
|
/// <summary> |
/// Strip characters that are incompatible with file names. |
/// </summary> |
/// <param name="fileName">the name of the file</param> |
@@ -132,7 +119,7 @@ |
/// <param name="separator">the separator character</param> |
/// <param name="escape">the escape character</param> |
/// <returns>path parts</returns> |
public static IEnumerable<string> PathSplit(this string path, char separator, char? escape) |
public static IEnumerable<string> PathSplit(this string path, char separator, char? escape = null) |
{ |
var s = new Stack<char>(); |
var p = new StringBuilder(); |
@@ -147,6 +134,11 @@ |
{ |
if (s.Count.Equals(0) || !s.Peek().Equals(escape)) |
{ |
if (p.Length.Equals(0)) |
{ |
p.Append(c); |
continue; |
} |
yield return p.ToString(); |
p = new StringBuilder(); |
continue; |
/Properties/AssemblyInfo.cs |
@@ -26,4 +26,4 @@ |
// by using the '*' as shown below: |
// [assembly: AssemblyVersion("1.0.*")] |
|
[assembly: AssemblyVersion("1.42.*")] |
[assembly: AssemblyVersion("1.43.*")] |