SmartTableColumnSchema.h
Building a column set from the shape of your data instead of typing twenty out.
Turning the shape of a data source into named columns.
A built column is a guess. The header, the sizing and the alignment are all first tries, there to be checked and fixed.
No value from the data reaches a column. Names are what a column is built from, with the types as well where the source is a struct.
- Namespace
- SmartTable
- Members
- 11
Public functions 9
The struct a table's columns are written against, going by which source it names.
Null when nothing is named at all, which is no fault: a model given at runtime is normal. OutProblem is filled in only where something WAS named and could not be used, so the two are told apart by the problem and never by the null.
File mode answers null and sets no problem, since a csv or a json file carries headings and not a UStruct. Both the compile check and the runtime warning read OutProblem, so the two cannot disagree about what a setup is missing.
One column per property, in the order the struct lists them.
A DataTable row struct and a UObject class alike, since UStruct is what both are. Properties only: a pure function binds, but nothing here can work out which of them was meant as a column.
A bool comes out as a narrow toggle column and a number as a right-aligned one, both at a fixed width. Everything else fills the space left over.
Each header is the name the editor shows for the field. Without editor data, DisplayName is gone and the header is the field name split into words, which is what the editor shows for a field with none.
One column per non-empty cell of the heading row, and every column comes out text.
A CSV carries no types: on disk every field is text. Guessing from the first row of values would turn a column of codes numeric, and 0208 would then draw as 208.
FCsvParser copies the whole text and parses every row of it, though only the first is read here.
One column per key of the first object, whether the file holds an array of objects or one object.
Later objects are never read. A file whose entries disagree about their keys has no one column set, and taking every key seen would leave most rows empty in most columns.
Adds the ones that are not named yet, and gives back how many it added.
It only ever adds. Nothing is dropped, nothing is reordered, and a width, a header or a CellClass already authored on a column stays exactly as it was.
A second run after a row struct grew a field adds that one column and touches nothing else. Emptying the array first is the way to a fresh start.
Every ColumnId used more than once, which for a well-formed table is none.
A doubled id hides the later column outright. Every lookup here takes the first match, so nothing draws, sorts, sizes or hides the later one, while the Details panel goes on showing it being edited. A column with no id is never a duplicate of another with no id.
What switching a table to NewSource would clear: each source field that is set and belongs to another source, named in one line. Empty when nothing would be lost.
The Data Table is named by its soft path, not the loaded name. A soft reference still names an asset that is gone, which is when the name matters most.
The full path SourceFile names. A relative path is read from the project folder, and an absolute one as it is. Empty when no file is set.
The project folder and not the working folder, because the editor runs from a folder of the engine's. A path relative to that reads another file, or none, once the engine or the project moves.
Every binding in Columns that is neither a property nor a pure function taking no arguments on Schema, in column order.
Both bindings of a column are checked, because a column that draws fine while sorting by nothing is the harder of the two to spot. A sort binding left unset falls back to the value binding, and one typo is then reported once, not twice.
FUnresolvedBinding struct, editor only
A binding a column names that the schema does not have.
Public variables 2
Next: SmartTableDispatcher.h