Update README.md

This commit is contained in:
2025-02-02 05:40:57 +01:00
committed by GitHub
parent e3c3b76caa
commit 3f96d049e5

View File

@@ -34,6 +34,10 @@ int main()
MiniPPFile::Section* gameSection = nullptr; MiniPPFile::Section* gameSection = nullptr;
result = root.GetSubSection("game", &gameSection); result = root.GetSubSection("game", &gameSection);
// "Easy" API
int64_t test = gameSection.GetValueOrDefault<MiniPPFile::Values::IntValue>("year", 1999);
// Verbose API
MiniPPFile::Values::StringValue* nameValue = nullptr; MiniPPFile::Values::StringValue* nameValue = nullptr;
result = gameSection->GetValue("name", &nameValue); result = gameSection->GetValue("name", &nameValue);
MiniPPFile::Values::IntValue* yearValue = nullptr; MiniPPFile::Values::IntValue* yearValue = nullptr;