/// <summary> /// /// </summary> /// <param name="baseDirectory">The parent directory of <paramref name="archiveDirectory"/>. <see cref="AbstractArchive.ArchivePath"/> will be set to <c>Path.Combine(baseDirectory, archiveDirectory)</c></param> /// <param name="archiveDirectory">The directory to store the archive files in</param> /// <param name="useExistingArchive">if true, use any files found in the archive directory. Otherwise, delete them</param> /// <param name="generator">The generator to use</param> /// <param name="mapping">The file name mapping</param> /// <param name="scheduler">The task scheduler for asynchronous tasks</param> public GeneratorArchive(string baseDirectory, string archiveDirectory, bool useExistingArchive, TGenerator generator, AbstractFileNameMapping mapping, TaskScheduler scheduler) : base(baseDirectory, archiveDirectory, scheduler) { _fileMapping = mapping; Generator = generator; if (!Directory.Exists(this.ArchivePath)) { Directory.CreateDirectory(this.ArchivePath); } else if (!useExistingArchive) { foreach (var fileName in GetArchivedFiles().ToList()) { File.Delete(fileName); } } }
/// <summary> /// Creates a new SrcMLArchive. The archive is created in <c>"baseDirectory\srcML"</c>. /// </summary> /// <param name="baseDirectory">the base directory</param> /// <param name="useExistingSrcML">If True, any existing SrcML files in <see cref="AbstractArchive.ArchivePath"/> will be used. If False, these files will be deleted and potentially recreated.</param> /// <param name="generator">The SrcMLGenerator to use to convert source files to SrcML.</param> /// <param name="xmlMapping">The XmlFileNameMapping to use to map source paths to xml file paths.</param> public SrcMLArchive(string baseDirectory, bool useExistingSrcML, SrcMLGenerator generator, AbstractFileNameMapping xmlMapping) : this(baseDirectory, DEFAULT_ARCHIVE_DIRECTORY, useExistingSrcML, generator, xmlMapping, TaskScheduler.Default) { }
/// <summary> /// Creates a new SrcMLArchive. /// </summary> /// <param name="baseDirectory">The parent of <paramref name="srcMLDirectory"/>. <see cref="AbstractArchive.ArchivePath"/> will be set to <c>Path.Combine(baseDirectory, srcMLDirectory)</c></param> /// <param name="srcMLDirectory">The directory to store the SrcML files in. This will be created as a subdirectory of <paramref name="baseDirectory"/></param> /// <param name="useExistingSrcML">If True, any existing SrcML files in <see cref="AbstractArchive.ArchivePath"/> will be used. If False, these files will be deleted and potentially recreated.</param> /// <param name="generator">The SrcMLGenerator to use to convert source files to SrcML.</param> /// <param name="xmlMapping">The XmlFileNameMapping to use to map source paths to xml file paths.</param> /// <param name="scheduler">The task scheduler to for asynchronous tasks</param> public SrcMLArchive(string baseDirectory, string srcMLDirectory, bool useExistingSrcML, SrcMLGenerator generator, AbstractFileNameMapping mapping, TaskScheduler scheduler) : base(baseDirectory, srcMLDirectory, useExistingSrcML, generator, mapping, scheduler) { }