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


C++ Plugin::Version方法代码示例

本文整理汇总了C++中Plugin::Version方法的典型用法代码示例。如果您正苦于以下问题:C++ Plugin::Version方法的具体用法?C++ Plugin::Version怎么用?C++ Plugin::Version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Plugin的用法示例。


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

示例1:

 Version::Version(const Plugin& plugin) {
     verString = plugin.Version();
 }
开发者ID:CJBrew,项目名称:loot,代码行数:3,代码来源:helpers.cpp

示例2: WritePlugin

    void WritePlugin(YAML::Emitter& out, const Plugin& plugin, const Game& game) {
        out << YAML::BeginMap;

        out << YAML::Key << "name"
            << YAML::Value << plugin.Name();

        out << YAML::Key << "isActive";
        if (game.IsActive(plugin.Name()))
            out << YAML::Value << true;
        else
            out << YAML::Value << false;

        if (plugin.Crc() != 0) {
            out << YAML::Key << "crc"
                << YAML::Value << IntToHexString(plugin.Crc());
        }

        if (!plugin.Version().empty()) {
            out << YAML::Key << "version"
                << YAML::Value << boost::locale::translate("Version").str() + ": " + plugin.Version();
        }

        std::set<Tag> tags = plugin.Tags();
        std::set<Tag> tagsAdd, tagsRemove;
        if (!tags.empty()) {
            for (std::set<Tag>::const_iterator it = tags.begin(), endit = tags.end(); it != endit; ++it) {
                if (it->IsAddition())
                    tagsAdd.insert(*it);
                else
                    tagsRemove.insert(*it);
            }
            if (!tagsAdd.empty()) {
                out << YAML::Key << "tagsAdd"
                    << YAML::Value << tagsAdd;
            }
            if (!tagsRemove.empty()) {
                out << YAML::Key << "tagsRemove"
                    << YAML::Value << tagsRemove;
            }
        }

        std::list<Message> messages = plugin.Messages();
        std::set<PluginDirtyInfo> dirtyInfo = plugin.DirtyInfo();
        for (std::set<PluginDirtyInfo>::const_iterator it = dirtyInfo.begin(), endit = dirtyInfo.end(); it != endit; ++it) {
            boost::format f;
            if (it->ITMs() > 0 && it->UDRs() > 0 && it->DeletedNavmeshes() > 0)
                f = boost::format(boost::locale::translate("Contains %1% ITM records, %2% UDR records and %3% deleted navmeshes. Clean with %4%.")) % it->ITMs() % it->UDRs() % it->DeletedNavmeshes() % it->CleaningUtility();
            else if (it->ITMs() == 0 && it->UDRs() == 0 && it->DeletedNavmeshes() == 0)
                f = boost::format(boost::locale::translate("Clean with %1%.")) % it->CleaningUtility();


            else if (it->ITMs() == 0 && it->UDRs() > 0 && it->DeletedNavmeshes() > 0)
                f = boost::format(boost::locale::translate("Contains %1% UDR records and %2% deleted navmeshes. Clean with %3%.")) % it->UDRs() % it->DeletedNavmeshes() % it->CleaningUtility();
            else if (it->ITMs() == 0 && it->UDRs() == 0 && it->DeletedNavmeshes() > 0)
                f = boost::format(boost::locale::translate("Contains %1% deleted navmeshes. Clean with %2%.")) % it->DeletedNavmeshes() % it->CleaningUtility();
            else if (it->ITMs() == 0 && it->UDRs() > 0 && it->DeletedNavmeshes() == 0)
                f = boost::format(boost::locale::translate("Contains %1% UDR records. Clean with %2%.")) % it->UDRs() % it->CleaningUtility();

            else if (it->ITMs() > 0 && it->UDRs() == 0 && it->DeletedNavmeshes() > 0)
                f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% deleted navmeshes. Clean with %3%.")) % it->ITMs() % it->DeletedNavmeshes() % it->CleaningUtility();
            else if (it->ITMs() > 0 && it->UDRs() == 0 && it->DeletedNavmeshes() == 0)
                f = boost::format(boost::locale::translate("Contains %1% ITM records. Clean with %2%.")) % it->ITMs() % it->CleaningUtility();

            else if (it->ITMs() > 0 && it->UDRs() > 0 && it->DeletedNavmeshes() == 0)
                f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% UDR records. Clean with %3%.")) % it->ITMs() % it->UDRs() % it->CleaningUtility();

            messages.push_back(loot::Message(loot::Message::warn, f.str()));
        }

        if (!messages.empty()) {
            out << YAML::Key << "messages"
                << YAML::Value << YAML::BeginSeq;
            for (std::list<Message>::const_iterator it = messages.begin(), endit = messages.end(); it != endit; ++it) {
                WriteMessage(out, *it);
            }
            out << YAML::EndSeq;
        }

        out << YAML::EndMap;
    }
开发者ID:dbb,项目名称:loot,代码行数:80,代码来源:generators.cpp


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