If the variables and values ββcannot contain the same signs or semicolons, and you can assume that the file will always be well formed, this is trivial.
Grab everything until you reach the semicolon. Divide the line by the = sign. The first part is your variable name. The second part is the meaning.
If you have to deal with comments, string literals (which may contain = or ; ), this is NOT-TRIVIAL , and you should use boost.Spirit .
If you are wondering how to break a string, there are many questions about the topic and especially good ones: Split a string in C ++?
source share