| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "DMJsonWriter.h" | 8 #include "DMJsonWriter.h" |
| 9 | 9 |
| 10 #include "ProcStats.h" | 10 #include "ProcStats.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 Json::Value root; | 103 Json::Value root; |
| 104 const char* data = (const char*)json->data(); | 104 const char* data = (const char*)json->data(); |
| 105 if (!reader.parse(data, data+json->size(), root)) { | 105 if (!reader.parse(data, data+json->size(), root)) { |
| 106 return false; | 106 return false; |
| 107 } | 107 } |
| 108 | 108 |
| 109 const Json::Value& results = root["results"]; | 109 const Json::Value& results = root["results"]; |
| 110 BitmapResult br; | 110 BitmapResult br; |
| 111 for (unsigned i = 0; i < results.size(); i++) { | 111 for (unsigned i = 0; i < results.size(); i++) { |
| 112 const Json::Value& r = results[i]; | 112 const Json::Value& r = results[i]; |
| 113 br.name = r["key"]["name"].asCString(); | 113 br.name = r["key"]["name"].asCString(); |
| 114 br.config = r["key"]["config"].asCString(); | 114 br.config = r["key"]["config"].asCString(); |
| 115 br.sourceType = r["key"]["source_type"].asCString(); | 115 br.sourceType = r["key"]["source_type"].asCString(); |
| 116 br.sourceOptions = r["key"]["source_options"].asCString(); | 116 br.ext = r["options"]["ext"].asCString(); |
| 117 br.ext = r["options"]["ext"].asCString(); | 117 br.md5 = r["md5"].asCString(); |
| 118 br.md5 = r["md5"].asCString(); | 118 |
| 119 if (!r["key"]["source_options"].isNull()) { |
| 120 br.sourceOptions = r["key"]["source_options"].asCString(); |
| 121 } |
| 119 callback(br); | 122 callback(br); |
| 120 } | 123 } |
| 121 return true; | 124 return true; |
| 122 } | 125 } |
| 123 | 126 |
| 124 } // namespace DM | 127 } // namespace DM |
| OLD | NEW |