}
aStdKeys[] =
{
- { HKEY_CLASSES_ROOT, _T("HKEY_CLASSES_ROOT"), _T("HKCR") },
+ { HKEY_CLASSES_ROOT, wxT("HKEY_CLASSES_ROOT"), wxT("HKCR") },
#ifdef __WIN32__
- { HKEY_CURRENT_USER, _T("HKEY_CURRENT_USER"), _T("HKCU") },
- { HKEY_LOCAL_MACHINE, _T("HKEY_LOCAL_MACHINE"), _T("HKLM") },
- { HKEY_USERS, _T("HKEY_USERS"), _T("HKU") }, // short name?
- { HKEY_PERFORMANCE_DATA, _T("HKEY_PERFORMANCE_DATA"), _T("HKPD") },
+ { HKEY_CURRENT_USER, wxT("HKEY_CURRENT_USER"), wxT("HKCU") },
+ { HKEY_LOCAL_MACHINE, wxT("HKEY_LOCAL_MACHINE"), wxT("HKLM") },
+ { HKEY_USERS, wxT("HKEY_USERS"), wxT("HKU") }, // short name?
+ { HKEY_PERFORMANCE_DATA, wxT("HKEY_PERFORMANCE_DATA"), wxT("HKPD") },
#if WINVER >= 0x0400
- { HKEY_CURRENT_CONFIG, _T("HKEY_CURRENT_CONFIG"), _T("HKCC") },
+ { HKEY_CURRENT_CONFIG, wxT("HKEY_CURRENT_CONFIG"), wxT("HKCC") },
#ifndef __GNUWIN32__
- { HKEY_DYN_DATA, _T("HKEY_DYN_DATA"), _T("HKDD") }, // short name?
+ { HKEY_DYN_DATA, wxT("HKEY_DYN_DATA"), wxT("HKDD") }, // short name?
#endif //GNUWIN32
#endif //WINVER >= 4.0
#endif //WIN32
};
// the registry name separator (perhaps one day MS will change it to '/' ;-)
-#define REG_SEPARATOR _T('\\')
+#define REG_SEPARATOR wxT('\\')
// useful for Windows programmers: makes somewhat more clear all these zeroes
// being passed to Windows APIs
const wxChar *wxRegKey::GetStdKeyName(size_t key)
{
// return empty string if key is invalid
- wxCHECK_MSG( key < nStdKeys, _T(""), _T("invalid key in wxRegKey::GetStdKeyName") );
+ wxCHECK_MSG( key < nStdKeys, wxT(""), wxT("invalid key in wxRegKey::GetStdKeyName") );
return aStdKeys[key].szName;
}
const wxChar *wxRegKey::GetStdKeyShortName(size_t key)
{
// return empty string if key is invalid
- wxCHECK( key < nStdKeys, _T("") );
+ wxCHECK( key < nStdKeys, wxT("") );
return aStdKeys[key].szShortName;
}
}
if ( ui == nStdKeys ) {
- wxFAIL_MSG(_T("invalid key prefix in wxRegKey::ExtractKeyName."));
+ wxFAIL_MSG(wxT("invalid key prefix in wxRegKey::ExtractKeyName."));
hRootKey = HKEY_CLASSES_ROOT;
}
return (StdKey)ui;
}
- wxFAIL_MSG(_T("non root hkey passed to wxRegKey::GetStdKeyFromHkey."));
+ wxFAIL_MSG(wxT("non root hkey passed to wxRegKey::GetStdKeyFromHkey."));
return HKCR;
}
return str;
}
-#ifdef __GNUWIN32__
+#if defined( __GNUWIN32__ ) && !defined(wxUSE_NORLANDER_HEADERS)
bool wxRegKey::GetKeyInfo(size_t* pnSubKeys,
size_t* pnMaxKeyLen,
size_t* pnValues,
#endif // WIN16/32
}
+// returns TRUE if this key has any values
+bool wxRegKey::HasValues() const
+{
+ // suppress possible messages from GetFirstValue()
+ wxLogNull nolog;
+
+ // just call GetFirstValue with dummy parameters
+ wxString str;
+ long l;
+ return CONST_CAST GetFirstValue(str, l);
+}
+
// returns TRUE if this key has any subkeys
bool wxRegKey::HasSubkeys() const
{
else {
// check that we read the value of right type
wxASSERT_MSG( dwType == REG_DWORD,
- _T("Type mismatch in wxRegKey::QueryValue().") );
+ wxT("Type mismatch in wxRegKey::QueryValue().") );
return TRUE;
}
if ( m_dwLastError == ERROR_SUCCESS ) {
// check that it was the right type
wxASSERT_MSG( dwType == REG_SZ,
- _T("Type mismatch in wxRegKey::QueryValue().") );
+ wxT("Type mismatch in wxRegKey::QueryValue().") );
return TRUE;
}
wxChar szValueName[1024]; // @@ use RegQueryInfoKey...
DWORD dwValueLen = WXSIZEOF(szValueName);
- lIndex++;
- m_dwLastError = RegEnumValue((HKEY) m_hKey, lIndex,
+ m_dwLastError = RegEnumValue((HKEY) m_hKey, lIndex++,
szValueName, &dwValueLen,
RESERVED,
NULL, // [out] type
static wxString s_str;
s_str = pKey->GetName();
if ( !wxIsEmpty(szValue) )
- s_str << _T("\\") << szValue;
+ s_str << wxT("\\") << szValue;
return s_str.c_str();
}