Hello all,
I have a summer internship and am creating a GUI in QT to generate a configuration file for a very complicated blind deconvolution process. My job is rather easy, though.
I have created the GUI and made an event for saving the parameters in to a .txt config file. Now, though, I need to be able to load a configuration file and set all the fields and checkboxes based on the values in the file.
I need to parse it in in C++. I haven't programmed c++ in a long time.
The file looks like:
############### ############### ######
# COMMENTS
############### ############### ######
VARIABLE: VALUE
############### ############### ######
# COMMENTS 2
############### ############### ######
VARIABLE2: VALUE2
These values can be stored as chars by my program.
I basically need to store each line in a string or cstring, throw out lines with a '#' in the front, and then split the "VARIABLE:VALUE " in to two separate strings using the : as a delimiter.
Once I have the two strings, I was just thinking of doing a bunch of if statements to match the string 1 VARIABLE to the var in my gui (named the same thing) and then assign the value with string2.
I could really use some help. I'm going to call my programming buddies tonight but I should have had this done already.
Much obliged,
Bri
I have a summer internship and am creating a GUI in QT to generate a configuration file for a very complicated blind deconvolution process. My job is rather easy, though.
I have created the GUI and made an event for saving the parameters in to a .txt config file. Now, though, I need to be able to load a configuration file and set all the fields and checkboxes based on the values in the file.
I need to parse it in in C++. I haven't programmed c++ in a long time.
The file looks like:
############### ############### ######
# COMMENTS
############### ############### ######
VARIABLE: VALUE
############### ############### ######
# COMMENTS 2
############### ############### ######
VARIABLE2: VALUE2
These values can be stored as chars by my program.
I basically need to store each line in a string or cstring, throw out lines with a '#' in the front, and then split the "VARIABLE:VALUE " in to two separate strings using the : as a delimiter.
Once I have the two strings, I was just thinking of doing a bunch of if statements to match the string 1 VARIABLE to the var in my gui (named the same thing) and then assign the value with string2.
I could really use some help. I'm going to call my programming buddies tonight but I should have had this done already.
Much obliged,
Bri
Comment