#includeKeyValues* kv = new KeyValues( "example" ); kv->SetString( "name", "John" ); kv->SetString( "age", "25" ); const char* name = kv->GetString( "name" ); const char* age = kv->GetString( "age" );
#includeIn this example, we create a new VGUI frame and retrieve its dialog variables using the GetDialogVariables function. We then retrieve the "title" variable using the GetString function. Based on the use of "vgui_controls/Frame.h", it is likely that the "KeyValues" library is part of the Valve Game UI (VGUI) toolkit for C++.vgui::Frame* myFrame = new vgui::Frame( NULL, "example" ); KeyValues* kv = myFrame->GetDialogVariables(); const char* title = kv->GetString( "title" );