当前位置: 首页>>代码示例>>C++>>正文


C++ ProjectSaver类代码示例

本文整理汇总了C++中ProjectSaver的典型用法代码示例。如果您正苦于以下问题:C++ ProjectSaver类的具体用法?C++ ProjectSaver怎么用?C++ ProjectSaver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ProjectSaver类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: writeIncludes

//==============================================================================
void LibraryModule::writeIncludes (ProjectSaver& projectSaver, OutputStream& out)
{
    Project& project = projectSaver.project;
    EnabledModuleList& modules = project.getModules();

    const String id (getID());
    const File localModuleFolder (project.getLocalModuleFolder (id));
    const File localHeader (getModuleHeaderFile (localModuleFolder));
    const bool usingLocalCopyOfModules = modules.shouldCopyModuleFilesLocally (id).getValue();

    if (usingLocalCopyOfModules
          && modules.shouldNotOverwriteModuleCodeOnSave (id).getValue()
          && localModuleFolder.getChildFile ("juce_module_info").exists())
    {
        projectSaver.filesCreated.add (localModuleFolder);
    }
    else
    {
        const File juceModuleFolder (moduleInfo.getFolder());

        localModuleFolder.createDirectory();

        if (usingLocalCopyOfModules)
            projectSaver.copyFolder (juceModuleFolder, localModuleFolder);
        else
            createLocalHeaderWrapper (projectSaver, getModuleHeaderFile (juceModuleFolder), localHeader);

        out << CodeHelpers::createIncludeStatement (localHeader, projectSaver.getGeneratedCodeFolder()
                                                                             .getChildFile ("AppConfig.h")) << newLine;
    }
}
开发者ID:SonicZentropy,项目名称:JUCE,代码行数:32,代码来源:jucer_Module.cpp

示例2: liveBuildSaver

void MainWindow::openPIP (PIPGenerator& generator)
{
    if (auto* window = ProjucerApplication::getApp().mainWindowList.getMainWindowForFile (generator.getJucerFile()))
    {
        if (auto* project = window->getProject())
        {
            project->setTemporaryDirectory (generator.getOutputDirectory());

            ProjectSaver liveBuildSaver (*project, project->getFile());
            liveBuildSaver.saveContentNeededForLiveBuild();

            if (auto* pcc = window->getProjectContentComponent())
            {
                pcc->invokeDirectly (CommandIDs::toggleBuildEnabled, true);
                pcc->invokeDirectly (CommandIDs::buildNow, true);
                pcc->invokeDirectly (CommandIDs::toggleContinuousBuild, true);

                auto fileToDisplay = generator.getPIPFile();

                if (fileToDisplay != File())
                {
                    pcc->showEditorForFile (fileToDisplay, true);

                    if (auto* sourceCodeEditor = dynamic_cast <SourceCodeEditor*> (pcc->getEditorComponent()))
                    {
                        sourceCodeEditor->editor->scrollToLine (findBestLineToScrollTo (StringArray::fromLines (fileToDisplay.loadFileAsString()),
                                                                                        generator.getMainClassName()));
                    }
                }

            }
        }
    }
}
开发者ID:julianstorer,项目名称:JUCE,代码行数:34,代码来源:jucer_MainWindow.cpp

示例3: updateProjectSettings

String Project::saveProject (const File& file, bool showProgressBox)
{
    updateProjectSettings();
    sanitiseConfigFlags();

    StoredSettings::getInstance()->recentFiles.addFile (file);

    ProjectSaver saver (*this, file);
    return saver.save (showProgressBox);
}
开发者ID:furio,项目名称:pyplasm,代码行数:10,代码来源:jucer_Project.cpp

示例4: updateProjectSettings

Result Project::saveProject (const File& file, bool isCommandLineApp)
{
    updateProjectSettings();
    sanitiseConfigFlags();

    if (! isCommandLineApp)
        registerRecentFile (file);

    ProjectSaver saver (*this, file);
    return saver.save (! isCommandLineApp);
}
开发者ID:lauyoume,项目名称:JUCE,代码行数:11,代码来源:jucer_Project.cpp

示例5: 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;
            }
        }
    }
}
开发者ID:Xaetrz,项目名称:AddSyn,代码行数:28,代码来源:jucer_Module.cpp

