-bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file)
-{
- wxString buf;
- buf.Printf(wxT("%d"), value);
-
- return wxWriteResource(section, entry, buf, file);
-}
-
-bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file)
-{
- static const wxChar defunkt[] = wxT("$$default");
-
- wxChar buf[1024];
- if (file != wxEmptyString)
- {
- int n = GetPrivateProfileString(section, entry, defunkt,
- buf, WXSIZEOF(buf), file);
- if (n == 0 || wxStrcmp(buf, defunkt) == 0)
- return false;
- }
- else
- {
- int n = GetProfileString(section, entry, defunkt, buf, WXSIZEOF(buf));
- if (n == 0 || wxStrcmp(buf, defunkt) == 0)
- return false;
- }
- if (*value) delete[] (*value);
- *value = wxStrcpy(new wxChar[wxStrlen(buf) + 1], buf);
- return true;
-}
-
-bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file)
-{
- wxChar *s = NULL;
- bool succ = wxGetResource(section, entry, (wxChar **)&s, file);
- if (succ)
- {
- *value = (float)wxStrtod(s, NULL);
- delete[] s;
- return true;
- }
- else return false;
-}
-
-bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file)
-{
- wxChar *s = NULL;
- bool succ = wxGetResource(section, entry, (wxChar **)&s, file);
- if (succ)
- {
- *value = wxStrtol(s, NULL, 10);
- delete[] s;
- return true;
- }
- else return false;
-}
-
-bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file)
-{
- wxChar *s = NULL;
- bool succ = wxGetResource(section, entry, (wxChar **)&s, file);
- if (succ)
- {
- *value = (int)wxStrtol(s, NULL, 10);
- delete[] s;
- return true;
- }
- else return false;
-}
-#endif // wxUSE_RESOURCES
-