Changeset 17013 for branches/2924_DotNetCoreMigration/HeuristicLab.PluginInfrastructure/3.3/Utils/UniPath.cs
- Timestamp:
- 06/17/19 10:40:41 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2924_DotNetCoreMigration/HeuristicLab.PluginInfrastructure/3.3/Utils/UniPath.cs
r16984 r17013 1 using System; 2 using System.Collections.Generic; 3 using System.IO; 1 using System.IO; 4 2 using System.Runtime.InteropServices; 5 using System.Text;6 3 using System.Text.RegularExpressions; 4 using HEAL.Attic; 7 5 8 6 namespace HeuristicLab.PluginInfrastructure { 9 [S erializable]7 [StorableType("8911C8DC-FDA0-4CF6-A0CD-C67E72094D62")] 10 8 public class UniPath { 11 9 12 10 #region Vars 11 [Storable] 13 12 private string fullPath = ""; 14 13 #endregion 15 14 16 15 #region Constructors 16 [StorableConstructor] 17 private UniPath(StorableConstructorFlag _) { } 17 18 public UniPath(string path) { 18 19 fullPath = Path.GetFullPath(path); 19 20 } 20 21 #endregion 21 22 22 23 private bool IsWindowsAbsolutePath(string path) => Regex.IsMatch(path, @"^[A-Z]:"); 23 24 24 25 private string Rebuild(char split, string startStr, string seperator) { 25 26 string[] splits = fullPath.Split(split); 26 27 string tmp = startStr; 27 28 int i = 1; 28 while (i < splits.Length - 1) {29 while (i < (splits.Length - 1)) { 29 30 tmp += splits[i] + seperator; 30 31 ++i;
Note: See TracChangeset
for help on using the changeset viewer.