| 168 | BundleManifest::BundleManifest(AnyMap const& m) : m_Headers(m) {} |
| 169 | |
| 170 | void |
| 171 | BundleManifest::Parse(std::istream& is) |
| 172 | { |
| 173 | rapidjson::IStreamWrapper jsonStream(is); |
| 174 | rapidjson::Document root; |
| 175 | if (root.ParseStream(jsonStream).HasParseError()) |
| 176 | { |
| 177 | throw std::runtime_error(rapidjson::GetParseError_En(root.GetParseError())); |
| 178 | } |
| 179 | |
| 180 | if (!root.IsObject()) |
| 181 | { |
| 182 | throw std::runtime_error("The Json root element must be an object."); |
| 183 | } |
| 184 | |
| 185 | ParseJsonObject(root, m_Headers); |
| 186 | } |
| 187 | |
| 188 | AnyMap const& |
| 189 | BundleManifest::GetHeaders() const |