| 127 | JSONParser parser; |
| 128 | |
| 129 | JSONDecoder(ceph::buffer::list& bl) { |
| 130 | if (!parser.parse(bl.c_str(), bl.length())) { |
| 131 | std::cout << "JSONDecoder::err()" << std::endl; |
| 132 | throw JSONDecoder::err("failed to parse JSON input"); |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | template<class T> |
| 137 | static bool decode_json(const char *name, T& val, JSONObj *obj, bool mandatory = false); |