Skip to content

Commit dfecf99

Browse files
authored
Merge pull request #3 from dfyockey/handle_pwa_manifests
Implement pull of icons referred to a web application manifest
2 parents 2deef63 + 0693ce5 commit dfecf99

File tree

7 files changed

+289
-19
lines changed

7 files changed

+289
-19
lines changed

Makefile.am

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@ AUTOMAKE_OPTIONS = subdir-objects
33
bin_PROGRAMS = ficonic
44

55
ficonic_SOURCES = \
6+
src/program_info.h \
67
src/Curler.cpp \
78
src/Curler.h \
89
src/main.cpp \
910
src/ficon.cpp \
1011
src/ficon.hpp \
11-
src/program_info.h \
12+
src/Parser.cpp \
13+
src/Parser.hpp \
1214
src/IconsRetriever.cpp \
1315
src/IconsRetriever.hpp \
16+
src/HtmlTagAccessor.cpp \
17+
src/HtmlTagAccessor.hpp \
1418
src/RootIconsRetriever.cpp \
1519
src/RootIconsRetriever.hpp \
1620
src/LinkIconsRetriever.cpp \
1721
src/LinkIconsRetriever.hpp \
1822
src/MetaIconsRetriever.cpp \
1923
src/MetaIconsRetriever.hpp \
20-
src/HtmlTagAccessor.cpp \
21-
src/HtmlTagAccessor.hpp
22-
24+
src/PwaIconsRetriever.cpp \
25+
src/PwaIconsRetriever.hpp
2326

2427
ficonic_CPPFLAGS = \
2528
-I/usr/include/ImageMagick-6 \

Makefile.in

Lines changed: 61 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Parser.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Parser.cpp
3+
* - Class Parser method implementation
4+
*
5+
* Copyright 2022 David Yockey
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*
19+
*/
20+
21+
#include "Parser.hpp"
22+
23+
///// public /////////////////////////////////////////////////////////
24+
25+
boost::json::value Parser::parse(std::string json) {
26+
jsonParser.reset();
27+
jsonParser.write(json);
28+
return jsonParser.release();
29+
}
30+
31+

src/Parser.hpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Parser.hpp
3+
* - Wrapper class for boost::json::parser
4+
*
5+
* Copyright 2022 David Yockey
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*
19+
*/
20+
21+
#ifndef SRC_PARSER_HPP_
22+
#define SRC_PARSER_HPP_
23+
24+
#include <string>
25+
#include <boost/json.hpp>
26+
27+
namespace bjs = boost::json;
28+
29+
class Parser {
30+
private:
31+
bjs::parser jsonParser;
32+
33+
public:
34+
bjs::value parse(std::string json);
35+
};
36+
37+
#endif /* SRC_PARSER_HPP_ */

0 commit comments

Comments
 (0)