vector\<string> IncludeSys should list full path of CSVs, to enable mixing canonical systems & custom CSVs
SYS
none specified = all
from IncludeSys vector, load system CSVs
SYS & RG
from IncludeSys vector, load systems CSVs
restrict addition to HwyVec based on Region
RG
none specified = all
use dirent to obtain list of systems for each region
add systems to IncludeSys vector, DBFmine style to avoid duplications
from IncludeSys vector, load systems CSVs
restrict addition to HwyVec based on Region
Neither RG nor SYS
all regions; all systems
load everything in systems.csv
User-specified CSV only
Per pseudocode below, no regions listed = no restrictions. Listing systems will restrict inclusion to these systems. This is right. No need to expand regions beyond what's included; if I mean to include more I should just put it in the CSV.
Does it make sense to restrict a custom CSV by system? No -- That would mean checking the System column in each CSV line (redundant in the vast majority of cases where the System column = CSV name), which would require either...
storing a separate vector of actual system codes for inclusion, or
stripping the path & extension back out of the IncludeSys element to yield the system name.
Either case would require another argument (IncludeSys) to ChoppedRtesCSV. Not a fan. That, and coding the rest of the vector management needed would be too much trouble for too little, questionable, gain.
Simplest solution is to just think of a user-specified CSV as a custom "system" in its own right, and proceed normally from there.
// PSEUDOCODE
// obtain IncludeSys vector
/* NOPE */ if (IncludeSys.empty() && !IncludeRG.empty())
// use dirent to obtain list of systems for each region
// add systems to IncludeSys vector, DBFmine style to avoid duplications
/* No wait, never mind! This is redundant, accomplished by scanning all system
CSVs and then restricting them to the specified regions. It may take a while
to process, but I don't have to write any extra code.
// pass IncludeSys to ReadSysCSV
/* DONE */ bool ReadSysCSV(vector<string>, bool)
// ...
/* DONE */ ReadSysCSV(IncludeSys, IncludeSys.empty());
// ...
/* DONE */ bool envV::ReadSysCSV(vector<string> &IncludeSys, bool PushToVector)
{ // yadda yadda
try { // yadda yadda
/* DONE */ if (PushToVector) IncludeSys.push_back(Repo+"hwy_data/_systems/"+System+".csv");
}
// catch, yadda yadda, indentation, closing braces
}
// pass each CSV to ChoppedRtesCSV and proceed from there
/* DONE */ for (unsigned int i = 0; i < IncludeSys.size() i++)
/* DONE */ ChoppedRtesCSV(HwyVec, env.IncludeRG, env.IncludeSys[i], env.Repo+"hwy_data/", 1);
vector\<string> IncludeSys should list full path of CSVs, to enable mixing canonical systems & custom CSVs
SYS
SYS & RG
RG
use dirent to obtain list of systems for each regionadd systems to IncludeSys vector, DBFmine style to avoid duplicationsNeither RG nor SYS
User-specified CSV only
...Does this all make sense? Double-check...
Yeah, looks about right.