f331967417
- fix esclusione file temp da regexp - fix gestione delete - test update/approve da REST
108 lines
3.1 KiB
C#
108 lines
3.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MP.FileData
|
|
{
|
|
public enum SearchMode
|
|
{
|
|
/// <summary>
|
|
/// Ricerca occorrenze di una RegExp dentro il contenuto del file
|
|
/// </summary>
|
|
StringOnFile,
|
|
|
|
/// <summary>
|
|
/// Cerca da path relativo + nome file
|
|
/// </summary>
|
|
PathAndName,
|
|
|
|
/// <summary>
|
|
/// Ricerca di espliciti TAG nel file
|
|
/// </summary>
|
|
TagListed
|
|
}
|
|
|
|
public class SearchRules
|
|
{
|
|
#region Public Properties
|
|
|
|
/// <summary>
|
|
/// Estensioni file esclusi
|
|
/// </summary>
|
|
public List<string> ExcludedFileExt { get; set; } = new List<string>();
|
|
|
|
/// <summary>
|
|
/// Pattern esclusione Tags (stop-words)
|
|
/// </summary>
|
|
public List<string> ExcludedTags { get; set; } = new List<string>();
|
|
|
|
/// <summary>
|
|
/// Pattern in formato RegExp
|
|
/// </summary>
|
|
public Dictionary<string, string> FileNameExtReplace { get; set; } = new Dictionary<string, string>();
|
|
|
|
/// <summary>
|
|
/// Quantità massima di caratteri da analizzare, 0 = tutti
|
|
/// </summary>
|
|
public int MaxChar2Search { get; set; } = 100;
|
|
|
|
/// <summary>
|
|
/// Modalità ricerca
|
|
/// </summary>
|
|
public SearchMode Mode { get; set; } = SearchMode.StringOnFile;
|
|
|
|
/// <summary>
|
|
/// Nome della regola di ricerca
|
|
/// </summary>
|
|
public string Name { get; set; } = "ND";
|
|
|
|
/// <summary>
|
|
/// Configurazione opzionale x rimozione filename da output finali
|
|
/// </summary>
|
|
public bool OutExcludeFileName { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Replace in uscita per "bonificare" il tag
|
|
/// </summary>
|
|
public Dictionary<string, string> OutReplace { get; set; } = new Dictionary<string, string>();
|
|
|
|
/// <summary>
|
|
/// Pattern in formato RegExp
|
|
/// </summary>
|
|
public string RegExPattern { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Configurazione opzionale x sostituzione placeholder {{fileName}} in RegExp con il VERO nome file
|
|
/// </summary>
|
|
public bool RegExRepFileName { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Configurazione opzionale x sostituzione carriage return --> spazi
|
|
/// </summary>
|
|
public bool ReplaceCR { get; set; } = true;
|
|
|
|
|
|
/// <summary>
|
|
/// Tag da collezionare, come elenco di stringhe
|
|
/// es: {"Customer", "Model"}
|
|
/// selezionerà
|
|
/// Customer=Steamware
|
|
/// MODEL=DEMO_SIMULATOR
|
|
/// </summary>
|
|
public List<string> Tag2Collect { get; set; } = new List<string>();
|
|
|
|
/// <summary>
|
|
/// Configurazione opzionale x escludere files da regexp su filename
|
|
/// </summary>
|
|
public bool ExclFileEnabled { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Pattern in formato RegExp x esclusione file da nome
|
|
/// </summary>
|
|
public string ExclFileRegExPattern { get; set; } = "";
|
|
|
|
#endregion Public Properties
|
|
}
|
|
} |