Gazebo Fuel_tools

API Reference

10.0.0
JSONParser.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17
18#ifndef GZ_FUEL_TOOLS_JSONPARSER_HH_
19#define GZ_FUEL_TOOLS_JSONPARSER_HH_
20
21#include <map>
22#include <string>
23#include <utility>
24#include <vector>
25
30
31namespace Json
32{
33 class Value;
34}
35
36namespace gz::fuel_tools
37{
38 class ServerConfig;
39
41 class GZ_FUEL_TOOLS_VISIBLE JSONParser
42 {
49 const std::string &_json,
50 const ServerConfig &_server);
51
58 const std::string &_json,
59 const ServerConfig &_server);
60
67 const std::string &_json,
68 const ServerConfig &_server);
69
76 const std::string &_json,
77 const ServerConfig &_server);
78
82 public: static std::string BuildModel(ModelIter _modelIt);
83
87 public: static std::string BuildWorld(WorldIter _worldIt);
88
95 public: static bool ParseLicenses(const std::string &_json,
97
102 private: static bool ParseModelImpl(
103 const Json::Value &_json, ModelIdentifier &_model);
104
109 private: static bool ParseWorldImpl(
110 const Json::Value &_json, WorldIdentifier &_world);
111
115 private: static std::vector<std::string> ParseTags(
116 const Json::Value &_json);
117 };
118} // namespace gz::fuel_tools
119
120#endif // GZ_FUEL_TOOLS_JSONPARSER_HH_