123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- using System;
- namespace Wayne.Lib.IO
- {
- /// <summary>
- /// Interface.
- /// </summary>
- public interface IPaths
- {
- #region Properties
- /// <summary>
- /// The root path used by Wayne applications.
- /// </summary>
- string Root { get; }
- /// <summary>
- /// The base path to all config files.
- /// </summary>
- string Config { get; }
- /// <summary>
- /// The base path to all transaction files.
- /// </summary>
- string Transactions { get; }
- /// <summary>
- /// The base path to all log files.
- /// </summary>
- string Log { get; }
- /// <summary>
- /// The complete path (including the file name) to the executable.
- /// </summary>
- string ExecutablePath { get; }
- /// <summary>
- /// The directory path to the executable.
- /// </summary>
- string ExecutableDirectory { get; }
- /// <summary>
- /// The base path to data files.
- /// </summary>
- string Data { get; }
- #endregion
- #region Methods
- /// <summary>
- /// Combines the Root path and the given subPath.
- /// </summary>
- /// <param name="subPath">The sub path (under the main path).</param>
- /// <returns></returns>
- string Combine(string subPath);
- /// <summary>
- /// Combines the Root path and the given subPath and file name.
- /// </summary>
- /// <param name="subPath">The sub path (under the main path).</param>
- /// <param name="subPath2">An additional sub path (or the name of a file).</param>
- /// <returns></returns>
- string Combine(string subPath, string subPath2);
- /// <summary>
- /// Returns the config path to the given config name.
- /// </summary>
- /// <param name="configName">The name of the config.</param>
- /// <returns></returns>
- string GetConfigPath(string configName);
- /// <summary>
- /// Returns the config path to the given config name.
- /// </summary>
- /// <param name="configName">The name of the config.</param>
- /// <param name="fileName">The name of a config file.</param>
- /// <returns></returns>
- string GetConfigPath(string configName, string fileName);
- /// <summary>
- /// Returns the transaction file path to the given terminal type.
- /// </summary>
- /// <param name="terminalType">The name of the terminal type.</param>
- /// <returns></returns>
- string GetTransactionsPath(string terminalType);
- /// <summary>
- /// Returns the transaction file path to the given terminal type.
- /// </summary>
- /// <param name="terminalType">The name of the terminal type.</param>
- /// <param name="subState">The name of the sub state.</param>
- /// <returns></returns>
- string GetTransactionsPath(string terminalType, string subState);
- /// <summary>
- /// Replaces the extension of a file (e.g. from C:\MyFile.aaa to C:\MyFile.bbb)
- /// </summary>
- /// <param name="fileName"></param>
- /// <param name="newExtension"></param>
- /// <returns></returns>
- string ReplaceExtension(string fileName, string newExtension);
- #endregion
- #region Parse
- /// <summary>
- /// Parses the path to replace any %...% variables with the current actual path.
- /// </summary>
- /// <param name="path"></param>
- /// <returns></returns>
- string Parse(string path);
- /// <summary>
- /// Checks if file exists
- /// </summary>
- /// <param name="fileName"></param>
- /// <returns></returns>
- [Obsolete("Use the DirectoryExists() in FileSupport instead!")]
- bool FileExists(string fileName);
- /// <summary>
- /// Checks if directory exists
- /// </summary>
- /// <param name="path"></param>
- /// <returns></returns>
- [Obsolete("Use the DirectoryExists() in FileSupport instead!")]
- bool DirectoryExists(string path);
- /// <summary>
- /// Ensures the directory exists by trying to create it if it does not exist already.
- /// </summary>
- /// <param name="path"></param>
- /// <returns></returns>
- [Obsolete("Use the DirectoryExists() in FileSupport instead!")]
- bool EnsureDirectoryExists(string path);
- #endregion
- }
- }
|