Converting Lines into Records
This lesson explains the functionality of the LoadRecords function.
We'll cover the following...
LoadRecords
is a function that takes a filename as an argument, reads the contents into std::string
and then performs the conversion:
Press + to interact
[[nodiscard]] std::vector<OrderRecord> LoadRecords(const fs::path& filename){const auto content = GetFileContents(filename);const auto lines = SplitLines(content);return LinesToRecords(lines);}
We assume ...