mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-17 00:44:19 +00:00
Added WindowsRegistry::keyExists() methods
This commit is contained in:
parent
30cc1ed757
commit
c3e082b252
3 changed files with 32 additions and 13 deletions
|
|
@ -1014,22 +1014,20 @@ private:
|
|||
|
||||
return addGroup (projectItem, childIDs);
|
||||
}
|
||||
else
|
||||
|
||||
if (projectItem.shouldBeAddedToTargetProject())
|
||||
{
|
||||
if (projectItem.shouldBeAddedToTargetProject())
|
||||
{
|
||||
const String itemPath (projectItem.getFilePath());
|
||||
RelativePath path;
|
||||
const String itemPath (projectItem.getFilePath());
|
||||
RelativePath path;
|
||||
|
||||
if (itemPath.startsWith ("${"))
|
||||
path = RelativePath (itemPath, RelativePath::unknown);
|
||||
else
|
||||
path = RelativePath (projectItem.getFile(), getTargetFolder(), RelativePath::buildTargetFolder);
|
||||
if (itemPath.startsWith ("${"))
|
||||
path = RelativePath (itemPath, RelativePath::unknown);
|
||||
else
|
||||
path = RelativePath (projectItem.getFile(), getTargetFolder(), RelativePath::buildTargetFolder);
|
||||
|
||||
return addFile (path, projectItem.shouldBeCompiled(),
|
||||
projectItem.shouldBeAddedToBinaryResources(),
|
||||
projectItem.shouldInhibitWarnings());
|
||||
}
|
||||
return addFile (path, projectItem.shouldBeCompiled(),
|
||||
projectItem.shouldBeAddedToBinaryResources(),
|
||||
projectItem.shouldInhibitWarnings());
|
||||
}
|
||||
|
||||
return String::empty;
|
||||
|
|
|
|||
|
|
@ -86,6 +86,12 @@ public:
|
|||
/** Returns true if the given value exists in the registry. */
|
||||
static bool valueExistsWow64 (const String& regValuePath);
|
||||
|
||||
/** Returns true if the given key exists in the registry. */
|
||||
static bool keyExists (const String& regValuePath);
|
||||
|
||||
/** Returns true if the given key exists in the registry. */
|
||||
static bool keyExistsWow64 (const String& regValuePath);
|
||||
|
||||
/** Deletes a registry value. */
|
||||
static void deleteValue (const String& regValuePath);
|
||||
|
||||
|
|
|
|||
|
|
@ -115,6 +115,11 @@ struct RegistryKeyWrapper
|
|||
return defaultValue;
|
||||
}
|
||||
|
||||
static bool keyExists (const String& regValuePath, const DWORD wow64Flags)
|
||||
{
|
||||
return RegistryKeyWrapper (regValuePath, false, wow64Flags).key != 0;
|
||||
}
|
||||
|
||||
static bool valueExists (const String& regValuePath, const DWORD wow64Flags)
|
||||
{
|
||||
const RegistryKeyWrapper key (regValuePath, false, wow64Flags);
|
||||
|
|
@ -159,6 +164,11 @@ bool WindowsRegistry::valueExistsWow64 (const String& regValuePath)
|
|||
return RegistryKeyWrapper::valueExists (regValuePath, 0x100 /*KEY_WOW64_64KEY*/);
|
||||
}
|
||||
|
||||
bool WindowsRegistry::keyExistsWow64 (const String& regValuePath)
|
||||
{
|
||||
return RegistryKeyWrapper::keyExists (regValuePath, 0x100 /*KEY_WOW64_64KEY*/);
|
||||
}
|
||||
|
||||
bool WindowsRegistry::setValue (const String& regValuePath, const String& value)
|
||||
{
|
||||
return RegistryKeyWrapper::setValue (regValuePath, REG_SZ, value.toWideCharPointer(),
|
||||
|
|
@ -185,6 +195,11 @@ bool WindowsRegistry::valueExists (const String& regValuePath)
|
|||
return RegistryKeyWrapper::valueExists (regValuePath, 0);
|
||||
}
|
||||
|
||||
bool WindowsRegistry::keyExists (const String& regValuePath)
|
||||
{
|
||||
return RegistryKeyWrapper::keyExists (regValuePath, 0);
|
||||
}
|
||||
|
||||
void WindowsRegistry::deleteValue (const String& regValuePath)
|
||||
{
|
||||
const RegistryKeyWrapper key (regValuePath, true, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue