#pragma implementation "fileconf.h"
#endif
-// ============================================================================
-// declarations
-// ============================================================================
-
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/wxprec.h"
+#include "wx/fileconf.h"
+
+#ifdef wxUSE_CONFIG
+
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
#ifndef WX_PRECOMP
- #include "wx/string.h"
- #include "wx/intl.h"
+ #include "wx/wx.h"
#endif //WX_PRECOMP
#include "wx/app.h"
#include "wx/log.h"
#include "wx/textfile.h"
#include "wx/config.h"
-#include "wx/fileconf.h"
#include "wx/utils.h" // for wxGetHomeDir
strDir = "/etc/";
#elif defined(__WXSTUBS__)
wxASSERT_MSG( FALSE, "TODO" ) ;
+ #elif defined(__WXMAC__)
+ wxASSERT_MSG( FALSE, "TODO" ) ;
#else // Windows
char szWinDir[MAX_PATH];
::GetWindowsDirectory(szWinDir, MAX_PATH);
wxString wxFileConfig::GetLocalDir()
{
wxString strDir;
-
+
wxGetHomeDir(&strDir);
+#ifdef __UNIX__
+ if (strDir.Last() != '/') strDir << '/';
+#else
+ if (strDir.Last() != '\\') strDir << '\\';
+#endif
+
return strDir;
}
bool wxFileConfig::Write(const wxString& key, long lValue)
{
// ltoa() is not ANSI :-(
- char szBuf[40]; // should be good for sizeof(long) <= 16 (128 bits)
- sprintf(szBuf, "%ld", lValue);
- return Write(key, szBuf);
+ wxString buf;
+ buf.Printf("%ld", lValue);
+ return Write(key, buf);
}
bool wxFileConfig::Flush(bool /* bCurrentOnly */)
// last entry?
if ( pNext == NULL )
m_linesTail = pPrev;
- else
+ else
pNext->SetPrev(pPrev);
delete pLine;
{
if(str.IsEmpty())
return str;
-
+
wxString strResult;
strResult.Alloc(str.Len());
return strResult;
}
+
+#endif
+
+ // wxUSE_CONFIG