wxString wxFileConfig::GetLocalDir()
{
wxString strDir;
-
+
wxGetHomeDir(&strDir);
- if (strDir.Last() != '/' && strDir.Last() != '\\')
- 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());