-
Notifications
You must be signed in to change notification settings - Fork 2
scl::comment Documentation
WizardCarter edited this page Jul 21, 2018
·
3 revisions
This is the documentation page for the scl::comment class of SCL. This class serves as a small way of adding comments to a file using the generic scl::config_file::put function.
The basic constructor for a comment. Takes a string representing the comment that will be stored in the object.
The internal variable for storing the comment taken in the constructor.
using namespace scl;
//create a new config file
config_file file("example.config", config_file::WRITE);
//add some comments and values
file.put(comment("Menu Settings"));
file.put("num_options", 5);
file.put(comment("In Game Settings"));;
file.put("show_tutorial", false);
file.put("field_of_view", 90);
//write changes to the file
file.write_changes();
//and close it to save memory.
file.close();This program produces the following output in example.config:
#Menu Settings
num_options=5
#In Game Settings
show_tutorial=0
field_of_view=90