import * as path from "path" ; import * as helpers from "../helpers" ; import * as files from "." ; /**
 * represents an absolute path to a directory,
 * i.e. path from filesystem root to the directory
 */ export class AbsoluteDirPath { value : string ; constructor ( value ) { this . value = helpers . unixify ( value ) ; } /** joins the given relative directory */ joinDir ( other ) { return new AbsoluteDirPath ( this . joinStr ( other . value ) ) ; } /** provides a path of this directory with the given path appended */ joinStr ( ... paths ) { return path . join ( this . platformified ( ) , ... paths ) ; } /** indicates whether this directory is the same as the given source dir */ matches ( other ) { return this . unixified ( ) === other . unixified ( ) ; } /**
     * Returns the path in the platform-specific format,
     * i.e. using '\' on Windows and '/' everywhere else
     */ platformified ( ) { return this . value . replace ( /\//g , path . sep ) ; } relativeStr ( other ) { return path . relative ( this . platformified ( ) , other ) ; } toFullDir ( sourceDir ) { return new files . FullDir ( path . relative ( sourceDir . platformified ( ) , this . platformified ( ) ) ) ; } /** Returns this absolute path using forward slashes as path separators */ unixified ( ) { return this . value ; } }