// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
-// ============================================================================
-// declarations
-// ============================================================================
-
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+#include <wx/confbase.h>
+
+#if wxUSE_CONFIG
+
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
-#ifndef WX_PRECOMP
- #include <wx/string.h>
- #include <wx/intl.h>
-#endif //WX_PRECOMP
-
#include <wx/app.h>
#include <wx/file.h>
#include <wx/log.h>
#include <wx/textfile.h>
-#include <wx/confbase.h>
#include <wx/utils.h>
// we must include (one of) these files for wxConfigBase::Create
const wxString& strEntry)
{
m_pContainer = (wxConfigBase *)pContainer;
- wxString strPath = strEntry.Before(wxCONFIG_PATH_SEPARATOR);
- // special case of "/keyname" when there is nothing before "/"
- if ( strPath.IsEmpty() && ((!strEntry.IsEmpty()) && strEntry[0] == wxCONFIG_PATH_SEPARATOR ))
+ // the path is everything which precedes the last slash
+ wxString strPath = strEntry.BeforeLast(wxCONFIG_PATH_SEPARATOR);
+
+ // except in the special case of "/keyname" when there is nothing before "/"
+ if ( strPath.IsEmpty() &&
+ ((!strEntry.IsEmpty()) && strEntry[0] == wxCONFIG_PATH_SEPARATOR) )
+ {
strPath = wxCONFIG_PATH_SEPARATOR;
+ }
if ( !strPath.IsEmpty() ) {
// do change the path
m_bChanged = TRUE;
- m_strName = strEntry.Right(wxCONFIG_PATH_SEPARATOR);
+ m_strName = strEntry.AfterLast(wxCONFIG_PATH_SEPARATOR);
m_strOldPath = m_pContainer->GetPath();
m_strOldPath += wxCONFIG_PATH_SEPARATOR;
m_pContainer->SetPath(strPath);
{
Bracket_None,
Bracket_Normal = ')',
- Bracket_Curly = '}',
+ Bracket_Curly = '}'
#ifdef __WXMSW__
- Bracket_Windows = '%' // yeah, Windows people are a bit strange ;-)
+ ,Bracket_Windows = '%' // yeah, Windows people are a bit strange ;-)
#endif
};
pc++;
}
}
+
+#endif
+
+ // wxUSE_CONFIG
+