1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-19 01:04:20 +00:00

Added some overloads to OwnedArray to let items be added from std::unique_ptrs. Also removed OwnedArray::addIfNotAlreadyThere because it's ambiguous about whether the object should be deleted if it fails to be added!

This commit is contained in:
jules 2019-05-14 15:16:15 +01:00
parent 332a9edb57
commit 62ead7dc7d
12 changed files with 94 additions and 56 deletions

View file

@ -341,7 +341,7 @@ void LibraryModule::getConfigFlags (Project& project, OwnedArray<Project::Config
if (line.startsWith ("/**") && line.containsIgnoreCase ("Config:"))
{
std::unique_ptr<Project::ConfigFlag> config (new Project::ConfigFlag());
auto config = std::make_unique<Project::ConfigFlag>();
config->sourceModuleID = getID();
config->symbol = line.fromFirstOccurrenceOf (":", false, false).trim();
@ -361,6 +361,7 @@ void LibraryModule::getConfigFlags (Project& project, OwnedArray<Project::Config
config->value = project.getConfigFlag (config->symbol);
i += 2;
if (lines[i].contains ("#define " + config->symbol))
{
auto value = lines[i].fromFirstOccurrenceOf ("#define " + config->symbol, false, true).trim();
@ -372,7 +373,7 @@ void LibraryModule::getConfigFlags (Project& project, OwnedArray<Project::Config
if (currentValue == "enabled") config->value = true;
else if (currentValue == "disabled") config->value = false;
flags.add (config.release());
flags.add (std::move (config));
}
}
}