static void getDependencies (Project& project, const String& moduleID, StringArray& dependencies) { ModuleDescription info (project.getModules().getModuleInfo (moduleID)); if (info.isValid()) { const var depsArray (info.moduleInfo ["dependencies"]); if (const Array<var>* const deps = depsArray.getArray()) { for (int i = 0; i < deps->size(); ++i) { const var& d = deps->getReference(i); String uid (d [Ids::ID].toString()); String version (d [Ids::version].toString()); if (! dependencies.contains (uid, true)) { dependencies.add (uid); getDependencies (project, uid, dependencies); } } } } }
void LibraryModule::findAndAddCompiledCode (ProjectExporter& exporter, ProjectSaver& projectSaver, const File& localModuleFolder, Array<File>& result) const { const var compileArray (moduleInfo.moduleInfo ["compile"]); // careful to keep this alive while the array is in use! if (const Array<var>* const files = compileArray.getArray()) { for (int i = 0; i < files->size(); ++i) { const var& file = files->getReference(i); const String filename (file ["file"].toString()); if (filename.isNotEmpty() && fileShouldBeAdded (exporter, file)) { const File compiledFile (localModuleFolder.getChildFile (filename)); result.add (compiledFile); Project::Item item (projectSaver.addFileToGeneratedGroup (compiledFile)); if (file ["warnings"].toString().equalsIgnoreCase ("disabled")) item.getShouldInhibitWarningsValue() = true; if (file ["stdcall"]) item.getShouldUseStdCallValue() = true; } } } }
void LibraryModule::getLocalCompiledFiles (const File& localModuleFolder, Array<File>& result) const { const var compileArray (moduleInfo.moduleInfo ["compile"]); // careful to keep this alive while the array is in use! if (const Array<var>* const files = compileArray.getArray()) { for (int i = 0; i < files->size(); ++i) { const var& file = files->getReference(i); const String filename (file ["file"].toString()); if (filename.isNotEmpty() #if JUCE_MAC && exporterTargetMatches ("xcode", file ["target"].toString()) #elif JUCE_WINDOWS && exporterTargetMatches ("msvc", file ["target"].toString()) #elif JUCE_LINUX && exporterTargetMatches ("linux", file ["target"].toString()) #endif ) { result.add (localModuleFolder.getChildFile (filename)); } } } }
void LibraryModule::findBrowseableFiles (const File& localModuleFolder, Array<File>& filesFound) const { const var filesArray (moduleInfo.moduleInfo ["browse"]); if (const Array<var>* const files = filesArray.getArray()) for (int i = 0; i < files->size(); ++i) findWildcardMatches (localModuleFolder, files->getReference(i), filesFound); }
void BluetoothStatus::populateFromJson(const var &json) { devices.clear(); for (const auto &btDevice : *json.getArray()) { auto device = new BluetoothDevice(); device->name = btDevice["name"].toString(); device->macAddress = btDevice["mac"].toString(); device->connected = btDevice["connected"]; device->paired = btDevice["paired"]; devices.add(device); } }
Array<DrawableButton *> AppListComponent::createIconsFromJsonArray(const var &json) { Array<DrawableButton *> buttons; if (json.isArray()) { for (const auto &item : *json.getArray()) { auto name = item["name"]; auto shell = item["shell"]; auto iconPath = item["icon"]; if (name.isString() && shell.isString() && iconPath.isString()) { auto icon = createAndOwnIcon(name, iconPath, shell); if (icon) { buttons.add(icon); } } } } checkShowPageNav(); return buttons; }