-
Notifications
You must be signed in to change notification settings - Fork 10
/
gen_all.py
39 lines (35 loc) · 1013 Bytes
/
gen_all.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import glob
import os
import re
files = [p for p in glob.glob('**/*', root_dir='include', recursive=True)
if re.search('\.(h|hpp)$', p)]
print(
r'''// Copyright Takatoshi Kondo 2023
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#if !defined(ASYNC_MQTT_ALL_HPP)
#define ASYNC_MQTT_ALL_HPP
'''
)
for file in sorted(files, key=lambda file: (file.count('/'), file)):
if file.find("/all.hpp") != -1:
continue
if file.find("/src.hpp") != -1:
continue
if file.find("/broker/") != -1:
continue
if file.find("/impl/") != -1:
continue
if file.find("/detail/") != -1:
continue
if file.find("/predefined_layer/") != -1 and file.find("/predefined_layer/mqtt.hpp") == -1:
continue
if file.find("/picosha2.h") != -1:
continue
print("#include <{}>".format(file))
print(
r'''
#endif // ASYNC_MQTT_ALL_HPP'''
)