Browse Source

Added WindowsRegistry::keyExists() methods

tags/2021-05-28
jules 12 years ago
parent
commit
c3e082b252
3 changed files with 32 additions and 13 deletions
  1. +11
    -13
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h
  2. +6
    -0
      modules/juce_core/misc/juce_WindowsRegistry.h
  3. +15
    -0
      modules/juce_core/native/juce_win32_Registry.cpp

+ 11
- 13
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h View File

@@ -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;


+ 6
- 0
modules/juce_core/misc/juce_WindowsRegistry.h View File

@@ -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);


+ 15
- 0
modules/juce_core/native/juce_win32_Registry.cpp View File

@@ -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…
Cancel
Save