public bool CanGetAbsolutePathFrom(IAbsoluteDirectoryPath path, out string failureMessage) { Debug.Assert(path != null); // Enforced by contract string pathAbsoluteUnused; return(AbsoluteRelativePathHelpers.TryGetAbsolutePathFrom(path, this, out pathAbsoluteUnused, out failureMessage)); }
public bool CanGetAbsolutePathFrom(IAbsoluteDirectoryPath path, out string failureMessage) { Argument.IsNotNull(nameof(path), path); string absolutePath; return(AbsoluteRelativePathHelpers.TryGetAbsolutePathFrom(path, this, out absolutePath, out failureMessage)); }
// // Absolute/Relative pathString conversion // IAbsoluteDirectoryPath IRelativeDirectoryPath.GetAbsolutePathFrom(IAbsoluteDirectoryPath path) { Debug.Assert(path != null); // Enforced by contracts! string pathAbsolute, failureReason; if (!AbsoluteRelativePathHelpers.TryGetAbsolutePathFrom(path, this, out pathAbsolute, out failureReason)) { throw new ArgumentException(failureReason); } Debug.Assert(pathAbsolute != null); Debug.Assert(pathAbsolute.Length > 0); return(pathAbsolute.ToAbsoluteDirectoryPath()); }
IAbsoluteFilePath IRelativeFilePath.GetAbsolutePathFrom(IAbsoluteDirectoryPath path) { Argument.IsNotNull(nameof(path), path); string absolutePath, failureMessage; if (!AbsoluteRelativePathHelpers.TryGetAbsolutePathFrom(path, this, out absolutePath, out failureMessage)) { throw new ArgumentException(failureMessage); } //Debug.Assert(pathAbsolute != null); //Debug.Assert(pathAbsolute.Length > 0); return((absolutePath + MiscHelpers.DirectorySeparatorChar + FileName).ToAbsoluteFilePath()); }