void EditorConfig::SetString(const wxString& key, const wxString& value) { SimpleStringValue data; data.SetValue(value); WriteObject(key, &data); // update the cache m_cacheStringValues[key] = value; }
wxString EditorConfig::GetString(const wxString& key, const wxString& defaultValue) { // Check the cache first std::map<wxString, wxString>::iterator iter = m_cacheStringValues.find(key); if(iter != m_cacheStringValues.end()) return iter->second; SimpleStringValue data; if(!ReadObject(key, &data)) { return defaultValue; } m_cacheStringValues[key] = data.GetValue(); return data.GetValue(); }
void EditorConfig::SaveStringValue(const wxString& key, const wxString& value) { SimpleStringValue data; data.SetValue(value); WriteObject(key, &data); }
wxString EditorConfig::GetStringValue(const wxString& key) { SimpleStringValue data; ReadObject(key, &data); return data.GetValue(); }