예제 #1
0
    bool statistics(std::map<std::string, ValueRef::ValueRefBase<double>*>& stats_) {
        bool result = true;

        for (const boost::filesystem::path& file : ListScripts("scripting/empire_statistics")) {
            result &= detail::parse_file<rules, std::map<std::string, ValueRef::ValueRefBase<double>*> >(file, stats_);
        }

        return result;
    }
예제 #2
0
    bool ship_parts(std::map<std::string, PartType*>& parts) {
        bool result = true;

        for(const boost::filesystem::path& file : ListScripts("scripting/ship_parts")) {
            result &= detail::parse_file<rules, std::map<std::string, PartType*>>(file, parts);
        }

        return result;
    }
예제 #3
0
    start_rule_payload ship_hulls(const boost::filesystem::path& path) {
        const lexer lexer;
        start_rule_payload hulls;

        for (const boost::filesystem::path& file : ListScripts(path)) {
            /*auto success =*/ detail::parse_file<grammar, start_rule_payload>(lexer, file, hulls);
        }

        return hulls;
    }
    bool ship_hulls(std::map<std::string, HullType*>& hulls) {
        bool result = true;

        std::vector<boost::filesystem::path> file_list = ListScripts("scripting/ship_hulls");

        for (std::vector<boost::filesystem::path>::iterator file_it = file_list.begin();
             file_it != file_list.end(); ++file_it)
        {
            result &= detail::parse_file<rules, std::map<std::string, HullType*> >(*file_it, hulls);
        }

        return result;
    }
    bool specials(std::map<std::string, Special*>& specials_) {
        bool result = true;

        std::vector<boost::filesystem::path> file_list = ListScripts("scripting/specials");

        for (std::vector<boost::filesystem::path>::iterator file_it = file_list.begin();
             file_it != file_list.end(); ++file_it)
        {
            result &= detail::parse_file<rules, std::map<std::string, Special*> >(*file_it, specials_);
        }

        return result;
    }
예제 #6
0
    bool statistics(std::map<std::string, ValueRef::ValueRefBase<double>*>& stats_) {
        bool result = true;

        std::vector<boost::filesystem::path> file_list = ListScripts("scripting/empire_statistics");

        for (std::vector<boost::filesystem::path>::iterator file_it = file_list.begin();
             file_it != file_list.end(); ++file_it)
        {
            result &= detail::parse_file<rules, std::map<std::string, ValueRef::ValueRefBase<double>*> >(*file_it, stats_);
        }

        return result;
    }
예제 #7
0
    start_rule_payload statistics(const boost::filesystem::path& path) {
        const lexer lexer;
        start_rule_payload all_stats;

        for (const boost::filesystem::path& file : ListScripts(path)) {
            start_rule_payload stats_;
            if (/*auto success =*/ detail::parse_file<grammar, start_rule_payload>(lexer, file, stats_)) {
                for (auto&& stat : stats_) {
                    auto maybe_inserted = all_stats.emplace(stat.first, std::move(stat.second));
                    if (!maybe_inserted.second) {
                        WarnLogger() << "Addition of second statistic with name " << maybe_inserted.first->first
                                     << " failed.  Keeping first statistic found.";
                    }
                }
            }
        }

        return all_stats;
    }
예제 #8
0
파일: fsstorage.c 프로젝트: jsharma44/vlc
static int List( addons_finder_t *p_finder )
{
    addon_type_t types[] = {
        ADDON_EXTENSION,
        ADDON_PLAYLIST_PARSER,
        ADDON_SERVICE_DISCOVERY
    };
    unsigned int i_type = 0;

    LoadCatalog( p_finder );

    /* Browse dirs to find rogue files */
    while( i_type < ARRAY_SIZE( types ) )
    {
        ListScripts( p_finder, types[i_type++] );
    }
    ListSkins( p_finder );

    return VLC_SUCCESS;
}