libyui-rest-api
 
Loading...
Searching...
No Matches
YJsonSerializer.h
1/*
2 Copyright (C) 2017 SUSE LLC
3
4 This library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of the
7 License, or (at your option) version 3.0 of the License. This library
8 is distributed in the hope that it will be useful, but WITHOUT ANY
9 WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
11 License for more details. You should have received a copy of the GNU
12 Lesser General Public License along with this library; if not, write
13 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
14 Floor, Boston, MA 02110-1301 USA
15*/
16
17#ifndef YJsonSerializer_h
18#define YJsonSerializer_h
19
20#include <iostream>
21#include <vector>
22
23class YWidget;
24
25namespace Json {
26 class Value;
27}
28
30{
31
32public:
33
34 // serialize one widget (by default recursively with all children)
35 static void serialize(YWidget *, std::ostream &output, bool recursive = true);
36
37 // serialize widget array (by default recursively with all children)
38 static void serialize(const std::vector<YWidget*> &widgets, std::ostream &output, bool recursive = true);
39
40 // save the JSON value as a text into the output stream
41 static void save(const Json::Value &json, std::ostream &output);
42};
43
44#endif // YJsonSerializer_h
Definition YJsonSerializer.h:30