if ( strPath.IsEmpty() )
return;
- if ( strPath[0] == APPCONF_PATH_SEPARATOR ) {
+ if ( strPath[0] == wxCONFIG_PATH_SEPARATOR ) {
// absolute path
wxSplitPath(aParts, strPath);
}
else {
// relative path, combine with current one
wxString strFullPath = GetPath();
- strFullPath << APPCONF_PATH_SEPARATOR << strPath;
+ strFullPath << wxCONFIG_PATH_SEPARATOR << strPath;
wxSplitPath(aParts, strFullPath);
}
m_strPath.Empty();
for ( uint n = 0; n < aParts.Count(); n++ ) {
strRegPath << '\\' << aParts[n];
- m_strPath << APPCONF_PATH_SEPARATOR << aParts[n];
+ m_strPath << wxCONFIG_PATH_SEPARATOR << aParts[n];
}
// change current key(s)
return bOk;
}
-uint wxRegConfig::GetNumberOfEntries() const
+uint wxRegConfig::GetNumberOfEntries(bool bRecursive) const
{
uint nEntries = 0;
// dummy vars
wxString str;
long l;
- bool bCont = GetFirstEntry(str, l);
+ bool bCont = ((wxRegConfig*)this)->GetFirstEntry(str, l);
while ( bCont ) {
nEntries++;
- bCont = GetNextEntry(str, l);
+ bCont = ((wxRegConfig*)this)->GetNextEntry(str, l);
}
return nEntries;
}
-uint wxRegConfig::GetNumberOfGroups() const
+uint wxRegConfig::GetNumberOfGroups(bool bRecursive) const
{
uint nGroups = 0;
// dummy vars
wxString str;
long l;
- bool bCont = GetFirstGroup(str, l);
+ bool bCont = ((wxRegConfig*)this)->GetFirstGroup(str, l);
while ( bCont ) {
nGroups++;
- bCont = GetNextGroup(str, l);
+ bCont = ((wxRegConfig*)this)->GetNextGroup(str, l);
}
return nGroups;
// reading/writing
// ----------------------------------------------------------------------------
-bool wxRegConfig::Read(wxString& str,
- const char *szKey,
- const char *szDefault) const
+bool wxRegConfig::Read(wxString *pStr,
+ const char *szKey,
+ const char *szDefault) const
{
PathChanger path(this, szKey);
// if immutable key exists in global key we must check that it's not
// overriden by the local key with the same name
if ( IsImmutable(path.Name()) ) {
- if ( TryGetValue(m_keyGlobal, path.Name(), str) ) {
+ if ( TryGetValue(m_keyGlobal, path.Name(), *pStr) ) {
if ( m_keyLocal.HasValue(path.Name()) ) {
wxLogWarning("User value for immutable key '%s' ignored.",
path.Name().c_str());
}
// first try local key
- if ( TryGetValue(m_keyLocal, path.Name(), str) ||
- (bQueryGlobal && TryGetValue(m_keyGlobal, path.Name(), str)) ) {
+ if ( TryGetValue(m_keyLocal, path.Name(), *pStr) ||
+ (bQueryGlobal && TryGetValue(m_keyGlobal, path.Name(), *pStr)) ) {
return TRUE;
}
+ if(IsRecordingDefaults())
+ ((wxRegConfig*)this)->Write(szKey,szDefault);
+
// default value
- str = szDefault;
+ *pStr = szDefault;
return FALSE;
}
-bool wxRegConfig::Read(long &lValue, const char *szKey, long lDefault) const
+bool wxRegConfig::Read(long *plResult, const char *szKey, long lDefault) const
{
PathChanger path(this, szKey);
// if immutable key exists in global key we must check that it's not
// overriden by the local key with the same name
if ( IsImmutable(path.Name()) ) {
- if ( TryGetValue(m_keyGlobal, path.Name(), &lValue) ) {
+ if ( TryGetValue(m_keyGlobal, path.Name(), plResult) ) {
if ( m_keyLocal.HasValue(path.Name()) ) {
wxLogWarning("User value for immutable key '%s' ignored.",
path.Name().c_str());
}
// first try local key
- if ( TryGetValue(m_keyLocal, path.Name(), &lValue) ||
- (bQueryGlobal && TryGetValue(m_keyGlobal, path.Name(), &lValue)) ) {
+ if ( TryGetValue(m_keyLocal, path.Name(), plResult) ||
+ (bQueryGlobal && TryGetValue(m_keyGlobal, path.Name(), plResult)) ) {
return TRUE;
}
// default
- lValue = lDefault;
+ *plResult = lDefault;
return FALSE;
}
return FALSE;
if ( !m_keyLocal.HasSubkeys() ) {
- wxString strKey = GetPath().Right(APPCONF_PATH_SEPARATOR);
+ wxString strKey = GetPath().Right(wxCONFIG_PATH_SEPARATOR);
SetPath(".."); // changes m_keyLocal
return m_keyLocal.DeleteKey(strKey);
}