//
            //  Path Browsing facilities
            //
            public IAbsoluteFilePath GetBrotherFileWithName(string fileName)
            {
                Debug.Assert(fileName != null);                 // Enforced by contract
                Debug.Assert(fileName.Length > 0);              // Enforced by contract
                var path      = PathBrowsingHelpers.GetBrotherFileWithName(this, fileName);
                var pathTyped = path as IAbsoluteFilePath;

                Debug.Assert(pathTyped != null);
                return(pathTyped);
            }
            public IAbsoluteDirectoryPath GetBrotherDirectoryWithName(string directoryName)
            {
                Debug.Assert(directoryName != null);                 // Enforced by contract
                Debug.Assert(directoryName.Length > 0);              // Enforced by contract
                var path      = PathBrowsingHelpers.GetBrotherDirectoryWithName(this, directoryName);
                var pathTyped = path as IAbsoluteDirectoryPath;

                Debug.Assert(pathTyped != null);
                return(pathTyped);
            }
            public IEnvironmentVariableDirectoryPath GetChildDirectoryPath(string directoryName)
            {
                Argument.IsNotNullOrEmpty(nameof(directoryName), directoryName);

                var pathString = PathBrowsingHelpers.GetChildDirectoryPath(this, directoryName);

                //Debug.Assert(pathString.IsValidEnvVarDirectoryPath());

                return(new EnvironmentVariableDirectoryPath(pathString));
            }
            public IEnvironmentVariableFilePath GetChildFilePath(string fileName)
            {
                Argument.IsNotNullOrEmpty(nameof(fileName), fileName);

                var pathString = PathBrowsingHelpers.GetChildFilePath(this, fileName);

                //Debug.Assert(pathString.IsValidEnvVarFilePath());

                return(new EnvironmentVariableFilePath(pathString));
            }
            public IAbsoluteFilePath GetChildFilePath(string fileName)
            {
                Argument.IsNotNullOrEmpty(nameof(fileName), fileName);

                var pathString = PathBrowsingHelpers.GetChildFilePath(this, fileName);

                //Debug.Assert(pathString.IsValidAbsoluteFilePath());

                return(new AbsoluteFilePath(pathString));
            }
            //
            //  Path Browsing facilities
            //
            public IEnvironmentVariableFilePath GetSisterFileWithName(string fileName)
            {
                Debug.Assert(fileName != null);                 // Enforced by contract
                Debug.Assert(fileName.Length > 0);              // Enforced by contract
                var path      = PathBrowsingHelpers.GetSisterFileWithName(this, fileName);
                var pathTyped = path as IEnvironmentVariableFilePath;

                Debug.Assert(pathTyped != null);
                return(pathTyped);
            }
            public IEnvironmentVariableDirectoryPath GetSisterDirectoryWithName(string directoryName)
            {
                Debug.Assert(directoryName != null);                 // Enforced by contract
                Debug.Assert(directoryName.Length > 0);              // Enforced by contract
                var path      = PathBrowsingHelpers.GetSisterDirectoryWithName(this, directoryName);
                var pathTyped = path as IEnvironmentVariableDirectoryPath;

                Debug.Assert(pathTyped != null);
                return(pathTyped);
            }
            //
            //  Path Browsing facilities
            //

            public IRelativeFilePath GetSisterFilePath(string fileName)
            {
                Debug.Assert(fileName != null);                 // Enforced by contracts
                Debug.Assert(fileName.Length > 0);              // Enforced by contracts
                var path      = PathBrowsingHelpers.GetSisterFileWithName(this, fileName);
                var pathTyped = path as IRelativeFilePath;

                Debug.Assert(pathTyped != null);
                return(pathTyped);
            }
            public IRelativeDirectoryPath GetSisterDirectoryPath(string directoryName)
            {
                Debug.Assert(directoryName != null);                 // Enforced by contracts
                Debug.Assert(directoryName.Length > 0);              // Enforced by contracts
                var path      = PathBrowsingHelpers.GetSisterDirectoryWithName(this, directoryName);
                var pathTyped = path as IRelativeDirectoryPath;

                Debug.Assert(pathTyped != null);
                return(pathTyped);
            }
            public IRelativeFilePath UpdateExtension(string extension)
            {
                Argument.IsNotNull(nameof(extension), extension);
                Argument.IsValid(nameof(extension), extension, extension.Length >= 2 && extension[0] == '.');

                var path = PathBrowsingHelpers.UpdateExtension(this, extension);

                //Debug.Assert(pathString.IsValidRelativeFilePath());

                return(new RelativeFilePath(path));
            }
Ejemplo n.º 11
0
            public IVariableFilePath UpdateExtension(string extension)
            {
                // All these 3 assertions have been checked by contract!
                Debug.Assert(extension != null);
                Debug.Assert(extension.Length >= 2);
                Debug.Assert(extension[0] == '.');
                var pathString = PathBrowsingHelpers.UpdateExtension(this, extension);

                Debug.Assert(pathString.IsValidVariableFilePath());
                return(new VariableFilePath(pathString));
            }
            public IAbsoluteFilePath GetChildFilePath(string fileName)
            {
                //Debug.Assert(fileName != null); // Enforced by contract
                //Debug.Assert(fileName.Length > 0); // Enforced by contract

                var pathString = PathBrowsingHelpers.GetChildFileWithName(this, fileName);

                //Debug.Assert(pathString.IsValidAbsoluteFilePath());

                return(new AbsoluteFilePath(pathString));
            }
            public IAbsoluteDirectoryPath GetChildDirectoryPath(string directoryName)
            {
                //Debug.Assert(directoryName != null); // Enforced by contract
                //Debug.Assert(directoryName.Length > 0); // Enforced by contract

                var pathString = PathBrowsingHelpers.GetChildDirectoryWithName(this, directoryName);

                //Debug.Assert(pathString.IsValidAbsoluteDirectoryPath());

                return(new AbsoluteDirectoryPath(pathString));
            }
            public IEnvVarFilePath UpdateExtension(string newExtension)
            {
                // All these 3 assertions have been checked by contract!
                Debug.Assert(newExtension != null);
                Debug.Assert(newExtension.Length >= 2);
                Debug.Assert(newExtension[0] == '.');
                string pathString = PathBrowsingHelpers.UpdateExtension(this, newExtension);

                Debug.Assert(pathString.IsValidEnvVarFilePath());
                return(new EnvVarFilePath(pathString));
            }
            public IEnvironmentVariableFilePath UpdateExtension(string extension)
            {
                Argument.IsNotNull(nameof(extension), extension);
                Argument.IsValid(nameof(extension), extension, extension.Length >= 2 && extension[0] == '.');

                var pathString = PathBrowsingHelpers.UpdateExtension(this, extension);

                //Debug.Assert(pathString.IsValidEnvVarFilePath());

                return(new EnvironmentVariableFilePath(pathString));
            }