public EPubInternalPath(EPubInternalPath folderPath, string zipPath) { string folder = folderPath.GetPathWithoutFileNameAsString(); string path = folder + zipPath; string[] pathArray = path.Split('/'); LoadAsPath(pathArray); }
public object Clone() { EPubInternalPath newPath = (EPubInternalPath)MemberwiseClone(); newPath._path.Clear(); foreach (var pathElement in _path) { var element = (PathElement)pathElement; newPath._path.Add((PathElement)element.Clone()); } return(newPath); }
/// <summary> /// Return Path only part of the path /// </summary> /// <returns></returns> public IEPubInternalPath GetPathWithoutFileName() { EPubInternalPath newPathObject = (EPubInternalPath)MemberwiseClone(); newPathObject._path.Clear(); foreach (var pathElement in _path) // copy all without Filename { var element = (PathElement)pathElement; if (element.Type != PathType.File) { newPathObject._path.Add((PathElement)element.Clone()); } } return(newPathObject); }
public string GetRelativePath(string path, bool flatStructure) { EPubInternalPath newPath = new EPubInternalPath(path); return GetRelativePath(newPath, flatStructure); }
public static string FormatImagePath(string validName, bool flatStructure) { EPubInternalPath imagePath = new EPubInternalPath(EPubInternalPath.GetDefaultLocation(DefaultLocations.DefaultImagesFolder), validName); return imagePath.GetRelativePath(EPubInternalPath.GetDefaultLocation(DefaultLocations.DefaultTextFolder), flatStructure); }
public string GetRelativePath(string path, bool flatStructure) { EPubInternalPath newPath = new EPubInternalPath(path); return(GetRelativePath(newPath, flatStructure)); }