| 126 | const std::vector<unsigned int> ALL_FLAGS = AllFlags(); |
| 127 | |
| 128 | unsigned int ParseScriptFlags(const std::string& str) |
| 129 | { |
| 130 | if (str.empty()) return 0; |
| 131 | |
| 132 | unsigned int flags = 0; |
| 133 | std::vector<std::string> words; |
| 134 | boost::algorithm::split(words, str, boost::algorithm::is_any_of(",")); |
| 135 | |
| 136 | for (const std::string& word : words) { |
| 137 | auto it = FLAG_NAMES.find(word); |
| 138 | if (it == FLAG_NAMES.end()) throw std::runtime_error("Unknown verification flag " + word); |
| 139 | flags |= it->second; |
| 140 | } |
| 141 | |
| 142 | return flags; |
| 143 | } |
| 144 | |
| 145 | void Test(const std::string& str) |
| 146 | { |