| 2009 | } |
| 2010 | |
| 2011 | Param TOPPBase::getDefaultParameters_() const |
| 2012 | { |
| 2013 | Param tmp; |
| 2014 | String loc = this->getToolPrefix(); |
| 2015 | //parameters |
| 2016 | for (vector<ParameterInformation>::const_iterator it = parameters_.begin(); it != parameters_.end(); ++it) |
| 2017 | { |
| 2018 | if (it->name == "ini" || it->name == "-help" || it->name == "-helphelp" || it->name == "instance" || it->name == "write_ini" || it->name == "write_ctd") // do not store those params in ini file |
| 2019 | { |
| 2020 | continue; |
| 2021 | } |
| 2022 | String name = loc + it->name; |
| 2023 | std::vector<std::string> tags; |
| 2024 | if (it->advanced) |
| 2025 | { |
| 2026 | tags.emplace_back("advanced"); |
| 2027 | } |
| 2028 | if (it->required) |
| 2029 | { |
| 2030 | tags.emplace_back("required"); |
| 2031 | } |
| 2032 | |
| 2033 | if (it->type == ParameterInformation::INPUT_FILE || it->type == ParameterInformation::INPUT_FILE_LIST) |
| 2034 | { |
| 2035 | tags.emplace_back("input file"); |
| 2036 | } |
| 2037 | |
| 2038 | if (it->type == ParameterInformation::INPUT_FILE && std::find(it->tags.begin(), it->tags.end(), "is_executable") != it->tags.end()) |
| 2039 | { |
| 2040 | tags.emplace_back("is_executable"); |
| 2041 | } |
| 2042 | |
| 2043 | if (it->type == ParameterInformation::OUTPUT_FILE || it->type == ParameterInformation::OUTPUT_FILE_LIST) |
| 2044 | { |
| 2045 | tags.emplace_back("output file"); |
| 2046 | } |
| 2047 | |
| 2048 | if (it->type == ParameterInformation::OUTPUT_PREFIX) |
| 2049 | { |
| 2050 | tags.emplace_back("output prefix"); |
| 2051 | } |
| 2052 | |
| 2053 | switch (it->type) |
| 2054 | { |
| 2055 | case ParameterInformation::STRING: |
| 2056 | tmp.setValue(name, (String)it->default_value.toString(), it->description, tags); |
| 2057 | if (!it->valid_strings.empty()) |
| 2058 | { |
| 2059 | tmp.setValidStrings(name, ListUtils::create<std::string>(it->valid_strings)); |
| 2060 | } |
| 2061 | break; |
| 2062 | |
| 2063 | case ParameterInformation::INPUT_FILE: |
| 2064 | case ParameterInformation::OUTPUT_FILE: |
| 2065 | case ParameterInformation::OUTPUT_PREFIX: |
| 2066 | tmp.setValue(name, (String)it->default_value.toString(), it->description, tags); |
| 2067 | if (!it->valid_strings.empty()) |
| 2068 | { |
no test coverage detected