示例6: createLocalHeaderWrapper

void LibraryModule::createLocalHeaderWrapper (ProjectSaver& projectSaver, const File& originalHeader, const File& localHeader) const
{
    Project& project = projectSaver.project;

    MemoryOutputStream out;

    out << "// This is an auto-generated file to redirect any included" << newLine
        << "// module headers to the correct external folder." << newLine
        << newLine;

    StringArray paths, guards;

    for (Project::ExporterIterator exporter (project); exporter.next();)
    {
        const RelativePath headerFromProject (exporter->getModuleFolderRelativeToProject (getID(), projectSaver)
                                                .getChildFile (originalHeader.getFileName()));

        const RelativePath fileFromHere (headerFromProject.rebased (project.getProjectFolder(),
                                                                    localHeader.getParentDirectory(), RelativePath::unknown));

        paths.add (fileFromHere.toUnixStyle().quoted());
        guards.add ("defined (" + exporter->getExporterIdentifierMacro() + ")");
    }

    writeGuardedInclude (out, paths, guards);
    out << newLine;

    projectSaver.replaceFileIfDifferent (localHeader, out);
}
开发者ID:Xaetrz,项目名称:AddSyn,代码行数:29,代码来源:jucer_Module.cpp

示例7: updateProjectSettings

Result Project::saveProject (const File& file, bool isCommandLineApp)
{
    if (isSaving)
        return Result::ok();

    updateProjectSettings();
    sanitiseConfigFlags();

    if (! isCommandLineApp)
        registerRecentFile (file);

    const ScopedValueSetter<bool> vs (isSaving, true, false);

    ProjectSaver saver (*this, file);
    return saver.save (! isCommandLineApp);
}
开发者ID:balajisriram,项目名称:plugin-GUI,代码行数:16,代码来源:jucer_Project.cpp

示例8: prepareExporter

//==============================================================================
void LibraryModule::prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) const
{
    Project& project = exporter.getProject();

    exporter.addToExtraSearchPaths (exporter.getModuleFolderRelativeToProject (getID(), projectSaver).getParentDirectory());

    const String extraDefs (moduleInfo.getPreprocessorDefs().trim());

    if (extraDefs.isNotEmpty())
        exporter.getExporterPreprocessorDefs() = exporter.getExporterPreprocessorDefsString() + "\n" + extraDefs;

    {
        Array<File> compiled;

        const File localModuleFolder = project.getModules().shouldCopyModuleFilesLocally (getID()).getValue()
                                          ? projectSaver.getLocalModuleFolder (getID())
                                          : moduleInfo.getFolder();

        findAndAddCompiledCode (exporter, projectSaver, localModuleFolder, compiled);

        if (project.getModules().shouldShowAllModuleFilesInProject (getID()).getValue())
            addBrowsableCode (exporter, projectSaver, compiled, moduleInfo.getFolder());
    }

    if (isVSTPluginHost (project))
        VSTHelpers::addVSTFolderToPath (exporter, exporter.extraSearchPaths);

    if (exporter.isXcode())
    {
        if (isAUPluginHost (project))
            exporter.xcodeFrameworks.addTokens ("AudioUnit CoreAudioKit", false);

        const String frameworks (moduleInfo.moduleInfo [exporter.isOSX() ? "OSXFrameworks" : "iOSFrameworks"].toString());
        exporter.xcodeFrameworks.addTokens (frameworks, ", ", String::empty);
    }
    else if (exporter.isLinux())
    {
        const String libs (moduleInfo.moduleInfo ["LinuxLibs"].toString());
        exporter.linuxLibs.addTokens (libs, ", ", String::empty);
        exporter.linuxLibs.trim();
        exporter.linuxLibs.sort (false);
        exporter.linuxLibs.removeDuplicates (false);
    }
    else if (exporter.isCodeBlocks())
    {
        const String libs (moduleInfo.moduleInfo ["mingwLibs"].toString());
        exporter.mingwLibs.addTokens (libs, ", ", String::empty);
        exporter.mingwLibs.trim();
        exporter.mingwLibs.sort (false);
        exporter.mingwLibs.removeDuplicates (false);
    }

    if (moduleInfo.isPluginClient())
    {
        if (shouldBuildVST  (project).getValue())  VSTHelpers::prepareExporter (exporter, projectSaver);
        if (shouldBuildAU   (project).getValue())  AUHelpers::prepareExporter (exporter, projectSaver);
        if (shouldBuildAAX  (project).getValue())  AAXHelpers::prepareExporter (exporter, projectSaver);
        if (shouldBuildRTAS (project).getValue())  RTASHelpers::prepareExporter (exporter, projectSaver);
    }
}
开发者ID:daimend,项目名称:JUCE,代码行数:61,代码来源:jucer_Module.cpp

