Gazebo Fuel_tools

API Reference

8.1.0
gz/fuel_tools/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 
31 namespace Json
32 {
33  class Value;
34 }
35 
36 namespace gz
37 {
38  namespace fuel_tools
39  {
40  class ServerConfig;
41 
43  class GZ_FUEL_TOOLS_VISIBLE JSONParser
44  {
50  public: static ModelIdentifier ParseModel(
51  const std::string &_json,
52  const ServerConfig &_server);
53 
59  public: static WorldIdentifier ParseWorld(
60  const std::string &_json,
61  const ServerConfig &_server);
62 
68  public: static std::vector<ModelIdentifier> ParseModels(
69  const std::string &_json,
70  const ServerConfig &_server);
71 
77  public: static std::vector<WorldIdentifier> ParseWorlds(
78  const std::string &_json,
79  const ServerConfig &_server);
80 
84  public: static std::string BuildModel(ModelIter _modelIt);
85 
89  public: static std::string BuildWorld(WorldIter _worldIt);
90 
97  public: static bool ParseLicenses(const std::string &_json,
99 
104  private: static bool ParseModelImpl(
105  const Json::Value &_json, ModelIdentifier &_model);
106 
111  private: static bool ParseWorldImpl(
112  const Json::Value &_json, WorldIdentifier &_world);
113 
117  private: static std::vector<std::string> ParseTags(
118  const Json::Value &_json);
119  };
120  }
121 }
122 
123 #endif