| 181 | } |
| 182 | |
| 183 | static bool is_safe_filename(color_ostream & out, const std::string & name) |
| 184 | { |
| 185 | if (name.empty()) |
| 186 | { |
| 187 | out << COLOR_LIGHTRED << "Missing filename!" << std::endl; |
| 188 | return false; |
| 189 | } |
| 190 | |
| 191 | for (auto it : name) |
| 192 | { |
| 193 | if (isalnum(it)) |
| 194 | { |
| 195 | continue; |
| 196 | } |
| 197 | |
| 198 | if (it != ' ' && it != '.' && it != '-' && it != '_') |
| 199 | { |
| 200 | out << COLOR_LIGHTRED << "Invalid symbol in name: " << it << std::endl; |
| 201 | return false; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | return true; |
| 206 | } |
| 207 | |
| 208 | template<typename B> |
| 209 | static void bitfield_to_json_array(Json::Value & out, B bits) |
no test coverage detected