added wxFileConfig::Save(stream); documented it in new, separate from wxConfig, wxFileConfig doc file (replaces patches 902372 and 900889)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-10-03 22:55:08 +00:00
parent e1cc687422
commit a121d72052
6 changed files with 160 additions and 15 deletions

View File

@@ -994,6 +994,30 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */)
return true;
}
#if wxUSE_STREAMS
bool wxFileConfig::Save(wxOutputStream& os, wxMBConv& conv)
{
// save unconditionally, even if not dirty
for ( wxFileConfigLineList *p = m_linesHead; p != NULL; p = p->Next() )
{
wxString line = p->Text();
line += wxTextFile::GetEOL();
if ( !os.Write(line.mb_str(conv), line.length()) )
{
wxLogError(_("Error saving user configuration data."));
return false;
}
}
ResetDirty();
return true;
}
#endif // wxUSE_STREAMS
// ----------------------------------------------------------------------------
// renaming groups/entries
// ----------------------------------------------------------------------------