Skip to content

Commit

Permalink
Update Demo Code
Browse files Browse the repository at this point in the history
  • Loading branch information
HawtStrokes committed Oct 6, 2022
1 parent fd20e3d commit 927c732
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions HawtLibDemo/HawtLibDemo/Source/Demos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,27 @@ file = "payroll.dat"
)";
ofs << iniContent;
ofs.close();
HawtLib::File::IniFile iniFile("sample.ini");
std::vector<std::string*> sectionNames = iniFile.GetSectionNames();
for (std::string* sectionName_ptr : sectionNames) {
std::cout << *sectionName_ptr << std::endl;
HawtLib::File::Section* keyValues = iniFile.GetSectionKV(*sectionName_ptr);
for (HawtLib::File::KeyValue<std::string, std::string>* kv : keyValues->keyValues) {
std::cout << "Key: " << kv->key << std::endl << "Value: " << kv->value << std::endl;
try
{
HawtLib::File::IniFile iniFile("sample.ini");

std::vector<std::string> sectionNames = iniFile.GetSectionNames();
for (std::string& sectionName_ptr : sectionNames) {
std::cout << sectionName_ptr << std::endl;
auto keyValues = iniFile.GetSectionKV(sectionName_ptr);
for (HawtLib::File::KeyValue<std::string, std::string>* kv : keyValues->keyValues) {
std::cout << "Key: " << kv->key << std::endl << "Value: " << kv->value << "[.]" << std::endl;
}
std::cout << "------------------" << std::endl;
}
std::cout << "------------------" << std::endl;

HawtLib::File::Persistence::IniSave(iniFile, "persistenceTest.ini");
}
catch (std::exception& e)
{
std::cout << e.what();
}

HawtLib::File::Persistence::IniSave(iniFile, "persistenceTest.ini");

std::cin.get();
}
Expand Down

0 comments on commit 927c732

Please sign in to comment.