/// <summary> Name of logging subdirectory.</summary>
privateconststringLOGDIRECTORYTITLE="Log";
/// <summary> Prevents an invalid instance to be created. </summary>
privateLoggingDirectoryManager(){}
publicLoggingDirectoryManager(
Func<string,IList<string>>fileListProvider,
Func<string,bool>directoryExistsChecker,
Action<string>directoryCreator,
Action<string>fileEraser,
stringlogFilePath,
chardirectorySeparatorChar,
intp_iRetainedFilesCountLimit)
{
m_oFileListProvider=fileListProvider??thrownewArgumentException($"Can not instantiate {nameof(LoggingDirectoryManager)}- object. File list provider delegate can not be null.");
thrownewArgumentException($"Can not instantiate {nameof(LoggingDirectoryManager)}- object. Directory creator delegate can not be null.");
}
m_oFileEraser=fileEraser??thrownewArgumentException($"Can not instantiate {nameof(LoggingDirectoryManager)}- object. File eraser delegate can not be null.");
if(string.IsNullOrEmpty(logFilePath))
{
thrownewArgumentException($"Can not instantiate {nameof(LoggingDirectoryManager)}- object. Log file path can not be null or empty.");
thrownewArgumentException($"Can not instantiate {nameof(LoggingDirectoryManager)}- object. Count of retained log files is {p_iRetainedFilesCountLimit} but must be equal or larger one.");
l_iIndex>=m_iRetainedFilesCountLimit-1;/* files remaining count must be m_iRetainedFilesCountLimit - 1 because new log file will be added afterwards */