| 206 | } |
| 207 | |
| 208 | byte toByte(json_spirit::mValue const& _v) |
| 209 | { |
| 210 | switch (_v.type()) |
| 211 | { |
| 212 | case json_spirit::str_type: return (byte)stoi(_v.get_str()); |
| 213 | case json_spirit::int_type: return (byte)_v.get_uint64(); |
| 214 | case json_spirit::bool_type: return (byte)_v.get_bool(); |
| 215 | case json_spirit::real_type: return (byte)_v.get_real(); |
| 216 | default: cwarn << "Bad type for scalar: " << _v.type(); |
| 217 | } |
| 218 | return 0; |
| 219 | } |
| 220 | |
| 221 | bytes importByteArray(std::string const& _str) |
| 222 | { |
no test coverage detected