- wxString app = wxT("wxConfigTestCaseRD");
- wxString vendor = wxT("wxWidgets");
- wxConfig *config = new wxConfig(app, vendor, wxT(""), wxT(""),
- wxCONFIG_USE_LOCAL_FILE);
- config->DeleteAll();
- config->SetRecordDefaults(false); // by default it is false
- wxString string1, string2, string3, string4;
- string1 = config->Read(wxT("string1"), wxT("abc"));
- string2 = config->Read(wxT("string2"), wxString(wxT("def")));
- config->Read(wxT("string3"), &string3, wxT("abc"));
- config->Read(wxT("string4"), &string4, wxString(wxT("def")));
- int int1, int2;
- config->Read(wxT("int1"), &int1, 123);
- int2 = config->Read(wxT("int2"), 1234);
- long long1;
- config->Read(wxString(wxT("long1")), &long1, 234L);
- double double1;
- config->Read(wxT("double1"), &double1, 345.67);
- bool bool1;
- config->Read(wxT("bool1"), &bool1, true);
- wxColour color1;
- config->Read(wxT("color1"), &color1, wxColour(11,22,33,44));
-
- CPPUNIT_ASSERT ( config->GetNumberOfEntries() == 0 );
-
- config->SetRecordDefaults(true);
-