예제 #1
0
 internal IPath Create(string path, PlatformPathTypes platformPathType, PathTypes pathType, string[] components)
 {
     switch (platformPathType)
     {
         case PlatformPathTypes.Infer:
             return Create(path, InferPlatformPathType(path), pathType, components);
         case PlatformPathTypes.Windows:
             switch (pathType)
             {
                 case PathTypes.Root:
                     return new WinRootPath(this, platformPathType, pathType, path, components);
                 case PathTypes.Directory:
                     return new WinDirectoryPath(this, platformPathType, pathType, path, components);
                 case PathTypes.File:
                     return new WinFilePath(this, platformPathType, pathType, path, components);
                 default:
                     throw new ArgumentOutOfRangeException("pathType", pathType, null);
             }
         case PlatformPathTypes.Unix:
             switch (pathType)
             {
                 case PathTypes.Root:
                     return new UnixRootPath(this, platformPathType, pathType, path, components);
                 case PathTypes.Directory:
                     return new UnixDirectoryPath(this, platformPathType, pathType, path, components);
                 case PathTypes.File:
                     return new UnixFilePath(this, platformPathType, pathType, path, components);
                 default:
                     throw new ArgumentOutOfRangeException("pathType", pathType, null);
             }
             ;
         default:
             throw new ArgumentOutOfRangeException("platformPathType", platformPathType, null);
     }
 }
예제 #2
0
파일: WinPath.cs 프로젝트: stormleoxia/lx
 protected BasePath(PathFactory factory, PlatformPathTypes platformPathType, PathTypes pathType, string path,
     string[] components)
 {
     Factory = factory;
     PlatformPathType = platformPathType;
     PathType = pathType;
     Components = components;
     Path = path;
 }
예제 #3
0
 public IPath Create(string path, PlatformPathTypes platformPathType)
 {
     switch (platformPathType)
     {
         case PlatformPathTypes.Infer:
             return Create(path, InferPlatformPathType(path));
         default: // TODO manage UNC and URI
         {
             var components = path.Split('/', '\\');
             var parts = _partFactory.MakeParts(path);
             components = PathUtility.CleanUp(components);
             return Create(path, platformPathType, InferPathType(path, components), components);
         }
     }
 }
예제 #4
0
파일: WinPath.cs 프로젝트: stormleoxia/lx
 protected WinPath(PathFactory factory, PlatformPathTypes platformPathType, PathTypes pathType, string path,
     string[] components)
     : base(factory, platformPathType, pathType, path, components)
 {
     var firstComponent = components.FirstOrDefault();
     Drive = PathUtility.GetDrive(firstComponent);
 }
예제 #5
0
 public UnixRootPath(PathFactory factory, PlatformPathTypes platformPathType, PathTypes pathType, string path,
     string[] components)
 {
     throw new NotImplementedException();
 }
예제 #6
0
 public UnixDirectoryPath(PathFactory factory, PlatformPathTypes platformPathType, PathTypes pathType,
     string path, string[] components)
 {
 }
예제 #7
0
 public WinFilePath(PathFactory factory, PlatformPathTypes platformPathType, PathTypes pathType, string path,
     string[] components)
     : base(factory, platformPathType, pathType, path, components)
 {
 }