MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetValues

Method GetValues

src/test/argsman_tests.cpp:848–869  ·  view source on GitHub ↗

Translate actions into a list of = setting strings.

Source from the content-addressed store, hash-verified

846
847 //! Translate actions into a list of <key>=<value> setting strings.
848 std::vector<std::string> GetValues(const ActionList& actions,
849 const std::string& section,
850 const std::string& name,
851 const std::string& value_prefix)
852 {
853 std::vector<std::string> values;
854 int suffix = 0;
855 for (Action action : actions) {
856 if (action == NONE) break;
857 std::string prefix;
858 if (action == SECTION_SET || action == SECTION_NEGATE) prefix = section + ".";
859 if (action == SET || action == SECTION_SET) {
860 for (int i = 0; i < 2; ++i) {
861 values.push_back(prefix + name + "=" + value_prefix + ToString(++suffix));
862 }
863 }
864 if (action == NEGATE || action == SECTION_NEGATE) {
865 values.push_back(prefix + "no" + name + "=1");
866 }
867 }
868 return values;
869 }
870};
871
872// Regression test covering different ways config settings can be merged. The

Callers

nothing calls this directly

Calls 2

ToStringFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected