GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
Loading...
Searching...
No Matches
GPALFileSettings.cs
1// =============================================================================
2// GPAL - Generally Positive Automation Library
3// Copyright © 2026 Software Decisions, Inc. All rights reserved.
4//
5// This file is part of GPAL.
6// Licensed under the Business Source License 1.1
7//
8// Primary development, architecture, and vision by Michael B. Vederman,
9// CEO of Software Decisions, Inc., Texas.
10//
11// Internal development maintained privately.
12// Public releases appear on GitHub: https://github.com/SoftwareDecisionsInc/GPAL.
13//
14// See LICENSE for full terms, including Additional Use Grant.
15// =============================================================================
16
17using System;
18using System.Collections.Generic;
19using System.Linq;
20using System.Text;
21using System.Threading.Tasks;
22
23namespace GenerallyPositive
24{
25 internal class GPALFileSettings
26 {
27 internal bool AlreadyTokenized { get; set; } = false;
28
29 public List<string> Filenames { get; internal set; }
30 public List<string> ReturnFilenames { get; internal set; }
31 public string SourceUrl { get; internal set; } // set when WithFileName was given a url, so the file knows what it is a copy of
32 internal Browser.IBrowser Browser { get; set; } // supplied by WithBrowser, used to reach a url our own connection cannot
33 public int NextFileCount { get; internal set; } = 0;
34 public IGPALGrid<string> ColumnList { get; internal set; } // a list for each filename supplied, or one for all. If not supplied, generate column1, column2...
35 public IGPALGrid<string> ExcelSheetNames { get; internal set; } // a list for each filename supplied, or one for all. If not supplied, generate column1, column2...
36 public IGPALGrid<int> ExcelRowsPerSheet { get; internal set; } // a list for each filename supplied, or one for all. If not supplied, generate column1, column2...
37 public int FileCount { get; internal set; } // count of user supplied filenames
38 public List<char?> Delimiter { get; internal set; } = null; // default to csv
39 public List<IGPALGrid<string>> TokenList { get; internal set; } // all the parsed out values from each file, in their own grids
40 public List<bool> FieldsEnclosedInQuotes { get; internal set; }
41 public List<bool> FirstLineIsColumnNames { get; internal set; }
42 public List<bool> IgnoreFirstLineColumnNames { get; internal set; }
43 public List<bool> OverwriteFile { get; internal set; } // overwrite the file or use Next to save to a new file with a new filename
44 public Enums.FileSortOrder FileSortOrder { get; internal set; } = Enums.FileSortOrder.NameAscending; // order in which wildcard-matched files are added to Filenames
45 public Enums.NextFilePattern NextFilePattern { get; internal set; } = Enums.NextFilePattern.CounterPadded; // how Next builds a new unique filename
46 public int NextPatternCounter { get; internal set; } = 0; // running counter for the Counter/CounterPadded patterns
47 public bool UseOneHeaderForAllFiles { get; internal set; }
48 public List<Dictionary<object, dynamic>> FileDictionary { get; internal set; }
49 public List<string> FileData { get; internal set; }
50 public List<IGPALGrid<string>> FileGrid { get; internal set; }
51
52 public GPALFileSettings()
53 {
54 TokenList = new List<IGPALGrid<string>>();
55 Filenames = new List<string>();
56 ReturnFilenames = new List<string>();
57 ColumnList = new GPALGrid<string>();
58 Delimiter = new List<char?>();
59 FieldsEnclosedInQuotes = new List<bool>();
60 FirstLineIsColumnNames = new List<bool>();
61 IgnoreFirstLineColumnNames = new List<bool>();
62 FileDictionary = new List<Dictionary<object, dynamic>>();
63 FileGrid = new List<IGPALGrid<string>>();
64 FileData = new List<string>();
65 ExcelRowsPerSheet = new GPALGrid<int>();
66 ExcelSheetNames = new GPALGrid<string>();
67 OverwriteFile = new List<bool>();
68 }
69 }
70}
71