本文整理汇总了C++中var::getArray方法的典型用法代码示例。如果您正苦于以下问题:C++ var::getArray方法的具体用法?C++ var::getArray怎么用?C++ var::getArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类var
的用法示例。
在下文中一共展示了var::getArray方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getDependencies
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);
}
}
}
}
}
示例2: findAndAddCompiledCode
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;
}
}
}
}
示例3: getLocalCompiledFiles
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));
}
}
}
}
示例4: findBrowseableFiles
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);
}
示例5: populateFromJson
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);
}
}
示例6: createAndOwnIcon
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;
}