wasSharp – Diff between revs 10 and 11
?pathlinks?
Rev 10 | Rev 11 | |||
---|---|---|---|---|
Line 2... | Line 2... | |||
2 | // Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3 // |
2 | // Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3 // |
|
3 | // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // |
3 | // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // |
|
4 | // rights of fair usage, the disclaimer and warranty conditions. // |
4 | // rights of fair usage, the disclaimer and warranty conditions. // |
|
5 | /////////////////////////////////////////////////////////////////////////// |
5 | /////////////////////////////////////////////////////////////////////////// |
|
Line -... | Line 6... | |||
- | 6 | |
||
6 | |
7 | using System; |
|
7 | using System.Collections.Generic; |
8 | using System.Collections.Generic; |
|
8 | using System.IO; |
9 | using System.IO; |
|
9 | using System.Linq; |
10 | using System.Linq; |
|
Line 19... | Line 20... | |||
19 | /// <summary> |
20 | /// <summary> |
|
20 | /// Combine multiple paths. |
21 | /// Combine multiple paths. |
|
21 | /// </summary> |
22 | /// </summary> |
|
22 | /// <param name="paths">an array of paths</param> |
23 | /// <param name="paths">an array of paths</param> |
|
23 | /// <returns>a combined path</returns> |
24 | /// <returns>a combined path</returns> |
|
24 | public static string PathCombine(params string[] paths) |
25 | public static string PathCombine(string separator = @"\", params string[] paths) |
|
25 | { |
26 | { |
|
26 | return paths.Aggregate((x, y) => Path.Combine(x, y)); |
27 | return string.Join(separator, paths); |
|
27 | } |
28 | } |
|
Line 28... | Line 29... | |||
28 | |
29 | |
|
29 | /// <summary> |
30 | /// <summary> |
|
30 | /// Strip characters that are incompatible with file names. |
31 | /// Strip characters that are incompatible with file names. |