示例9: updateProjectSettings

const String Project::saveDocument (const File& file)
{
    updateProjectSettings();

    {
        // (getting these forces the values to be sanitised)
        OwnedArray <Project::JuceConfigFlag> flags;
        getJuceConfigFlags (flags);
    }

    if (FileHelpers::isJuceFolder (getLocalJuceFolder()))
        StoredSettings::getInstance()->setLastKnownJuceFolder (getLocalJuceFolder().getFullPathName());

    StoredSettings::getInstance()->recentFiles.addFile (file);

    ProjectSaver saver (*this, file);
    return saver.save();
}
开发者ID:randi2kewl,项目名称:ShoutOut,代码行数:18,代码来源:jucer_Project.cpp

示例10: writeIncludes

//==============================================================================
void LibraryModule::writeIncludes (ProjectSaver& projectSaver, OutputStream& out)
{
    const File localModuleFolder (projectSaver.getLocalModuleFolder (getID()));
    const File localHeader (getModuleHeaderFile (localModuleFolder));

    localModuleFolder.createDirectory();

    if (projectSaver.project.getModules().shouldCopyModuleFilesLocally (getID()).getValue())
    {
        projectSaver.copyFolder (moduleInfo.getFolder(), localModuleFolder);
    }
    else
    {
        localModuleFolder.createDirectory();
        createLocalHeaderWrapper (projectSaver, getModuleHeaderFile (moduleInfo.getFolder()), localHeader);
    }

    out << CodeHelpers::createIncludeStatement (localHeader, projectSaver.getGeneratedCodeFolder()
                                                                         .getChildFile ("AppConfig.h")) << newLine;
}
开发者ID:Xaetrz,项目名称:AddSyn,代码行数:21,代码来源:jucer_Module.cpp

示例11: getModuleFolderRelativeToProject

RelativePath ProjectExporter::getModuleFolderRelativeToProject (const String& moduleID, ProjectSaver& projectSaver) const
{
    if (project.getModules().shouldCopyModuleFilesLocally (moduleID).getValue())
        return RelativePath (project.getRelativePathForFile (projectSaver.getLocalModuleFolder (moduleID)),
                             RelativePath::projectFolder);

    String path (getPathForModuleString (moduleID));

    if (path.isEmpty())
        return getLegacyModulePath (moduleID).getChildFile (moduleID);

    return RelativePath (path, RelativePath::projectFolder).getChildFile (moduleID);
}
开发者ID:Theadd,项目名称:Designi,代码行数:13,代码来源:ProjectExporter.cpp

示例12: writeIncludes

//==============================================================================
void LibraryModule::writeIncludes (ProjectSaver& projectSaver, OutputStream& out)
{
    Project& project = projectSaver.project;
    EnabledModuleList& modules = project.getModules();

    const String id (getID());

    if (modules.shouldCopyModuleFilesLocally (id).getValue())
    {
        const File juceModuleFolder (moduleInfo.getFolder());

        const File localModuleFolder (project.getLocalModuleFolder (id));
        localModuleFolder.createDirectory();
        projectSaver.copyFolder (juceModuleFolder, localModuleFolder);
    }

    out << "#include <" << moduleInfo.moduleFolder.getFileName() << "/"
        << moduleInfo.getHeader().getFileName()
        << ">" << newLine;
}
开发者ID:kokoar,项目名称:JUCE,代码行数:21,代码来源:jucer_Module.cpp

示例13: saver

Result Project::saveResourcesOnly (const File& file)
{
    ProjectSaver saver (*this, file);
    return saver.saveResourcesOnly();
}
开发者ID:lauyoume,项目名称:JUCE,代码行数:5,代码来源:jucer_Project.cpp


注:本文中的ProjectSaver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。