cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
structured_data.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Classes for representing generic structured data
4
5
Author: Thomas Kiley
6
7
\*******************************************************************/
8
#ifndef CPROVER_UTIL_STRUCTURED_DATA_H
9
#define CPROVER_UTIL_STRUCTURED_DATA_H
10
11
#include "
json.h
"
12
13
#include <string>
14
#include <vector>
15
16
struct
labelt
17
{
18
public
:
19
explicit
labelt
(std::vector<std::string>
components
);
20
21
std::string
camel_case
()
const
;
22
std::string
snake_case
()
const
;
23
std::string
kebab_case
()
const
;
24
std::string
pretty
()
const
;
25
26
bool
operator<
(
const
labelt
&other)
const
;
27
28
private
:
29
std::vector<std::string>
components
;
30
};
31
32
struct
structured_data_entryt
33
{
34
static
structured_data_entryt
data_node
(
const
jsont
&
data
);
35
static
structured_data_entryt
36
entry
(std::map<labelt, structured_data_entryt>
children
);
37
38
bool
is_leaf
()
const
;
39
std::string
leaf_data
()
const
;
40
jsont
leaf_object
()
const
;
41
const
std::map<labelt, structured_data_entryt> &
children
()
const
;
42
43
private
:
44
explicit
structured_data_entryt
(
jsont
data
);
45
explicit
structured_data_entryt
(
46
std::map<labelt, structured_data_entryt>
children
);
47
48
jsont
data
;
49
std::map<labelt, structured_data_entryt>
_children
;
50
};
51
73
class
structured_datat
74
{
75
public
:
76
explicit
structured_datat
(std::map<labelt, structured_data_entryt>
data
);
77
const
std::map<labelt, structured_data_entryt> &
data
()
const
;
78
79
private
:
80
std::map<labelt, structured_data_entryt>
_data
;
81
};
82
90
std::string
to_pretty
(
const
structured_datat
&);
91
92
#endif
// CPROVER_UTIL_STRUCTURED_DATA_H
jsont
Definition
json.h:27
structured_datat
A way of representing nested key/value data.
Definition
structured_data.h:74
structured_datat::data
const std::map< labelt, structured_data_entryt > & data() const
Definition
structured_data.cpp:169
structured_datat::structured_datat
structured_datat(std::map< labelt, structured_data_entryt > data)
Definition
structured_data.cpp:108
structured_datat::_data
std::map< labelt, structured_data_entryt > _data
Definition
structured_data.h:80
json.h
labelt::camel_case
std::string camel_case() const
Definition
structured_data.cpp:24
labelt::labelt
labelt(std::vector< std::string > components)
Definition
structured_data.cpp:14
labelt::kebab_case
std::string kebab_case() const
Definition
structured_data.cpp:40
labelt::components
std::vector< std::string > components
Definition
structured_data.h:29
labelt::snake_case
std::string snake_case() const
Definition
structured_data.cpp:33
labelt::pretty
std::string pretty() const
Definition
structured_data.cpp:47
labelt::operator<
bool operator<(const labelt &other) const
Definition
structured_data.cpp:59
structured_data_entryt::data_node
static structured_data_entryt data_node(const jsont &data)
Definition
structured_data.cpp:64
structured_data_entryt::leaf_data
std::string leaf_data() const
Definition
structured_data.cpp:93
structured_data_entryt::data
jsont data
Definition
structured_data.h:48
structured_data_entryt::_children
std::map< labelt, structured_data_entryt > _children
Definition
structured_data.h:49
structured_data_entryt::children
const std::map< labelt, structured_data_entryt > & children() const
Definition
structured_data.cpp:98
structured_data_entryt::leaf_object
jsont leaf_object() const
Definition
structured_data.cpp:103
structured_data_entryt::is_leaf
bool is_leaf() const
Definition
structured_data.cpp:88
structured_data_entryt::entry
static structured_data_entryt entry(std::map< labelt, structured_data_entryt > children)
Definition
structured_data.cpp:72
structured_data_entryt::structured_data_entryt
structured_data_entryt(jsont data)
Definition
structured_data.cpp:77
to_pretty
std::string to_pretty(const structured_datat &)
Convert the structured_data into plain text.
Definition
structured_data.cpp:149
util
structured_data.h
Generated by
1.17.0