1) Not sure why you check for ";" in ParseLine, but you would need to check for the 2nd "|", e.g.
size_t pos = line.find("|");
if (pos != std::string::npos)
{
size_t pos1 = line.find("|", pos + 1);
value = line.substr(pos + 1, pos1 - pos - 1);
}
2) The easiest solution to the student name is to produce similar logic as the university value, e.g.
size_t pos = line.find("student ");
if (pos != std::string::npos)
{
size_t pos1 = line.find(" ", pos + 8);
key = line.substr(pos + 8, pos1 - pos - 8);
}
Following this would then simply have the following in the main function:
if (ParseLine(line, key, value))
{
obj.data.name = key;
obj.data.content = value;
}
(You should probably create a function inside the if statement to validate the key and/or value to ensure they are acceptable values)