![]() |
GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
|
Classes | |
| class | DataFormatDetector |
Public Member Functions | |
| IGPALConverter | ToGPALObject () |
| Returns this converter cast to IGPALConverter to begin a fluent conversion chain. | |
| IAllowConverterSettingsAndActions | WithInput (List< Dictionary< object, dynamic > > inputDictionary) |
| Sets the input to a list of dictionaries (one per input "document"), clearing any previously configured input/output settings. | |
| IAllowConverterSettingsAndActions | WithInput (IGPALDatabase inputDatabase) |
| Sets the input to the contents of a GPAL database, clearing any previously configured input/output settings. | |
| IAllowConverterInputAndActions | SaveTo (IGPALDatabase outputDatabase) |
| Converts the configured input to database format and writes the resulting rows into the given database. | |
| IAllowConverterSettingsAndActions | WithInput (IGPALGrid< string > inputGrid) |
| Sets the input to a GPAL grid of strings (GRID format, comma input delimiter), clearing any previously configured input/output settings. | |
| IAllowConverterInputAndActions | SaveTo (ref IGPALGrid< string > outputGrid) |
| Converts the configured input to GRID format and writes the resulting rows/columns into the given grid. | |
| IAllowConverterSettingsAndActions | WithInput (string inputData) |
| Sets the input to a raw string of data, clearing any previously configured input/output settings. If an input delimiter has not been set, the data format is auto-detected from the content (JSON/XML/YAML/CSV/etc.). | |
| IAllowConverterInputAndActions | SaveTo (string outputData) |
| Converts the configured input to a string in the configured (or detected) output format. | |
| IAllowConverterSettingsAndActions | WithInput (GPALFile inputFile) |
| Sets the input to one or more files, clearing any previously configured input/output settings. The data format of each matching file is determined from its file extension. | |
| IAllowConverterInputAndActions | AppendTo (GPALFile outputFile) |
| Converts the configured input and appends the resulting data to the given output file (instead of overwriting it). | |
| IAllowConverterInputAndActions | SaveTo (GPALFile outputFile) |
| Converts the configured input and writes (overwrites) the resulting data to the given output file. | |
| IAllowConverterSettingsAndActions | WithInput (dynamic inputClass) |
| Sets the input to an arbitrary class instance (or collection), clearing any previously configured input/output settings. The instance is reflected/walked into a dictionary representation (CLASS format) that can then be converted to any output format. | |
| IAllowConverterInputAndActions | SaveTo< T > (ref T outputClass) |
| IAllowConverterSettingsAndActions | WithInputType (DataFormat inDataFormat) |
| Explicitly overrides the detected/assumed input data format. | |
| IAllowConverterSettingsAndActions | WithOutputType (DataFormat outDataFormat) |
| Explicitly sets the output data format to use when converting. | |
| IAllowConverterSettingsAndActions | WithFirstLineHasColumnNames (bool firstLineHeaders=true) |
| Specifies whether the first line/row of delimited input contains column header names. | |
| IAllowConverterSettingsAndActions | WithIgnoreFirstLineColumnNames (bool ignoreFirstLine=true) |
| Specifies whether the first line/row of delimited input should be ignored (skipped) rather than treated as data or column names. | |
| IAllowConverterSettingsAndActions | WithColumnsEnclosedInQuotes (bool fieldsEnclosedInQuotes=true) |
| Specifies whether delimited fields should be wrapped in quotes when writing output. | |
| IAllowConverterSettingsAndActions | WithColumnNames (List< string > columnNames) |
| Supplies the column names for this conversion. Caller-supplied names override the input source's own column names (a file's column list, a database's columns) positionally; any columns the caller does not supply are backfilled from the source. The names persist until the next WithInput. The source (e.g. the GPALFile) is never modified. | |
| IAllowConverterSettingsAndActions | WithColumnName (string columnName) |
| Appends a single column name to the conversion's column list. Repeated calls build the list in order. See WithColumnNames(List<string>) for override/backfill semantics. | |
| IAllowConverterInputAndActions | PrettyPrintTo (out string outputData) |
| Pretty-prints JSON, YAML, XML, or HTML. Other formats (CSV, TAB, PIPE, etc.) are returned as-is. | |
| IAllowConverterInput | RegisterKnownStructType (Type knownStructType) |
| Registers a struct type as a "known" type for class/dictionary conversion, so the converter can correctly recognize and reconstruct instances of it (rather than treating it as a generic nested dictionary). | |
| IAllowConverterInputAndActions | RenderTo (IGPALDatabase outputDatabase) |
| Renders the configured input as a visual document (e.g. PDF or image) rather than a text data format, storing the rendered output in the given database. Not yet implemented. | |
| IAllowConverterInputAndActions | RenderTo (string outputData) |
| Renders the configured input as a visual document (e.g. PDF or image) rather than a text data format, storing the rendered output in the given string. Not yet implemented. | |
| IAllowConverterInputAndActions | RenderTo (GPALFile outputFile) |
| Renders the configured input as a visual document (e.g. PDF or image) rather than a text data format, writing the rendered output to the given file. Not yet implemented. | |
| IAllowConverterInputAndActions | RenderToClass (out dynamic outputClass) |
| Renders the configured input as a visual document (e.g. PDF or image) rather than a text data format, storing the rendered output in the given class instance. Not yet implemented. | |
Definition at line 40 of file GPALConverter.cs.
| IAllowConverterInputAndActions GenerallyPositive.GPALConverter.AppendTo | ( | GPALFile | outputFile | ) |
Converts the configured input and appends the resulting data to the given output file (instead of overwriting it).
| outputFile | The file to append the converted data to; its data format is determined from its file extension |
Implements GenerallyPositive.IAllowConverterActions.
Definition at line 282 of file GPALConverter.cs.
| IAllowConverterInputAndActions GenerallyPositive.GPALConverter.PrettyPrintTo | ( | out string | outputData | ) |
Pretty-prints JSON, YAML, XML, or HTML. Other formats (CSV, TAB, PIPE, etc.) are returned as-is.
Pretty prints the data based on the CURRENT Input Format (InDataFormat). Works great with your fluent chain: WithInput(...).PrettyPrintTo(...)
Implements GenerallyPositive.IAllowConverterActions.
Definition at line 503 of file GPALConverter.cs.
| IAllowConverterInput GenerallyPositive.GPALConverter.RegisterKnownStructType | ( | Type | knownStructType | ) |
Registers a struct type as a "known" type for class/dictionary conversion, so the converter can correctly recognize and reconstruct instances of it (rather than treating it as a generic nested dictionary).
| knownStructType | The struct Type to register |
Implements GenerallyPositive.IAllowConverterInput.
Definition at line 1747 of file GPALConverter.cs.
| IAllowConverterInputAndActions GenerallyPositive.GPALConverter.RenderTo | ( | GPALFile | outputFile | ) |
Renders the configured input as a visual document (e.g. PDF or image) rather than a text data format, writing the rendered output to the given file. Not yet implemented.
| outputFile | The file that would receive the rendered output |
Implements GenerallyPositive.IAllowConverterActions.
Definition at line 1781 of file GPALConverter.cs.
| IAllowConverterInputAndActions GenerallyPositive.GPALConverter.RenderTo | ( | IGPALDatabase | outputDatabase | ) |
Renders the configured input as a visual document (e.g. PDF or image) rather than a text data format, storing the rendered output in the given database. Not yet implemented.
| outputDatabase | The database that would receive the rendered output |
Implements GenerallyPositive.IAllowConverterActions.
Definition at line 1759 of file GPALConverter.cs.
| IAllowConverterInputAndActions GenerallyPositive.GPALConverter.RenderTo | ( | string | outputData | ) |
Renders the configured input as a visual document (e.g. PDF or image) rather than a text data format, storing the rendered output in the given string. Not yet implemented.
| outputData | The string that would receive the rendered output |
Implements GenerallyPositive.IAllowConverterActions.
Definition at line 1770 of file GPALConverter.cs.
| IAllowConverterInputAndActions GenerallyPositive.GPALConverter.RenderToClass | ( | out dynamic | outputClass | ) |
Renders the configured input as a visual document (e.g. PDF or image) rather than a text data format, storing the rendered output in the given class instance. Not yet implemented.
| outputClass | The object that would receive the rendered output |
Implements GenerallyPositive.IAllowConverterActions.
Definition at line 1792 of file GPALConverter.cs.
| IAllowConverterInputAndActions GenerallyPositive.GPALConverter.SaveTo | ( | GPALFile | outputFile | ) |
Converts the configured input and writes (overwrites) the resulting data to the given output file.
| outputFile | The file to write the converted data to; its data format is determined from its file extension |
Implements GenerallyPositive.IAllowConverterActions.
Definition at line 301 of file GPALConverter.cs.
| IAllowConverterInputAndActions GenerallyPositive.GPALConverter.SaveTo | ( | IGPALDatabase | outputDatabase | ) |
Converts the configured input to database format and writes the resulting rows into the given database.
| outputDatabase | The database to write the converted rows into |
Implements GenerallyPositive.IAllowConverterActions.
Definition at line 141 of file GPALConverter.cs.
| IAllowConverterInputAndActions GenerallyPositive.GPALConverter.SaveTo | ( | ref IGPALGrid< string > | outputGrid | ) |
Converts the configured input to GRID format and writes the resulting rows/columns into the given grid.
| outputGrid | The grid to receive the converted rows; also used to determine the output element type |
Implements GenerallyPositive.IAllowConverterActions.
Definition at line 185 of file GPALConverter.cs.
| IAllowConverterInputAndActions GenerallyPositive.GPALConverter.SaveTo | ( | string | outputData | ) |
Converts the configured input to a string in the configured (or detected) output format.
| outputData | The output data string; the converted result is stored on the converter's settings |
Implements GenerallyPositive.IAllowConverterActions.
Definition at line 242 of file GPALConverter.cs.
| IAllowConverterInputAndActions GenerallyPositive.GPALConverter.SaveTo< T > | ( | ref T | outputClass | ) |
Implements GenerallyPositive.IAllowConverterActions.
Definition at line 344 of file GPALConverter.cs.
| IGPALConverter GenerallyPositive.GPALConverter.ToGPALObject | ( | ) |
Returns this converter cast to IGPALConverter to begin a fluent conversion chain.
Implements GenerallyPositive.IAllowToGPALObject< TResult >.
Definition at line 92 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithColumnName | ( | string | columnName | ) |
Appends a single column name to the conversion's column list. Repeated calls build the list in order. See WithColumnNames(List<string>) for override/backfill semantics.
| columnName | The column name to append. |
Implements GenerallyPositive.IAllowConverterSettings.
Definition at line 465 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithColumnNames | ( | List< string > | columnNames | ) |
Supplies the column names for this conversion. Caller-supplied names override the input source's own column names (a file's column list, a database's columns) positionally; any columns the caller does not supply are backfilled from the source. The names persist until the next WithInput. The source (e.g. the GPALFile) is never modified.
| columnNames | The ordered column names to use for this conversion. |
Implements GenerallyPositive.IAllowConverterSettings.
Definition at line 451 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithColumnsEnclosedInQuotes | ( | bool | fieldsEnclosedInQuotes = true | ) |
Specifies whether delimited fields should be wrapped in quotes when writing output.
| fieldsEnclosedInQuotes | True to enclose each output field in quotes (default true) |
Implements GenerallyPositive.IAllowConverterSettings.
Definition at line 437 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithFirstLineHasColumnNames | ( | bool | firstLineHeaders = true | ) |
Specifies whether the first line/row of delimited input contains column header names.
| firstLineHeaders | True if the first line/row contains column names (default true) |
Implements GenerallyPositive.IAllowConverterSettings.
Definition at line 416 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithIgnoreFirstLineColumnNames | ( | bool | ignoreFirstLine = true | ) |
Specifies whether the first line/row of delimited input should be ignored (skipped) rather than treated as data or column names.
| ignoreFirstLine | True to skip the first line/row of the input (default true) |
Implements GenerallyPositive.IAllowConverterSettings.
Definition at line 427 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithInput | ( | dynamic | inputClass | ) |
Sets the input to an arbitrary class instance (or collection), clearing any previously configured input/output settings.
The instance is reflected/walked into a dictionary representation (CLASS format) that can then be converted to any output format.
| inputClass | The object, collection, or dictionary to use as the conversion input |
Implements GenerallyPositive.IAllowConverterInput.
Definition at line 316 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithInput | ( | GPALFile | inputFile | ) |
Sets the input to one or more files, clearing any previously configured input/output settings.
The data format of each matching file is determined from its file extension.
| inputFile | The GPALFile (which may expand to multiple matching files) to use as the conversion input |
Implements GenerallyPositive.IAllowConverterInput.
Definition at line 262 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithInput | ( | IGPALDatabase | inputDatabase | ) |
Sets the input to the contents of a GPAL database, clearing any previously configured input/output settings.
| inputDatabase | The database whose tokenized rows are used as the conversion input |
Implements GenerallyPositive.IAllowConverterInput.
Definition at line 121 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithInput | ( | IGPALGrid< string > | inputGrid | ) |
Sets the input to a GPAL grid of strings (GRID format, comma input delimiter), clearing any previously configured input/output settings.
| inputGrid | The grid of string values to use as the conversion input |
Implements GenerallyPositive.IAllowConverterInput.
Definition at line 159 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithInput | ( | List< Dictionary< object, dynamic > > | inputDictionary | ) |
Sets the input to a list of dictionaries (one per input "document"), clearing any previously configured input/output settings.
| inputDictionary | List of dictionaries to use as the conversion input |
Definition at line 101 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithInput | ( | string | inputData | ) |
Sets the input to a raw string of data, clearing any previously configured input/output settings.
If an input delimiter has not been set, the data format is auto-detected from the content (JSON/XML/YAML/CSV/etc.).
| inputData | The raw input data (e.g. CSV, JSON, XML, YAML, delimited text) |
Implements GenerallyPositive.IAllowConverterInput.
Definition at line 219 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithInputType | ( | DataFormat | inDataFormat | ) |
Explicitly overrides the detected/assumed input data format.
| inDataFormat | The data format to treat the configured input as |
Implements GenerallyPositive.IAllowConverterSettings.
Definition at line 387 of file GPALConverter.cs.
| IAllowConverterSettingsAndActions GenerallyPositive.GPALConverter.WithOutputType | ( | DataFormat | outDataFormat | ) |
Explicitly sets the output data format to use when converting.
| outDataFormat | The data format to convert the input to |
Implements GenerallyPositive.IAllowConverterSettings.
Definition at line 406 of file GPALConverter.cs.