Gazebo Fuel_tools
API Reference
9.1.0
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
src
gz-fuel-tools
include
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
26
#include "
gz/fuel_tools/ModelIdentifier.hh
"
27
#include "
gz/fuel_tools/ModelIter.hh
"
28
#include "
gz/fuel_tools/WorldIdentifier.hh
"
29
#include "
gz/fuel_tools/WorldIter.hh
"
30
31
namespace
Json
32
{
33
class
Value;
34
}
35
36
namespace
gz::fuel_tools
37
{
38
class
ServerConfig;
39
41
class
GZ_FUEL_TOOLS_VISIBLE
JSONParser
42
{
48
public
:
static
ModelIdentifier
ParseModel
(
49
const
std::string
&_json,
50
const
ServerConfig
&_server);
51
57
public
:
static
WorldIdentifier
ParseWorld
(
58
const
std::string
&_json,
59
const
ServerConfig
&_server);
60
66
public
:
static
std::vector<ModelIdentifier>
ParseModels
(
67
const
std::string
&_json,
68
const
ServerConfig
&_server);
69
75
public
:
static
std::vector<WorldIdentifier>
ParseWorlds
(
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,
96
std::map<std::string, unsigned int>
&_licenses);
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_