I am parsing text files and populating a TVirtualStringTree with Keywords which is used to navigate the text files. I like some advice on structuring the database.
I have 2 arrays of records which hold Level 0 and level 1 data which populates the corresponding levels in the Tree. The text file can reference other text files, these need to be similarly parsed and added into the Tree. This file nesting can continue to any depth.
Level 0 records hold child count and keys into Level 1 records.
Image shows top file referencing ADC.inc which references ADCdefs.inc all of which can be expanded into the same tree.
In order to parse the nested files the parser needs to be recursive.
I have created a class holding the Level0 and Level1 data records and its heirachical order for each text file I encounter and hold these classes in an object list. I haven’t yet written the code for updating the Virtual String Tree.
Before I get too deep into this is there a better way of doing this.
John Barrat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.