Compare commits
1578 Commits
v4.28.2
...
feat/githu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02961e60e9 | ||
|
|
312e0296bd | ||
|
|
0a6e7c794b | ||
|
|
c60d5544e9 | ||
|
|
d52b1e13ec | ||
|
|
05668443fc | ||
|
|
b495a16a0a | ||
|
|
c6fa1a7258 | ||
|
|
c3bb7c8d17 | ||
|
|
530e32f1a1 | ||
|
|
d8f364aa58 | ||
|
|
40f33fd2f2 | ||
|
|
c632054716 | ||
|
|
38c1f77326 | ||
|
|
f74004d954 | ||
|
|
7eaf4f2de3 | ||
|
|
73458d38ca | ||
|
|
e6eef5a03d | ||
|
|
e20f429ae4 | ||
|
|
434d05bcd9 | ||
|
|
1ea5104aee | ||
|
|
e18a46acfa | ||
|
|
fcf25b2a2a | ||
|
|
624cef1e8c | ||
|
|
9b7f1e36e0 | ||
|
|
6963037ba0 | ||
|
|
2642053096 | ||
|
|
1da98683f3 | ||
|
|
ed4c7c0a04 | ||
|
|
05870cc6c7 | ||
|
|
7a66c5315d | ||
|
|
68e56325b6 | ||
|
|
140db8e274 | ||
|
|
8c3643b691 | ||
|
|
cef5797419 | ||
|
|
8535c53289 | ||
|
|
aa032b5790 | ||
|
|
b49a495f78 | ||
|
|
970e45209a | ||
|
|
edbf4aefda | ||
|
|
87ea4fe357 | ||
|
|
694572694d | ||
|
|
8b90bd7968 | ||
|
|
22221cce21 | ||
|
|
f93f7979e1 | ||
|
|
b3d991070e | ||
|
|
df9791e5d9 | ||
|
|
4921fb7558 | ||
|
|
dadbfd92d0 | ||
|
|
25e9e0d745 | ||
|
|
44a0b20c49 | ||
|
|
7d8cb51689 | ||
|
|
f10eb36229 | ||
|
|
5a303d9c34 | ||
|
|
4473a45e63 | ||
|
|
48f9188fb4 | ||
|
|
f761605bfc | ||
|
|
2ba2db3c5a | ||
|
|
ff8ba97918 | ||
|
|
17f01726b4 | ||
|
|
1b8911f550 | ||
|
|
9f5e502d42 | ||
|
|
1f49d6363d | ||
|
|
1e55c956b7 | ||
|
|
e97b54173b | ||
|
|
496af0800f | ||
|
|
34d0a637cf | ||
|
|
43c5306ba4 | ||
|
|
718de46ac7 | ||
|
|
b8df114b73 | ||
|
|
fb560915d5 | ||
|
|
994be62578 | ||
|
|
41a87e3806 | ||
|
|
78545b8dfe | ||
|
|
e7bff44fe1 | ||
|
|
a530b93b5f | ||
|
|
fd9c0d3f6e | ||
|
|
e4e22d3c51 | ||
|
|
a50c00ea8f | ||
|
|
a0608eb314 | ||
|
|
a340d515ad | ||
|
|
7891ba2c8d | ||
|
|
6c61e42d9b | ||
|
|
11cc3b04b9 | ||
|
|
6b63576798 | ||
|
|
c2f71bd49b | ||
|
|
7071432e6c | ||
|
|
c6a9378dbf | ||
|
|
57fbe81be1 | ||
|
|
b6ba67b2b8 | ||
|
|
20b6cea436 | ||
|
|
e3d1359626 | ||
|
|
4b7cc9dc1e | ||
|
|
b2d06dd24d | ||
|
|
002bf0ab02 | ||
|
|
2baf567120 | ||
|
|
44aa11eccc | ||
|
|
3c50d37ddd | ||
|
|
860bd8f155 | ||
|
|
89213dfbff | ||
|
|
265c1b4ffe | ||
|
|
112db812fb | ||
|
|
aec6c0c070 | ||
|
|
ad6ba8f81c | ||
|
|
f20c839af5 | ||
|
|
0aae618a29 | ||
|
|
2bc9796c0c | ||
|
|
37aff29443 | ||
|
|
bc14fcb0dd | ||
|
|
3f858de1f3 | ||
|
|
a624ffc461 | ||
|
|
a0c90d4d8d | ||
|
|
b4c8112322 | ||
|
|
b59fdc8db8 | ||
|
|
f6f458a660 | ||
|
|
9ad82247db | ||
|
|
ef09a3ef12 | ||
|
|
fa7f04c55b | ||
|
|
5252f67faf | ||
|
|
01ffe4886e | ||
|
|
5bce745838 | ||
|
|
6b0e1ef9ac | ||
|
|
4ff0343916 | ||
|
|
ec7720e3d0 | ||
|
|
37a8e5b0d9 | ||
|
|
8bfb223dac | ||
|
|
adf18f00af | ||
|
|
6d72bb6e24 | ||
|
|
07669bc806 | ||
|
|
a586c526a0 | ||
|
|
5e66b9bfc8 | ||
|
|
c587b11904 | ||
|
|
550353f9f9 | ||
|
|
ce00d41141 | ||
|
|
973582a52e | ||
|
|
a36c8f7644 | ||
|
|
b7561c5b17 | ||
|
|
b5cf46ddd0 | ||
|
|
e295c1a830 | ||
|
|
5003df7cf8 | ||
|
|
35e1af29cd | ||
|
|
357353e23c | ||
|
|
fbd42db377 | ||
|
|
80c1b50254 | ||
|
|
3e3aad1569 | ||
|
|
3a18ab2970 | ||
|
|
0d8c150c21 | ||
|
|
55a6c41216 | ||
|
|
a4a8bf644d | ||
|
|
f4cc72a44b | ||
|
|
114bd8d2d0 | ||
|
|
d04838b846 | ||
|
|
063c8d54ef | ||
|
|
f815d850e6 | ||
|
|
b5eb2a004f | ||
|
|
fa51662273 | ||
|
|
ab484ffdc4 | ||
|
|
3efe3cc698 | ||
|
|
9f242800e8 | ||
|
|
c170147162 | ||
|
|
9eaa4a4afa | ||
|
|
14e546b4c3 | ||
|
|
4ae002e1bb | ||
|
|
8cc725f3e8 | ||
|
|
718d2d07fa | ||
|
|
f5dea882d0 | ||
|
|
98ecb301b4 | ||
|
|
54dcd2736a | ||
|
|
d2e5001e7e | ||
|
|
d6572b2c7e | ||
|
|
3e5b6dd4fb | ||
|
|
ccfcbd830d | ||
|
|
895a22fcfe | ||
|
|
ff41a13170 | ||
|
|
c9744cb5f0 | ||
|
|
d1a60aa1bb | ||
|
|
d1b581a3f5 | ||
|
|
3d862ec61b | ||
|
|
198043b865 | ||
|
|
2dbd8fc83a | ||
|
|
fd53a3e516 | ||
|
|
1a40aa3fae | ||
|
|
268cfebd13 | ||
|
|
f4572f9f94 | ||
|
|
90d3c140fe | ||
|
|
f2ca2e48aa | ||
|
|
4f1ef65a9c | ||
|
|
1b2cc439f2 | ||
|
|
33bca2e82a | ||
|
|
6d9b12eff6 | ||
|
|
d6a65ec5db | ||
|
|
825f3afe3f | ||
|
|
229d280724 | ||
|
|
7f9c5c0b8c | ||
|
|
ed407de99c | ||
|
|
34d8a26c0a | ||
|
|
7ef398bd54 | ||
|
|
60d58bf93e | ||
|
|
47aa717a4d | ||
|
|
ea5ae36654 | ||
|
|
7c58f1d493 | ||
|
|
ba9c282d96 | ||
|
|
b704c9a941 | ||
|
|
0e2e1222a9 | ||
|
|
b1ecfd8304 | ||
|
|
327115b003 | ||
|
|
4fff19a738 | ||
|
|
624b9834b0 | ||
|
|
c0b3ea28ea | ||
|
|
6ec82116b7 | ||
|
|
1fc47ab475 | ||
|
|
3286bf6164 | ||
|
|
f72d36c67b | ||
|
|
d03a5cfc2c | ||
|
|
77ccb26512 | ||
|
|
f078e19ce1 | ||
|
|
0d8103777c | ||
|
|
1640f99668 | ||
|
|
83412902fb | ||
|
|
742898c624 | ||
|
|
9e8009299c | ||
|
|
bed66f2c7b | ||
|
|
ce4e8692a7 | ||
|
|
67cb180ba8 | ||
|
|
09baaf2c20 | ||
|
|
1102d933c8 | ||
|
|
b3f7af41ef | ||
|
|
b70e1ef492 | ||
|
|
3532b4483e | ||
|
|
ac43a1d5c9 | ||
|
|
325ca10c70 | ||
|
|
8cc7fe3e33 | ||
|
|
39f09a4142 | ||
|
|
9e3fd79b89 | ||
|
|
11b64cae3a | ||
|
|
0f14c11e3d | ||
|
|
e1c9705ff2 | ||
|
|
8c45959ea6 | ||
|
|
655e03f815 | ||
|
|
47f912e998 | ||
|
|
6c19c1ccbd | ||
|
|
ef458b41fd | ||
|
|
f9a216ed2f | ||
|
|
063e44a8b8 | ||
|
|
065c09b9d6 | ||
|
|
e8eda19c02 | ||
|
|
66cde22297 | ||
|
|
f89d71d5c1 | ||
|
|
41e6c76d56 | ||
|
|
33cb6ef8eb | ||
|
|
2e05ebb696 | ||
|
|
f62162317e | ||
|
|
442c4218d4 | ||
|
|
42e4e0223d | ||
|
|
3fa6e72604 | ||
|
|
10dd024bcf | ||
|
|
8c245946a6 | ||
|
|
c8b32ba265 | ||
|
|
ca557d7000 | ||
|
|
23e60d386c | ||
|
|
cc15014b9c | ||
|
|
d4d392819e | ||
|
|
1bf5a67c87 | ||
|
|
53df9b4e4d | ||
|
|
c6d332d625 | ||
|
|
3b08454352 | ||
|
|
6240ca54ed | ||
|
|
6c4d5951ae | ||
|
|
1652647f17 | ||
|
|
7c57454c1b | ||
|
|
78f6ca6fa8 | ||
|
|
d44a5f8257 | ||
|
|
f76a8627cc | ||
|
|
84bee958ce | ||
|
|
d4d809dd45 | ||
|
|
5b7029ca76 | ||
|
|
9855f565ab | ||
|
|
4d0304b804 | ||
|
|
ccd6fbef29 | ||
|
|
de61d407f6 | ||
|
|
106bba6679 | ||
|
|
303e0dd036 | ||
|
|
fff1e5d7ff | ||
|
|
33823e1c81 | ||
|
|
321347fa6b | ||
|
|
fa355d48bc | ||
|
|
c413b14df3 | ||
|
|
fc69d98d22 | ||
|
|
43dd9b5250 | ||
|
|
62bac0c6b9 | ||
|
|
92ffafb769 | ||
|
|
8c9cec989a | ||
|
|
b727e1d152 | ||
|
|
c69b810619 | ||
|
|
295743e448 | ||
|
|
297f1612fe | ||
|
|
49c5b3dff5 | ||
|
|
4629705d17 | ||
|
|
2dec6372e0 | ||
|
|
37fe1c97ea | ||
|
|
f3b02fbc98 | ||
|
|
8254c5b0fd | ||
|
|
b6f2df28b3 | ||
|
|
f7d30de263 | ||
|
|
e2c43fc437 | ||
|
|
22ff69e89a | ||
|
|
993ddae3bd | ||
|
|
e5813e6430 | ||
|
|
cda4a9b498 | ||
|
|
3e4ad00c20 | ||
|
|
86fc8a87fd | ||
|
|
fed45e98b1 | ||
|
|
3edd84f137 | ||
|
|
b79e3e7516 | ||
|
|
b05332fd04 | ||
|
|
15cde5284b | ||
|
|
b5ae4f9fbc | ||
|
|
8904bc1eab | ||
|
|
e0e49b5542 | ||
|
|
1e7e5b6d9f | ||
|
|
e5fb933b98 | ||
|
|
c343756e30 | ||
|
|
ce4c9cd87c | ||
|
|
748a602327 | ||
|
|
8df651bb82 | ||
|
|
b4fc3528de | ||
|
|
fb638a9c08 | ||
|
|
8bc3558cb5 | ||
|
|
28333e3f75 | ||
|
|
c5cfd44a21 | ||
|
|
072057beff | ||
|
|
e35b09b19d | ||
|
|
f52dbd116e | ||
|
|
031ff11bd8 | ||
|
|
976f813ad2 | ||
|
|
2f8a5481f7 | ||
|
|
750aa2ac67 | ||
|
|
41e488d2e7 | ||
|
|
a01c5756a1 | ||
|
|
0dc3ad50d3 | ||
|
|
a429b634f5 | ||
|
|
75bb86b573 | ||
|
|
a57d719ed5 | ||
|
|
cf98c29553 | ||
|
|
e27ff5502a | ||
|
|
b396f37221 | ||
|
|
a6f533afc6 | ||
|
|
02decce31e | ||
|
|
ecab6b1ad2 | ||
|
|
6d7d595354 | ||
|
|
17fca4e1ea | ||
|
|
58b18c3782 | ||
|
|
7ab466a17b | ||
|
|
56c939d0e5 | ||
|
|
73a3ba7f48 | ||
|
|
c4b94ace10 | ||
|
|
94efd15f91 | ||
|
|
47b38d5416 | ||
|
|
1f9aa4c7a7 | ||
|
|
15eb4f87d8 | ||
|
|
b42f010e9d | ||
|
|
63f3b90f1c | ||
|
|
32d06df501 | ||
|
|
175c396053 | ||
|
|
de5dd23b36 | ||
|
|
16036b1b56 | ||
|
|
64af0f5202 | ||
|
|
465c389c07 | ||
|
|
9ec3c9f158 | ||
|
|
3a18e5799a | ||
|
|
051c22ebdb | ||
|
|
5cc8f751f2 | ||
|
|
f8da676839 | ||
|
|
a722071115 | ||
|
|
45e8ce93b5 | ||
|
|
ae41b5fc5c | ||
|
|
d0e3cba92e | ||
|
|
9606274a28 | ||
|
|
4dd3f0cba3 | ||
|
|
752b2d7066 | ||
|
|
cbcfeac0de | ||
|
|
4fd6030779 | ||
|
|
41f2b72a9f | ||
|
|
222b82f3f5 | ||
|
|
b3cf1a5b01 | ||
|
|
4bc1e22058 | ||
|
|
7251099996 | ||
|
|
cbf4bbcf6a | ||
|
|
1ddf8f0236 | ||
|
|
5e2f206d95 | ||
|
|
cdd7e6cb12 | ||
|
|
6eb85ff640 | ||
|
|
6c62a8462d | ||
|
|
fa98339687 | ||
|
|
e9b485ac5b | ||
|
|
ad63509588 | ||
|
|
212836c466 | ||
|
|
4601501939 | ||
|
|
d109106dcb | ||
|
|
6896df67d4 | ||
|
|
6b0f7ea6ef | ||
|
|
cdec1e1925 | ||
|
|
d03571fb2a | ||
|
|
214744aa69 | ||
|
|
f6bf20f7e3 | ||
|
|
c5d6bfa506 | ||
|
|
67456c0cb2 | ||
|
|
da78caa4f2 | ||
|
|
40c736ea46 | ||
|
|
b5f9b7601e | ||
|
|
d70ce66cb4 | ||
|
|
f0b8774d35 | ||
|
|
62dbe304ca | ||
|
|
d7034ab3f4 | ||
|
|
76b03fdda9 | ||
|
|
9a81ebe8df | ||
|
|
79cc49c512 | ||
|
|
e00c98ed11 | ||
|
|
928e2994a2 | ||
|
|
43cd479aa7 | ||
|
|
4a59b32911 | ||
|
|
7677fac783 | ||
|
|
8fffaa2eb0 | ||
|
|
978f35967e | ||
|
|
6bed31fe28 | ||
|
|
49f24e42f1 | ||
|
|
c70cd85a04 | ||
|
|
2b8f320ee1 | ||
|
|
e16ec680b2 | ||
|
|
afbe5e2e03 | ||
|
|
e36b185505 | ||
|
|
5f31cd9ab0 | ||
|
|
a7d7a65a97 | ||
|
|
ae93554f58 | ||
|
|
23945022e0 | ||
|
|
605dcda98a | ||
|
|
0165469ad0 | ||
|
|
949618ca3c | ||
|
|
0d1f415172 | ||
|
|
362a872b00 | ||
|
|
b3d9f6b64c | ||
|
|
7f4854c47d | ||
|
|
60af8c0f14 | ||
|
|
8673a36de4 | ||
|
|
82c6425c77 | ||
|
|
0fe64b28e0 | ||
|
|
60446de766 | ||
|
|
36b7c4191c | ||
|
|
8dcfcc06a8 | ||
|
|
34dd31fbbd | ||
|
|
704145a3d9 | ||
|
|
4129033c3f | ||
|
|
a20f4097e4 | ||
|
|
9dbf4e85ad | ||
|
|
265ba6d2a6 | ||
|
|
85d508a76f | ||
|
|
6f6dccf02e | ||
|
|
084fbb6f11 | ||
|
|
9c3663c5d9 | ||
|
|
0b08f525b2 | ||
|
|
adcfb3dcf4 | ||
|
|
1f8bb96cc4 | ||
|
|
35e399c29d | ||
|
|
e675b4bd21 | ||
|
|
9c843a9dc5 | ||
|
|
0caf181bca | ||
|
|
58a64c05a9 | ||
|
|
414c7201eb | ||
|
|
711b0ea043 | ||
|
|
cc970f60f2 | ||
|
|
c12362a34b | ||
|
|
7d91810871 | ||
|
|
7d847eaf0a | ||
|
|
78258ccc6f | ||
|
|
682b1458ee | ||
|
|
42154a24d7 | ||
|
|
fa08675fc5 | ||
|
|
a90792d17a | ||
|
|
772b3b010e | ||
|
|
167014fcef | ||
|
|
ce012da241 | ||
|
|
2ed9e994a4 | ||
|
|
3c151f8422 | ||
|
|
8a02c9d75a | ||
|
|
fe742acb1c | ||
|
|
72baf23452 | ||
|
|
5e9055d5d8 | ||
|
|
da8b1b669f | ||
|
|
c6949bb76a | ||
|
|
ff7136447a | ||
|
|
1bd8dce63a | ||
|
|
e94cbb1b7c | ||
|
|
646d1e2172 | ||
|
|
ff1164776b | ||
|
|
bc7de558e9 | ||
|
|
5e03372d56 | ||
|
|
c668ebc4a9 | ||
|
|
e1526c939a | ||
|
|
fd5d523460 | ||
|
|
bc01f3bf25 | ||
|
|
a2fcfadba2 | ||
|
|
c2bd0133ba | ||
|
|
cf2455770d | ||
|
|
0c4e9958fd | ||
|
|
01c96431ce | ||
|
|
1e856c9a28 | ||
|
|
4c031484af | ||
|
|
d01d7b1368 | ||
|
|
03be3e77d6 | ||
|
|
a162f20f73 | ||
|
|
a469b1d4ca | ||
|
|
c084ad2593 | ||
|
|
9960c5b7cd | ||
|
|
ec27c41840 | ||
|
|
11bc14592e | ||
|
|
c102233a54 | ||
|
|
eba917d38a | ||
|
|
037991a66b | ||
|
|
b532155b42 | ||
|
|
c2d014a74d | ||
|
|
827594cc29 | ||
|
|
fb2f88e71b | ||
|
|
27bd5054fa | ||
|
|
1ddd7023bc | ||
|
|
09c04eec27 | ||
|
|
21cf20fea8 | ||
|
|
070662c513 | ||
|
|
0368f6e31a | ||
|
|
eb9fc59e0a | ||
|
|
b0a76fea8d | ||
|
|
5a65afbb49 | ||
|
|
a22212c558 | ||
|
|
936db94023 | ||
|
|
c0aee71d7b | ||
|
|
fd13d970c1 | ||
|
|
08ecc3913c | ||
|
|
e0dbd0a7a5 | ||
|
|
489403f832 | ||
|
|
b79de46f7f | ||
|
|
f5b6bf1ced | ||
|
|
28d66894b8 | ||
|
|
8b8ab2664f | ||
|
|
bfc4f25756 | ||
|
|
7346ab4d6c | ||
|
|
dc2f99b32f | ||
|
|
951634fbef | ||
|
|
b4b753c357 | ||
|
|
ad723c9d3b | ||
|
|
4c505faa86 | ||
|
|
cc2082e214 | ||
|
|
7635e124f9 | ||
|
|
f0b07b7819 | ||
|
|
4de621c182 | ||
|
|
0c5a79f5a7 | ||
|
|
8795288e76 | ||
|
|
470cefa834 | ||
|
|
56122a6af2 | ||
|
|
d0121ba22e | ||
|
|
b2eeaaa33e | ||
|
|
04044b4f7e | ||
|
|
8391b601fc | ||
|
|
0e3da9cf85 | ||
|
|
390165b661 | ||
|
|
ea1446ea5b | ||
|
|
63d21f1ccb | ||
|
|
a1b9a36b23 | ||
|
|
20d8151895 | ||
|
|
0be47d1cb8 | ||
|
|
73ad1c62e9 | ||
|
|
dcf331fabc | ||
|
|
03343070d0 | ||
|
|
bca181c365 | ||
|
|
e1228e26fb | ||
|
|
74342c0a25 | ||
|
|
b4c180f275 | ||
|
|
b3350ac23b | ||
|
|
1c94820755 | ||
|
|
41506ffa6f | ||
|
|
f9717be116 | ||
|
|
f896ab1f84 | ||
|
|
8e00c54833 | ||
|
|
c351323605 | ||
|
|
9a1b8e8cc8 | ||
|
|
70376024fa | ||
|
|
44319974c5 | ||
|
|
dc080cca33 | ||
|
|
a529d83758 | ||
|
|
c5cf3900d4 | ||
|
|
774b74575b | ||
|
|
4165234f9c | ||
|
|
be08f05be4 | ||
|
|
bf49151640 | ||
|
|
9c887176d5 | ||
|
|
a48a24932e | ||
|
|
2111a401b2 | ||
|
|
246a628acf | ||
|
|
ef7e64a180 | ||
|
|
b954513444 | ||
|
|
57243d944d | ||
|
|
4cc4ec9c64 | ||
|
|
33818281c1 | ||
|
|
9f05c01c5d | ||
|
|
b8e69f62db | ||
|
|
2000bc3597 | ||
|
|
a0ce5e1acf | ||
|
|
b3b09a966d | ||
|
|
17a3718853 | ||
|
|
f56643a1c0 | ||
|
|
cd347b73e7 | ||
|
|
8c2d73d76e | ||
|
|
724c3d0623 | ||
|
|
2f4dc75540 | ||
|
|
02ec5be3a2 | ||
|
|
5c40b54bd2 | ||
|
|
42338942f5 | ||
|
|
437a6958e4 | ||
|
|
df90caba1b | ||
|
|
38f7c32018 | ||
|
|
fe11b359f4 | ||
|
|
f3a86a94ac | ||
|
|
d945ef1d1b | ||
|
|
21098fbeb8 | ||
|
|
36d54df766 | ||
|
|
c19302755d | ||
|
|
5a20a85dfe | ||
|
|
379349d71a | ||
|
|
6b289e9c9b | ||
|
|
979f2e91da | ||
|
|
02b1f0db62 | ||
|
|
dbb550f71a | ||
|
|
c4c1cbc7f5 | ||
|
|
030b3f718e | ||
|
|
cf05d0d4bb | ||
|
|
6f450c18a2 | ||
|
|
006201d12f | ||
|
|
3b01249c11 | ||
|
|
35c639326e | ||
|
|
f4ea366bf3 | ||
|
|
303162ed8b | ||
|
|
558f35e39b | ||
|
|
6eee1d85bc | ||
|
|
3d3d8c1036 | ||
|
|
c00d1673f5 | ||
|
|
634117c687 | ||
|
|
2cd3781f00 | ||
|
|
b4ee62714b | ||
|
|
93f34fa002 | ||
|
|
99e53443c3 | ||
|
|
9e814827df | ||
|
|
55e9ec4e1f | ||
|
|
acf01e5698 | ||
|
|
015ad7863f | ||
|
|
f57bc040d5 | ||
|
|
de43c04f68 | ||
|
|
aabd8a199b | ||
|
|
366e700c10 | ||
|
|
80f30d4c8b | ||
|
|
6796a2dcd1 | ||
|
|
9f808db912 | ||
|
|
48003b344d | ||
|
|
9e1b44491c | ||
|
|
22900fdd71 | ||
|
|
b2a604e7da | ||
|
|
73bbf5fb68 | ||
|
|
fd762415e5 | ||
|
|
9d2a4720e7 | ||
|
|
05127b1f56 | ||
|
|
f958383e3a | ||
|
|
c3dbf2b129 | ||
|
|
4b11f96141 | ||
|
|
05a1233c13 | ||
|
|
0bde2ae92d | ||
|
|
1cc8381d4d | ||
|
|
f6b81886fa | ||
|
|
155e45ea5c | ||
|
|
3594217fb0 | ||
|
|
98772abb3e | ||
|
|
9a7369f9be | ||
|
|
393cf1b373 | ||
|
|
81a5227005 | ||
|
|
c3e18d3eef | ||
|
|
5856ad2afe | ||
|
|
58bac2c1d0 | ||
|
|
2efe941daf | ||
|
|
767edee59c | ||
|
|
e0d332e3fa | ||
|
|
302a82eb68 | ||
|
|
e2f15fbb16 | ||
|
|
430f656a95 | ||
|
|
dcd6011141 | ||
|
|
531e169a1e | ||
|
|
8ff37f3f73 | ||
|
|
cf6cb8ab14 | ||
|
|
217e3d40dd | ||
|
|
c686f8e187 | ||
|
|
af8ff14e18 | ||
|
|
897f8066fc | ||
|
|
5f8c3e0e02 | ||
|
|
871f611141 | ||
|
|
b250d7ac26 | ||
|
|
6c1f95637c | ||
|
|
37ae5d611e | ||
|
|
a6be1dc4d5 | ||
|
|
a7db686116 | ||
|
|
6c06e49168 | ||
|
|
4d2214e413 | ||
|
|
478765a2df | ||
|
|
c2aa103a49 | ||
|
|
aa7f98b836 | ||
|
|
2915678e90 | ||
|
|
3af7dd863a | ||
|
|
2ac2ec7f79 | ||
|
|
7cc1e7b551 | ||
|
|
a4e5c595d3 | ||
|
|
54be213527 | ||
|
|
d160fc6572 | ||
|
|
1858055b49 | ||
|
|
81f934647f | ||
|
|
ab76804767 | ||
|
|
9759890b68 | ||
|
|
a017f5a546 | ||
|
|
6e35bb6379 | ||
|
|
811c38e6a8 | ||
|
|
e3fb8e608b | ||
|
|
0ad2df9813 | ||
|
|
d1a1010e53 | ||
|
|
a5fa75543b | ||
|
|
f9599282f9 | ||
|
|
ba449e89f2 | ||
|
|
b57a27fe2e | ||
|
|
19fb2b0583 | ||
|
|
2bd4bd58bc | ||
|
|
becd5e1a69 | ||
|
|
b46a6e5f82 | ||
|
|
374861e561 | ||
|
|
50c804c7e0 | ||
|
|
e4ce8009ad | ||
|
|
60482d7dea | ||
|
|
36b7cc180e | ||
|
|
d79a9b92ed | ||
|
|
f90fc74916 | ||
|
|
ce37e751de | ||
|
|
c6ee063189 | ||
|
|
529e053edd | ||
|
|
714015bb8e | ||
|
|
bda25e549f | ||
|
|
b5b30f9539 | ||
|
|
58a2dc831c | ||
|
|
5c0f903f43 | ||
|
|
30cd2fc487 | ||
|
|
fc2449feeb | ||
|
|
2725b30841 | ||
|
|
8274997c45 | ||
|
|
f89eca7794 | ||
|
|
2dee06a0f0 | ||
|
|
5153082de5 | ||
|
|
177f72fd01 | ||
|
|
dd2e09f7ed | ||
|
|
47f93548fc | ||
|
|
b318c4a878 | ||
|
|
9f3ff3c07a | ||
|
|
482bfb7f39 | ||
|
|
e26e1f7f38 | ||
|
|
11f0aa4e2e | ||
|
|
4915ef3276 | ||
|
|
60440f262b | ||
|
|
2992a1a02e | ||
|
|
84b722ab23 | ||
|
|
b2c532e7aa | ||
|
|
cdc15ee101 | ||
|
|
56e545de3a | ||
|
|
51e656ae8e | ||
|
|
1c3d9be1b2 | ||
|
|
3e3c2450c8 | ||
|
|
dbb9e1c554 | ||
|
|
1fd26107b9 | ||
|
|
8054460c1a | ||
|
|
01ea6c00a9 | ||
|
|
4361cb5ee3 | ||
|
|
fa55db7e1e | ||
|
|
94a69d74c1 | ||
|
|
581b95db0d | ||
|
|
18355621b9 | ||
|
|
bf73e14937 | ||
|
|
04b230cc8c | ||
|
|
1ee4dd9f58 | ||
|
|
6b5f836e22 | ||
|
|
f12323deeb | ||
|
|
97aa809072 | ||
|
|
d9ca21913b | ||
|
|
11c5419871 | ||
|
|
b4438d7a9f | ||
|
|
486efee545 | ||
|
|
8a28f57ac0 | ||
|
|
fba373469d | ||
|
|
e997986102 | ||
|
|
979e3af778 | ||
|
|
33c6f06773 | ||
|
|
9da3312a22 | ||
|
|
3d4923b78d | ||
|
|
9c6ae6cd06 | ||
|
|
dfbc147ffb | ||
|
|
127803b3b5 | ||
|
|
1f1f94b2cb | ||
|
|
3412d57f2c | ||
|
|
14d8bc0f5d | ||
|
|
26b0589e0b | ||
|
|
8b4c73e01a | ||
|
|
1246f2f582 | ||
|
|
90be17900d | ||
|
|
51d637659c | ||
|
|
c217eaefc0 | ||
|
|
d3245dcb86 | ||
|
|
589d5962b9 | ||
|
|
2e1d34e43c | ||
|
|
0e9151266a | ||
|
|
0dfba56443 | ||
|
|
f49427e1dc | ||
|
|
9160d6d912 | ||
|
|
5abe552d56 | ||
|
|
d3ff599ab4 | ||
|
|
3bbd61aedf | ||
|
|
ea77fcce91 | ||
|
|
37d92becca | ||
|
|
1f0b06b165 | ||
|
|
845a9995aa | ||
|
|
ad87ab956b | ||
|
|
aef7a82007 | ||
|
|
a3d7745954 | ||
|
|
d4dc518774 | ||
|
|
9203b3d9c3 | ||
|
|
925bdf2a81 | ||
|
|
0db0149b01 | ||
|
|
0dd832526c | ||
|
|
d393a227ea | ||
|
|
a9b580da1e | ||
|
|
543964929b | ||
|
|
55d10017a1 | ||
|
|
87d3993226 | ||
|
|
c44d9132ad | ||
|
|
dcbca0c672 | ||
|
|
c555bd5021 | ||
|
|
dbddb55595 | ||
|
|
9aa361cb6e | ||
|
|
94a8b7dcb1 | ||
|
|
3aa1261a34 | ||
|
|
32632402d3 | ||
|
|
26a1734e7a | ||
|
|
31c23c44e7 | ||
|
|
6c65842a9c | ||
|
|
c5370d1f1c | ||
|
|
2c72213108 | ||
|
|
12d1cf2ea6 | ||
|
|
f7270a349e | ||
|
|
e61783dfec | ||
|
|
88c9054a91 | ||
|
|
e8b1a4a65a | ||
|
|
035ff6c926 | ||
|
|
8b5fb20957 | ||
|
|
e6367fd2a7 | ||
|
|
f725860acf | ||
|
|
4319a0f4ef | ||
|
|
858de4ef40 | ||
|
|
6bcb238f9a | ||
|
|
690c99c4e3 | ||
|
|
7df2060c3c | ||
|
|
8157dedc22 | ||
|
|
8f4e63d633 | ||
|
|
531c65ed7c | ||
|
|
f3d6358dd7 | ||
|
|
9b2da02bdd | ||
|
|
999f9087b5 | ||
|
|
400dc9f42f | ||
|
|
5397727f95 | ||
|
|
437ae363ae | ||
|
|
129cff1ac2 | ||
|
|
637b8be32c | ||
|
|
3c7f0d8e00 | ||
|
|
eca4f95612 | ||
|
|
d0392b70c7 | ||
|
|
5581776313 | ||
|
|
8a7cf9ee56 | ||
|
|
1ec93236f6 | ||
|
|
55f5c5508e | ||
|
|
af71f497ec | ||
|
|
436eabcb76 | ||
|
|
4ec8c32a9d | ||
|
|
55345e6efa | ||
|
|
61fbb12099 | ||
|
|
1079844c22 | ||
|
|
931b11339c | ||
|
|
6f29561f57 | ||
|
|
172dfa62a4 | ||
|
|
cf15e7d65b | ||
|
|
0ee6079edc | ||
|
|
0478eb3be8 | ||
|
|
3fdc1d2011 | ||
|
|
3ee30f23ff | ||
|
|
50f6813de8 | ||
|
|
c8cc39515a | ||
|
|
bc4313e9e2 | ||
|
|
33dac71960 | ||
|
|
9de91e8709 | ||
|
|
84f34ebdb2 | ||
|
|
1ba2c557d5 | ||
|
|
647cf6d656 | ||
|
|
501003b108 | ||
|
|
9c94dfea97 | ||
|
|
53b644b688 | ||
|
|
1f2a6ca7eb | ||
|
|
762e433036 | ||
|
|
3d85b7a351 | ||
|
|
b40a5ec180 | ||
|
|
f92f2f729f | ||
|
|
b1d62d4d29 | ||
|
|
4067c9d369 | ||
|
|
ac3dcd9175 | ||
|
|
7fe35dfa24 | ||
|
|
9867a46106 | ||
|
|
3001fc30ba | ||
|
|
4e02c82efd | ||
|
|
573a16e143 | ||
|
|
7e97aadb5f | ||
|
|
d6a4c9df20 | ||
|
|
6f00c2db39 | ||
|
|
078feead6f | ||
|
|
396460fe7e | ||
|
|
d5cac654cb | ||
|
|
d3686d4262 | ||
|
|
18f572e0e3 | ||
|
|
15b537b0e2 | ||
|
|
58e1788072 | ||
|
|
ed7da40e60 | ||
|
|
dd5e9519a9 | ||
|
|
7dce5b6c25 | ||
|
|
1a65cd840b | ||
|
|
e6bf3c4605 | ||
|
|
39693497ea | ||
|
|
65e96f7313 | ||
|
|
88aa5cc9e9 | ||
|
|
4f55990e8f | ||
|
|
d9486f2432 | ||
|
|
e8e9937c43 | ||
|
|
4a464c14ec | ||
|
|
f4df22907a | ||
|
|
4fb9aa2c8b | ||
|
|
6c79ff49ee | ||
|
|
6d8ca0f3ae | ||
|
|
8e69781d5e | ||
|
|
627fd12893 | ||
|
|
c704e2aa70 | ||
|
|
f3eef61341 | ||
|
|
e346b24d33 | ||
|
|
95b3bea4be | ||
|
|
294cfee63f | ||
|
|
05625c3f5e | ||
|
|
7686c29a10 | ||
|
|
d42722b127 | ||
|
|
04c921c873 | ||
|
|
55a9db2218 | ||
|
|
3ac0a1d1d4 | ||
|
|
60ad3e1f7c | ||
|
|
4b004340c7 | ||
|
|
eead8b8b86 | ||
|
|
65a0b3f91b | ||
|
|
91b0b8e4f4 | ||
|
|
793c7b115e | ||
|
|
f84ac3ce1b | ||
|
|
101474d036 | ||
|
|
4e73b07b52 | ||
|
|
1b0e74ad20 | ||
|
|
7a88dbb780 | ||
|
|
5dc39561e3 | ||
|
|
4a216ddd59 | ||
|
|
d362e97d43 | ||
|
|
41b5d81f37 | ||
|
|
5529c9bb3a | ||
|
|
7a6542b37c | ||
|
|
17ac702c8f | ||
|
|
8dca4d31d0 | ||
|
|
efae540915 | ||
|
|
0d9b6294ab | ||
|
|
9b193c6f45 | ||
|
|
ebbde85b85 | ||
|
|
4fcfa56b18 | ||
|
|
de9fdccde1 | ||
|
|
40292de864 | ||
|
|
4682d427e0 | ||
|
|
5cb73e630a | ||
|
|
d0c96b4b84 | ||
|
|
2a7f0db5e8 | ||
|
|
d6f7a0ecea | ||
|
|
238d886f0e | ||
|
|
a937afa06f | ||
|
|
7ef36afaf9 | ||
|
|
68ddca7f6c | ||
|
|
c7ab89c307 | ||
|
|
1746417a78 | ||
|
|
bab14c12bd | ||
|
|
369b57ec38 | ||
|
|
b8a30971fe | ||
|
|
6949ba9d14 | ||
|
|
1d39b0fbdc | ||
|
|
3cd26fa7db | ||
|
|
13d8f74704 | ||
|
|
86b4e710fd | ||
|
|
aef2fc0d14 | ||
|
|
438e59ee47 | ||
|
|
d3e3ecd423 | ||
|
|
6edfb842e0 | ||
|
|
858238c5e9 | ||
|
|
95f5c5569e | ||
|
|
02f12795b5 | ||
|
|
f1270fcd3c | ||
|
|
b5a1030f73 | ||
|
|
b22edbb92b | ||
|
|
0df376426c | ||
|
|
a1c31a47c6 | ||
|
|
77886acce0 | ||
|
|
7c3a760cc2 | ||
|
|
8a2732fa02 | ||
|
|
f8e7a755a4 | ||
|
|
32875b8bd9 | ||
|
|
54d612f42b | ||
|
|
c7f6b42bc3 | ||
|
|
e7668275c8 | ||
|
|
11f1c1fba7 | ||
|
|
d0701a95b7 | ||
|
|
2eb5e0c3ae | ||
|
|
44431b865d | ||
|
|
c790e5cfc6 | ||
|
|
461c638897 | ||
|
|
56ca855f7f | ||
|
|
b490f27b49 | ||
|
|
b60ee2d925 | ||
|
|
19d7705cbb | ||
|
|
700e820570 | ||
|
|
a218b3deb4 | ||
|
|
9c472f8fc7 | ||
|
|
2691fd7130 | ||
|
|
e23b5abcbe | ||
|
|
8f79e405b8 | ||
|
|
576af93eb2 | ||
|
|
730b4842b3 | ||
|
|
8b0ecb3ea1 | ||
|
|
8efdc52772 | ||
|
|
7e3782433b | ||
|
|
1302f0885e | ||
|
|
504067d9c4 | ||
|
|
c25c29d7dd | ||
|
|
655c0c059a | ||
|
|
a1a182776f | ||
|
|
1de3b6dced | ||
|
|
7cf9c32013 | ||
|
|
3b7fff780b | ||
|
|
b01ddac697 | ||
|
|
6c5786a672 | ||
|
|
99b9ee37ee | ||
|
|
7a25ccfcb9 | ||
|
|
a4fab00981 | ||
|
|
b69a66ecfd | ||
|
|
2d21ba3a6e | ||
|
|
3d11713555 | ||
|
|
a4024f19c5 | ||
|
|
be34b07274 | ||
|
|
6365c70196 | ||
|
|
1a99d4d95d | ||
|
|
b71168e601 | ||
|
|
a72dfbee70 | ||
|
|
6bf3619d66 | ||
|
|
b725c3aa72 | ||
|
|
ac4d249b35 | ||
|
|
167991fae4 | ||
|
|
8e8378583a | ||
|
|
808c10446d | ||
|
|
6cc215e552 | ||
|
|
e876017275 | ||
|
|
6e5aed1317 | ||
|
|
eb0838a485 | ||
|
|
d9c55f4dcf | ||
|
|
74a06fc732 | ||
|
|
16f0963de3 | ||
|
|
2defbbc7ca | ||
|
|
b12216c0ea | ||
|
|
035a1b6368 | ||
|
|
ede9b458c6 | ||
|
|
305a5ad973 | ||
|
|
324e9e26b5 | ||
|
|
930dc26d51 | ||
|
|
fc30703cb8 | ||
|
|
03d0776bd0 | ||
|
|
abe6badce2 | ||
|
|
5ebcb70fac | ||
|
|
4e0c1d0f6c | ||
|
|
11689cc861 | ||
|
|
6277eb3a5a | ||
|
|
60b9d671d2 | ||
|
|
0765a0be35 | ||
|
|
3ae0e78066 | ||
|
|
64b418c1cc | ||
|
|
0ba66601d5 | ||
|
|
d299d66ff6 | ||
|
|
d7fc112987 | ||
|
|
b1d49b5643 | ||
|
|
c17c7e5ac5 | ||
|
|
c4a80426d3 | ||
|
|
e22aa3a217 | ||
|
|
6bf368ad8f | ||
|
|
36757e87d2 | ||
|
|
fb6e870b7d | ||
|
|
c477381edf | ||
|
|
db10b40170 | ||
|
|
3746eab179 | ||
|
|
bcb0a1970b | ||
|
|
b9e47a05fb | ||
|
|
309793c58e | ||
|
|
89c5788325 | ||
|
|
32356773dd | ||
|
|
ff177dae6e | ||
|
|
829de5ef67 | ||
|
|
e30ea1dac7 | ||
|
|
f2c7a8c92e | ||
|
|
23d1326e6b | ||
|
|
5fc90291d9 | ||
|
|
746b5f5489 | ||
|
|
413e3ee860 | ||
|
|
82c7028c74 | ||
|
|
fe643754a7 | ||
|
|
de865ef60e | ||
|
|
b81bb50ad9 | ||
|
|
e7371f7311 | ||
|
|
3babfdd954 | ||
|
|
d299a50ccd | ||
|
|
1b7850fe3f | ||
|
|
ae4c46914f | ||
|
|
22dcb001c9 | ||
|
|
6331e92d42 | ||
|
|
8de092f8a6 | ||
|
|
83f0610d9b | ||
|
|
0a67e99692 | ||
|
|
6ff39b8597 | ||
|
|
1deaa51123 | ||
|
|
79b1d9da42 | ||
|
|
cf828efbee | ||
|
|
d945c21d71 | ||
|
|
434f1797f5 | ||
|
|
f44dae1b78 | ||
|
|
9158528030 | ||
|
|
5292c4fb98 | ||
|
|
d520dad86c | ||
|
|
f6ffd5ea87 | ||
|
|
1bc32ff062 | ||
|
|
6bdc0fcef3 | ||
|
|
5b622f7082 | ||
|
|
2e9a53ea59 | ||
|
|
b54446b26f | ||
|
|
b56eaa9481 | ||
|
|
8a72b2add0 | ||
|
|
dd97c6e1d6 | ||
|
|
3e2297db9f | ||
|
|
3ebe8d2cc3 | ||
|
|
a24e0e4bdc | ||
|
|
89be919ee6 | ||
|
|
e8dae39ba2 | ||
|
|
6648498d7e | ||
|
|
f2b30c363b | ||
|
|
55fc88403e | ||
|
|
1455bf01a8 | ||
|
|
712308a465 | ||
|
|
e6bf27185f | ||
|
|
d63f6d7b90 | ||
|
|
09d594442e | ||
|
|
f36f6dc41c | ||
|
|
752c0d42e0 | ||
|
|
5d4e9c1bfc | ||
|
|
ab58229e96 | ||
|
|
2497c708b2 | ||
|
|
4d5b6a7afd | ||
|
|
f9f9c4ee13 | ||
|
|
cf6a607a51 | ||
|
|
b303f7b847 | ||
|
|
2f5f498f43 | ||
|
|
d5fb81aa57 | ||
|
|
9a96158563 | ||
|
|
6032d0d1c8 | ||
|
|
ad3e816155 | ||
|
|
f7872bb2ca | ||
|
|
ce7f5f3f6b | ||
|
|
1688884091 | ||
|
|
27ffe05aaa | ||
|
|
637db34306 | ||
|
|
a37a126105 | ||
|
|
8e90f981fb | ||
|
|
af15c56ed5 | ||
|
|
19b0f518aa | ||
|
|
a57d644c0e | ||
|
|
64c9c41349 | ||
|
|
ea21a787b3 | ||
|
|
642014a35b | ||
|
|
c1082feef4 | ||
|
|
6ca3c14b4e | ||
|
|
d1701f51d7 | ||
|
|
4c6d01a96a | ||
|
|
be5e145c16 | ||
|
|
8cd39559e4 | ||
|
|
2d5f991a7c | ||
|
|
ce9a285f05 | ||
|
|
1b53164fb5 | ||
|
|
f0e81a141f | ||
|
|
0b5017d689 | ||
|
|
2f22380d96 | ||
|
|
c20cd33fb9 | ||
|
|
7bbb5f3122 | ||
|
|
5ec4a6f71e | ||
|
|
e61a8eebaf | ||
|
|
90a6c36b17 | ||
|
|
68d20b0efc | ||
|
|
0edfc3a347 | ||
|
|
b82bcfa10c | ||
|
|
a83cc24db0 | ||
|
|
327a7ce4bb | ||
|
|
f47abe6a91 | ||
|
|
46871e98c1 | ||
|
|
391ed39211 | ||
|
|
027ae716a4 | ||
|
|
39bc9878d6 | ||
|
|
cf7e9e1c8e | ||
|
|
624ed939c8 | ||
|
|
f8e6b0e982 | ||
|
|
bf9981054d | ||
|
|
80237630ab | ||
|
|
2e4e61c155 | ||
|
|
e9810d5ed8 | ||
|
|
f083059e0b | ||
|
|
3d7b0d2a69 | ||
|
|
4658f05532 | ||
|
|
70104e7e82 | ||
|
|
dc97305494 | ||
|
|
d8b0121938 | ||
|
|
db73e2f56e | ||
|
|
1e36e9ba48 | ||
|
|
b723b83b0e | ||
|
|
6afb0526e8 | ||
|
|
c4e44c784f | ||
|
|
feea4f1ac8 | ||
|
|
03e6615423 | ||
|
|
b1f74fcd6d | ||
|
|
dfc95b40b3 | ||
|
|
ab4fa44f5c | ||
|
|
fcd5dfb861 | ||
|
|
c1bdea35e8 | ||
|
|
d36acc417c | ||
|
|
81c1958992 | ||
|
|
8c6db4c514 | ||
|
|
ae9b55e493 | ||
|
|
9c0eff49f0 | ||
|
|
d0043a65e5 | ||
|
|
41aa25a4b2 | ||
|
|
ec0e42d9db | ||
|
|
54e723b541 | ||
|
|
eacd15bee8 | ||
|
|
e5ffec18a2 | ||
|
|
4acb69d02f | ||
|
|
e969c61d0a | ||
|
|
4707807c93 | ||
|
|
e9bba419b2 | ||
|
|
27d779b3ca | ||
|
|
3e5b4bb3be | ||
|
|
8ade314b27 | ||
|
|
337d4d8acd | ||
|
|
578e2b1479 | ||
|
|
4c2ecfd31a | ||
|
|
fcea4750f8 | ||
|
|
a9535f6f80 | ||
|
|
2db2923e94 | ||
|
|
919989f1b7 | ||
|
|
ab947189a2 | ||
|
|
5b484e3ebd | ||
|
|
5073104f1d | ||
|
|
f7e990b253 | ||
|
|
6cf257179b | ||
|
|
892bbf18dc | ||
|
|
c0c4e2bcee | ||
|
|
aead81e796 | ||
|
|
577d11317a | ||
|
|
77b2ee89a4 | ||
|
|
6345b0dd2a | ||
|
|
6e4de53eb3 | ||
|
|
b17fcce49f | ||
|
|
931251a49f | ||
|
|
b9f39111bc | ||
|
|
22d59dafdb | ||
|
|
5aba3664bc | ||
|
|
e2b8257174 | ||
|
|
d725bc6326 | ||
|
|
29c1ca4a49 | ||
|
|
b112f5dc24 | ||
|
|
a741bfe633 | ||
|
|
98b679867a | ||
|
|
f239fd86dc | ||
|
|
edb02e1f6a | ||
|
|
37bd5b5e07 | ||
|
|
3a0fb0d53b | ||
|
|
0ad336263b | ||
|
|
2a5802c253 | ||
|
|
a29154dd38 | ||
|
|
fd9577dcf1 | ||
|
|
59e08285d0 | ||
|
|
4fc2a16628 | ||
|
|
6fcc266125 | ||
|
|
6718137086 | ||
|
|
8df9f475d9 | ||
|
|
1924bf45bc | ||
|
|
77df630a6d | ||
|
|
2a8ef187e6 | ||
|
|
654ad3cc6f | ||
|
|
5d50c8a5d4 | ||
|
|
67a33423ba | ||
|
|
a013ca3275 | ||
|
|
5b3389fced | ||
|
|
d569e23a0e | ||
|
|
e440e023d0 | ||
|
|
d0ad287eac | ||
|
|
241a264b9e | ||
|
|
ea47301e14 | ||
|
|
12767f62f3 | ||
|
|
39c394b556 | ||
|
|
cb4bd7aace | ||
|
|
7c9d88cdbf | ||
|
|
8d33f507ca | ||
|
|
7a2562549a | ||
|
|
0178ace830 | ||
|
|
0b90c1ea0d | ||
|
|
a7e129b665 | ||
|
|
6a8d38d8a6 | ||
|
|
08f0198ea6 | ||
|
|
611178a123 | ||
|
|
24890f878b | ||
|
|
a659ec31c4 | ||
|
|
d988c096d6 | ||
|
|
7dd4c6e6ab | ||
|
|
257f37ef0e | ||
|
|
8484823c64 | ||
|
|
c051f20958 | ||
|
|
072472a143 | ||
|
|
fc15ef31a2 | ||
|
|
7c930c6030 | ||
|
|
1067cd8309 | ||
|
|
b624bbce53 | ||
|
|
87789c74a7 | ||
|
|
a9b4044f8b | ||
|
|
13d4bb7c7f | ||
|
|
1891e8861b | ||
|
|
d4bceb1c16 | ||
|
|
98ba616c02 | ||
|
|
9e9a5b0859 | ||
|
|
240e0d8dd5 | ||
|
|
2ef010278f | ||
|
|
f2aa29a0f8 | ||
|
|
58b9b0fd75 | ||
|
|
5e4002b058 | ||
|
|
ceb6544367 | ||
|
|
3be6348194 | ||
|
|
9053b8a372 | ||
|
|
f385070640 | ||
|
|
33a484071c | ||
|
|
1ba86f2554 | ||
|
|
37c8f95489 | ||
|
|
f3ba5c47b0 | ||
|
|
263a90c244 | ||
|
|
6c67fcb32c | ||
|
|
67413cf0e6 | ||
|
|
b66e297b5d | ||
|
|
0af135a8e4 | ||
|
|
99090f302e | ||
|
|
fce45d9656 | ||
|
|
622d2e81a2 | ||
|
|
2d5366bf44 | ||
|
|
6701054fd5 | ||
|
|
7f6d9e36d3 | ||
|
|
7d46677fa3 | ||
|
|
e67b1e7c07 | ||
|
|
1ebdecaa10 | ||
|
|
11c099da2f | ||
|
|
72c01d39eb | ||
|
|
4f118af87c | ||
|
|
ee9d576401 | ||
|
|
3ca51cb548 | ||
|
|
4f817e93fa | ||
|
|
b2dbaab771 | ||
|
|
beed3fdc43 | ||
|
|
08b6469aad | ||
|
|
182a0fd182 | ||
|
|
6e4e6cee4e | ||
|
|
7b4d175678 | ||
|
|
ad32918fc3 | ||
|
|
e00024ea65 | ||
|
|
c997bbea4c | ||
|
|
54fa1af24b | ||
|
|
bf49c82580 | ||
|
|
3314b3034a | ||
|
|
c8df13455b | ||
|
|
c21d3280c7 | ||
|
|
c43b757f1b | ||
|
|
b950958bce | ||
|
|
d5e65fbb5d | ||
|
|
b845dc8c46 | ||
|
|
311fc34378 | ||
|
|
2bc2763f3f | ||
|
|
8b9ad4a28b | ||
|
|
cb9256dec0 | ||
|
|
82d809da21 | ||
|
|
514c712628 | ||
|
|
553a5b641a | ||
|
|
6cb046d65c | ||
|
|
53cc2c2572 | ||
|
|
9fdd3d7742 | ||
|
|
f85cdebec7 | ||
|
|
e7451c2430 | ||
|
|
3c984195af | ||
|
|
62400452cd | ||
|
|
949fdfb408 | ||
|
|
8a4ecd0263 | ||
|
|
69fe734e30 | ||
|
|
4ba0d7e6b9 | ||
|
|
90e40e13ff | ||
|
|
b8d7c67495 | ||
|
|
fafdb3b641 | ||
|
|
333e2c6704 | ||
|
|
e2b56f6401 | ||
|
|
dbef8075be | ||
|
|
0f48e53445 | ||
|
|
70bc90504c | ||
|
|
6b503bfa49 | ||
|
|
d168d46c60 | ||
|
|
04274bf260 | ||
|
|
e759a50d89 | ||
|
|
3aaf554bf9 | ||
|
|
122c76b542 | ||
|
|
c4d7548bce | ||
|
|
984ba72b94 | ||
|
|
fa613f1a44 | ||
|
|
df357ca0c0 | ||
|
|
344a461f53 | ||
|
|
7120bbd488 | ||
|
|
3db0964f2c | ||
|
|
98935e4a59 | ||
|
|
7364d9a517 | ||
|
|
16020e6637 | ||
|
|
68289b8111 | ||
|
|
4a077b2697 | ||
|
|
472fea4463 | ||
|
|
f4119ab3b8 | ||
|
|
c36a077bc2 | ||
|
|
ae6c6f7b5b | ||
|
|
e6f7f2054a | ||
|
|
823aa332c2 | ||
|
|
dd1166887c | ||
|
|
ec9c4f9a62 | ||
|
|
e68f93be6e | ||
|
|
0a9efad6a1 | ||
|
|
7e19caa2f6 | ||
|
|
240cd9069a | ||
|
|
35ac89616d | ||
|
|
bfb5ebd81b | ||
|
|
456bcbaf66 | ||
|
|
01cd21d25a | ||
|
|
ad0d2528e7 | ||
|
|
221860adbd | ||
|
|
4a20069a60 | ||
|
|
ce39a7ffbb | ||
|
|
7c4b52a2a0 | ||
|
|
ad067e812a | ||
|
|
af1b5af4b8 | ||
|
|
27ff5a11b7 | ||
|
|
cc2e426ea6 | ||
|
|
d38b614659 | ||
|
|
1e024c9b2b | ||
|
|
b21756de26 | ||
|
|
b4ac8ba647 | ||
|
|
694640d8a1 | ||
|
|
886bdfe486 | ||
|
|
9c0f6cfc0f | ||
|
|
75ebd56616 | ||
|
|
cddf553e35 | ||
|
|
18550385b7 | ||
|
|
ad9238ab63 | ||
|
|
67a025c846 | ||
|
|
aeb84b3d8f | ||
|
|
8c6bd1a4ba | ||
|
|
86aea12398 | ||
|
|
4e487cf0ba | ||
|
|
64188cbec5 | ||
|
|
477ef3d7dc | ||
|
|
fbd9b1e20a | ||
|
|
6b35a9ced0 | ||
|
|
9014a8c93e | ||
|
|
aa0f2b8d9b | ||
|
|
c01883b723 | ||
|
|
1818359763 | ||
|
|
e54a6373fa | ||
|
|
e440fb521b | ||
|
|
ea6c249ec6 | ||
|
|
7d89e1d2e8 | ||
|
|
a5aa750913 | ||
|
|
4f0a3920c4 | ||
|
|
2867484aa8 | ||
|
|
d270d0a032 | ||
|
|
8eee0f7486 | ||
|
|
6d3b875820 | ||
|
|
df950c593d | ||
|
|
f1767d661d | ||
|
|
48263ab49c | ||
|
|
5c3a07445b | ||
|
|
81f9cf79d3 | ||
|
|
786cbe44c5 | ||
|
|
324feac0f7 | ||
|
|
8cf235ccb6 | ||
|
|
1b75b22851 | ||
|
|
bc2905c987 | ||
|
|
dce36cdf51 | ||
|
|
40cbe52c00 | ||
|
|
812138fda5 | ||
|
|
2d35708fb4 | ||
|
|
e72da87514 | ||
|
|
e22b75ef96 | ||
|
|
cebd997fcc | ||
|
|
727282110b | ||
|
|
0f05a82e89 | ||
|
|
e95f02eabc | ||
|
|
607d0f9d72 | ||
|
|
a8031dec6b | ||
|
|
1fb4eb0355 | ||
|
|
7c264fa1e4 | ||
|
|
ea97f8f3bc | ||
|
|
021bcba05a | ||
|
|
13bb38c6f2 | ||
|
|
a9f961ed94 | ||
|
|
29f3c67c9d | ||
|
|
4d9edf7c46 | ||
|
|
a190e95559 | ||
|
|
2afee109dc | ||
|
|
481cc6eb71 | ||
|
|
62ce372a20 | ||
|
|
e09942d2b0 | ||
|
|
f102f498b7 | ||
|
|
cea20154ec | ||
|
|
9ffcfab62a | ||
|
|
e769dfd316 | ||
|
|
9d65675a90 | ||
|
|
de31d16528 | ||
|
|
983b13dd7d | ||
|
|
d5f9e5470b | ||
|
|
64c925610c | ||
|
|
37697eb39f | ||
|
|
a363ff43ea | ||
|
|
d46976b794 | ||
|
|
7468357c9c | ||
|
|
cd564d6005 | ||
|
|
25922ac246 | ||
|
|
550811a7a3 | ||
|
|
eb2979320f | ||
|
|
af8f665017 | ||
|
|
54e7ab71ef | ||
|
|
456183937a | ||
|
|
bb530ad098 | ||
|
|
8bf2a17603 | ||
|
|
5da189deeb | ||
|
|
c2a77fbf82 | ||
|
|
8f1fc01bbb | ||
|
|
153fb6198e | ||
|
|
30ab80f6f0 | ||
|
|
c715a1bc0c | ||
|
|
e40d26b83e | ||
|
|
e033ce0aac | ||
|
|
5deac04d38 | ||
|
|
ff3a8f4301 | ||
|
|
6ce6b2d10a |
240
.clang-format
@@ -1,35 +1,45 @@
|
||||
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||
# for clang-format 17.0.1
|
||||
Language: Json
|
||||
ColumnLimit: 1000
|
||||
IndentWidth: 4
|
||||
---
|
||||
Language: Cpp
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
BasedOnStyle: 'WebKit'
|
||||
# AccessModifierOffset: 2
|
||||
AlignAfterOpenBracket: 'AlwaysBreak'
|
||||
AlignArrayOfStructures: None
|
||||
AlignConsecutiveMacros: None
|
||||
AlignConsecutiveAssignments: None
|
||||
AlignConsecutiveBitFields: None
|
||||
AlignConsecutiveDeclarations: None
|
||||
AlignConsecutiveMacros: None
|
||||
# AlignConsecutiveShortCaseStatements: None
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: Align
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AlignTrailingComments:
|
||||
Kind: Always
|
||||
OverEmptyLines: 1
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||
# AllowShortCompoundRequirementOnASingleLine: true
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: InlineOnly
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: Inline
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
AttributeMacros:
|
||||
- __capability
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
# AttributeMacros:
|
||||
# - __pragma
|
||||
# - _Pragma
|
||||
# - __attribute__
|
||||
# - __declspec
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BitFieldColonSpacing: After
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: true
|
||||
@@ -37,159 +47,147 @@ BraceWrapping:
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterObjCDeclaration: true
|
||||
# AfterObjCDeclaration: true
|
||||
AfterStruct: true
|
||||
AfterUnion: false
|
||||
AfterUnion: true
|
||||
AfterExternBlock: true
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeConceptDeclarations: true
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
# BracedInitializerIndentWidth: 4
|
||||
BreakAfterAttributes: Never
|
||||
BreakAfterJavaFieldAnnotations: true
|
||||
BreakArrays: true
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakBeforeConceptDeclarations: Always
|
||||
BreakBeforeInlineASMColon: OnlyMultiline
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakInheritanceList: BeforeComma
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 120
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
QualifierAlignment: Leave
|
||||
ColumnLimit: 100
|
||||
# CommentPragmas: '^ MEO pragma:'
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: false
|
||||
DeriveLineEnding: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
EmptyLineAfterAccessModifier: Never
|
||||
EmptyLineBeforeAccessModifier: LogicalBlock
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
PackConstructorInitializers: BinPack
|
||||
BasedOnStyle: ''
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
AllowAllConstructorInitializersOnNextLine: true
|
||||
# ExperimentalAutoDetectBinPacking: true
|
||||
FixNamespaceComments: true
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IfMacros:
|
||||
- KJ_IF_MAYBE
|
||||
# ForEachMacros:
|
||||
# - foreach
|
||||
# - Q_FOREACH
|
||||
# - BOOST_FOREACH
|
||||
# IfMacros:
|
||||
# - 'KJ_IF_MAYBE'
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IncludeIsMainSourceRegex: ''
|
||||
# IncludeCategories:
|
||||
# IncludeIsMainRegex:
|
||||
# IncludeIsMainSourceRegex:
|
||||
IndentAccessModifiers: false
|
||||
IndentCaseLabels: false
|
||||
IndentCaseBlocks: false
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentCaseLabels: false
|
||||
IndentExternBlock: AfterExternBlock
|
||||
IndentGotoLabels: false
|
||||
IndentPPDirectives: None
|
||||
IndentRequiresClause: false
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
InsertTrailingCommas: None
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
IndentWrappedFunctionNames: true
|
||||
InsertBraces: true
|
||||
InsertNewlineAtEOF: true
|
||||
InsertTrailingCommas: Wrapped
|
||||
IntegerLiteralSeparator:
|
||||
Binary: 4
|
||||
BinaryMinDigits: 9
|
||||
Decimal: 3
|
||||
DecimalMinDigits: 7
|
||||
Hex: -1
|
||||
# JavaImportGroups:
|
||||
# JavaScriptQuotes:
|
||||
# JavaScriptWrapImports:
|
||||
KeepEmptyLinesAtEOF: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
LambdaBodyIndentation: Signature
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
# LineEnding: LF
|
||||
# MacroBlockBegin: "MAA.*_NS_BEGIN$"
|
||||
# MacroBlockEnd: "MAA.*_NS_END$"
|
||||
# Macros:
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: All
|
||||
ObjCBinPackProtocolList: Auto
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCBreakBeforeNestedBlockParam: true
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakOpenParenthesis: 0
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 1000
|
||||
PenaltyIndentedWhitespace: 0
|
||||
NamespaceIndentation: None
|
||||
# NamespaceMacros:
|
||||
# ObjCBinPackProtocolList:
|
||||
# ObjCBlockIndentWidth:
|
||||
# ObjCBreakBeforeNestedBlockParam:
|
||||
# ObjCSpaceAfterProperty:
|
||||
# ObjCSpaceBeforeProtocolList:
|
||||
PackConstructorInitializers: Never
|
||||
# PenaltyBreakAssignment:
|
||||
# PenaltyBreakBeforeFirstCallParameter:
|
||||
# PenaltyBreakComment:
|
||||
# PenaltyBreakFirstLessLess:
|
||||
# PenaltyBreakOpenParenthesis:
|
||||
# PenaltyBreakTemplateDeclaration:
|
||||
# PenaltyExcessCharacter:
|
||||
# PenaltyIndentedWhitespace:
|
||||
# PenaltyReturnTypeOnItsOwnLine:
|
||||
PointerAlignment: Left
|
||||
PPIndentWidth: -1
|
||||
ReferenceAlignment: Pointer
|
||||
# QualifierAlignment: Custom
|
||||
# QualifierOrder:
|
||||
# - inline
|
||||
# - static
|
||||
# - const
|
||||
# - constexpr
|
||||
# - type
|
||||
ReferenceAlignment: Left
|
||||
ReflowComments: true
|
||||
RemoveBracesLLVM: false
|
||||
RemoveParentheses: Leave
|
||||
RemoveSemicolon: false
|
||||
RequiresClausePosition: OwnLine
|
||||
SeparateDefinitionBlocks: Leave
|
||||
ShortNamespaceLines: 50
|
||||
RequiresExpressionIndentation: OuterScope
|
||||
SeparateDefinitionBlocks: Always
|
||||
ShortNamespaceLines: 1000
|
||||
SortIncludes: CaseSensitive
|
||||
SortJavaStaticImport: Before
|
||||
SortUsingDeclarations: true
|
||||
# SortJavaStaticImport:
|
||||
SortUsingDeclarations: Lexicographic
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceAroundPointerQualifiers: Default
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeJsonColon: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeParensOptions:
|
||||
AfterControlStatements: true
|
||||
AfterForeachMacros: true
|
||||
AfterFunctionDefinitionName: false
|
||||
AfterFunctionDeclarationName: false
|
||||
AfterIfMacros: true
|
||||
AfterOverloadedOperator: false
|
||||
AfterRequiresInClause: true
|
||||
AfterRequiresInExpression: true
|
||||
BeforeNonEmptyParentheses: false
|
||||
SpaceAroundPointerQualifiers: Default
|
||||
# SpaceBeforeParensOptions:
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceBeforeSquareBrackets: false
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: Never
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInLineCommentPrefix:
|
||||
Minimum: 1
|
||||
Maximum: -1
|
||||
SpacesInParentheses: false
|
||||
SpacesInParens: Never
|
||||
SpacesInSquareBrackets: false
|
||||
SpaceBeforeSquareBrackets: false
|
||||
BitFieldColonSpacing: Both
|
||||
Standard: c++20
|
||||
StatementAttributeLikeMacros:
|
||||
- Q_EMIT
|
||||
StatementMacros:
|
||||
- Q_UNUSED
|
||||
- QT_REQUIRE_VERSION
|
||||
# StatementAttributeLikeMacros:
|
||||
# StatementMacros:
|
||||
TabWidth: 4
|
||||
UseCRLF: false
|
||||
# TypeNames:
|
||||
# TypenameMacros:
|
||||
UseTab: Never
|
||||
WhitespaceSensitiveMacros:
|
||||
- STRINGIZE
|
||||
- PP_STRINGIZE
|
||||
- BOOST_PP_STRINGIZE
|
||||
- NS_SWIFT_NAME
|
||||
- CF_SWIFT_NAME
|
||||
# VerilogBreakBetweenInstancePorts:
|
||||
# WhitespaceSensitiveMacros:
|
||||
|
||||
@@ -10,72 +10,3 @@ end_of_line = lf
|
||||
[*.json]
|
||||
|
||||
indent_size = 4
|
||||
|
||||
[*.{c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]
|
||||
|
||||
indent_size = 4
|
||||
|
||||
# Visual C++ Code Style settings
|
||||
|
||||
cpp_generate_documentation_comments = xml
|
||||
|
||||
# Visual C++ Formatting settings
|
||||
|
||||
cpp_indent_braces = false
|
||||
cpp_indent_multi_line_relative_to = innermost_parenthesis
|
||||
cpp_indent_within_parentheses = indent
|
||||
cpp_indent_preserve_within_parentheses = true
|
||||
cpp_indent_case_contents = true
|
||||
cpp_indent_case_labels = false
|
||||
cpp_indent_case_contents_when_block = false
|
||||
cpp_indent_lambda_braces_when_parameter = true
|
||||
cpp_indent_goto_labels = one_left
|
||||
cpp_indent_preprocessor = leftmost_column
|
||||
cpp_indent_access_specifiers = false
|
||||
cpp_indent_namespace_contents = true
|
||||
cpp_indent_preserve_comments = false
|
||||
cpp_new_line_before_open_brace_namespace = new_line
|
||||
cpp_new_line_before_open_brace_type = new_line
|
||||
cpp_new_line_before_open_brace_function = new_line
|
||||
cpp_new_line_before_open_brace_block = same_line
|
||||
cpp_new_line_before_open_brace_lambda = same_line
|
||||
cpp_new_line_scope_braces_on_separate_lines = false
|
||||
cpp_new_line_close_brace_same_line_empty_type = false
|
||||
cpp_new_line_close_brace_same_line_empty_function = false
|
||||
cpp_new_line_before_catch = true
|
||||
cpp_new_line_before_else = true
|
||||
cpp_new_line_before_while_in_do_while = false
|
||||
cpp_space_before_function_open_parenthesis = remove
|
||||
cpp_space_within_parameter_list_parentheses = false
|
||||
cpp_space_between_empty_parameter_list_parentheses = false
|
||||
cpp_space_after_keywords_in_control_flow_statements = true
|
||||
cpp_space_within_control_flow_statement_parentheses = false
|
||||
cpp_space_before_lambda_open_parenthesis = false
|
||||
cpp_space_within_cast_parentheses = false
|
||||
cpp_space_after_cast_close_parenthesis = false
|
||||
cpp_space_within_expression_parentheses = false
|
||||
cpp_space_before_block_open_brace = true
|
||||
cpp_space_between_empty_braces = false
|
||||
cpp_space_before_initializer_list_open_brace = false
|
||||
cpp_space_within_initializer_list_braces = true
|
||||
cpp_space_preserve_in_initializer_list = true
|
||||
cpp_space_before_open_square_bracket = false
|
||||
cpp_space_within_square_brackets = false
|
||||
cpp_space_before_empty_square_brackets = false
|
||||
cpp_space_between_empty_square_brackets = false
|
||||
cpp_space_group_square_brackets = true
|
||||
cpp_space_within_lambda_brackets = false
|
||||
cpp_space_between_empty_lambda_brackets = false
|
||||
cpp_space_before_comma = false
|
||||
cpp_space_after_comma = true
|
||||
cpp_space_remove_around_member_operators = true
|
||||
cpp_space_before_inheritance_colon = true
|
||||
cpp_space_before_constructor_colon = true
|
||||
cpp_space_remove_before_semicolon = true
|
||||
cpp_space_after_semicolon = false
|
||||
cpp_space_remove_around_unary_operator = true
|
||||
cpp_space_around_binary_operator = insert
|
||||
cpp_space_around_assignment_operator = insert
|
||||
cpp_space_pointer_reference_alignment = left
|
||||
cpp_space_around_ternary_operator = insert
|
||||
cpp_wrap_preserve_blocks = one_liners
|
||||
|
||||
22
.github/ISSUE_TEMPLATE/cn-bug-report.yaml
vendored
@@ -9,15 +9,29 @@ body:
|
||||
options:
|
||||
- label: 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决
|
||||
required: true
|
||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等
|
||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等
|
||||
required: true
|
||||
- label: 我已查看最新测试版本的更新内容,并未提及该 bug 已被修复的情况
|
||||
- label: 我已查看最新测试版本的更新内容,并未提及该 Bug 已被修复的情况
|
||||
required: true
|
||||
- label: 我已检查了置顶议题(pinned issue),确认我的问题未被提及
|
||||
required: true
|
||||
- type: textarea
|
||||
id: describe
|
||||
attributes:
|
||||
label: 问题描述
|
||||
description: 尽可能详细描述你的问题
|
||||
description: 描述问题时请尽可能详细
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: >-
|
||||
请提供 MAA 版本。可在 MAA -> 设置 -> 软件更新中找到(点击图标可复制)。
|
||||
placeholder: |
|
||||
Resource Version:
|
||||
UI Version:
|
||||
Core Version:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
@@ -25,7 +39,7 @@ body:
|
||||
attributes:
|
||||
label: 日志文件
|
||||
description: |
|
||||
**上传 `debug` 文件夹中的 `asst.log` 和 `gui.log` 日志文件,并说明问题出现的大致时间点**
|
||||
**请在关闭MAA后,上传 `debug` 文件夹中的 `asst.log` 和 `gui.log` 日志文件,并说明问题出现的大致时间点**
|
||||
**请直接将完整的文件拖拽进来,而非自己裁切或复制的片段;若文件体积过大可压缩后再上传**
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -7,9 +7,9 @@ body:
|
||||
attributes:
|
||||
label: 在提问之前...
|
||||
options:
|
||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等
|
||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等
|
||||
required: true
|
||||
- label: 我基本确定这是一个新功能/建议,而不是遇到了 bug(不确定的话请附上日志)
|
||||
- label: 我基本确定这是一个新功能/建议,而不是遇到了 Bug(不确定的话请附上日志)
|
||||
required: true
|
||||
- type: textarea
|
||||
id: describe
|
||||
|
||||
81
.github/ISSUE_TEMPLATE/cn-mumu-report.yaml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
name: MuMu 截图增强反馈(使用中文)
|
||||
description: 有关 MuMu 截图增强功能的集中反馈
|
||||
labels: ['mumu api']
|
||||
body:
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: 在提问之前...
|
||||
options:
|
||||
- label: 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决
|
||||
required: true
|
||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等
|
||||
required: true
|
||||
- label: 我已检查了置顶议题(Pinned Issue),确认我的问题未被提及
|
||||
required: true
|
||||
- label: 我正在使用最新的 MAA 内测版本和最新的**官版** MuMu 模拟器
|
||||
required: true
|
||||
- label: 我已参考文档确定安装路径、实例编号、屏幕编号填写正确,并确认在关闭截图增强模式后问题消失
|
||||
required: true
|
||||
- label: 我未开启高帧率模式,且显存使用策略为“画面表现更好”
|
||||
required: false
|
||||
- label: 我正在使用后台保活功能,并确定该问题仅在开启后台保活时出现
|
||||
required: false
|
||||
- type: textarea
|
||||
id: describe
|
||||
attributes:
|
||||
label: 问题描述
|
||||
description: 描述问题时请尽可能详细
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: >-
|
||||
请提供 MAA 版本和 MuMu 版本。MAA 版本可在 MAA -> 设置 -> 软件更新中找到(点击图标可复制)。MuMu 版本可在右上角菜单按钮 -> 关于 MuMu 中找到。
|
||||
placeholder: |
|
||||
Resource Version:
|
||||
UI Version:
|
||||
Core Version:
|
||||
MuMu 版本号:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: MAA 日志文件
|
||||
description: |
|
||||
**上传 `debug` 文件夹中的 `asst.log` 和 `gui.log` 日志文件,并说明问题出现的大致时间点**
|
||||
**请直接将完整的文件拖拽进来,而非自己裁切或复制的片段;若文件体积过大可压缩后再上传**
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: mumulogs
|
||||
attributes:
|
||||
label: MuMu 问题诊断
|
||||
description: |
|
||||
**在 MuMu 右上角菜单按钮 -> 问题诊断 中点击 复制配置信息,并将全部内容粘贴进来。**
|
||||
**注意隐去 电脑出口IP地址 等以保护个人隐私**
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: 截图
|
||||
description: |
|
||||
如果有,添加屏幕截图以帮助解释你的问题,包括但不限于 MAA 软件截图、游戏画面截图
|
||||
若是**识别相关问题**,请尽可能提供模拟器自带的截图工具截取的无遮挡的**原图**(或通过 adb 截取原图)
|
||||
用其他的工具(如QQ)截取的图片包含窗口边框,不利于我们排除bug
|
||||
`debug` 文件夹下有一些自动截图的错误图片,若有相关的,请一并打包上传
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: others
|
||||
attributes:
|
||||
label: 还有别的吗?
|
||||
description: |
|
||||
操作系统?相关的配置?链接?参考资料?
|
||||
任何能让我们对你所遇到的问题有更多了解的东西
|
||||
validations:
|
||||
required: false
|
||||
2
.github/ISSUE_TEMPLATE/cn-others.yaml
vendored
@@ -1,5 +1,5 @@
|
||||
name: 其他议题(使用中文)
|
||||
description: 提出问题,而不是 bug 反馈或需求建议
|
||||
description: 提出问题,而不是 Bug 反馈或需求建议
|
||||
labels: ['question']
|
||||
body:
|
||||
- type: textarea
|
||||
|
||||
20
.github/ISSUE_TEMPLATE/en-bug-report.yaml
vendored
@@ -24,11 +24,27 @@ body:
|
||||
I have checked the latest beta update and there is no mention
|
||||
of the bug being fixed.
|
||||
required: true
|
||||
- label: >-
|
||||
I have reviewed the pinned issues and confirmed that my issue
|
||||
is not mentioned.
|
||||
required: true
|
||||
- type: textarea
|
||||
id: describe
|
||||
attributes:
|
||||
label: Description
|
||||
description: Describe your problem in as much detail as possible.
|
||||
description: Please provide a detailed description of your issue.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: >-
|
||||
Please provide the MAA version. Can be found in MAA -> Settings -> Update. (Click to copy)
|
||||
placeholder: |
|
||||
Resource Version:
|
||||
UI Version:
|
||||
Core Version:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
@@ -36,7 +52,7 @@ body:
|
||||
attributes:
|
||||
label: Log files
|
||||
description: >-
|
||||
**Upload the `asst.log` and `gui.log` log file in the `debug` folder and**
|
||||
**After closing the MAA, upload the `asst.log` and `gui.log` log file in the `debug` folder and**
|
||||
**indicate the approximate point in time when the problem occurred.**
|
||||
|
||||
**Please drag and drop the full file in, not your own cuttings or copies;**
|
||||
|
||||
27
.github/issue-checker.yml
vendored
@@ -67,6 +67,12 @@ labels:
|
||||
- name: remove roguelike
|
||||
content:
|
||||
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)(?:[Mm]odule: |)roguelike(?:`|)'
|
||||
- name: skip reclamation
|
||||
content:
|
||||
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)(?:[Mm]odule: |)reclamation(?:`|)'
|
||||
- name: remove reclamation
|
||||
content:
|
||||
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)(?:[Mm]odule: |)reclamation(?:`|)'
|
||||
|
||||
- name: skip client
|
||||
content:
|
||||
@@ -167,7 +173,7 @@ labels:
|
||||
- name: roguelike
|
||||
content: "module: roguelike"
|
||||
regexes:
|
||||
"肉[鸽鴿]|集成战略|[Rr]ogue|[Ii]ntegrated [Ss]tategy|I.S.|ローグ"
|
||||
"肉[鸽鴿]|集成战略|[Rr]ogue|[Ii]ntegrated [Ss]tategy|I\\.S\\.|ローグ"
|
||||
skip-if:
|
||||
- skip all
|
||||
- skip module
|
||||
@@ -177,6 +183,20 @@ labels:
|
||||
- remove module
|
||||
- remove roguelike
|
||||
|
||||
# `module: reclamation`
|
||||
- name: reclamation
|
||||
content: "module: reclamation"
|
||||
regexes:
|
||||
"生息|演算|沙洲遗闻|[Ff]ire [Ww]ithin|[Rr]eclamation"
|
||||
skip-if:
|
||||
- skip all
|
||||
- skip module
|
||||
- skip reclamation
|
||||
remove-if:
|
||||
- remove all
|
||||
- remove module
|
||||
- remove reclamation
|
||||
|
||||
# `module: copilot`
|
||||
- name: copilot1
|
||||
content: "module: copilot"
|
||||
@@ -256,7 +276,7 @@ labels:
|
||||
- name: others
|
||||
content: "module: others"
|
||||
regexes:
|
||||
"信用|拜访|登录|开始唤醒|连接模拟器|账号切换|远程控制|干员识别|生息演算|生息盐酸|[Vv]isit|[Ll]ogin|[Ss]tartup|MaaCore(?!.dll)"
|
||||
"信用|拜访|登录|开始唤醒|连接模拟器|账号切换|远程控制|干员识别|[Vv]isit|[Ll]ogin|[Ss]tartup|MaaCore(?!.dll)"
|
||||
skip-if:
|
||||
- skip all
|
||||
- skip module
|
||||
@@ -361,7 +381,7 @@ labels:
|
||||
- name: pr-ambiguous
|
||||
# 不符合 commitizen 的 PR
|
||||
content: ambiguous
|
||||
regexes: '^(?!(?:build|chore|ci|docs?|feat|fix|i18n|perf|refactor|rft|style|test)[\:\.\(\,]|[Rr]evert|[Rr]elease)'
|
||||
regexes: '^(?!(?:build|chore|ci|docs?|feat!?|fix|i18n|perf|refactor|rft|style|test)[\:\.\(\,]|[Rr]evert|[Rr]elease)'
|
||||
mode:
|
||||
pull_request_target:
|
||||
skip-if:
|
||||
@@ -394,6 +414,7 @@ labels:
|
||||
- others
|
||||
- recruit
|
||||
- roguelike
|
||||
- reclamation
|
||||
|
||||
# `release`
|
||||
- name: release
|
||||
|
||||
158095
.github/qodana.sarif.json
vendored
53
.github/workflows/ci.yml
vendored
@@ -82,7 +82,7 @@ jobs:
|
||||
echo "**Full Changelog**: [$last_tag -> $this_tag](https://github.com/MaaAssistantArknights/MaaAssistantArknights/compare/${last_tag}...${this_tag})" >> CHANGELOG.md
|
||||
|
||||
- name: Upload changelog to Github
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
with:
|
||||
name: changelog
|
||||
@@ -106,15 +106,21 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
show-progress: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Cache .nuke/temp, ~/.nuget/packages
|
||||
uses: actions/cache@v3
|
||||
id: cache-nuget
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
.nuke/temp
|
||||
~/.nuget/packages
|
||||
key: ${{ runner.os }}-${{ matrix.msbuild_target }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
|
||||
|
||||
- name: Restore dependencies
|
||||
if: steps.cache-nuget.outputs.cache-hit != 'true'
|
||||
run: dotnet restore
|
||||
|
||||
- name: Bootstrap MaaDeps
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -142,7 +148,7 @@ jobs:
|
||||
$match = "0.0.1"
|
||||
}
|
||||
[xml]$csproj = Get-Content -Path $csprojPath
|
||||
$node = $csproj.Project.PropertyGroup | where {$_.AssemblyName -ne $null}
|
||||
$node = $csproj.Project.PropertyGroup | where {$_.ApplicationVersion -ne $null}
|
||||
$node.InformationalVersion = $tag
|
||||
$node.Version = $match
|
||||
$node.FileVersion = $match
|
||||
@@ -167,7 +173,7 @@ jobs:
|
||||
shell: bash
|
||||
|
||||
- name: Upload MAA to Github
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MAA-win-${{ matrix.lowercase_target }}
|
||||
path: artifacts
|
||||
@@ -219,19 +225,19 @@ jobs:
|
||||
CC: ${{ matrix.arch == 'x86_64' && 'ccache gcc-12' || 'ccache aarch64-linux-gnu-gcc-12' }}
|
||||
CXX: ${{ matrix.arch == 'x86_64' && 'ccache g++-12' || 'ccache aarch64-linux-gnu-g++-12' }}
|
||||
|
||||
- name: Install cross compile tool (CLI)
|
||||
if: ${{ matrix.arch != 'x86_64' }}
|
||||
uses: taiki-e/install-action@v2
|
||||
- name: Setup Cross Compile Toolchains for CLI
|
||||
uses: ./src/maa-cli/.github/actions/setup
|
||||
with:
|
||||
tool: cross
|
||||
os: ubuntu-latest
|
||||
target_arch: ${{ matrix.arch }}
|
||||
|
||||
- name: Build CLI
|
||||
run: |
|
||||
$CARGO_CMD build --release --locked --package maa-cli
|
||||
cargo build --release --locked --package maa-cli --features vendored-openssl
|
||||
cp -v target/$CARGO_BUILD_TARGET/release/maa $GITHUB_WORKSPACE/install/maa
|
||||
env:
|
||||
CARGO_CMD: ${{ matrix.arch == 'x86_64' && 'cargo' || 'cross' }}
|
||||
CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu
|
||||
cargo build --release --locked --package maa-cli --no-default-features \
|
||||
--features git2,vendored-openssl
|
||||
cp -v target/$CARGO_BUILD_TARGET/release/maa $GITHUB_WORKSPACE/appimage-maa
|
||||
working-directory: src/maa-cli
|
||||
|
||||
- name: Build Appimage
|
||||
@@ -245,6 +251,7 @@ jobs:
|
||||
wget -c https://raw.githubusercontent.com/MaaAssistantArknights/design/main/logo/maa-logo_512x512.png -O Maa.AppDir/maa.png
|
||||
mkdir -pv Maa.AppDir/usr/share/icons/hicolor/512x512/apps/
|
||||
cp -v Maa.AppDir/maa.png Maa.AppDir/usr/share/icons/hicolor/512x512/apps/
|
||||
cp -v appimage-maa Maa.AppDir/usr/share/maa/maa
|
||||
chmod a+x Maa.AppDir/usr/share/maa/maa
|
||||
|
||||
cat > Maa.AppDir/maa.desktop <<EOF
|
||||
@@ -262,8 +269,10 @@ jobs:
|
||||
mkdir -pv Maa.AppDir/usr/share/metainfo/
|
||||
cp -v tools/AppImage/io.github.maaassistantarknights.maaassistantarknights.metainfo.xml Maa.AppDir/usr/share/metainfo/
|
||||
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
|
||||
# appimagetool with embedded runtime does not support cross build, till AppImage/appimagetool 7a10b8
|
||||
wget "https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-${{ matrix.arch }}"
|
||||
chmod a+x appimagetool-x86_64.AppImage
|
||||
./appimagetool-x86_64.AppImage Maa.AppDir
|
||||
ARCH=${{ matrix.arch }} ./appimagetool-x86_64.AppImage --runtime-file runtime-${{ matrix.arch }} Maa.AppDir
|
||||
chmod a+x MaaAssistantArknights-${{ matrix.arch }}.AppImage
|
||||
mv -v MaaAssistantArknights-${{ matrix.arch }}.AppImage $GITHUB_WORKSPACE/release/MAA-${{ needs.meta.outputs.tag }}-linux-${{ matrix.arch }}.AppImage
|
||||
|
||||
@@ -274,7 +283,7 @@ jobs:
|
||||
tar czvf $GITHUB_WORKSPACE/release/MAA-${{ needs.meta.outputs.tag }}-linux-${{ matrix.arch }}.tar.gz .
|
||||
|
||||
- name: Upload MAA to Github
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MAA-linux-${{ matrix.arch }}
|
||||
path: |
|
||||
@@ -283,7 +292,7 @@ jobs:
|
||||
|
||||
macOS-Core:
|
||||
needs: meta
|
||||
runs-on: macos-13
|
||||
runs-on: macos-14
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [arm64, x86_64]
|
||||
@@ -314,14 +323,14 @@ jobs:
|
||||
cmake --install build --prefix install
|
||||
|
||||
- name: Upload MAA to Github
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MAACore-macos-${{ matrix.arch }}
|
||||
path: "install/*.dylib"
|
||||
|
||||
macOS-GUI:
|
||||
needs: [meta, macOS-Core]
|
||||
runs-on: macos-13
|
||||
runs-on: macos-14
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -330,13 +339,13 @@ jobs:
|
||||
submodules: recursive
|
||||
|
||||
- name: Download Arm64 MAA from Github
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: MAACore-macos-arm64
|
||||
path: install-arm64
|
||||
|
||||
- name: Download x64 MAA from Github
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: MAACore-macos-x86_64
|
||||
path: install-x86_64
|
||||
@@ -358,7 +367,7 @@ jobs:
|
||||
- name: Build XCFramework
|
||||
run: |
|
||||
xcodebuild -create-xcframework -library libMaaCore.dylib -headers ../include -output MaaCore.xcframework
|
||||
xcodebuild -create-xcframework -library libMaaDerpLearning.dylib -output MaaDerpLearning.xcframework
|
||||
xcodebuild -create-xcframework -library libfastdeploy_ppocr.dylib -output fastdeploy_ppocr.xcframework
|
||||
xcodebuild -create-xcframework -library libonnxruntime.*.dylib -output ONNXRuntime.xcframework
|
||||
xcodebuild -create-xcframework -library libopencv*.dylib -output OpenCV.xcframework
|
||||
working-directory: build
|
||||
@@ -424,7 +433,7 @@ jobs:
|
||||
working-directory: release
|
||||
|
||||
- name: Upload MAA to Github
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MAA-macos-universal
|
||||
path: ${{ startsWith(github.ref, 'refs/tags/v') && 'release/MAA*' || 'src/MaaMacGui/MAA.xcarchive/**' }}
|
||||
@@ -435,7 +444,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download MAA from Github
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: assets
|
||||
|
||||
|
||||
50
.github/workflows/docs-build-test.yml
vendored
@@ -1,50 +0,0 @@
|
||||
name: Build Test for docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- "master"
|
||||
paths:
|
||||
- "docs/**"
|
||||
pull_request:
|
||||
branches:
|
||||
- "dev"
|
||||
paths:
|
||||
- "docs/**"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-test:
|
||||
timeout-minutes: 20
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
show-progress: false
|
||||
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: "npm"
|
||||
cache-dependency-path: "./docs/package-lock.json"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: "./docs"
|
||||
|
||||
- name: Cleanup files
|
||||
run: rm tsconfig.json
|
||||
working-directory: "./docs"
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
working-directory: "./docs"
|
||||
|
||||
- name: Upload artifact to GitHub
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: docs
|
||||
path: "./docs/.vuepress/dist"
|
||||
36
.github/workflows/gen-changelog.yml
vendored
@@ -2,12 +2,16 @@ name: gen-changelog
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, ready_for_review]
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- ready_for_review
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
gen:
|
||||
if: github.event.pull_request.draft == false && startsWith(github.event.pull_request.title, 'Release v') # startsWith 表达式不区分大小写
|
||||
# startsWith 表达式不区分大小写
|
||||
if: github.event.pull_request.draft == false && startsWith(github.event.pull_request.title, 'Release v')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -18,6 +22,8 @@ jobs:
|
||||
|
||||
- name: Extract tag name
|
||||
id: extract_tag
|
||||
env:
|
||||
PR_BODY: ${{ format('{0}/{1}', runner.temp, 'output' ) }}
|
||||
run: |
|
||||
tag_name=$(echo "${{ github.event.pull_request.title }}" | sed -E 's/(Release|release)//' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||
echo "tag_name=$tag_name" >> $GITHUB_OUTPUT
|
||||
@@ -27,19 +33,33 @@ jobs:
|
||||
|
||||
latest_stable_tag=$(git tag -l 'v*' | grep -v '-' | sort -V | tail -n 1) # 上一个 stable 版本
|
||||
newest_tag=$(git describe --tags --match "v*" --abbrev=0) # 最新版本
|
||||
echo "latest_stable_tag: $latest_stable_tag"
|
||||
echo "newest_tag: $newest_tag"
|
||||
echo "latest_stable_tag=$latest_stable_tag" >> $GITHUB_OUTPUT
|
||||
echo "newest_tag=$newest_tag" >> $GITHUB_OUTPUT
|
||||
|
||||
if [[ $tag_name == *-* ]]; then # 判断新版本是否为 beta 版本
|
||||
latest=$newest_tag # 若是,则将 latest 参数设置为最新版本
|
||||
if [[ $tag_name == *-* ]]; then # 判断新版本是否为 beta 版本
|
||||
latest=$newest_tag # 若是,则将 latest 参数设置为最新版本
|
||||
else
|
||||
latest=$latest_stable_tag # 若否,则设置为上一个 stable 版本
|
||||
latest=$latest_stable_tag # 若否,则设置为上一个 stable 版本
|
||||
fi
|
||||
|
||||
echo "latest=$latest" >> $GITHUB_OUTPUT
|
||||
|
||||
cat $GITHUB_OUTPUT
|
||||
|
||||
echo '======='
|
||||
|
||||
echo 'Target RP: ${{ github.event.pull_request.html_url }}' >> $PR_BODY
|
||||
echo '' >> $PR_BODY
|
||||
echo '<details><summary>Debug info</summary>' >> $PR_BODY
|
||||
echo '' >> $PR_BODY
|
||||
echo '```' >> $PR_BODY
|
||||
sed 's/=/: /1' $GITHUB_OUTPUT >> $PR_BODY
|
||||
echo '```' >> $PR_BODY
|
||||
echo '' >> $PR_BODY
|
||||
echo '</details>' >> $PR_BODY
|
||||
|
||||
cat $PR_BODY
|
||||
|
||||
- name: Generate Changelog
|
||||
run: |
|
||||
git switch dev
|
||||
@@ -63,7 +83,7 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
title: ${{ steps.extract_tag.outputs.pr_title }}
|
||||
body: ${{ github.event.pull_request.html_url }}
|
||||
body-path: ${{ format('{0}/{1}', runner.temp, 'output' ) }}
|
||||
base: "dev"
|
||||
branch: "changelog"
|
||||
delete-branch: true
|
||||
|
||||
2
.github/workflows/issue-checker.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: zzyyyl/issue-checker@v1.7
|
||||
- uses: zzyyyl/issue-checker@v1.8
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
configuration-path: .github/issue-checker.yml
|
||||
|
||||
49
.github/workflows/markdown-checker.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Lint Markdown files
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "**/*.md"
|
||||
- ".github/workflows/lint-markdown.yml"
|
||||
pull_request:
|
||||
paths:
|
||||
- "**/*.md"
|
||||
- ".github/workflows/lint-markdown.yml"
|
||||
schedule:
|
||||
- cron: "44 7 * * 2"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint Markdown
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
- name: Lint Markdown
|
||||
uses: DavidAnson/markdownlint-cli2-action@v16
|
||||
with:
|
||||
config: docs/.markdownlint.yaml
|
||||
globs: |
|
||||
README.md
|
||||
docs/**/*.md
|
||||
|
||||
# check-links:
|
||||
# name: Check Dead Links
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Check out code
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# show-progress: false
|
||||
#
|
||||
# - name: Check Dead Link
|
||||
# uses: umbrelladocs/action-linkspector@v1
|
||||
# with:
|
||||
# # Use github-pr-review when triggered by a pull request; otherwise, use github-check
|
||||
# reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }}
|
||||
# filter_mode: nofilter
|
||||
# fail_on_error: true
|
||||
12
.github/workflows/pr-checker.yml
vendored
@@ -1,12 +1,9 @@
|
||||
name: PR Checker
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
types: [opened, edited, ready_for_review, reopened, synchronize]
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
check_commit_name_in_pr:
|
||||
@@ -16,7 +13,6 @@ jobs:
|
||||
- name: Cleanup Previous Comment
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { data: comments } = await github.rest.issues.listComments({
|
||||
owner: context.repo.owner,
|
||||
@@ -32,11 +28,9 @@ jobs:
|
||||
comment_id: previousComment.id
|
||||
});
|
||||
}
|
||||
|
||||
- name: Check Commits
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { data: commits } = await github.rest.pulls.listCommits({
|
||||
owner: context.repo.owner,
|
||||
@@ -45,7 +39,7 @@ jobs:
|
||||
per_page: 100
|
||||
});
|
||||
|
||||
const regex = /^((build|chore|ci|docs?|feat|fix|perf|refactor|rft|style|test|i18n|typo)[\:\.\(\,]|[Rr]evert|[Rr]elease)/;
|
||||
const regex = /^((build|chore|ci|docs?|feat!?|fix|perf|refactor|rft|style|test|i18n|typo)[\:\.\(\,]|[Rr]evert|[Rr]elease)/;
|
||||
const invalidCommits = commits.filter(commit => !regex.test(commit.commit.message) || commit.parents.length > 1);
|
||||
|
||||
console.log(`Checked ${commits.length} commit(s)`);
|
||||
@@ -62,4 +56,4 @@ jobs:
|
||||
});
|
||||
|
||||
core.setFailed(`Found ${invalidCommits.length} invalid commit(s):\n${invalidCommitNames.join("\n-------------------\n")}`);
|
||||
}
|
||||
}
|
||||
45
.github/workflows/qodana.yml
vendored
@@ -1,45 +0,0 @@
|
||||
name: Qodana static analysis
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request: # 在 PR 更新的场合进行扫描
|
||||
paths:
|
||||
- ".github/workflows/qodana.yml"
|
||||
- "src/MaaWpfGui/*"
|
||||
- "qodana.yaml"
|
||||
- "src/MaaWpfGui/**"
|
||||
- "MAA.sln"
|
||||
push: # 在主分支推送代码的场合进行扫描
|
||||
branches:
|
||||
- master
|
||||
- "releases/*"
|
||||
- dev
|
||||
paths:
|
||||
- ".github/workflows/qodana.yml"
|
||||
- "src/MaaWpfGui/**"
|
||||
- "qodana.yaml"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
checks: write
|
||||
|
||||
jobs:
|
||||
qodana:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
|
||||
fetch-depth: 0 # a full history is required for pull request analysis
|
||||
show-progress: false
|
||||
|
||||
- name: Qodana Scan
|
||||
uses: JetBrains/qodana-action@main
|
||||
with:
|
||||
pr-mode: false
|
||||
post-pr-comment: true
|
||||
args: --baseline,.github/qodana.sarif.json
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
|
||||
51
.github/workflows/release-nightly-ota.yml
vendored
@@ -37,6 +37,7 @@ jobs:
|
||||
tag: ${{ steps.set_tag.outputs.tag }}
|
||||
pre_version: ${{ steps.set_tag.outputs.pre_version }}
|
||||
main_tag_name: ${{ steps.push_main_tag.outputs.main_tag_name }}
|
||||
changelog: ${{ steps.generate_changelog.outputs.changelog }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -45,7 +46,6 @@ jobs:
|
||||
#ref: ${{ inputs.ref }}
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
show-progress: false
|
||||
|
||||
- name: Checkout ref
|
||||
run: |
|
||||
@@ -60,6 +60,9 @@ jobs:
|
||||
- name: Set tag
|
||||
id: set_tag
|
||||
run: |
|
||||
# pre_version是上一个公版,这里需要拉上一个tag,避免堆积过多commit
|
||||
$latest_tag=$(git describe --tags --abbrev=0)
|
||||
echo "latest_tag=$latest_tag" >> $env:GITHUB_OUTPUT
|
||||
$described = $(git describe --tags --long --match 'v*')
|
||||
$ids = $($described -split "-")
|
||||
if ($ids.length -eq 3) {
|
||||
@@ -90,20 +93,58 @@ jobs:
|
||||
git push --tags origin HEAD:refs/tags/$main_tag_name -f
|
||||
echo "main_tag_name=$main_tag_name" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: Generate Changelog
|
||||
id: generate_changelog
|
||||
run: |
|
||||
python3 tools/ChangelogGenerator/changelog_generator.py --latest "${{ steps.set_tag.outputs.latest_tag }}" --tag "${{ steps.set_tag.outputs.tag }}"
|
||||
$content=$(((Get-Content .\changelog.md) | Select-Object -Skip 2) -join "\n\n")
|
||||
echo "changelog=$content" >> $env:GITHUB_OUTPUT
|
||||
echo $content
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PYTHONIOENCODING: "utf-8"
|
||||
|
||||
- name: Cache .nuke/temp, ~/.nuget/packages
|
||||
uses: actions/cache@v3
|
||||
id: cache-nuget
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
.nuke/temp
|
||||
~/.nuget/packages
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
|
||||
|
||||
- name: Restore dependencies
|
||||
if: steps.cache-nuget.outputs.cache-hit != 'true'
|
||||
run: dotnet restore
|
||||
|
||||
- name: Bootstrap MaaDeps
|
||||
run: |
|
||||
python3 maadeps-download.py ${{ matrix.lowercase_target }}-windows
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Taggify Version
|
||||
run: |
|
||||
$csprojPath = "src/MaaWpfGui/MaaWpfGui.csproj"
|
||||
$csprojPath = Resolve-Path -Path $csprojPath
|
||||
$tag = '${{ steps.set_tag.outputs.tag }}' -replace '.*?/', ''
|
||||
if ($tag -match '\d+(\.\d+){1,3}') {
|
||||
$match = $Matches[0]
|
||||
} else {
|
||||
$match = "0.0.1"
|
||||
}
|
||||
echo "Tag value: $tag"
|
||||
echo "Version value: $match"
|
||||
[xml]$csproj = Get-Content -Path $csprojPath
|
||||
$node = $csproj.Project.PropertyGroup | where {$_.ApplicationVersion -ne $null}
|
||||
$node.InformationalVersion = $tag
|
||||
$node.Version = $match
|
||||
$node.FileVersion = $match
|
||||
$node.AssemblyVersion = $match
|
||||
$csproj.Save($csprojPath)
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Run './build.cmd DevBuild'
|
||||
run: |
|
||||
$env:GITHUB_WORKFLOW = 'dev-build-win' # pretend this is a dev-build-win workflow
|
||||
@@ -116,7 +157,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload MAA to Github
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MAA-win-${{ matrix.lowercase_target }}
|
||||
path: artifacts
|
||||
@@ -162,7 +203,7 @@ jobs:
|
||||
show-progress: false
|
||||
|
||||
- name: Download MAA from Github
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: MAA-win-${{ matrix.target }}
|
||||
path: ${{ format('{0}/{1}', 'build-ota', needs.build-win-nightly.outputs.tag) }}
|
||||
@@ -207,7 +248,7 @@ jobs:
|
||||
run: |
|
||||
pre_version=${{ needs.build-win-nightly.outputs.pre_version }}
|
||||
cur_version=${{ needs.build-win-nightly.outputs.main_tag_name }}
|
||||
echo -e "${{ inputs.release_body || '' }}\n\n**Full Changelog**: [$pre_version -> $cur_version](https://github.com/$GITHUB_REPOSITORY/compare/$pre_version...$cur_version)" > alpha_changelog.md
|
||||
echo -e "${{ inputs.release_body || '' }}\n\n${{ needs.build-win-nightly.outputs.changelog }}\n\n**Full Changelog**: [$pre_version -> $cur_version](https://github.com/$GITHUB_REPOSITORY/compare/$pre_version...$cur_version)" > alpha_changelog.md
|
||||
export r=$(cat alpha_changelog.md)
|
||||
|
||||
# https://github.com/svenstaro/upload-release-action
|
||||
|
||||
46
.github/workflows/release-ota.yml
vendored
@@ -9,12 +9,12 @@ on:
|
||||
limit:
|
||||
description: Number of releases to fetch from MaaAssistantArknights, 2 at least
|
||||
required: false
|
||||
default: 31
|
||||
default: '31'
|
||||
type: number
|
||||
limit_2:
|
||||
description: Number of releases to fetch from MaaRelease
|
||||
required: false
|
||||
default: 30
|
||||
default: '30'
|
||||
type: number
|
||||
|
||||
env:
|
||||
@@ -25,8 +25,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch MaaRelease
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
show-progress: false
|
||||
repository: ${{ format('{0}/{1}', github.repository_owner, 'MaaRelease') }}
|
||||
path: MaaRelease
|
||||
fetch-depth: 0
|
||||
@@ -65,7 +66,7 @@ jobs:
|
||||
PUSH_REMOTE: https://github-actions[bot]:${{ secrets.MAARELEASE_RELEASE }}@github.com/${{ github.repository_owner }}/MaaRelease
|
||||
|
||||
- name: Upload release config to GitHub
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MaaReleaseConfig
|
||||
path: ./build-ota/config
|
||||
@@ -83,19 +84,21 @@ jobs:
|
||||
- x64
|
||||
steps:
|
||||
- name: Download release config
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Fetch MaaRelease
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
show-progress: false
|
||||
repository: ${{ format('{0}/{1}', github.repository_owner, 'MaaRelease') }}
|
||||
path: MaaRelease
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.MAARELEASE_RELEASE }}
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
show-progress: false
|
||||
path: MaaAssistantArknights
|
||||
|
||||
- name: Download latest version for server
|
||||
@@ -123,7 +126,7 @@ jobs:
|
||||
|
||||
make-ota-mac:
|
||||
needs: create-tag
|
||||
runs-on: macos-13
|
||||
runs-on: macos-14
|
||||
steps:
|
||||
- name: Fetch release info
|
||||
run: gh release list --repo 'MaaAssistantArknights/MaaAssistantArknights' --limit ${{ inputs.limit || 31 }} | tee ./release_maa.txt
|
||||
@@ -200,30 +203,3 @@ jobs:
|
||||
- name: Setup release mirror
|
||||
run: |
|
||||
gh workflow --repo MaaAssistantArknights/MaaRelease run release-mirrors.yml
|
||||
|
||||
- name: Deploy docs
|
||||
run: |
|
||||
mkdir -p ${{ runner.temp }}/new
|
||||
mkdir -p ${{ runner.temp }}/old
|
||||
gh api /repos/MaaAssistantArknights/MaaAssistantArknights/tags --jq '.[].name' > ${{ runner.temp }}/release_maa.txt
|
||||
export NEW_VERSION=$(sed -n '1p' ${{ runner.temp }}/release_maa.txt)
|
||||
echo "NEW_VERSION: $NEW_VERSION"
|
||||
export OLD_VERSION=$(sed -n '2p' ${{ runner.temp }}/release_maa.txt)
|
||||
echo "OLD_VERSION: $OLD_VERSION"
|
||||
gh api "/repos/MaaAssistantArknights/MaaAssistantArknights/tarball/$NEW_VERSION" > ${{ runner.temp }}/new.tar.gz
|
||||
gh api "/repos/MaaAssistantArknights/MaaAssistantArknights/tarball/$OLD_VERSION" > ${{ runner.temp }}/old.tar.gz
|
||||
tar -xzf ${{ runner.temp }}/new.tar.gz -C ${{ runner.temp }}/new
|
||||
tar -xzf ${{ runner.temp }}/old.tar.gz -C ${{ runner.temp }}/old
|
||||
export NEW_PATH="${{ runner.temp }}/new/$(ls ${{ runner.temp }}/new)/docs"
|
||||
echo "NEW_PATH: $NEW_PATH"
|
||||
export OLD_PATH="${{ runner.temp }}/old/$(ls ${{ runner.temp }}/old)/docs"
|
||||
echo "OLD_PATH: $OLD_PATH"
|
||||
export DOCS_DIFF=$(diff -aqr $NEW_PATH $OLD_PATH)
|
||||
if [ -n "$DOCS_DIFF" ]; then
|
||||
echo "Found changes, start to deploy the docs:"
|
||||
echo "$DOCS_DIFF"
|
||||
gh workflow --repo MaaAssistantArknights/maa-website run azure-deploy.yaml
|
||||
echo "Deploying the docs."
|
||||
else
|
||||
echo "Nothing changed, exit."
|
||||
fi
|
||||
|
||||
55
.github/workflows/res-update-game.yml
vendored
@@ -44,22 +44,48 @@ jobs:
|
||||
ref: main
|
||||
path: .\tools\ResourceUpdater\x64\Release\Official
|
||||
sparse-checkout: |
|
||||
levels.json
|
||||
item
|
||||
building_skill
|
||||
gamedata/excel
|
||||
/levels.json
|
||||
/item
|
||||
/building_skill
|
||||
/gamedata/excel/item_table.json
|
||||
/gamedata/excel/building_data.json
|
||||
/gamedata/excel/range_table.json
|
||||
/gamedata/excel/character_table.json
|
||||
/gamedata/excel/gacha_table.json
|
||||
/gamedata/excel/roguelike_topic_table.json
|
||||
/gamedata/excel/activity_table.json
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Clone ArknightsGameResource_Yostar for Overseas
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
show-progress: false
|
||||
repository: Kengxxiao/ArknightsGameData_YoStar
|
||||
repository: Kengxxiao/ArknightsGameData_Yostar
|
||||
ref: main
|
||||
path: .\tools\ResourceUpdater\x64\Release\Overseas
|
||||
sparse-checkout: |
|
||||
en_US/gamedata/excel
|
||||
ja_JP/gamedata/excel
|
||||
ko_kr/gamedata/excel
|
||||
/en_US/gamedata/excel/item_table.json
|
||||
/en_US/gamedata/excel/building_data.json
|
||||
/en_US/gamedata/excel/range_table.json
|
||||
/en_US/gamedata/excel/character_table.json
|
||||
/en_US/gamedata/excel/gacha_table.json
|
||||
/en_US/gamedata/excel/roguelike_topic_table.json
|
||||
/en_US/gamedata/excel/activity_table.json
|
||||
/ja_JP/gamedata/excel/item_table.json
|
||||
/ja_JP/gamedata/excel/building_data.json
|
||||
/ja_JP/gamedata/excel/range_table.json
|
||||
/ja_JP/gamedata/excel/character_table.json
|
||||
/ja_JP/gamedata/excel/gacha_table.json
|
||||
/ja_JP/gamedata/excel/roguelike_topic_table.json
|
||||
/ja_JP/gamedata/excel/activity_table.json
|
||||
/ko_KR/gamedata/excel/item_table.json
|
||||
/ko_KR/gamedata/excel/building_data.json
|
||||
/ko_KR/gamedata/excel/range_table.json
|
||||
/ko_KR/gamedata/excel/character_table.json
|
||||
/ko_KR/gamedata/excel/gacha_table.json
|
||||
/ko_KR/gamedata/excel/roguelike_topic_table.json
|
||||
/ko_KR/gamedata/excel/activity_table.json
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Clone arknights-toolbox-update for Taiwan
|
||||
uses: actions/checkout@v4
|
||||
@@ -95,23 +121,23 @@ jobs:
|
||||
echo "numbers: "$numbers
|
||||
|
||||
$length = $numbers.Length
|
||||
$isAllEqual = $true
|
||||
$noDiff = $true
|
||||
for ($i = 0; $i -lt $length; $i += 2) {
|
||||
$firstNumber = $numbers[$i]
|
||||
$secondNumber = $numbers[$i+1]
|
||||
|
||||
if ($firstNumber -gt 1) {
|
||||
$isAllEqual = $false
|
||||
$noDiff = $false
|
||||
break
|
||||
}
|
||||
|
||||
if ($firstNumber -ne $secondNumber) {
|
||||
$isAllEqual = $false
|
||||
$noDiff = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
echo "isAllEqual: "$isAllEqual
|
||||
echo "only_sorted=$isAllEqual" >> $env:GITHUB_OUTPUT
|
||||
echo "noDiff: "$noDiff
|
||||
echo "only_sorted=$noDiff" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: Cancelling
|
||||
if: steps.check_only_sorted.outputs.only_sorted == 'True'
|
||||
@@ -133,7 +159,7 @@ jobs:
|
||||
} else {
|
||||
$commit_msg = "chore: Auto Update Game Resources - $(Get-Date -Format 'yyyy-MM-dd')"
|
||||
}
|
||||
git commit -m "$commit_msg" -m "" -m "[skip changelog]"
|
||||
git commit -m "$commit_msg" -m "[skip changelog]"
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
echo "have_commits=True" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
@@ -151,6 +177,7 @@ jobs:
|
||||
github_token: ${{ secrets.MISTEOWORKFLOW }}
|
||||
|
||||
- name: Update OTA resource
|
||||
if: steps.add_files.outputs.have_commits == 'True'
|
||||
run: |
|
||||
gh workflow --repo MaaAssistantArknights/MaaRelease run update-resource.yml
|
||||
|
||||
|
||||
29
.github/workflows/smoke-testing.yml
vendored
@@ -33,16 +33,11 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
- name: Setup NuGet
|
||||
uses: NuGet/setup-nuget@v1.2.0
|
||||
|
||||
- name: Restore NuGet packages
|
||||
run: |
|
||||
nuget restore MAA.sln
|
||||
if ($LASTEXITCODE) { nuget restore MAA.sln }
|
||||
if ($LASTEXITCODE) { nuget restore MAA.sln }
|
||||
|
||||
submodules: recursive
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
|
||||
- name: Bootstrap MaaDeps
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -59,17 +54,17 @@ jobs:
|
||||
run: |
|
||||
.\x64\Debug\Sample.exe
|
||||
|
||||
- name: Run tests - YoStarJP
|
||||
- name: Run tests - YostarJP
|
||||
run: |
|
||||
.\x64\Debug\Sample.exe YoStarJP
|
||||
.\x64\Debug\Sample.exe YostarJP
|
||||
|
||||
- name: Run tests - YoStarEN
|
||||
- name: Run tests - YostarEN
|
||||
run: |
|
||||
.\x64\Debug\Sample.exe YoStarEN
|
||||
.\x64\Debug\Sample.exe YostarEN
|
||||
|
||||
- name: Run tests - YoStarKR
|
||||
- name: Run tests - YostarKR
|
||||
run: |
|
||||
.\x64\Debug\Sample.exe YoStarKR
|
||||
.\x64\Debug\Sample.exe YostarKR
|
||||
|
||||
- name: Run tests - txwy
|
||||
run: |
|
||||
@@ -77,7 +72,7 @@ jobs:
|
||||
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: log
|
||||
path: .\x64\Debug\debug
|
||||
|
||||
109
.github/workflows/website-workflow.yml
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
name: MaaWebsite Workflow
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
- "dev"
|
||||
paths:
|
||||
- ".github/workflows/website-workflow.yml"
|
||||
- "docs/**"
|
||||
- "website/**"
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/website-workflow.yml"
|
||||
- "docs/**"
|
||||
- "website/**"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
deploy-to-prod-env:
|
||||
description: "Deploy to production environment"
|
||||
default: false
|
||||
required: true
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
build:
|
||||
timeout-minutes: 20
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
run_install: false
|
||||
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
cache-dependency-path: './website/pnpm-lock.yaml'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
working-directory: "./website"
|
||||
|
||||
- name: Build
|
||||
run: pnpm run build
|
||||
working-directory: "./website"
|
||||
|
||||
- name: Upload artifact to GitHub
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: "./website/dist"
|
||||
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.event_name != 'pull_request'
|
||||
steps:
|
||||
- name: Download website artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
|
||||
- name: Set deployment environment
|
||||
id: set-deployment-env
|
||||
run: |
|
||||
if [[ "${{ github.event_name }}" != "workflow_dispatch" && "${{ github.ref }}" == "refs/heads/master" ]] || [[ "${{ github.event.inputs.deploy-to-prod-env }}" == "true" ]]; then
|
||||
echo "AZURE_TARGET_ENV=prod" >> $GITHUB_ENV
|
||||
else
|
||||
echo "AZURE_TARGET_ENV=dev" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Show environment
|
||||
run: echo ${{ env.AZURE_TARGET_ENV }}
|
||||
|
||||
- name: Deploy to Azure (prod)
|
||||
id: deploy-prod
|
||||
uses: Azure/static-web-apps-deploy@v1
|
||||
if: env.AZURE_TARGET_ENV == 'prod'
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_MAA_WEBSITE }}
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
action: "upload"
|
||||
app_location: "."
|
||||
api_location: ""
|
||||
skip_app_build: true
|
||||
skip_api_build: true
|
||||
|
||||
- name: Deploy to Azure (dev)
|
||||
id: deploy-dev
|
||||
uses: Azure/static-web-apps-deploy@v1
|
||||
if: env.AZURE_TARGET_ENV == 'dev'
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_MAA_WEBSITE }}
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
action: "upload"
|
||||
deployment_environment: dev
|
||||
app_location: "."
|
||||
api_location: ""
|
||||
skip_app_build: true
|
||||
skip_api_build: true
|
||||
1
.gitignore
vendored
@@ -447,3 +447,4 @@ enc_temp_folder/*
|
||||
/resource/Arknights-Tile-Pos/act2bossrush_04-activities-act2bossrush-level_bossrush2_04.json
|
||||
# CF 活动关卡(异格夜刀),手动改的地图
|
||||
/resource/Arknights-Tile-Pos/act24side_09-activities-act24side-level_act24side_09.json
|
||||
/src/MaaWpfGui/FodyWeavers.xml
|
||||
|
||||
3
.gitmodules
vendored
@@ -12,3 +12,6 @@
|
||||
[submodule "src/maa-cli"]
|
||||
path = src/maa-cli
|
||||
url = https://github.com/MaaAssistantArknights/maa-cli.git
|
||||
[submodule "3rdparty/EmulatorExtras"]
|
||||
path = 3rdparty/EmulatorExtras
|
||||
url = https://github.com/MaaXYZ/EmulatorExtras.git
|
||||
|
||||
5
.linkspector.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
dirs:
|
||||
- .
|
||||
useGitIgnore: true
|
||||
ignorePatterns:
|
||||
- pattern: "^https?://127.0.0.1(:\\d+)?/"
|
||||
1
3rdparty/EmulatorExtras
vendored
Submodule
172
3rdparty/include/Arknights-Tile-Pos/TileCalc.hpp
vendored
@@ -1,172 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <cmath>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <meojson/json.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
|
||||
#include "TileDef.hpp"
|
||||
|
||||
namespace Map
|
||||
{
|
||||
struct Tile
|
||||
{
|
||||
int heightType = 0;
|
||||
int buildableType = 0;
|
||||
std::string tileKey;
|
||||
};
|
||||
|
||||
class Level
|
||||
{
|
||||
public:
|
||||
Level(const json::value& data);
|
||||
int get_width() const { return width; }
|
||||
int get_height() const { return height; }
|
||||
Tile get_item(int y, int x) const { return tiles[y][x]; }
|
||||
std::vector<cv::Point3d> view;
|
||||
LevelKey key;
|
||||
|
||||
private:
|
||||
int height = 0;
|
||||
int width = 0;
|
||||
std::vector<std::vector<Tile>> tiles;
|
||||
};
|
||||
|
||||
class TileCalc
|
||||
{
|
||||
public:
|
||||
TileCalc(int width, int height);
|
||||
|
||||
bool run(const Level& level, bool side, std::vector<std::vector<cv::Point2d>>& out_pos,
|
||||
std::vector<std::vector<Tile>>& out_tiles, double shift_x = 0, double shift_y = 0) const;
|
||||
|
||||
private:
|
||||
bool adapter(double& x, double& y) const;
|
||||
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
const double degree = atan(1.0) * 4 / 180;
|
||||
std::vector<Level> levels;
|
||||
cv::Mat MatrixP = cv::Mat(4, 4, CV_64F);
|
||||
cv::Mat MatrixX = cv::Mat(4, 4, CV_64F);
|
||||
cv::Mat MatrixY = cv::Mat(4, 4, CV_64F);
|
||||
};
|
||||
|
||||
inline void InitMat4x4(cv::Mat& m, double (*num)[4])
|
||||
{
|
||||
for (int i = 0; i < m.rows; i++)
|
||||
for (int j = 0; j < m.cols; j++)
|
||||
m.at<double>(i, j) = num[i][j];
|
||||
}
|
||||
|
||||
inline Level::Level(const json::value& data)
|
||||
{
|
||||
key.stageId = data.at("stageId").as_string();
|
||||
key.code = data.at("code").as_string();
|
||||
key.levelId = data.at("levelId").as_string();
|
||||
key.name = data.get("name", "null");
|
||||
this->height = data.at("height").as_integer();
|
||||
this->width = data.at("width").as_integer();
|
||||
for (const json::value& point_data : data.at("view").as_array()) {
|
||||
cv::Point3d tmp;
|
||||
auto point_array = point_data.as_array();
|
||||
tmp.x = point_array[0].as_double();
|
||||
tmp.y = point_array[1].as_double();
|
||||
tmp.z = point_array[2].as_double();
|
||||
this->view.emplace_back(std::move(tmp));
|
||||
}
|
||||
for (const json::value& row : data.at("tiles").as_array()) {
|
||||
std::vector<Tile> tmp;
|
||||
tmp.reserve(this->width);
|
||||
for (const json::value& tile : row.as_array()) {
|
||||
tmp.emplace_back(Tile { tile.at("heightType").as_integer(), tile.at("buildableType").as_integer(),
|
||||
tile.get("tileKey", std::string()) });
|
||||
}
|
||||
tiles.emplace_back(std::move(tmp));
|
||||
}
|
||||
}
|
||||
|
||||
inline TileCalc::TileCalc(int width, int height)
|
||||
{
|
||||
this->width = width;
|
||||
this->height = height;
|
||||
double ratio = static_cast<double>(height) / width;
|
||||
double matrixP[4][4] { { ratio / tan(20 * degree), 0, 0, 0 },
|
||||
{ 0, 1 / tan(20 * degree), 0, 0 },
|
||||
{ 0, 0, -(1000 + 0.3) / (1000 - 0.3), -(1000 * 0.3 * 2) / (1000 - 0.3) },
|
||||
{ 0, 0, -1, 0 } };
|
||||
InitMat4x4(this->MatrixP, matrixP);
|
||||
double matrixX[4][4] { { 1, 0, 0, 0 },
|
||||
{ 0, cos(30 * degree), -sin(30 * degree), 0 },
|
||||
{ 0, -sin(30 * degree), -cos(30 * degree), 0 },
|
||||
{ 0, 0, 0, 1 } };
|
||||
InitMat4x4(this->MatrixX, matrixX);
|
||||
double matrixY[4][4] { { cos(10 * degree), 0, sin(10 * degree), 0 },
|
||||
{ 0, 1, 0, 0 },
|
||||
{ -sin(10 * degree), 0, cos(10 * degree), 0 },
|
||||
{ 0, 0, 0, 1 } };
|
||||
InitMat4x4(this->MatrixY, matrixY);
|
||||
}
|
||||
|
||||
inline bool TileCalc::run(const Level& level, bool side, std::vector<std::vector<cv::Point2d>>& out_pos,
|
||||
std::vector<std::vector<Tile>>& out_tiles, double shift_x, double shift_y) const
|
||||
{
|
||||
auto [x, y, z] = level.view[side ? 1 : 0];
|
||||
double adapter_y = 0, adapter_z = 0;
|
||||
this->adapter(adapter_y, adapter_z);
|
||||
double matrix[4][4] {
|
||||
{ 1, 0, 0, -x }, { 0, 1, 0, -y - adapter_y }, { 0, 0, 1, -z - adapter_z }, { 0, 0, 0, 1 }
|
||||
};
|
||||
auto raw = cv::Mat(cv::Size(4, 4), CV_64F);
|
||||
auto Finall_Matrix = cv::Mat(cv::Size(4, 4), CV_64F);
|
||||
InitMat4x4(raw, matrix);
|
||||
if (side) {
|
||||
Finall_Matrix = this->MatrixP * this->MatrixX * this->MatrixY * raw;
|
||||
}
|
||||
else {
|
||||
Finall_Matrix = this->MatrixP * this->MatrixX * raw;
|
||||
}
|
||||
int h = level.get_height();
|
||||
int w = level.get_width();
|
||||
auto map_point = cv::Mat(cv::Size(1, 4), CV_64F);
|
||||
map_point.at<double>(3, 0) = 1;
|
||||
auto tmp_pos = std::vector<cv::Point2d>(w);
|
||||
auto tmp_tiles = std::vector<Tile>(w);
|
||||
for (int i = 0; i < h; i++) {
|
||||
for (int j = 0; j < w; j++) {
|
||||
tmp_tiles[j] = level.get_item(i, j);
|
||||
map_point.at<double>(0, 0) = j - (w - 1) / 2.0 + shift_x;
|
||||
map_point.at<double>(1, 0) = (h - 1) / 2.0 - i + shift_y;
|
||||
map_point.at<double>(2, 0) = tmp_tiles[j].heightType * -0.4;
|
||||
cv::Mat view_point = Finall_Matrix * map_point;
|
||||
view_point = view_point / view_point.at<double>(3, 0);
|
||||
view_point = (view_point + 1) / 2;
|
||||
tmp_pos[j] = cv::Point2d(view_point.at<double>(0, 0) * this->width,
|
||||
(1 - view_point.at<double>(1, 0)) * this->height);
|
||||
}
|
||||
out_pos.emplace_back(tmp_pos);
|
||||
out_tiles.emplace_back(tmp_tiles);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool TileCalc::adapter(double& x, double& y) const
|
||||
{
|
||||
const double fromRatio = 9.0 / 16;
|
||||
const double toRatio = 3.0 / 4;
|
||||
double ratio = static_cast<double>(height) / width;
|
||||
if (ratio < fromRatio - 0.00001) {
|
||||
x = 0;
|
||||
y = 0;
|
||||
return false;
|
||||
}
|
||||
double t = (ratio - fromRatio) / (toRatio - fromRatio);
|
||||
x = -1.4 * t;
|
||||
y = -2.8 * t;
|
||||
return true;
|
||||
}
|
||||
} // namespace Map
|
||||
137
3rdparty/include/Arknights-Tile-Pos/TileCalc2.hpp
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
#pragma once
|
||||
|
||||
#include <meojson/json.hpp>
|
||||
#include <numbers>
|
||||
#include <opencv2/core/matx.hpp>
|
||||
#include <opencv2/core/types.hpp>
|
||||
|
||||
#include "TileDef.hpp"
|
||||
|
||||
namespace Map::TileCalc2
|
||||
{
|
||||
using vec3d = cv::Vec3d;
|
||||
using matrix4x4 = cv::Matx44d;
|
||||
static constexpr double degree = std::numbers::pi / 180;
|
||||
|
||||
inline vec3d camera_pos(const Level& level, bool side = false, int width = 1280, int height = 720)
|
||||
{
|
||||
const auto [x, y, z] = level.view[side ? 1 : 0];
|
||||
|
||||
static constexpr double fromRatio = 9. / 16;
|
||||
static constexpr double toRatio = 3. / 4;
|
||||
const double ratio = static_cast<double>(height) / width;
|
||||
const double t = (fromRatio - ratio) / (fromRatio - toRatio);
|
||||
const vec3d pos_adj = { -1.4 * t, -2.8 * t, 0 };
|
||||
return { x + pos_adj[0], y + pos_adj[1], z + pos_adj[2] };
|
||||
}
|
||||
|
||||
inline vec3d camera_euler_angles_yxz(const Level& /*level*/, bool side = false)
|
||||
{
|
||||
if (side) {
|
||||
return { 10 * degree, 30 * degree, 0 };
|
||||
}
|
||||
|
||||
return { 0, 30 * degree, 0 };
|
||||
}
|
||||
|
||||
inline matrix4x4 camera_matrix_from_trans(
|
||||
const vec3d& pos,
|
||||
const vec3d& euler,
|
||||
double ratio,
|
||||
double fov_2_y = 20 * degree,
|
||||
double far = 1000,
|
||||
double near = 0.3)
|
||||
{
|
||||
const double cos_y = std::cos(euler[0]);
|
||||
const double sin_y = std::sin(euler[0]);
|
||||
const double cos_x = std::cos(euler[1]);
|
||||
const double sin_x = std::sin(euler[1]);
|
||||
const double tan_f = std::tan(fov_2_y);
|
||||
|
||||
const matrix4x4 translate = {
|
||||
1, 0, 0, -pos[0], //
|
||||
0, 1, 0, -pos[1], //
|
||||
0, 0, 1, -pos[2], //
|
||||
0, 0, 0, 1,
|
||||
};
|
||||
const matrix4x4 matrixY = {
|
||||
cos_y, 0, sin_y, 0, //
|
||||
0, 1, 0, 0, //
|
||||
-sin_y, 0, cos_y, 0, //
|
||||
0, 0, 0, 1,
|
||||
};
|
||||
const matrix4x4 matrixX = {
|
||||
1, 0, 0, 0, //
|
||||
0, cos_x, -sin_x, 0, //
|
||||
0, -sin_x, -cos_x, 0, //
|
||||
0, 0, 0, 1,
|
||||
};
|
||||
const matrix4x4 proj = {
|
||||
// clang-format off
|
||||
ratio / tan_f, 0, 0, 0,
|
||||
0, 1 / tan_f, 0, 0,
|
||||
0, 0, -(far + near) / (far - near), -(far * near * 2) / (far - near),
|
||||
0, 0, -1, 0,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
return proj * matrixX * matrixY * translate;
|
||||
}
|
||||
|
||||
inline cv::Point
|
||||
world_to_screen(const Level& level, const vec3d& world_pos, bool side, const vec3d& offset = {})
|
||||
{
|
||||
static constexpr double width = 1280;
|
||||
static constexpr double height = 720;
|
||||
const vec3d pos_cam = camera_pos(level, side, width, height) + offset;
|
||||
const vec3d euler = camera_euler_angles_yxz(level, side);
|
||||
const matrix4x4 matrix = camera_matrix_from_trans(pos_cam, euler, height / width);
|
||||
auto result = matrix * cv::Point3d(world_pos);
|
||||
result = result / result(3);
|
||||
result = (result + cv::Vec4d::ones()) / 2.;
|
||||
return {
|
||||
static_cast<int>(std::round(result(0) * width)),
|
||||
static_cast<int>(std::round((1 - result(1)) * height)),
|
||||
};
|
||||
}
|
||||
|
||||
inline vec3d get_tile_world_pos(const Level& level, int tile_y, int tile_x)
|
||||
{
|
||||
const int h = level.get_height();
|
||||
const int w = level.get_width();
|
||||
const auto& tile = level.get_item(tile_y, tile_x);
|
||||
return {
|
||||
tile_x - (w - 1) / 2.,
|
||||
(h - 1) / 2. - tile_y,
|
||||
tile.heightType * -0.4,
|
||||
};
|
||||
}
|
||||
|
||||
inline auto get_tile_screen_pos(
|
||||
const Level& level,
|
||||
int tile_y,
|
||||
int tile_x,
|
||||
bool side = false,
|
||||
const vec3d& offset = {})
|
||||
{
|
||||
return world_to_screen(level, get_tile_world_pos(level, tile_y, tile_x), side, offset);
|
||||
}
|
||||
|
||||
static constexpr double rel_pos_x = 1.3143386840820312;
|
||||
static constexpr double rel_pos_y = 1.314337134361267;
|
||||
static constexpr double rel_pos_z = -0.3967874050140381;
|
||||
|
||||
inline auto get_retreat_screen_pos(const Level& level)
|
||||
{
|
||||
const vec3d relative_pos = { -rel_pos_x, +rel_pos_y, rel_pos_z };
|
||||
return world_to_screen(level, relative_pos, true);
|
||||
}
|
||||
|
||||
inline auto get_skill_screen_pos(const Level& level)
|
||||
{
|
||||
const vec3d relative_pos = { +rel_pos_x, -rel_pos_y, rel_pos_z };
|
||||
return world_to_screen(level, relative_pos, true);
|
||||
}
|
||||
|
||||
} // namespace Map::TileCalc2
|
||||
|
||||
106
3rdparty/include/Arknights-Tile-Pos/TileDef.hpp
vendored
@@ -1,32 +1,94 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <meojson/json.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
|
||||
namespace Map
|
||||
{
|
||||
struct LevelKey
|
||||
{
|
||||
std::string stageId;
|
||||
std::string code;
|
||||
std::string levelId;
|
||||
std::string name;
|
||||
struct LevelKey
|
||||
{
|
||||
std::string stageId;
|
||||
std::string code;
|
||||
std::string levelId;
|
||||
std::string name;
|
||||
|
||||
bool empty_or_equal(const std::string& lhs, const std::string& rhs) const noexcept
|
||||
{
|
||||
return (lhs.empty() || rhs.empty()) ? true : lhs == rhs;
|
||||
bool empty_or_equal(const std::string& lhs, const std::string& rhs) const noexcept
|
||||
{
|
||||
return (lhs.empty() || rhs.empty()) ? true : lhs == rhs;
|
||||
}
|
||||
|
||||
bool operator==(const LevelKey& other) const noexcept
|
||||
{
|
||||
return empty_or_equal(stageId, other.stageId) && empty_or_equal(code, other.code)
|
||||
&& empty_or_equal(levelId, other.levelId) && empty_or_equal(name, other.name);
|
||||
}
|
||||
|
||||
bool operator==(const std::string& any_key) const noexcept
|
||||
{
|
||||
if (any_key.empty()) {
|
||||
return false;
|
||||
}
|
||||
bool operator==(const LevelKey& other) const noexcept
|
||||
{
|
||||
return empty_or_equal(stageId, other.stageId) && empty_or_equal(code, other.code) &&
|
||||
empty_or_equal(levelId, other.levelId) && empty_or_equal(name, other.name);
|
||||
return empty_or_equal(stageId, any_key) || empty_or_equal(code, any_key)
|
||||
|| empty_or_equal(levelId, any_key) || empty_or_equal(name, any_key);
|
||||
}
|
||||
};
|
||||
|
||||
struct Tile
|
||||
{
|
||||
int heightType = 0;
|
||||
int buildableType = 0;
|
||||
std::string tileKey;
|
||||
};
|
||||
|
||||
class Level
|
||||
{
|
||||
public:
|
||||
explicit Level(const json::value& data);
|
||||
Level() = default;
|
||||
|
||||
int get_width() const { return width; }
|
||||
|
||||
int get_height() const { return height; }
|
||||
|
||||
Tile get_item(int y, int x) const { return tiles[y][x]; }
|
||||
|
||||
std::vector<cv::Point3d> view {};
|
||||
LevelKey key {};
|
||||
|
||||
private:
|
||||
int height = 0;
|
||||
int width = 0;
|
||||
std::vector<std::vector<Tile>> tiles;
|
||||
};
|
||||
|
||||
inline Level::Level(const json::value& data)
|
||||
{
|
||||
key.stageId = data.at("stageId").as_string();
|
||||
key.code = data.at("code").as_string();
|
||||
key.levelId = data.at("levelId").as_string();
|
||||
key.name = data.get("name", "null");
|
||||
this->height = data.at("height").as_integer();
|
||||
this->width = data.at("width").as_integer();
|
||||
for (const json::value& point_data : data.at("view").as_array()) {
|
||||
cv::Point3d tmp;
|
||||
auto point_array = point_data.as_array();
|
||||
tmp.x = point_array[0].as_double();
|
||||
tmp.y = point_array[1].as_double();
|
||||
tmp.z = point_array[2].as_double();
|
||||
this->view.emplace_back(tmp);
|
||||
}
|
||||
for (const json::value& row : data.at("tiles").as_array()) {
|
||||
std::vector<Tile> tmp;
|
||||
tmp.reserve(this->width);
|
||||
for (const json::value& tile : row.as_array()) {
|
||||
tmp.emplace_back(Tile { tile.at("heightType").as_integer(),
|
||||
tile.at("buildableType").as_integer(),
|
||||
tile.get("tileKey", std::string()) });
|
||||
}
|
||||
bool operator==(const std::string& any_key) const noexcept
|
||||
{
|
||||
if (any_key.empty()) {
|
||||
return false;
|
||||
}
|
||||
return empty_or_equal(stageId, any_key) || empty_or_equal(code, any_key) ||
|
||||
empty_or_equal(levelId, any_key) || empty_or_equal(name, any_key);
|
||||
}
|
||||
};
|
||||
tiles.emplace_back(std::move(tmp));
|
||||
}
|
||||
}
|
||||
} // namespace Map
|
||||
|
||||
195
3rdparty/include/meojson/.clang-format
vendored
@@ -1,195 +0,0 @@
|
||||
Language: Json
|
||||
ColumnLimit: 1000
|
||||
IndentWidth: 4
|
||||
---
|
||||
Language: Cpp
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignArrayOfStructures: None
|
||||
AlignConsecutiveMacros: None
|
||||
AlignConsecutiveAssignments: None
|
||||
AlignConsecutiveBitFields: None
|
||||
AlignConsecutiveDeclarations: None
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: Align
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
AttributeMacros:
|
||||
- __capability
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: true
|
||||
AfterControlStatement: Never
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterObjCDeclaration: true
|
||||
AfterStruct: true
|
||||
AfterUnion: false
|
||||
AfterExternBlock: true
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeConceptDeclarations: true
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 120
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
QualifierAlignment: Leave
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: false
|
||||
DeriveLineEnding: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
EmptyLineAfterAccessModifier: Never
|
||||
EmptyLineBeforeAccessModifier: LogicalBlock
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
PackConstructorInitializers: BinPack
|
||||
BasedOnStyle: ''
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
AllowAllConstructorInitializersOnNextLine: true
|
||||
FixNamespaceComments: true
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IfMacros:
|
||||
- KJ_IF_MAYBE
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IncludeIsMainSourceRegex: ''
|
||||
IndentAccessModifiers: false
|
||||
IndentCaseLabels: false
|
||||
IndentCaseBlocks: false
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentExternBlock: AfterExternBlock
|
||||
IndentRequiresClause: false
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
InsertTrailingCommas: None
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
LambdaBodyIndentation: Signature
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: Inner
|
||||
ObjCBinPackProtocolList: Auto
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCBreakBeforeNestedBlockParam: true
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakOpenParenthesis: 0
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 1000
|
||||
PenaltyIndentedWhitespace: 0
|
||||
PointerAlignment: Left
|
||||
PPIndentWidth: -1
|
||||
ReferenceAlignment: Pointer
|
||||
ReflowComments: true
|
||||
RemoveBracesLLVM: false
|
||||
RequiresClausePosition: OwnLine
|
||||
SeparateDefinitionBlocks: Leave
|
||||
ShortNamespaceLines: 50
|
||||
SortIncludes: CaseSensitive
|
||||
SortJavaStaticImport: Before
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeParensOptions:
|
||||
AfterControlStatements: true
|
||||
AfterForeachMacros: true
|
||||
AfterFunctionDefinitionName: false
|
||||
AfterFunctionDeclarationName: false
|
||||
AfterIfMacros: true
|
||||
AfterOverloadedOperator: false
|
||||
AfterRequiresInClause: true
|
||||
AfterRequiresInExpression: true
|
||||
BeforeNonEmptyParentheses: false
|
||||
SpaceAroundPointerQualifiers: Default
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: Never
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInLineCommentPrefix:
|
||||
Minimum: 1
|
||||
Maximum: -1
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
SpaceBeforeSquareBrackets: false
|
||||
BitFieldColonSpacing: Both
|
||||
Standard: c++20
|
||||
StatementAttributeLikeMacros:
|
||||
- Q_EMIT
|
||||
StatementMacros:
|
||||
- Q_UNUSED
|
||||
- QT_REQUIRE_VERSION
|
||||
TabWidth: 4
|
||||
UseCRLF: false
|
||||
UseTab: Never
|
||||
WhitespaceSensitiveMacros:
|
||||
- STRINGIZE
|
||||
- PP_STRINGIZE
|
||||
- BOOST_PP_STRINGIZE
|
||||
- NS_SWIFT_NAME
|
||||
- CF_SWIFT_NAME
|
||||
88
3rdparty/include/meojson/bitops.hpp
vendored
@@ -1,88 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#if __cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
|
||||
#include <bit>
|
||||
namespace json::__bitops {
|
||||
using std::countl_one;
|
||||
using std::countr_one;
|
||||
using std::countl_zero;
|
||||
using std::countr_zero;
|
||||
inline constexpr bool is_little_endian() {
|
||||
return std::endian::native == std::endian::little;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#include <cstdint>
|
||||
namespace json::__bitops {
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
inline constexpr int countl_zero(uint32_t x) {
|
||||
if constexpr (sizeof(uint32_t) == sizeof(unsigned int))
|
||||
return x == 0 ? 32 : __builtin_clz(x);
|
||||
if constexpr (sizeof(uint32_t) == sizeof(unsigned long))
|
||||
return x == 0 ? 32 : __builtin_clzl(x);
|
||||
return x == 0 ? 32 : __builtin_clzll(x);
|
||||
}
|
||||
inline constexpr int countr_zero(uint32_t x) {
|
||||
if constexpr (sizeof(uint32_t) == sizeof(unsigned int))
|
||||
return x == 0 ? 32 : __builtin_ctz(x);
|
||||
if constexpr (sizeof(uint32_t) == sizeof(unsigned long))
|
||||
return x == 0 ? 32 : __builtin_ctzl(x);
|
||||
return x == 0 ? 32 : __builtin_ctzll(x);
|
||||
}
|
||||
inline constexpr int countl_zero(uint64_t x) {
|
||||
return x == 0 ? 64 : __builtin_clzll(x);
|
||||
}
|
||||
inline constexpr int countr_zero(uint64_t x) {
|
||||
return x == 0 ? 64 : __builtin_ctzll(x);
|
||||
}
|
||||
#elif defined(_MSC_VER)
|
||||
#ifdef __AVX2__
|
||||
// lzcnt intrinsics is not constexpr
|
||||
inline int countl_zero(uint32_t x) {
|
||||
return __lzcnt(x);
|
||||
}
|
||||
inline int countr_zero(uint32_t x) {
|
||||
return _tzcnt_u32(x);
|
||||
}
|
||||
inline int countl_zero(uint64_t x) {
|
||||
return (int)__lzcnt64(x);
|
||||
}
|
||||
inline int countr_zero(uint64_t x) {
|
||||
return (int)_tzcnt_u64(x);
|
||||
}
|
||||
#else
|
||||
inline constexpr int countl_zero(uint32_t x) {
|
||||
unsigned long index = 0;
|
||||
return _BitScanReverse(&index, x) ? 31 - index : 32;
|
||||
}
|
||||
inline constexpr int countr_zero(uint32_t x) {
|
||||
unsigned long index = 0;
|
||||
return _BitScanForward(&index, x) ? index : 32;
|
||||
}
|
||||
inline constexpr int countl_zero(uint64_t x) {
|
||||
unsigned long index = 0;
|
||||
return _BitScanReverse64(&index, x) ? 63 - index : 64;
|
||||
}
|
||||
inline constexpr int countr_zero(uint64_t x) {
|
||||
unsigned long index = 0;
|
||||
return _BitScanForward64(&index, x) ? index : 64;
|
||||
}
|
||||
#endif // __AVX2__
|
||||
#else // compiler
|
||||
#error "bring your own bit counting implementation"
|
||||
#endif
|
||||
inline int countl_one(uint32_t x) { return countl_zero(~x); }
|
||||
inline int countr_one(uint32_t x) { return countr_zero(~x); }
|
||||
inline int countl_one(uint64_t x) { return countl_zero(~x); }
|
||||
inline int countr_one(uint64_t x) { return countr_zero(~x); }
|
||||
|
||||
// no constexpr endian awareness before C++20
|
||||
inline bool is_little_endian() {
|
||||
union {
|
||||
uint32_t u32;
|
||||
uint8_t u8;
|
||||
} u = { 0x01020304 };
|
||||
return u.u8 == 4;
|
||||
}
|
||||
}
|
||||
#endif // C++20
|
||||
533
3rdparty/include/meojson/common/array.hpp
vendored
Normal file
@@ -0,0 +1,533 @@
|
||||
#pragma once
|
||||
|
||||
#include <initializer_list>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
#include "exception.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
namespace json
|
||||
{
|
||||
template <typename string_t>
|
||||
class basic_array
|
||||
{
|
||||
friend class basic_value<string_t>;
|
||||
friend class basic_object<string_t>;
|
||||
|
||||
public:
|
||||
using raw_array = std::vector<basic_value<string_t>>;
|
||||
using value_type = typename raw_array::value_type;
|
||||
using iterator = typename raw_array::iterator;
|
||||
using const_iterator = typename raw_array::const_iterator;
|
||||
using reverse_iterator = typename raw_array::reverse_iterator;
|
||||
using const_reverse_iterator = typename raw_array::const_reverse_iterator;
|
||||
using char_t = typename string_t::value_type;
|
||||
|
||||
public:
|
||||
basic_array() = default;
|
||||
basic_array(const basic_array<string_t>& rhs) = default;
|
||||
basic_array(basic_array<string_t>&& rhs) noexcept = default;
|
||||
basic_array(std::initializer_list<value_type> init_list);
|
||||
basic_array(typename raw_array::size_type size);
|
||||
|
||||
// explicit basic_array(const basic_value<string_t>& val);
|
||||
// explicit basic_array(basic_value<string_t>&& val);
|
||||
|
||||
template <typename collection_t,
|
||||
std::enable_if_t<_utils::is_collection<collection_t> &&
|
||||
std::is_constructible_v<value_type, _utils::range_value_t<collection_t>>,
|
||||
bool> = true>
|
||||
basic_array(collection_t arr)
|
||||
: _array_data(std::make_move_iterator(arr.begin()), std::make_move_iterator(arr.end()))
|
||||
{}
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_to_json_in_member<jsonization_t>::value, bool> = true>
|
||||
basic_array(const jsonization_t& value) : basic_array(value.to_json())
|
||||
{}
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_to_json_in_templ_spec<jsonization_t>::value, bool> = true>
|
||||
basic_array(const jsonization_t& value) : basic_array(ext::jsonization<jsonization_t>().to_json(value))
|
||||
{}
|
||||
|
||||
~basic_array() noexcept = default;
|
||||
|
||||
bool empty() const noexcept { return _array_data.empty(); }
|
||||
size_t size() const noexcept { return _array_data.size(); }
|
||||
bool contains(size_t pos) const { return pos < _array_data.size(); }
|
||||
bool exists(size_t pos) const { return contains(pos); }
|
||||
const basic_value<string_t>& at(size_t pos) const;
|
||||
|
||||
string_t dumps(std::optional<size_t> indent = std::nullopt) const { return indent ? format(*indent) : to_string(); }
|
||||
string_t to_string() const;
|
||||
string_t format(size_t indent = 4) const { return format(indent, 0); }
|
||||
template <typename value_t>
|
||||
bool all() const;
|
||||
template <typename value_t, template <typename...> typename collection_t = std::vector>
|
||||
collection_t<value_t> as_collection() const;
|
||||
|
||||
// Usage: get(key_1, key_2, ..., default_value);
|
||||
template <typename... key_then_default_value_t>
|
||||
auto get(key_then_default_value_t&&... keys_then_default_value) const;
|
||||
|
||||
template <typename value_t = basic_value<string_t>>
|
||||
std::optional<value_t> find(size_t pos) const;
|
||||
|
||||
template <typename... args_t>
|
||||
decltype(auto) emplace_back(args_t&&... args);
|
||||
template <typename... args_t>
|
||||
decltype(auto) push_back(args_t&&... args);
|
||||
|
||||
void clear() noexcept;
|
||||
bool erase(size_t pos);
|
||||
bool erase(iterator iter);
|
||||
|
||||
iterator begin() noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
|
||||
reverse_iterator rbegin() noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
|
||||
const basic_value<string_t>& operator[](size_t pos) const;
|
||||
basic_value<string_t>& operator[](size_t pos);
|
||||
|
||||
basic_array<string_t> operator+(const basic_array<string_t>& rhs) const&;
|
||||
basic_array<string_t> operator+(basic_array<string_t>&& rhs) const&;
|
||||
basic_array<string_t> operator+(const basic_array<string_t>& rhs) &&;
|
||||
basic_array<string_t> operator+(basic_array<string_t>&& rhs) &&;
|
||||
|
||||
basic_array<string_t>& operator+=(const basic_array<string_t>& rhs);
|
||||
basic_array<string_t>& operator+=(basic_array<string_t>&& rhs);
|
||||
|
||||
basic_array<string_t>& operator=(const basic_array<string_t>&) = default;
|
||||
basic_array<string_t>& operator=(basic_array<string_t>&&) noexcept = default;
|
||||
template <typename value_t, std::enable_if_t<std::is_convertible_v<value_t, basic_array<string_t>>, bool> = true>
|
||||
basic_array<string_t>& operator=(value_t rhs)
|
||||
{
|
||||
return *this = basic_array<string_t>(std::move(rhs));
|
||||
}
|
||||
|
||||
bool operator==(const basic_array<string_t>& rhs) const;
|
||||
bool operator!=(const basic_array<string_t>& rhs) const { return !(*this == rhs); }
|
||||
|
||||
template <typename value_t, template <typename...> typename collection_t = std::vector,
|
||||
std::enable_if_t<_utils::is_collection<collection_t<value_t>>, bool> = true>
|
||||
explicit operator collection_t<value_t>() const
|
||||
{
|
||||
return as_collection<value_t, collection_t>();
|
||||
}
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_from_json_in_member<jsonization_t, string_t>::value, bool> = true>
|
||||
explicit operator jsonization_t() const
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!dst.from_json(*this)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_from_json_in_templ_spec<jsonization_t, string_t>::value, bool> = true>
|
||||
explicit operator jsonization_t() const
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!ext::jsonization<jsonization_t>().from_json(*this, dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
private:
|
||||
template <typename... key_then_default_value_t, size_t... keys_indexes_t>
|
||||
auto get(std::tuple<key_then_default_value_t...> keys_then_default_value,
|
||||
std::index_sequence<keys_indexes_t...>) const;
|
||||
template <typename value_t, typename... rest_keys_t>
|
||||
auto get_helper(const value_t& default_value, size_t pos, rest_keys_t&&... rest) const;
|
||||
template <typename value_t>
|
||||
auto get_helper(const value_t& default_value, size_t pos) const;
|
||||
|
||||
string_t format(size_t indent, size_t indent_times) const;
|
||||
|
||||
private:
|
||||
raw_array _array_data;
|
||||
};
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_array<string_t>::basic_array(std::initializer_list<value_type> init_list) : _array_data(init_list)
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_array<string_t>::basic_array(typename raw_array::size_type size) : _array_data(size)
|
||||
{}
|
||||
|
||||
// template <typename string_t>
|
||||
// inline basic_array<string_t>::basic_array(const basic_value<string_t>& val) : basic_array<string_t>(val.as_array())
|
||||
//{}
|
||||
//
|
||||
// template <typename string_t>
|
||||
// inline basic_array<string_t>::basic_array(basic_value<string_t>&& val)
|
||||
// : basic_array<string_t>(std::move(val.as_array()))
|
||||
//{}
|
||||
|
||||
template <typename string_t>
|
||||
inline void basic_array<string_t>::clear() noexcept
|
||||
{
|
||||
_array_data.clear();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_array<string_t>::erase(size_t pos)
|
||||
{
|
||||
return erase(_array_data.begin() + pos);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_array<string_t>::erase(iterator iter)
|
||||
{
|
||||
return _array_data.erase(iter) != _array_data.end();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... args_t>
|
||||
inline decltype(auto) basic_array<string_t>::emplace_back(args_t&&... args)
|
||||
{
|
||||
static_assert(std::is_constructible_v<value_type, args_t...>,
|
||||
"Parameter can't be used to construct a raw_array::value_type");
|
||||
return _array_data.emplace_back(std::forward<args_t>(args)...);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... args_t>
|
||||
inline decltype(auto) basic_array<string_t>::push_back(args_t&&... args)
|
||||
{
|
||||
return emplace_back(std::forward<args_t>(args)...);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline const basic_value<string_t>& basic_array<string_t>::at(size_t pos) const
|
||||
{
|
||||
return _array_data.at(pos);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline string_t basic_array<string_t>::to_string() const
|
||||
{
|
||||
string_t str { '[' };
|
||||
for (auto iter = _array_data.cbegin(); iter != _array_data.cend();) {
|
||||
str += iter->to_string();
|
||||
if (++iter != _array_data.cend()) {
|
||||
str += ',';
|
||||
}
|
||||
}
|
||||
str += char_t(']');
|
||||
return str;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline string_t basic_array<string_t>::format(size_t indent, size_t indent_times) const
|
||||
{
|
||||
const string_t tail_indent(indent * indent_times, ' ');
|
||||
const string_t body_indent(indent * (indent_times + 1), ' ');
|
||||
|
||||
string_t str { '[', '\n' };
|
||||
for (auto iter = _array_data.cbegin(); iter != _array_data.cend();) {
|
||||
str += body_indent + iter->format(indent, indent_times + 1);
|
||||
if (++iter != _array_data.cend()) {
|
||||
str += ',';
|
||||
}
|
||||
str += '\n';
|
||||
}
|
||||
str += tail_indent + char_t(']');
|
||||
return str;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline bool basic_array<string_t>::all() const
|
||||
{
|
||||
for (const auto& elem : _array_data) {
|
||||
if (!elem.template is<value_t>()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace _as_collection_helper
|
||||
{
|
||||
template <typename T>
|
||||
class has_emplace_back
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int) -> decltype(std::declval<U>().emplace_back(), std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
|
||||
public:
|
||||
static constexpr bool value = decltype(test<T>(0))::value;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t, template <typename...> typename collection_t>
|
||||
inline collection_t<value_t> basic_array<string_t>::as_collection() const
|
||||
{
|
||||
collection_t<value_t> result;
|
||||
if constexpr (_as_collection_helper::has_emplace_back<collection_t<value_t>>::value) {
|
||||
for (const auto& elem : _array_data) {
|
||||
result.emplace_back(elem.template as<value_t>());
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (const auto& elem : _array_data) {
|
||||
result.emplace(elem.template as<value_t>());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... key_then_default_value_t>
|
||||
inline auto basic_array<string_t>::get(key_then_default_value_t&&... keys_then_default_value) const
|
||||
{
|
||||
return get(std::forward_as_tuple(keys_then_default_value...),
|
||||
std::make_index_sequence<sizeof...(keys_then_default_value) - 1> {});
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... key_then_default_value_t, size_t... keys_indexes_t>
|
||||
inline auto basic_array<string_t>::get(std::tuple<key_then_default_value_t...> keys_then_default_value,
|
||||
std::index_sequence<keys_indexes_t...>) const
|
||||
{
|
||||
constexpr unsigned long default_value_index = sizeof...(key_then_default_value_t) - 1;
|
||||
return get_helper(std::get<default_value_index>(keys_then_default_value),
|
||||
std::get<keys_indexes_t>(keys_then_default_value)...);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t, typename... rest_keys_t>
|
||||
inline auto basic_array<string_t>::get_helper(const value_t& default_value, size_t pos, rest_keys_t&&... rest) const
|
||||
{
|
||||
constexpr bool is_json = std::is_same_v<basic_value<string_t>, value_t> ||
|
||||
std::is_same_v<basic_array<string_t>, value_t> ||
|
||||
std::is_same_v<basic_object<string_t>, value_t>;
|
||||
constexpr bool is_string = std::is_constructible_v<string_t, value_t> && !is_json;
|
||||
|
||||
if (!contains(pos)) {
|
||||
if constexpr (is_string) {
|
||||
return string_t(default_value);
|
||||
}
|
||||
else {
|
||||
return value_t(default_value);
|
||||
}
|
||||
}
|
||||
|
||||
return at(pos).get_helper(default_value, std::forward<rest_keys_t>(rest)...);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline auto basic_array<string_t>::get_helper(const value_t& default_value, size_t pos) const
|
||||
{
|
||||
constexpr bool is_json = std::is_same_v<basic_value<string_t>, value_t> ||
|
||||
std::is_same_v<basic_array<string_t>, value_t> ||
|
||||
std::is_same_v<basic_object<string_t>, value_t>;
|
||||
constexpr bool is_string = std::is_constructible_v<string_t, value_t> && !is_json;
|
||||
|
||||
if (!contains(pos)) {
|
||||
if constexpr (is_string) {
|
||||
return string_t(default_value);
|
||||
}
|
||||
else {
|
||||
return value_t(default_value);
|
||||
}
|
||||
}
|
||||
|
||||
auto val = _array_data.at(pos);
|
||||
if (val.template is<value_t>()) {
|
||||
if constexpr (is_string) {
|
||||
return val.template as<string_t>();
|
||||
}
|
||||
else {
|
||||
return val.template as<value_t>();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if constexpr (is_string) {
|
||||
return string_t(default_value);
|
||||
}
|
||||
else {
|
||||
return value_t(default_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline std::optional<value_t> basic_array<string_t>::find(size_t pos) const
|
||||
{
|
||||
if (!contains(pos)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
const auto& val = _array_data.at(pos);
|
||||
return val.template is<value_t>() ? std::optional<value_t>(val.template as<value_t>()) : std::nullopt;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::iterator basic_array<string_t>::begin() noexcept
|
||||
{
|
||||
return _array_data.begin();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::iterator basic_array<string_t>::end() noexcept
|
||||
{
|
||||
return _array_data.end();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::const_iterator basic_array<string_t>::begin() const noexcept
|
||||
{
|
||||
return _array_data.begin();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::const_iterator basic_array<string_t>::end() const noexcept
|
||||
{
|
||||
return _array_data.end();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::const_iterator basic_array<string_t>::cbegin() const noexcept
|
||||
{
|
||||
return _array_data.cbegin();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::const_iterator basic_array<string_t>::cend() const noexcept
|
||||
{
|
||||
return _array_data.cend();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::reverse_iterator basic_array<string_t>::rbegin() noexcept
|
||||
{
|
||||
return _array_data.rbegin();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::reverse_iterator basic_array<string_t>::rend() noexcept
|
||||
{
|
||||
return _array_data.rend();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::const_reverse_iterator basic_array<string_t>::rbegin() const noexcept
|
||||
{
|
||||
return _array_data.rbegin();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::const_reverse_iterator basic_array<string_t>::rend() const noexcept
|
||||
{
|
||||
return _array_data.rend();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::const_reverse_iterator basic_array<string_t>::crbegin() const noexcept
|
||||
{
|
||||
return _array_data.crbegin();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::const_reverse_iterator basic_array<string_t>::crend() const noexcept
|
||||
{
|
||||
return _array_data.crend();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_array<string_t>::operator[](size_t pos)
|
||||
{
|
||||
return _array_data[pos];
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline const basic_value<string_t>& basic_array<string_t>::operator[](size_t pos) const
|
||||
{
|
||||
return _array_data[pos];
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_array<string_t> basic_array<string_t>::operator+(const basic_array<string_t>& rhs) const&
|
||||
{
|
||||
basic_array<string_t> temp = *this;
|
||||
temp._array_data.insert(_array_data.end(), rhs.begin(), rhs.end());
|
||||
return temp;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_array<string_t> basic_array<string_t>::operator+(basic_array<string_t>&& rhs) const&
|
||||
{
|
||||
basic_array<string_t> temp = *this;
|
||||
temp._array_data.insert(_array_data.end(), std::make_move_iterator(rhs.begin()),
|
||||
std::make_move_iterator(rhs.end()));
|
||||
return temp;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_array<string_t> basic_array<string_t>::operator+(const basic_array<string_t>& rhs) &&
|
||||
{
|
||||
_array_data.insert(_array_data.end(), rhs.begin(), rhs.end());
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_array<string_t> basic_array<string_t>::operator+(basic_array<string_t>&& rhs) &&
|
||||
{
|
||||
_array_data.insert(_array_data.end(), std::make_move_iterator(rhs.begin()), std::make_move_iterator(rhs.end()));
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_array<string_t>& basic_array<string_t>::operator+=(const basic_array<string_t>& rhs)
|
||||
{
|
||||
_array_data.insert(_array_data.end(), rhs.begin(), rhs.end());
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_array<string_t>& basic_array<string_t>::operator+=(basic_array<string_t>&& rhs)
|
||||
{
|
||||
_array_data.insert(_array_data.end(), std::make_move_iterator(rhs.begin()), std::make_move_iterator(rhs.end()));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_array<string_t>::operator==(const basic_array<string_t>& rhs) const
|
||||
{
|
||||
return _array_data == rhs._array_data;
|
||||
}
|
||||
|
||||
template <typename ostream_t, typename string_t,
|
||||
typename std_ostream_t =
|
||||
std::basic_ostream<typename string_t::value_type, std::char_traits<typename string_t::value_type>>,
|
||||
typename enable_t =
|
||||
std::enable_if_t<std::is_same_v<std_ostream_t, ostream_t> || std::is_base_of_v<std_ostream_t, ostream_t>>>
|
||||
ostream_t& operator<<(ostream_t& out, const basic_array<string_t>& arr)
|
||||
{
|
||||
out << arr.format();
|
||||
return out;
|
||||
}
|
||||
} // namespace json
|
||||
26
3rdparty/include/meojson/common/exception.hpp
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
namespace json
|
||||
{
|
||||
class exception : public std::exception
|
||||
{
|
||||
public:
|
||||
exception() = default;
|
||||
exception(const std::string& msg) : _what(msg) {}
|
||||
|
||||
exception(const exception&) = default;
|
||||
exception& operator=(const exception&) = default;
|
||||
exception(exception&&) = default;
|
||||
exception& operator=(exception&&) = default;
|
||||
|
||||
virtual ~exception() noexcept override = default;
|
||||
|
||||
virtual const char* what() const noexcept override { return _what.empty() ? "Unknown exception" : _what.c_str(); }
|
||||
|
||||
protected:
|
||||
std::string _what;
|
||||
};
|
||||
}
|
||||
474
3rdparty/include/meojson/common/object.hpp
vendored
Normal file
@@ -0,0 +1,474 @@
|
||||
#pragma once
|
||||
|
||||
#include <initializer_list>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
#include "exception.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
namespace json
|
||||
{
|
||||
template <typename string_t>
|
||||
class basic_object
|
||||
{
|
||||
friend class basic_value<string_t>;
|
||||
friend class basic_array<string_t>;
|
||||
|
||||
public:
|
||||
using raw_object = std::map<string_t, basic_value<string_t>>;
|
||||
using key_type = typename raw_object::key_type;
|
||||
using mapped_type = typename raw_object::mapped_type;
|
||||
using value_type = typename raw_object::value_type;
|
||||
using iterator = typename raw_object::iterator;
|
||||
using const_iterator = typename raw_object::const_iterator;
|
||||
using char_t = typename string_t::value_type;
|
||||
|
||||
public:
|
||||
basic_object() = default;
|
||||
basic_object(const basic_object<string_t>& rhs) = default;
|
||||
basic_object(basic_object<string_t>&& rhs) noexcept = default;
|
||||
basic_object(std::initializer_list<value_type> init_list);
|
||||
|
||||
// explicit basic_object(const basic_value<string_t>& val);
|
||||
// explicit basic_object(basic_value<string_t>&& val);
|
||||
|
||||
template <typename map_t, std::enable_if_t<_utils::is_map<map_t> &&
|
||||
std::is_constructible_v<value_type, _utils::range_value_t<map_t>>,
|
||||
bool> = true>
|
||||
basic_object(map_t map) : _object_data(std::make_move_iterator(map.begin()), std::make_move_iterator(map.end()))
|
||||
{}
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_to_json_in_member<jsonization_t>::value, bool> = true>
|
||||
basic_object(const jsonization_t& value) : basic_object(value.to_json())
|
||||
{}
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_to_json_in_templ_spec<jsonization_t>::value, bool> = true>
|
||||
basic_object(const jsonization_t& value) : basic_object(ext::jsonization<jsonization_t>().to_json(value))
|
||||
{}
|
||||
|
||||
~basic_object() = default;
|
||||
|
||||
bool empty() const noexcept { return _object_data.empty(); }
|
||||
size_t size() const noexcept { return _object_data.size(); }
|
||||
bool contains(const string_t& key) const;
|
||||
bool exists(const string_t& key) const { return contains(key); }
|
||||
const basic_value<string_t>& at(const string_t& key) const;
|
||||
|
||||
string_t dumps(std::optional<size_t> indent = std::nullopt) const { return indent ? format(*indent) : to_string(); }
|
||||
string_t to_string() const;
|
||||
string_t format(size_t indent = 4) const { return format(indent, 0); }
|
||||
template <typename value_t>
|
||||
bool all() const;
|
||||
template <typename value_t, template <typename...> typename map_t = std::map>
|
||||
map_t<string_t, value_t> as_map() const;
|
||||
|
||||
// Usage: get(key_1, key_2, ..., default_value);
|
||||
template <typename... key_then_default_value_t>
|
||||
auto get(key_then_default_value_t&&... keys_then_default_value) const;
|
||||
|
||||
template <typename value_t = basic_value<string_t>>
|
||||
std::optional<value_t> find(const string_t& key) const;
|
||||
|
||||
template <typename... args_t>
|
||||
decltype(auto) emplace(args_t&&... args);
|
||||
template <typename... args_t>
|
||||
decltype(auto) insert(args_t&&... args);
|
||||
|
||||
void clear() noexcept;
|
||||
bool erase(const string_t& key);
|
||||
bool erase(iterator iter);
|
||||
|
||||
iterator begin() noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
|
||||
basic_value<string_t>& operator[](const string_t& key);
|
||||
basic_value<string_t>& operator[](string_t&& key);
|
||||
|
||||
basic_object<string_t> operator|(const basic_object<string_t>& rhs) const&;
|
||||
basic_object<string_t> operator|(basic_object<string_t>&& rhs) const&;
|
||||
basic_object<string_t> operator|(const basic_object<string_t>& rhs) &&;
|
||||
basic_object<string_t> operator|(basic_object<string_t>&& rhs) &&;
|
||||
|
||||
basic_object<string_t>& operator|=(const basic_object<string_t>& rhs);
|
||||
basic_object<string_t>& operator|=(basic_object<string_t>&& rhs);
|
||||
|
||||
basic_object<string_t>& operator=(const basic_object<string_t>&) = default;
|
||||
basic_object<string_t>& operator=(basic_object<string_t>&&) = default;
|
||||
template <typename value_t, std::enable_if_t<std::is_convertible_v<value_t, basic_object<string_t>>, bool> = true>
|
||||
basic_object<string_t>& operator=(value_t rhs)
|
||||
{
|
||||
return *this = basic_object<string_t>(std::move(rhs));
|
||||
}
|
||||
|
||||
bool operator==(const basic_object<string_t>& rhs) const;
|
||||
bool operator!=(const basic_object<string_t>& rhs) const { return !(*this == rhs); }
|
||||
|
||||
template <typename value_t, template <typename...> typename map_t = std::map,
|
||||
std::enable_if_t<_utils::is_map<map_t<string_t, value_t>>, bool> = true>
|
||||
explicit operator map_t<string_t, value_t>() const
|
||||
{
|
||||
return as_map<value_t, map_t>();
|
||||
}
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_from_json_in_member<jsonization_t, string_t>::value, bool> = true>
|
||||
explicit operator jsonization_t() const
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!dst.from_json(*this)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_from_json_in_templ_spec<jsonization_t, string_t>::value, bool> = true>
|
||||
explicit operator jsonization_t() const
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!ext::jsonization<jsonization_t>().from_json(*this, dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
private:
|
||||
template <typename... key_then_default_value_t, size_t... keys_indexes_t>
|
||||
auto get(std::tuple<key_then_default_value_t...> keys_then_default_value,
|
||||
std::index_sequence<keys_indexes_t...>) const;
|
||||
template <typename value_t, typename... rest_keys_t>
|
||||
auto get_helper(const value_t& default_value, const string_t& key, rest_keys_t&&... rest) const;
|
||||
template <typename value_t>
|
||||
auto get_helper(const value_t& default_value, const string_t& key) const;
|
||||
|
||||
string_t format(size_t indent, size_t indent_times) const;
|
||||
|
||||
private:
|
||||
raw_object _object_data;
|
||||
};
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_object<string_t>::basic_object(std::initializer_list<value_type> init_list)
|
||||
: _object_data(std::make_move_iterator(init_list.begin()), std::make_move_iterator(init_list.end()))
|
||||
{}
|
||||
|
||||
// template <typename string_t>
|
||||
// inline basic_object<string_t>::basic_object(const basic_value<string_t>& val) :
|
||||
// basic_object<string_t>(val.as_object())
|
||||
//{}
|
||||
//
|
||||
// template <typename string_t>
|
||||
// inline basic_object<string_t>::basic_object(basic_value<string_t>&& val)
|
||||
// : basic_object<string_t>(std::move(val.as_object()))
|
||||
//{}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_object<string_t>::contains(const string_t& key) const
|
||||
{
|
||||
return _object_data.find(key) != _object_data.cend();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline const basic_value<string_t>& basic_object<string_t>::at(const string_t& key) const
|
||||
{
|
||||
return _object_data.at(key);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline void basic_object<string_t>::clear() noexcept
|
||||
{
|
||||
_object_data.clear();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_object<string_t>::erase(const string_t& key)
|
||||
{
|
||||
return _object_data.erase(key) > 0 ? true : false;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_object<string_t>::erase(iterator iter)
|
||||
{
|
||||
return _object_data.erase(iter) != _object_data.end();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... args_t>
|
||||
inline decltype(auto) basic_object<string_t>::emplace(args_t&&... args)
|
||||
{
|
||||
static_assert(std::is_constructible_v<value_type, args_t...>,
|
||||
"Parameter can't be used to construct a raw_object::value_type");
|
||||
return _object_data.emplace(std::forward<args_t>(args)...);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... args_t>
|
||||
inline decltype(auto) basic_object<string_t>::insert(args_t&&... args)
|
||||
{
|
||||
return emplace(std::forward<args_t>(args)...);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline string_t basic_object<string_t>::to_string() const
|
||||
{
|
||||
string_t str { '{' };
|
||||
for (auto iter = _object_data.cbegin(); iter != _object_data.cend();) {
|
||||
const auto& [key, val] = *iter;
|
||||
str += char_t('"') + _utils::unescape_string(key) + string_t { '\"', ':' } + val.to_string();
|
||||
if (++iter != _object_data.cend()) {
|
||||
str += ',';
|
||||
}
|
||||
}
|
||||
str += char_t('}');
|
||||
return str;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline string_t basic_object<string_t>::format(size_t indent, size_t indent_times) const
|
||||
{
|
||||
const string_t tail_indent(indent * indent_times, ' ');
|
||||
const string_t body_indent(indent * (indent_times + 1), ' ');
|
||||
|
||||
string_t str { '{', '\n' };
|
||||
for (auto iter = _object_data.cbegin(); iter != _object_data.cend();) {
|
||||
const auto& [key, val] = *iter;
|
||||
str += body_indent + char_t('"') + _utils::unescape_string(key) + string_t { '\"', ':', ' ' } +
|
||||
val.format(indent, indent_times + 1);
|
||||
if (++iter != _object_data.cend()) {
|
||||
str += ',';
|
||||
}
|
||||
str += '\n';
|
||||
}
|
||||
str += tail_indent + char_t('}');
|
||||
return str;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline bool basic_object<string_t>::all() const
|
||||
{
|
||||
for (const auto& [_, val] : _object_data) {
|
||||
if (!val.template is<value_t>()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t, template <typename...> typename map_t>
|
||||
inline map_t<string_t, value_t> basic_object<string_t>::as_map() const
|
||||
{
|
||||
map_t<string_t, value_t> result;
|
||||
for (const auto& [key, val] : _object_data) {
|
||||
result.emplace(key, val.template as<value_t>());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... key_then_default_value_t>
|
||||
inline auto basic_object<string_t>::get(key_then_default_value_t&&... keys_then_default_value) const
|
||||
{
|
||||
return get(std::forward_as_tuple(keys_then_default_value...),
|
||||
std::make_index_sequence<sizeof...(keys_then_default_value) - 1> {});
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... key_then_default_value_t, size_t... keys_indexes_t>
|
||||
inline auto basic_object<string_t>::get(std::tuple<key_then_default_value_t...> keys_then_default_value,
|
||||
std::index_sequence<keys_indexes_t...>) const
|
||||
{
|
||||
constexpr unsigned long default_value_index = sizeof...(key_then_default_value_t) - 1;
|
||||
return get_helper(std::get<default_value_index>(keys_then_default_value),
|
||||
std::get<keys_indexes_t>(keys_then_default_value)...);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t, typename... rest_keys_t>
|
||||
inline auto basic_object<string_t>::get_helper(const value_t& default_value, const string_t& key,
|
||||
rest_keys_t&&... rest) const
|
||||
{
|
||||
constexpr bool is_json = std::is_same_v<basic_value<string_t>, value_t> ||
|
||||
std::is_same_v<basic_array<string_t>, value_t> ||
|
||||
std::is_same_v<basic_object<string_t>, value_t>;
|
||||
constexpr bool is_string = std::is_constructible_v<string_t, value_t> && !is_json;
|
||||
|
||||
if (!contains(key)) {
|
||||
if constexpr (is_string) {
|
||||
return string_t(default_value);
|
||||
}
|
||||
else {
|
||||
return value_t(default_value);
|
||||
}
|
||||
}
|
||||
|
||||
return at(key).get_helper(default_value, std::forward<rest_keys_t>(rest)...);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline auto basic_object<string_t>::get_helper(const value_t& default_value, const string_t& key) const
|
||||
{
|
||||
constexpr bool is_json = std::is_same_v<basic_value<string_t>, value_t> ||
|
||||
std::is_same_v<basic_array<string_t>, value_t> ||
|
||||
std::is_same_v<basic_object<string_t>, value_t>;
|
||||
constexpr bool is_string = std::is_constructible_v<string_t, value_t> && !is_json;
|
||||
|
||||
if (!contains(key)) {
|
||||
if constexpr (is_string) {
|
||||
return string_t(default_value);
|
||||
}
|
||||
else {
|
||||
return value_t(default_value);
|
||||
}
|
||||
}
|
||||
|
||||
auto val = _object_data.at(key);
|
||||
if (val.template is<value_t>()) {
|
||||
if constexpr (is_string) {
|
||||
return val.template as<string_t>();
|
||||
}
|
||||
else {
|
||||
return val.template as<value_t>();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if constexpr (is_string) {
|
||||
return string_t(default_value);
|
||||
}
|
||||
else {
|
||||
return value_t(default_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline std::optional<value_t> basic_object<string_t>::find(const string_t& key) const
|
||||
{
|
||||
auto iter = _object_data.find(key);
|
||||
if (iter == _object_data.end()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
const auto& val = iter->second;
|
||||
return val.template is<value_t>() ? std::optional<value_t>(val.template as<value_t>()) : std::nullopt;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_object<string_t>::iterator basic_object<string_t>::begin() noexcept
|
||||
{
|
||||
return _object_data.begin();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_object<string_t>::iterator basic_object<string_t>::end() noexcept
|
||||
{
|
||||
return _object_data.end();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_object<string_t>::const_iterator basic_object<string_t>::begin() const noexcept
|
||||
{
|
||||
return _object_data.begin();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_object<string_t>::const_iterator basic_object<string_t>::end() const noexcept
|
||||
{
|
||||
return _object_data.end();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_object<string_t>::const_iterator basic_object<string_t>::cbegin() const noexcept
|
||||
{
|
||||
return _object_data.cbegin();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_object<string_t>::const_iterator basic_object<string_t>::cend() const noexcept
|
||||
{
|
||||
return _object_data.cend();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_object<string_t>::operator[](const string_t& key)
|
||||
{
|
||||
return _object_data[key];
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_object<string_t>::operator[](string_t&& key)
|
||||
{
|
||||
return _object_data[std::move(key)];
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_object<string_t> basic_object<string_t>::operator|(const basic_object<string_t>& rhs) const&
|
||||
{
|
||||
basic_object<string_t> temp = *this;
|
||||
temp._object_data.insert(rhs.begin(), rhs.end());
|
||||
return temp;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_object<string_t> basic_object<string_t>::operator|(basic_object<string_t>&& rhs) const&
|
||||
{
|
||||
basic_object<string_t> temp = *this;
|
||||
// temp._object_data.merge(std::move(rhs._object_data));
|
||||
temp._object_data.insert(std::make_move_iterator(rhs.begin()), std::make_move_iterator(rhs.end()));
|
||||
return temp;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_object<string_t> basic_object<string_t>::operator|(const basic_object<string_t>& rhs) &&
|
||||
{
|
||||
_object_data.insert(rhs.begin(), rhs.end());
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_object<string_t> basic_object<string_t>::operator|(basic_object<string_t>&& rhs) &&
|
||||
{
|
||||
//_object_data.merge(std::move(rhs._object_data));
|
||||
_object_data.insert(std::make_move_iterator(rhs.begin()), std::make_move_iterator(rhs.end()));
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_object<string_t>& basic_object<string_t>::operator|=(const basic_object<string_t>& rhs)
|
||||
{
|
||||
_object_data.insert(rhs.begin(), rhs.end());
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_object<string_t>& basic_object<string_t>::operator|=(basic_object<string_t>&& rhs)
|
||||
{
|
||||
_object_data.insert(std::make_move_iterator(rhs.begin()), std::make_move_iterator(rhs.end()));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_object<string_t>::operator==(const basic_object<string_t>& rhs) const
|
||||
{
|
||||
return _object_data == rhs._object_data;
|
||||
}
|
||||
|
||||
template <typename ostream_t, typename string_t,
|
||||
typename std_ostream_t =
|
||||
std::basic_ostream<typename string_t::value_type, std::char_traits<typename string_t::value_type>>,
|
||||
typename enable_t =
|
||||
std::enable_if_t<std::is_same_v<std_ostream_t, ostream_t> || std::is_base_of_v<std_ostream_t, ostream_t>>>
|
||||
ostream_t& operator<<(ostream_t& out, const basic_object<string_t>& obj)
|
||||
{
|
||||
out << obj.format();
|
||||
return out;
|
||||
}
|
||||
} // namespace json
|
||||
170
3rdparty/include/meojson/common/serialization.hpp
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include "types.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
namespace json
|
||||
{
|
||||
namespace _serialization_helper
|
||||
{
|
||||
template <typename in_t, typename serializer_t>
|
||||
class is_serializable
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int) -> decltype(std::declval<serializer_t>()(std::declval<U>()), std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
|
||||
public:
|
||||
static constexpr bool value = decltype(test<in_t>(0))::value;
|
||||
};
|
||||
|
||||
struct empty_serializer
|
||||
{
|
||||
// sample:
|
||||
// json::value operator()(const type_1&) const { return ...; }
|
||||
// json::value operator()(const type_2&) const { return ...; }
|
||||
// json::value operator()(const type_3&) const { return ...; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
void unable_to_serialize()
|
||||
{
|
||||
static_assert(!sizeof(T), "Unable to serialize T. "
|
||||
#ifdef _MSC_VER
|
||||
"See T below: " __FUNCSIG__
|
||||
#else
|
||||
// "See T below: " __PRETTY_FUNCTION__
|
||||
|
||||
#endif
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
namespace _serialization_helper
|
||||
{
|
||||
template <typename out_t, typename deserializer_t, typename string_t = default_string_t>
|
||||
class is_deserializable
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<deserializer_t>()(std::declval<basic_value<string_t>>(), std::declval<U&>()),
|
||||
std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
|
||||
public:
|
||||
static constexpr bool value = decltype(test<out_t>(0))::value;
|
||||
};
|
||||
|
||||
struct empty_deserializer
|
||||
{
|
||||
// sample:
|
||||
// bool operator()(const json::value&, type_1&) const { return ...; }
|
||||
// bool operator()(const json::value&, type_2&) const { return ...; }
|
||||
// bool operator()(const json::value&, type_3&) const { return ...; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
void unable_to_deserialize()
|
||||
{
|
||||
static_assert(!sizeof(T), "Unable to deserialize T. "
|
||||
#ifdef _MSC_VER
|
||||
"See T below: " __FUNCSIG__
|
||||
#else
|
||||
// "See T below: " __PRETTY_FUNCTION__
|
||||
|
||||
#endif
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename in_t, typename serializer_t = _serialization_helper::empty_serializer,
|
||||
typename string_t = default_string_t>
|
||||
basic_value<string_t> serialize(in_t&& in, const serializer_t& serializer = {})
|
||||
{
|
||||
if constexpr (_serialization_helper::is_serializable<in_t, serializer_t>::value) {
|
||||
return serializer(std::forward<in_t>(in));
|
||||
}
|
||||
else if constexpr (std::is_constructible_v<basic_value<string_t>, in_t>) {
|
||||
return basic_value<string_t>(std::forward<in_t>(in));
|
||||
}
|
||||
else if constexpr (_utils::is_collection<std::decay_t<in_t>>) {
|
||||
basic_array<string_t> arr;
|
||||
for (auto&& elem : in) {
|
||||
using elem_t = decltype(elem);
|
||||
|
||||
auto j_elem = serialize<elem_t, serializer_t, string_t>(std::forward<elem_t>(elem), serializer);
|
||||
arr.emplace_back(std::move(j_elem));
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
else if constexpr (_utils::is_map<std::decay_t<in_t>>) {
|
||||
basic_object<string_t> obj;
|
||||
for (auto&& [key, elem] : in) {
|
||||
using key_t = decltype(key);
|
||||
using elem_t = decltype(elem);
|
||||
|
||||
auto j_elem = serialize<elem_t, serializer_t, string_t>(std::forward<elem_t>(elem), serializer);
|
||||
obj.emplace(std::forward<key_t>(key), std::move(j_elem));
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
else {
|
||||
_serialization_helper::unable_to_serialize<in_t>();
|
||||
}
|
||||
}
|
||||
|
||||
template <typename out_t, typename deserializer_t = _serialization_helper::empty_deserializer,
|
||||
typename string_t = default_string_t>
|
||||
bool deserialize(const basic_value<string_t>& in, out_t& out, const deserializer_t& deserializer = {})
|
||||
{
|
||||
if constexpr (_serialization_helper::is_deserializable<out_t, deserializer_t>::value) {
|
||||
return deserializer(in, out);
|
||||
}
|
||||
else if constexpr (std::is_constructible_v<out_t, basic_value<string_t>>) {
|
||||
out = out_t(in);
|
||||
return true;
|
||||
}
|
||||
else if constexpr (_utils::is_collection<std::decay_t<out_t>>) {
|
||||
if (!in.is_array()) {
|
||||
return false;
|
||||
}
|
||||
for (auto&& j_elem : in.as_array()) {
|
||||
using elem_t = typename out_t::value_type;
|
||||
elem_t elem {};
|
||||
if (!deserialize<elem_t, deserializer_t, string_t>(j_elem, elem, deserializer)) {
|
||||
return false;
|
||||
}
|
||||
if constexpr (_as_collection_helper::has_emplace_back<out_t>::value) {
|
||||
out.emplace_back(std::move(elem));
|
||||
}
|
||||
else {
|
||||
out.emplace(std::move(elem));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if constexpr (_utils::is_map<std::decay_t<out_t>>) {
|
||||
if (!in.is_object()) {
|
||||
return false;
|
||||
}
|
||||
for (auto&& [key, j_elem] : in.as_object()) {
|
||||
using elem_t = typename out_t::value_type;
|
||||
elem_t elem {};
|
||||
if (!deserialize<elem_t, deserializer_t, string_t>(j_elem, elem, deserializer)) {
|
||||
return false;
|
||||
}
|
||||
out.emplace(std::move(elem));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
_serialization_helper::unable_to_deserialize<out_t>();
|
||||
}
|
||||
}
|
||||
} // namespace json
|
||||
5
3rdparty/include/meojson/common/types.hpp
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "array.hpp"
|
||||
#include "object.hpp"
|
||||
#include "value.hpp"
|
||||
235
3rdparty/include/meojson/common/utils.hpp
vendored
Normal file
@@ -0,0 +1,235 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
namespace json
|
||||
{
|
||||
template <typename string_t>
|
||||
class basic_value;
|
||||
template <typename string_t>
|
||||
class basic_array;
|
||||
template <typename string_t>
|
||||
class basic_object;
|
||||
|
||||
using default_string_t = std::string;
|
||||
|
||||
using value = basic_value<default_string_t>;
|
||||
using array = basic_array<default_string_t>;
|
||||
using object = basic_object<default_string_t>;
|
||||
|
||||
using wvalue = basic_value<std::wstring>;
|
||||
using warray = basic_array<std::wstring>;
|
||||
using wobject = basic_object<std::wstring>;
|
||||
}
|
||||
|
||||
namespace json::ext
|
||||
{
|
||||
template <typename T>
|
||||
class jsonization
|
||||
{
|
||||
public:
|
||||
// json::value to_json(const T&) const;
|
||||
// bool check_json(const json::value&) const;
|
||||
// bool from_json(const json::value&, T&) const;
|
||||
};
|
||||
}
|
||||
|
||||
namespace json::_utils
|
||||
{
|
||||
template <typename T>
|
||||
using iterator_t = decltype(std::declval<T&>().begin());
|
||||
template <typename T>
|
||||
using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>;
|
||||
template <typename T>
|
||||
using iter_value_t = typename std::iterator_traits<remove_cvref_t<T>>::value_type;
|
||||
template <typename R>
|
||||
using range_value_t = iter_value_t<iterator_t<R>>;
|
||||
|
||||
template <typename T, typename = void>
|
||||
constexpr bool is_string = false;
|
||||
template <typename T>
|
||||
constexpr bool is_string<T, std::void_t<typename T::traits_type>> =
|
||||
std::is_same_v<typename T::traits_type, std::char_traits<typename T::value_type>>;
|
||||
|
||||
template <typename T, typename = void>
|
||||
constexpr bool is_container = false;
|
||||
template <typename T>
|
||||
constexpr bool is_container<T, std::void_t<typename T::value_type, range_value_t<T>>> =
|
||||
std::is_same_v<typename T::value_type, range_value_t<T>> && !is_string<T>;
|
||||
|
||||
template <typename T, typename = void>
|
||||
constexpr bool is_map = false;
|
||||
template <typename T>
|
||||
constexpr bool is_map<T, std::void_t<typename T::key_type, typename T::mapped_type>> = is_container<T>;
|
||||
|
||||
template <typename T, typename = void>
|
||||
constexpr bool is_collection = false;
|
||||
template <typename T>
|
||||
constexpr bool is_collection<T> = is_container<T> && !is_map<T>;
|
||||
|
||||
template <typename T>
|
||||
class has_to_json_in_member
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int) -> decltype(std::declval<U>().to_json(), std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
|
||||
public:
|
||||
static constexpr bool value = decltype(test<T>(0))::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class has_to_json_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int) -> decltype(std::declval<ext::jsonization<U>>().to_json(std::declval<U>()), std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
|
||||
public:
|
||||
static constexpr bool value = decltype(test<T>(0))::value;
|
||||
};
|
||||
|
||||
template <typename T, typename string_t>
|
||||
class has_check_json_in_member
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<U>().check_json(std::declval<json::basic_value<string_t>>()), std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
|
||||
public:
|
||||
static constexpr bool value = decltype(test<T>(0))::value;
|
||||
};
|
||||
|
||||
template <typename T, typename string_t>
|
||||
class has_check_json_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<U>>().check_json(std::declval<json::basic_value<string_t>>()),
|
||||
std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
|
||||
public:
|
||||
static constexpr bool value = decltype(test<T>(0))::value;
|
||||
};
|
||||
|
||||
template <typename T, typename string_t>
|
||||
class has_from_json_in_member
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<U>().from_json(std::declval<json::basic_value<string_t>>()), std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
|
||||
public:
|
||||
static constexpr bool value = decltype(test<T>(0))::value;
|
||||
};
|
||||
|
||||
template <typename T, typename string_t>
|
||||
class has_from_json_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<U>>().from_json(std::declval<json::basic_value<string_t>>(),
|
||||
std::declval<U&>()),
|
||||
std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
|
||||
public:
|
||||
static constexpr bool value = decltype(test<T>(0))::value;
|
||||
};
|
||||
|
||||
template <typename string_t>
|
||||
static constexpr string_t unescape_string(const string_t& str)
|
||||
{
|
||||
using char_t = typename string_t::value_type;
|
||||
|
||||
string_t result {};
|
||||
auto cur = str.cbegin();
|
||||
auto end = str.cend();
|
||||
auto no_escape_beg = cur;
|
||||
char_t escape = 0;
|
||||
|
||||
for (; cur != end; ++cur) {
|
||||
switch (*cur) {
|
||||
case '"':
|
||||
escape = '"';
|
||||
break;
|
||||
case '\\':
|
||||
escape = '\\';
|
||||
break;
|
||||
case '\b':
|
||||
escape = 'b';
|
||||
break;
|
||||
case '\f':
|
||||
escape = 'f';
|
||||
break;
|
||||
case '\n':
|
||||
escape = 'n';
|
||||
break;
|
||||
case '\r':
|
||||
escape = 'r';
|
||||
break;
|
||||
case '\t':
|
||||
escape = 't';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (escape) {
|
||||
result += string_t(no_escape_beg, cur) + char_t('\\') + escape;
|
||||
no_escape_beg = cur + 1;
|
||||
escape = 0;
|
||||
}
|
||||
}
|
||||
result += string_t(no_escape_beg, cur);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
static constexpr string_t true_string()
|
||||
{
|
||||
return { 't', 'r', 'u', 'e' };
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
static constexpr string_t false_string()
|
||||
{
|
||||
return { 'f', 'a', 'l', 's', 'e' };
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
static constexpr string_t null_string()
|
||||
{
|
||||
return { 'n', 'u', 'l', 'l' };
|
||||
}
|
||||
|
||||
template <typename string_t, typename any_t>
|
||||
string_t to_basic_string(any_t&& arg)
|
||||
{
|
||||
if constexpr (std::is_same_v<string_t, std::string>) {
|
||||
return std::to_string(std::forward<any_t>(arg));
|
||||
}
|
||||
else if constexpr (std::is_same_v<string_t, std::wstring>) {
|
||||
return std::to_wstring(std::forward<any_t>(arg));
|
||||
}
|
||||
else {
|
||||
static_assert(!sizeof(any_t), "Unsupported type");
|
||||
}
|
||||
}
|
||||
} // namespace json::_utils
|
||||
994
3rdparty/include/meojson/common/value.hpp
vendored
Normal file
@@ -0,0 +1,994 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <variant>
|
||||
|
||||
#include "exception.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
namespace json
|
||||
{
|
||||
template <typename string_t>
|
||||
class basic_value
|
||||
{
|
||||
using array_ptr = std::unique_ptr<basic_array<string_t>>;
|
||||
using object_ptr = std::unique_ptr<basic_object<string_t>>;
|
||||
|
||||
public:
|
||||
enum class value_type : char
|
||||
{
|
||||
invalid,
|
||||
null,
|
||||
boolean,
|
||||
string,
|
||||
number,
|
||||
array,
|
||||
object
|
||||
};
|
||||
|
||||
using var_t = std::variant<string_t, array_ptr, object_ptr>;
|
||||
using char_t = typename string_t::value_type;
|
||||
|
||||
public:
|
||||
basic_value();
|
||||
basic_value(const basic_value<string_t>& rhs);
|
||||
basic_value(basic_value<string_t>&& rhs) noexcept;
|
||||
|
||||
basic_value(bool b);
|
||||
|
||||
basic_value(int num);
|
||||
basic_value(unsigned num);
|
||||
basic_value(long num);
|
||||
basic_value(unsigned long num);
|
||||
basic_value(long long num);
|
||||
basic_value(unsigned long long num);
|
||||
basic_value(float num);
|
||||
basic_value(double num);
|
||||
basic_value(long double num);
|
||||
|
||||
basic_value(const char_t* str);
|
||||
basic_value(string_t str);
|
||||
basic_value(std::nullptr_t);
|
||||
|
||||
basic_value(basic_array<string_t> arr);
|
||||
basic_value(basic_object<string_t> obj);
|
||||
basic_value(std::initializer_list<typename basic_object<string_t>::value_type> init_list);
|
||||
|
||||
// Constructed from raw data
|
||||
template <typename... args_t>
|
||||
basic_value(value_type type, args_t&&... args);
|
||||
|
||||
template <typename collection_t,
|
||||
std::enable_if_t<_utils::is_collection<collection_t> &&
|
||||
std::is_constructible_v<typename basic_array<string_t>::value_type,
|
||||
_utils::range_value_t<collection_t>>,
|
||||
bool> = true>
|
||||
basic_value(collection_t&& collection) : basic_value(basic_array<string_t>(std::forward<collection_t>(collection)))
|
||||
{}
|
||||
template <typename map_t, std::enable_if_t<_utils::is_map<map_t> &&
|
||||
std::is_constructible_v<typename basic_object<string_t>::value_type,
|
||||
_utils::range_value_t<map_t>>,
|
||||
bool> = true>
|
||||
basic_value(map_t&& map) : basic_value(basic_object<string_t>(std::forward<map_t>(map)))
|
||||
{}
|
||||
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_to_json_in_member<jsonization_t>::value, bool> = true>
|
||||
basic_value(const jsonization_t& value) : basic_value(value.to_json())
|
||||
{}
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_to_json_in_templ_spec<jsonization_t>::value, bool> = true>
|
||||
basic_value(const jsonization_t& value) : basic_value(ext::jsonization<jsonization_t>().to_json(value))
|
||||
{}
|
||||
|
||||
template <typename value_t, std::enable_if_t<!std::is_convertible_v<value_t, basic_value<string_t>>, bool> = true>
|
||||
basic_value(value_t) = delete;
|
||||
|
||||
// I don't know if you want to convert char to string or number, so I delete these constructors.
|
||||
basic_value(char) = delete;
|
||||
basic_value(wchar_t) = delete;
|
||||
basic_value(char16_t) = delete;
|
||||
basic_value(char32_t) = delete;
|
||||
|
||||
~basic_value();
|
||||
|
||||
bool valid() const noexcept { return _type != value_type::invalid; }
|
||||
bool empty() const noexcept { return is_null(); }
|
||||
bool is_null() const noexcept { return _type == value_type::null; }
|
||||
bool is_number() const noexcept { return _type == value_type::number; }
|
||||
bool is_boolean() const noexcept { return _type == value_type::boolean; }
|
||||
bool is_string() const noexcept { return _type == value_type::string; }
|
||||
bool is_array() const noexcept { return _type == value_type::array; }
|
||||
bool is_object() const noexcept { return _type == value_type::object; }
|
||||
template <typename value_t>
|
||||
bool is() const noexcept;
|
||||
|
||||
template <typename value_t>
|
||||
bool all() const;
|
||||
|
||||
bool contains(const string_t& key) const;
|
||||
bool contains(size_t pos) const;
|
||||
bool exists(const string_t& key) const { return contains(key); }
|
||||
bool exists(size_t pos) const { return contains(pos); }
|
||||
value_type type() const noexcept { return _type; }
|
||||
const basic_value<string_t>& at(size_t pos) const;
|
||||
const basic_value<string_t>& at(const string_t& key) const;
|
||||
|
||||
bool erase(size_t pos);
|
||||
bool erase(const string_t& key);
|
||||
|
||||
// Usage: get(key_1, key_2, ..., default_value);
|
||||
template <typename... key_then_default_value_t>
|
||||
auto get(key_then_default_value_t&&... keys_then_default_value) const;
|
||||
|
||||
template <typename value_t = basic_value<string_t>>
|
||||
std::optional<value_t> find(size_t pos) const;
|
||||
template <typename value_t = basic_value<string_t>>
|
||||
std::optional<value_t> find(const string_t& key) const;
|
||||
|
||||
bool as_boolean() const;
|
||||
int as_integer() const;
|
||||
unsigned as_unsigned() const;
|
||||
long as_long() const;
|
||||
unsigned long as_unsigned_long() const;
|
||||
long long as_long_long() const;
|
||||
unsigned long long as_unsigned_long_long() const;
|
||||
float as_float() const;
|
||||
double as_double() const;
|
||||
long double as_long_double() const;
|
||||
string_t as_string() const;
|
||||
const basic_array<string_t>& as_array() const;
|
||||
const basic_object<string_t>& as_object() const;
|
||||
|
||||
template <typename value_t, template <typename...> typename collection_t = std::vector>
|
||||
collection_t<value_t> as_collection() const;
|
||||
template <typename value_t, template <typename...> typename map_t = std::map>
|
||||
map_t<string_t, value_t> as_map() const;
|
||||
|
||||
template <typename value_t>
|
||||
value_t as() const;
|
||||
|
||||
basic_array<string_t>& as_array();
|
||||
basic_object<string_t>& as_object();
|
||||
|
||||
template <typename... args_t>
|
||||
decltype(auto) emplace(args_t&&... args);
|
||||
|
||||
void clear() noexcept;
|
||||
|
||||
string_t dumps(std::optional<size_t> indent = std::nullopt) const { return indent ? format(*indent) : to_string(); }
|
||||
// return raw string
|
||||
string_t to_string() const;
|
||||
string_t format(size_t indent = 4) const { return format(indent, 0); }
|
||||
|
||||
basic_value<string_t>& operator=(const basic_value<string_t>& rhs);
|
||||
basic_value<string_t>& operator=(basic_value<string_t>&&) noexcept;
|
||||
template <typename value_t, std::enable_if_t<std::is_convertible_v<value_t, basic_value<string_t>>, bool> = true>
|
||||
basic_value<string_t>& operator=(value_t rhs)
|
||||
{
|
||||
return *this = basic_value<string_t>(std::move(rhs));
|
||||
}
|
||||
|
||||
bool operator==(const basic_value<string_t>& rhs) const;
|
||||
bool operator!=(const basic_value<string_t>& rhs) const { return !(*this == rhs); }
|
||||
|
||||
const basic_value<string_t>& operator[](size_t pos) const;
|
||||
basic_value<string_t>& operator[](size_t pos);
|
||||
basic_value<string_t>& operator[](const string_t& key);
|
||||
basic_value<string_t>& operator[](string_t&& key);
|
||||
|
||||
basic_value<string_t> operator|(const basic_object<string_t>& rhs) const&;
|
||||
basic_value<string_t> operator|(basic_object<string_t>&& rhs) const&;
|
||||
basic_value<string_t> operator|(const basic_object<string_t>& rhs) &&;
|
||||
basic_value<string_t> operator|(basic_object<string_t>&& rhs) &&;
|
||||
|
||||
basic_value<string_t>& operator|=(const basic_object<string_t>& rhs);
|
||||
basic_value<string_t>& operator|=(basic_object<string_t>&& rhs);
|
||||
|
||||
basic_value<string_t> operator+(const basic_array<string_t>& rhs) const&;
|
||||
basic_value<string_t> operator+(basic_array<string_t>&& rhs) const&;
|
||||
basic_value<string_t> operator+(const basic_array<string_t>& rhs) &&;
|
||||
basic_value<string_t> operator+(basic_array<string_t>&& rhs) &&;
|
||||
|
||||
basic_value<string_t>& operator+=(const basic_array<string_t>& rhs);
|
||||
basic_value<string_t>& operator+=(basic_array<string_t>&& rhs);
|
||||
|
||||
explicit operator bool() const { return as_boolean(); }
|
||||
explicit operator int() const { return as_integer(); }
|
||||
explicit operator unsigned() const { return as_unsigned(); }
|
||||
explicit operator long() const { return as_long(); }
|
||||
explicit operator unsigned long() const { return as_unsigned_long(); }
|
||||
explicit operator long long() const { return as_long_long(); }
|
||||
explicit operator unsigned long long() const { return as_unsigned_long_long(); }
|
||||
explicit operator float() const { return as_float(); }
|
||||
explicit operator double() const { return as_double(); }
|
||||
explicit operator long double() const { return as_long_double(); }
|
||||
explicit operator string_t() const { return as_string(); }
|
||||
|
||||
explicit operator basic_array<string_t>() const { return as_array(); }
|
||||
explicit operator basic_object<string_t>() const { return as_object(); }
|
||||
|
||||
template <typename value_t, template <typename...> typename collection_t = std::vector,
|
||||
std::enable_if_t<_utils::is_collection<collection_t<value_t>>, bool> = true>
|
||||
explicit operator collection_t<value_t>() const
|
||||
{
|
||||
return as_collection<value_t, collection_t>();
|
||||
}
|
||||
template <typename value_t, template <typename...> typename map_t = std::map,
|
||||
std::enable_if_t<_utils::is_map<map_t<string_t, value_t>>, bool> = true>
|
||||
explicit operator map_t<string_t, value_t>() const
|
||||
{
|
||||
return as_map<value_t, map_t>();
|
||||
}
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_from_json_in_member<jsonization_t, string_t>::value, bool> = true>
|
||||
explicit operator jsonization_t() const
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!dst.from_json(*this)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
template <typename jsonization_t,
|
||||
std::enable_if_t<_utils::has_from_json_in_templ_spec<jsonization_t, string_t>::value, bool> = true>
|
||||
explicit operator jsonization_t() const
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!ext::jsonization<jsonization_t>().from_json(*this, dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class basic_array<string_t>;
|
||||
friend class basic_object<string_t>;
|
||||
|
||||
string_t format(size_t indent, size_t indent_times) const;
|
||||
|
||||
static var_t deep_copy(const var_t& src);
|
||||
|
||||
template <typename... key_then_default_value_t, size_t... keys_indexes_t>
|
||||
auto get(std::tuple<key_then_default_value_t...> keys_then_default_value,
|
||||
std::index_sequence<keys_indexes_t...>) const;
|
||||
|
||||
template <typename value_t, typename first_key_t, typename... rest_keys_t>
|
||||
auto get_helper(const value_t& default_value, first_key_t&& first, rest_keys_t&&... rest) const;
|
||||
template <typename value_t, typename unique_key_t>
|
||||
auto get_helper(const value_t& default_value, unique_key_t&& first) const;
|
||||
|
||||
const string_t& as_basic_type_str() const;
|
||||
string_t& as_basic_type_str();
|
||||
|
||||
value_type _type = value_type::null;
|
||||
var_t _raw_data;
|
||||
};
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value() = default;
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(const basic_value<string_t>& rhs)
|
||||
: _type(rhs._type), _raw_data(deep_copy(rhs._raw_data))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(basic_value<string_t>&& rhs) noexcept = default;
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(bool b)
|
||||
: _type(value_type::boolean),
|
||||
_raw_data(string_t(b ? _utils::true_string<string_t>() : _utils::false_string<string_t>()))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(int num)
|
||||
: _type(value_type::number), _raw_data(_utils::to_basic_string<string_t>(num))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(unsigned num)
|
||||
: _type(value_type::number), _raw_data(_utils::to_basic_string<string_t>(num))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(long num)
|
||||
: _type(value_type::number), _raw_data(_utils::to_basic_string<string_t>(num))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(unsigned long num)
|
||||
: _type(value_type::number), _raw_data(_utils::to_basic_string<string_t>(num))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(long long num)
|
||||
: _type(value_type::number), _raw_data(_utils::to_basic_string<string_t>(num))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(unsigned long long num)
|
||||
: _type(value_type::number), _raw_data(_utils::to_basic_string<string_t>(num))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(float num)
|
||||
: _type(value_type::number), _raw_data(_utils::to_basic_string<string_t>(num))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(double num)
|
||||
: _type(value_type::number), _raw_data(_utils::to_basic_string<string_t>(num))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(long double num)
|
||||
: _type(value_type::number), _raw_data(_utils::to_basic_string<string_t>(num))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(const char_t* str) : _type(value_type::string), _raw_data(string_t(str))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(string_t str) : _type(value_type::string), _raw_data(std::move(str))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(std::nullptr_t) : _type(value_type::null)
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(basic_array<string_t> arr)
|
||||
: _type(value_type::array), _raw_data(std::make_unique<basic_array<string_t>>(std::move(arr)))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(basic_object<string_t> obj)
|
||||
: _type(value_type::object), _raw_data(std::make_unique<basic_object<string_t>>(std::move(obj)))
|
||||
{}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::basic_value(std::initializer_list<typename basic_object<string_t>::value_type> init_list)
|
||||
: _type(value_type::object), _raw_data(std::make_unique<basic_object<string_t>>(init_list))
|
||||
{}
|
||||
|
||||
// for Pimpl
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>::~basic_value() = default;
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline bool basic_value<string_t>::is() const noexcept
|
||||
{
|
||||
if constexpr (std::is_same_v<basic_value<string_t>, value_t>) {
|
||||
return true;
|
||||
}
|
||||
else if constexpr (_utils::has_check_json_in_member<value_t, string_t>::value) {
|
||||
return value_t().check_json(*this);
|
||||
}
|
||||
else if constexpr (_utils::has_check_json_in_templ_spec<value_t, string_t>::value) {
|
||||
return ext::jsonization<value_t>().check_json(*this);
|
||||
}
|
||||
else if constexpr (std::is_same_v<bool, value_t>) {
|
||||
return is_boolean();
|
||||
}
|
||||
else if constexpr (std::is_arithmetic_v<value_t>) {
|
||||
return is_number();
|
||||
}
|
||||
else if constexpr (std::is_constructible_v<string_t, value_t>) {
|
||||
return is_string();
|
||||
}
|
||||
else if constexpr (std::is_same_v<basic_array<string_t>, value_t>) {
|
||||
return is_array();
|
||||
}
|
||||
else if constexpr (_utils::is_collection<value_t>) {
|
||||
return is_array() && all<typename value_t::value_type>();
|
||||
}
|
||||
else if constexpr (std::is_same_v<basic_object<string_t>, value_t>) {
|
||||
return is_object();
|
||||
}
|
||||
else if constexpr (_utils::is_map<value_t>) {
|
||||
return is_object() && std::is_constructible_v<string_t, typename value_t::key_type> &&
|
||||
all<typename value_t::mapped_type>();
|
||||
}
|
||||
else {
|
||||
static_assert(!sizeof(value_t), "Unsupported type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_value<string_t>::contains(const string_t& key) const
|
||||
{
|
||||
return is_object() && as_object().contains(key);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_value<string_t>::contains(size_t pos) const
|
||||
{
|
||||
return is_array() && as_array().contains(pos);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline const basic_value<string_t>& basic_value<string_t>::at(size_t pos) const
|
||||
{
|
||||
return as_array().at(pos);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline const basic_value<string_t>& basic_value<string_t>::at(const string_t& key) const
|
||||
{
|
||||
return as_object().at(key);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_value<string_t>::erase(size_t pos)
|
||||
{
|
||||
return as_array().erase(pos);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_value<string_t>::erase(const string_t& key)
|
||||
{
|
||||
return as_object().erase(key);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... key_then_default_value_t>
|
||||
inline auto basic_value<string_t>::get(key_then_default_value_t&&... keys_then_default_value) const
|
||||
{
|
||||
return get(std::forward_as_tuple(keys_then_default_value...),
|
||||
std::make_index_sequence<sizeof...(keys_then_default_value) - 1> {});
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... key_then_default_value_t, size_t... keys_indexes_t>
|
||||
inline auto basic_value<string_t>::get(std::tuple<key_then_default_value_t...> keys_then_default_value,
|
||||
std::index_sequence<keys_indexes_t...>) const
|
||||
{
|
||||
constexpr unsigned long default_value_index = sizeof...(key_then_default_value_t) - 1;
|
||||
return get_helper(std::get<default_value_index>(keys_then_default_value),
|
||||
std::get<keys_indexes_t>(keys_then_default_value)...);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t, typename first_key_t, typename... rest_keys_t>
|
||||
inline auto basic_value<string_t>::get_helper(const value_t& default_value, first_key_t&& first,
|
||||
rest_keys_t&&... rest) const
|
||||
{
|
||||
if constexpr (std::is_constructible_v<string_t, first_key_t>) {
|
||||
return is_object() ? as_object().get_helper(default_value, std::forward<first_key_t>(first),
|
||||
std::forward<rest_keys_t>(rest)...)
|
||||
: default_value;
|
||||
}
|
||||
else if constexpr (std::is_integral_v<std::decay_t<first_key_t>>) {
|
||||
return is_array() ? as_array().get_helper(default_value, std::forward<first_key_t>(first),
|
||||
std::forward<rest_keys_t>(rest)...)
|
||||
: default_value;
|
||||
}
|
||||
else {
|
||||
static_assert(!sizeof(first_key_t), "Parameter must be integral or string_t constructible");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t, typename unique_key_t>
|
||||
inline auto basic_value<string_t>::get_helper(const value_t& default_value, unique_key_t&& first) const
|
||||
{
|
||||
if constexpr (std::is_constructible_v<string_t, unique_key_t>) {
|
||||
return is_object() ? as_object().get_helper(default_value, std::forward<unique_key_t>(first)) : default_value;
|
||||
}
|
||||
else if constexpr (std::is_integral_v<std::decay_t<unique_key_t>>) {
|
||||
return is_array() ? as_array().get_helper(default_value, std::forward<unique_key_t>(first)) : default_value;
|
||||
}
|
||||
else {
|
||||
static_assert(!sizeof(unique_key_t), "Parameter must be integral or string_t constructible");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline std::optional<value_t> basic_value<string_t>::find(size_t pos) const
|
||||
{
|
||||
return is_array() ? as_array().template find<value_t>(pos) : std::nullopt;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline std::optional<value_t> basic_value<string_t>::find(const string_t& key) const
|
||||
{
|
||||
return is_object() ? as_object().template find<value_t>(key) : std::nullopt;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_value<string_t>::as_boolean() const
|
||||
{
|
||||
if (is_boolean()) {
|
||||
if (const string_t& b_str = as_basic_type_str(); b_str == _utils::true_string<string_t>()) {
|
||||
return true;
|
||||
}
|
||||
else if (b_str == _utils::false_string<string_t>()) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
throw exception("Unknown Parse Error");
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline int basic_value<string_t>::as_integer() const
|
||||
{
|
||||
if (is_number()) {
|
||||
return std::stoi(as_basic_type_str());
|
||||
}
|
||||
else {
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline unsigned basic_value<string_t>::as_unsigned() const
|
||||
{
|
||||
// I don't know why there is no std::stou.
|
||||
return static_cast<unsigned>(as_unsigned_long());
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline long basic_value<string_t>::as_long() const
|
||||
{
|
||||
if (is_number()) {
|
||||
return std::stol(as_basic_type_str());
|
||||
}
|
||||
else {
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline unsigned long basic_value<string_t>::as_unsigned_long() const
|
||||
{
|
||||
if (is_number()) {
|
||||
return std::stoul(as_basic_type_str());
|
||||
}
|
||||
else {
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline long long basic_value<string_t>::as_long_long() const
|
||||
{
|
||||
if (is_number()) {
|
||||
return std::stoll(as_basic_type_str());
|
||||
}
|
||||
else {
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline unsigned long long basic_value<string_t>::as_unsigned_long_long() const
|
||||
{
|
||||
if (is_number()) {
|
||||
return std::stoull(as_basic_type_str());
|
||||
}
|
||||
else {
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline float basic_value<string_t>::as_float() const
|
||||
{
|
||||
if (is_number()) {
|
||||
return std::stof(as_basic_type_str());
|
||||
}
|
||||
else {
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline double basic_value<string_t>::as_double() const
|
||||
{
|
||||
if (is_number()) {
|
||||
return std::stod(as_basic_type_str());
|
||||
}
|
||||
else {
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline long double basic_value<string_t>::as_long_double() const
|
||||
{
|
||||
if (is_number()) {
|
||||
return std::stold(as_basic_type_str());
|
||||
}
|
||||
else {
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline string_t basic_value<string_t>::as_string() const
|
||||
{
|
||||
if (is_string()) {
|
||||
return as_basic_type_str();
|
||||
}
|
||||
else {
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline const basic_array<string_t>& basic_value<string_t>::as_array() const
|
||||
{
|
||||
if (is_array()) {
|
||||
return *std::get<array_ptr>(_raw_data);
|
||||
}
|
||||
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline const basic_object<string_t>& basic_value<string_t>::as_object() const
|
||||
{
|
||||
if (is_object()) {
|
||||
return *std::get<object_ptr>(_raw_data);
|
||||
}
|
||||
|
||||
throw exception("Wrong Type or data empty");
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_array<string_t>& basic_value<string_t>::as_array()
|
||||
{
|
||||
if (empty()) {
|
||||
*this = basic_array<string_t>();
|
||||
}
|
||||
|
||||
if (is_array()) {
|
||||
return *std::get<array_ptr>(_raw_data);
|
||||
}
|
||||
|
||||
throw exception("Wrong Type");
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_object<string_t>& basic_value<string_t>::as_object()
|
||||
{
|
||||
if (empty()) {
|
||||
*this = basic_object<string_t>();
|
||||
}
|
||||
|
||||
if (is_object()) {
|
||||
return *std::get<object_ptr>(_raw_data);
|
||||
}
|
||||
|
||||
throw exception("Wrong Type or data empty");
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline value_t basic_value<string_t>::as() const
|
||||
{
|
||||
if constexpr (std::is_same_v<basic_value<string_t>, value_t>) {
|
||||
return *this;
|
||||
}
|
||||
else if constexpr (_utils::has_from_json_in_member<value_t, string_t>::value) {
|
||||
value_t dst {};
|
||||
if (!dst.from_json(*this)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
else if constexpr (_utils::has_from_json_in_templ_spec<value_t, string_t>::value) {
|
||||
value_t dst {};
|
||||
if (!ext::jsonization<value_t>().from_json(*this, dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
else {
|
||||
return static_cast<value_t>(*this);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline const string_t& basic_value<string_t>::as_basic_type_str() const
|
||||
{
|
||||
return std::get<string_t>(_raw_data);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline string_t& basic_value<string_t>::as_basic_type_str()
|
||||
{
|
||||
return std::get<string_t>(_raw_data);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... args_t>
|
||||
inline decltype(auto) basic_value<string_t>::emplace(args_t&&... args)
|
||||
{
|
||||
constexpr bool is_array_args = std::is_constructible_v<typename basic_array<string_t>::value_type, args_t...>;
|
||||
constexpr bool is_object_args = std::is_constructible_v<typename basic_object<string_t>::value_type, args_t...>;
|
||||
|
||||
static_assert(is_array_args || is_object_args, "Args can not constructure a array or object value");
|
||||
|
||||
if constexpr (is_array_args) {
|
||||
return as_array().emplace_back(std::forward<args_t>(args)...);
|
||||
}
|
||||
else if constexpr (is_object_args) {
|
||||
return as_object().emplace(std::forward<args_t>(args)...);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline void basic_value<string_t>::clear() noexcept
|
||||
{
|
||||
*this = basic_value<string_t>();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline string_t basic_value<string_t>::to_string() const
|
||||
{
|
||||
switch (_type) {
|
||||
case value_type::null:
|
||||
return _utils::null_string<string_t>();
|
||||
case value_type::boolean:
|
||||
case value_type::number:
|
||||
return as_basic_type_str();
|
||||
case value_type::string:
|
||||
return char_t('"') + _utils::unescape_string(as_basic_type_str()) + char_t('"');
|
||||
case value_type::array:
|
||||
return as_array().to_string();
|
||||
case value_type::object:
|
||||
return as_object().to_string();
|
||||
default:
|
||||
throw exception("Unknown basic_value Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline string_t basic_value<string_t>::format(size_t indent, size_t indent_times) const
|
||||
{
|
||||
switch (_type) {
|
||||
case value_type::null:
|
||||
case value_type::boolean:
|
||||
case value_type::number:
|
||||
case value_type::string:
|
||||
return to_string();
|
||||
case value_type::array:
|
||||
return as_array().format(indent, indent_times);
|
||||
case value_type::object:
|
||||
return as_object().format(indent, indent_times);
|
||||
default:
|
||||
throw exception("Unknown basic_value Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline bool basic_value<string_t>::all() const
|
||||
{
|
||||
if (is_array()) {
|
||||
return as_array().template all<value_t>();
|
||||
}
|
||||
else if (is_object()) {
|
||||
return as_object().template all<value_t>();
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t, template <typename...> typename collection_t>
|
||||
inline collection_t<value_t> basic_value<string_t>::as_collection() const
|
||||
{
|
||||
return as_array().template as_collection<value_t, collection_t>();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t, template <typename...> typename map_t>
|
||||
inline map_t<string_t, value_t> basic_value<string_t>::as_map() const
|
||||
{
|
||||
return as_object().template as_map<value_t, map_t>();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_value<string_t>::operator=(const basic_value<string_t>& rhs)
|
||||
{
|
||||
_type = rhs._type;
|
||||
_raw_data = deep_copy(rhs._raw_data);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_value<string_t>::operator=(basic_value<string_t>&& rhs) noexcept = default;
|
||||
|
||||
template <typename string_t>
|
||||
inline bool basic_value<string_t>::operator==(const basic_value<string_t>& rhs) const
|
||||
{
|
||||
if (_type != rhs._type) return false;
|
||||
|
||||
switch (_type) {
|
||||
case value_type::null:
|
||||
return rhs.is_null();
|
||||
case value_type::boolean:
|
||||
case value_type::number:
|
||||
case value_type::string:
|
||||
return _raw_data == rhs._raw_data;
|
||||
case value_type::array:
|
||||
return as_array() == rhs.as_array();
|
||||
case value_type::object:
|
||||
return as_object() == rhs.as_object();
|
||||
default:
|
||||
throw exception("Unknown basic_value Type");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline const basic_value<string_t>& basic_value<string_t>::operator[](size_t pos) const
|
||||
{
|
||||
// basic_array not support to create by operator[]
|
||||
|
||||
return as_array()[pos];
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_value<string_t>::operator[](size_t pos)
|
||||
{
|
||||
// basic_array not support to create by operator[]
|
||||
|
||||
return as_array()[pos];
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_value<string_t>::operator[](const string_t& key)
|
||||
{
|
||||
if (empty()) {
|
||||
*this = basic_object<string_t>();
|
||||
}
|
||||
|
||||
return as_object()[key];
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_value<string_t>::operator[](string_t&& key)
|
||||
{
|
||||
if (empty()) {
|
||||
*this = basic_object<string_t>();
|
||||
}
|
||||
|
||||
return as_object()[std::move(key)];
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t> basic_value<string_t>::operator|(const basic_object<string_t>& rhs) const&
|
||||
{
|
||||
return as_object() | rhs;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t> basic_value<string_t>::operator|(basic_object<string_t>&& rhs) const&
|
||||
{
|
||||
return as_object() | std::move(rhs);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t> basic_value<string_t>::operator|(const basic_object<string_t>& rhs) &&
|
||||
{
|
||||
return std::move(as_object()) | rhs;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t> basic_value<string_t>::operator|(basic_object<string_t>&& rhs) &&
|
||||
{
|
||||
return std::move(as_object()) | std::move(rhs);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_value<string_t>::operator|=(const basic_object<string_t>& rhs)
|
||||
{
|
||||
as_object() |= rhs;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_value<string_t>::operator|=(basic_object<string_t>&& rhs)
|
||||
{
|
||||
as_object() |= std::move(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t> basic_value<string_t>::operator+(const basic_array<string_t>& rhs) const&
|
||||
{
|
||||
return as_array() + rhs;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t> basic_value<string_t>::operator+(basic_array<string_t>&& rhs) const&
|
||||
{
|
||||
return as_array() + std::move(rhs);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t> basic_value<string_t>::operator+(const basic_array<string_t>& rhs) &&
|
||||
{
|
||||
return std::move(as_array()) + rhs;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t> basic_value<string_t>::operator+(basic_array<string_t>&& rhs) &&
|
||||
{
|
||||
return std::move(as_array()) + std::move(rhs);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_value<string_t>::operator+=(const basic_array<string_t>& rhs)
|
||||
{
|
||||
as_array() += rhs;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_value<string_t>::operator+=(basic_array<string_t>&& rhs)
|
||||
{
|
||||
as_array() += std::move(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... args_t>
|
||||
inline basic_value<string_t>::basic_value(value_type type, args_t&&... args)
|
||||
: _type(type), _raw_data(std::forward<args_t>(args)...)
|
||||
{
|
||||
static_assert(std::is_constructible_v<var_t, args_t...>, "Parameter can't be used to construct a var_t");
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_value<string_t>::var_t basic_value<string_t>::deep_copy(const var_t& src)
|
||||
{
|
||||
var_t dst;
|
||||
if (const auto string_ptr = std::get_if<string_t>(&src)) {
|
||||
dst = *string_ptr;
|
||||
}
|
||||
else if (const auto arr_ptr = std::get_if<array_ptr>(&src)) {
|
||||
dst = std::make_unique<basic_array<string_t>>(**arr_ptr);
|
||||
}
|
||||
else if (const auto obj_ptr = std::get_if<object_ptr>(&src)) {
|
||||
dst = std::make_unique<basic_object<string_t>>(**obj_ptr);
|
||||
}
|
||||
else {
|
||||
// maybe invalid_value
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
template <typename ostream_t, typename string_t,
|
||||
typename std_ostream_t =
|
||||
std::basic_ostream<typename string_t::value_type, std::char_traits<typename string_t::value_type>>,
|
||||
typename =
|
||||
std::enable_if_t<std::is_same_v<std_ostream_t, ostream_t> || std::is_base_of_v<std_ostream_t, ostream_t>>>
|
||||
ostream_t& operator<<(ostream_t& out, const basic_value<string_t>& val)
|
||||
{
|
||||
out << val.format();
|
||||
return out;
|
||||
}
|
||||
} // namespace json
|
||||
2685
3rdparty/include/meojson/json.hpp
vendored
4
3rdparty/include/meojson/json5.hpp
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/types.hpp"
|
||||
#include "parser5/parser5.hpp"
|
||||
112
3rdparty/include/meojson/parser/bitops.hpp
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
#pragma once
|
||||
|
||||
#if __cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
|
||||
#include <bit>
|
||||
namespace json::_bitops
|
||||
{
|
||||
using std::countl_one;
|
||||
using std::countl_zero;
|
||||
using std::countr_one;
|
||||
using std::countr_zero;
|
||||
inline constexpr bool is_little_endian()
|
||||
{
|
||||
return std::endian::native == std::endian::little;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#include <cstdint>
|
||||
namespace json::_bitops
|
||||
{
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
inline constexpr int countl_zero(uint32_t x)
|
||||
{
|
||||
if constexpr (sizeof(uint32_t) == sizeof(unsigned int)) return x == 0 ? 32 : __builtin_clz(x);
|
||||
if constexpr (sizeof(uint32_t) == sizeof(unsigned long)) return x == 0 ? 32 : __builtin_clzl(x);
|
||||
return x == 0 ? 32 : __builtin_clzll(x);
|
||||
}
|
||||
inline constexpr int countr_zero(uint32_t x)
|
||||
{
|
||||
if constexpr (sizeof(uint32_t) == sizeof(unsigned int)) return x == 0 ? 32 : __builtin_ctz(x);
|
||||
if constexpr (sizeof(uint32_t) == sizeof(unsigned long)) return x == 0 ? 32 : __builtin_ctzl(x);
|
||||
return x == 0 ? 32 : __builtin_ctzll(x);
|
||||
}
|
||||
inline constexpr int countl_zero(uint64_t x)
|
||||
{
|
||||
return x == 0 ? 64 : __builtin_clzll(x);
|
||||
}
|
||||
inline constexpr int countr_zero(uint64_t x)
|
||||
{
|
||||
return x == 0 ? 64 : __builtin_ctzll(x);
|
||||
}
|
||||
#elif defined(_MSC_VER)
|
||||
#ifdef __AVX2__
|
||||
// lzcnt intrinsics is not constexpr
|
||||
inline int countl_zero(uint32_t x)
|
||||
{
|
||||
return __lzcnt(x);
|
||||
}
|
||||
inline int countr_zero(uint32_t x)
|
||||
{
|
||||
return _tzcnt_u32(x);
|
||||
}
|
||||
inline int countl_zero(uint64_t x)
|
||||
{
|
||||
return (int)__lzcnt64(x);
|
||||
}
|
||||
inline int countr_zero(uint64_t x)
|
||||
{
|
||||
return (int)_tzcnt_u64(x);
|
||||
}
|
||||
#else
|
||||
inline constexpr int countl_zero(uint32_t x)
|
||||
{
|
||||
unsigned long index = 0;
|
||||
return _BitScanReverse(&index, x) ? 31 - index : 32;
|
||||
}
|
||||
inline constexpr int countr_zero(uint32_t x)
|
||||
{
|
||||
unsigned long index = 0;
|
||||
return _BitScanForward(&index, x) ? index : 32;
|
||||
}
|
||||
inline constexpr int countl_zero(uint64_t x)
|
||||
{
|
||||
unsigned long index = 0;
|
||||
return _BitScanReverse64(&index, x) ? 63 - index : 64;
|
||||
}
|
||||
inline constexpr int countr_zero(uint64_t x)
|
||||
{
|
||||
unsigned long index = 0;
|
||||
return _BitScanForward64(&index, x) ? index : 64;
|
||||
}
|
||||
#endif // __AVX2__
|
||||
#else // compiler
|
||||
#error "bring your own bit counting implementation"
|
||||
#endif
|
||||
inline int countl_one(uint32_t x)
|
||||
{
|
||||
return countl_zero(~x);
|
||||
}
|
||||
inline int countr_one(uint32_t x)
|
||||
{
|
||||
return countr_zero(~x);
|
||||
}
|
||||
inline int countl_one(uint64_t x)
|
||||
{
|
||||
return countl_zero(~x);
|
||||
}
|
||||
inline int countr_one(uint64_t x)
|
||||
{
|
||||
return countr_zero(~x);
|
||||
}
|
||||
|
||||
// no constexpr endian awareness before C++20
|
||||
inline bool is_little_endian()
|
||||
{
|
||||
union {
|
||||
uint32_t u32;
|
||||
uint8_t u8;
|
||||
} u = { 0x01020304 };
|
||||
return u.u8 == 4;
|
||||
}
|
||||
} // namespace json::_bitops
|
||||
#endif // C++20
|
||||
@@ -1,25 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <type_traits>
|
||||
|
||||
#include "bitops.hpp"
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define __packed_bytes_strong_inline __attribute__((always_inline))
|
||||
#define __packed_bytes_strong_inline __attribute__((always_inline))
|
||||
#elif defined(_MSC_VER)
|
||||
#define __packed_bytes_strong_inline __forceinline
|
||||
#else
|
||||
#define __packed_bytes_strong_inline inline
|
||||
#endif
|
||||
|
||||
struct packed_bytes_trait_none {
|
||||
namespace json::_packed_bytes
|
||||
{
|
||||
struct packed_bytes_trait_none
|
||||
{
|
||||
static constexpr bool available = false;
|
||||
};
|
||||
|
||||
template <size_t N>
|
||||
struct packed_bytes {
|
||||
struct packed_bytes
|
||||
{
|
||||
using traits = packed_bytes_trait_none;
|
||||
};
|
||||
}
|
||||
|
||||
#if defined(__SSE2__) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP)
|
||||
#include "packed_bytes_x86.hpp"
|
||||
@@ -27,100 +34,108 @@ struct packed_bytes {
|
||||
#include "packed_bytes_arm.hpp"
|
||||
#endif
|
||||
|
||||
struct packed_bytes_trait_uint64 {
|
||||
namespace json::_packed_bytes
|
||||
{
|
||||
struct packed_bytes_trait_uint64
|
||||
{
|
||||
static constexpr bool available = sizeof(void*) >= 8;
|
||||
static constexpr auto step = 8;
|
||||
using value_type = std::enable_if_t<sizeof(void*) >= 8, uint64_t>;
|
||||
using value_type = uint64_t;
|
||||
|
||||
__packed_bytes_strong_inline static value_type load_unaligned(const void *ptr) {
|
||||
__packed_bytes_strong_inline static value_type load_unaligned(const void* ptr)
|
||||
{
|
||||
value_type result;
|
||||
memcpy((void*)&result, ptr, 8);
|
||||
return result;
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type less(value_type x, uint8_t n) {
|
||||
return (((x) - UINT64_C(0x0101010101010101) * (n)) & ~(x) & UINT64_C(0x8080808080808080));
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type is_zero_memberwise(value_type v) {
|
||||
return (((v) - UINT64_C(0x0101010101010101)) & ~(v) & UINT64_C(0x8080808080808080));
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static bool is_all_zero(value_type v)
|
||||
__packed_bytes_strong_inline static value_type less(value_type x, uint8_t n)
|
||||
{
|
||||
return v == UINT64_C(0);
|
||||
return (((x)-UINT64_C(0x0101010101010101) * (n)) & ~(x)&UINT64_C(0x8080808080808080));
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, uint8_t n) {
|
||||
__packed_bytes_strong_inline static value_type is_zero_memberwise(value_type v)
|
||||
{
|
||||
return (((v)-UINT64_C(0x0101010101010101)) & ~(v)&UINT64_C(0x8080808080808080));
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static bool is_all_zero(value_type v) { return v == UINT64_C(0); }
|
||||
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, uint8_t n)
|
||||
{
|
||||
return is_zero_memberwise((x) ^ (UINT64_C(0x0101010101010101) * (n)));
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type bitwise_or(value_type a, value_type b) {
|
||||
return a | b;
|
||||
}
|
||||
__packed_bytes_strong_inline static value_type bitwise_or(value_type a, value_type b) { return a | b; }
|
||||
|
||||
__packed_bytes_strong_inline static size_t first_nonzero_byte(value_type x) {
|
||||
if (json::__bitops::is_little_endian())
|
||||
return json::__bitops::countr_zero(x) / 8;
|
||||
__packed_bytes_strong_inline static size_t first_nonzero_byte(value_type x)
|
||||
{
|
||||
if (_bitops::is_little_endian())
|
||||
return _bitops::countr_zero(x) / 8;
|
||||
else
|
||||
return json::__bitops::countl_zero(x) / 8;
|
||||
return _bitops::countl_zero(x) / 8;
|
||||
}
|
||||
};
|
||||
|
||||
struct packed_bytes_trait_uint32 {
|
||||
struct packed_bytes_trait_uint32
|
||||
{
|
||||
static constexpr bool available = true;
|
||||
static constexpr auto step = 4;
|
||||
using value_type = uint32_t;
|
||||
|
||||
__packed_bytes_strong_inline static value_type load_unaligned(const void *ptr) {
|
||||
__packed_bytes_strong_inline static value_type load_unaligned(const void* ptr)
|
||||
{
|
||||
value_type result;
|
||||
memcpy((void*)&result, ptr, 4);
|
||||
return result;
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type less(value_type x, uint8_t n) {
|
||||
__packed_bytes_strong_inline static value_type less(value_type x, uint8_t n)
|
||||
{
|
||||
return (((x) - ~UINT32_C(0) / 255 * (n)) & ~(x) & ~UINT32_C(0) / 255 * 128);
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type is_zero_memberwise(value_type v) {
|
||||
return (((v) - UINT32_C(0x01010101)) & ~(v) & UINT32_C(0x80808080));;
|
||||
__packed_bytes_strong_inline static value_type is_zero_memberwise(value_type v)
|
||||
{
|
||||
return (((v)-UINT32_C(0x01010101)) & ~(v)&UINT32_C(0x80808080));
|
||||
;
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static bool is_all_zero(value_type v) {
|
||||
return v == UINT32_C(0);
|
||||
}
|
||||
__packed_bytes_strong_inline static bool is_all_zero(value_type v) { return v == UINT32_C(0); }
|
||||
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, uint8_t n) {
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, uint8_t n)
|
||||
{
|
||||
return is_zero_memberwise((x) ^ (~UINT32_C(0) / 255 * (n)));
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type bitwise_or(value_type a, value_type b) {
|
||||
return a | b;
|
||||
}
|
||||
__packed_bytes_strong_inline static value_type bitwise_or(value_type a, value_type b) { return a | b; }
|
||||
|
||||
__packed_bytes_strong_inline static size_t first_nonzero_byte(value_type x) {
|
||||
if (json::__bitops::is_little_endian())
|
||||
return json::__bitops::countr_zero(x) / 8;
|
||||
__packed_bytes_strong_inline static size_t first_nonzero_byte(value_type x)
|
||||
{
|
||||
if (_bitops::is_little_endian())
|
||||
return _bitops::countr_zero(x) / 8;
|
||||
else
|
||||
return json::__bitops::countl_zero(x) / 8;
|
||||
return _bitops::countl_zero(x) / 8;
|
||||
}
|
||||
};
|
||||
template <>
|
||||
struct packed_bytes<8> {
|
||||
using traits = std::enable_if_t<packed_bytes_trait_uint64::available, packed_bytes_trait_uint64>;
|
||||
struct packed_bytes<8>
|
||||
{
|
||||
using traits = packed_bytes_trait_uint64;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct packed_bytes<4> {
|
||||
struct packed_bytes<4>
|
||||
{
|
||||
using traits = packed_bytes_trait_uint32;
|
||||
};
|
||||
|
||||
template <size_t N>
|
||||
using packed_bytes_trait = typename packed_bytes<N>::traits;
|
||||
|
||||
using packed_bytes_trait_max = std::conditional_t<packed_bytes_trait<32>::available, packed_bytes_trait<32>,
|
||||
std::conditional_t<packed_bytes_trait<16>::available, packed_bytes_trait<16>,
|
||||
std::conditional_t<packed_bytes_trait<8>::available, packed_bytes_trait<8>,
|
||||
packed_bytes_trait<4>
|
||||
>>>;
|
||||
|
||||
using packed_bytes_trait_max =
|
||||
std::conditional_t<packed_bytes_trait<32>::available, packed_bytes_trait<32>,
|
||||
std::conditional_t<packed_bytes_trait<16>::available, packed_bytes_trait<16>,
|
||||
std::conditional_t<packed_bytes_trait<8>::available, packed_bytes_trait<8>,
|
||||
packed_bytes_trait<4>>>>;
|
||||
} // namespace json::_packed_bytes
|
||||
@@ -9,34 +9,31 @@
|
||||
#define __packed_bytes_trait_arm64
|
||||
#endif
|
||||
|
||||
struct packed_bytes_trait_neon {
|
||||
namespace json::_packed_bytes
|
||||
{
|
||||
struct packed_bytes_trait_neon
|
||||
{
|
||||
static constexpr bool available = true;
|
||||
static constexpr auto step = 16;
|
||||
using value_type = uint8x16_t;
|
||||
|
||||
__packed_bytes_strong_inline static value_type load_unaligned(const void *ptr) {
|
||||
return vld1q_u8((uint8_t*)ptr);
|
||||
}
|
||||
__packed_bytes_strong_inline static value_type load_unaligned(const void* ptr) { return vld1q_u8((uint8_t*)ptr); }
|
||||
|
||||
__packed_bytes_strong_inline static value_type less(value_type x, uint8_t n) {
|
||||
__packed_bytes_strong_inline static value_type less(value_type x, uint8_t n)
|
||||
{
|
||||
auto bcast = vdupq_n_u8(n);
|
||||
auto is_less = vcltq_u8(x, bcast);
|
||||
return is_less;
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, uint8_t n) {
|
||||
return vceqq_u8(x, vdupq_n_u8(n));
|
||||
}
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, uint8_t n) { return vceqq_u8(x, vdupq_n_u8(n)); }
|
||||
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, value_type y) {
|
||||
return vceqq_u8(x, y);
|
||||
}
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, value_type y) { return vceqq_u8(x, y); }
|
||||
|
||||
__packed_bytes_strong_inline static value_type bitwise_or(value_type a, value_type b) {
|
||||
return vorrq_u8(a, b);
|
||||
}
|
||||
__packed_bytes_strong_inline static value_type bitwise_or(value_type a, value_type b) { return vorrq_u8(a, b); }
|
||||
|
||||
__packed_bytes_strong_inline static bool is_all_zero(value_type x) {
|
||||
__packed_bytes_strong_inline static bool is_all_zero(value_type x)
|
||||
{
|
||||
#ifdef __packed_bytes_trait_arm64
|
||||
return vmaxvq_u8(x) == 0;
|
||||
#else
|
||||
@@ -46,18 +43,20 @@ struct packed_bytes_trait_neon {
|
||||
#endif
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static size_t first_nonzero_byte(value_type x) {
|
||||
__packed_bytes_strong_inline static size_t first_nonzero_byte(value_type x)
|
||||
{
|
||||
// https://community.arm.com/arm-community-blogs/b/infrastructure-solutions-blog/posts/porting-x86-vector-bitmask-optimizations-to-arm-neon
|
||||
auto cmp = equal(x, 0);
|
||||
auto res = vshrn_n_u16(cmp, 4);
|
||||
auto mask64 = vget_lane_u64(vreinterpret_u64_u8(res), 0);
|
||||
return json::__bitops::countr_one(mask64) >> 2;
|
||||
return _bitops::countr_one(mask64) >> 2;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct packed_bytes<16> {
|
||||
struct packed_bytes<16>
|
||||
{
|
||||
using traits = packed_bytes_trait_neon;
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -2,21 +2,26 @@
|
||||
#include "packed_bytes.hpp"
|
||||
|
||||
#include <emmintrin.h>
|
||||
#if defined(__SSE4_1__) || defined(__AVX2__) || defined(_MSC_VER)
|
||||
#if defined(__SSE4_1__) || defined(__AVX2__) || defined(_MSC_VER)
|
||||
// MSVC enables all SSE4.1 intrinsics by default
|
||||
#include <smmintrin.h>
|
||||
#endif
|
||||
|
||||
struct packed_bytes_trait_sse {
|
||||
namespace json::_packed_bytes
|
||||
{
|
||||
struct packed_bytes_trait_sse
|
||||
{
|
||||
static constexpr bool available = true;
|
||||
static constexpr auto step = 16;
|
||||
using value_type = __m128i;
|
||||
|
||||
__packed_bytes_strong_inline static value_type load_unaligned(const void *ptr) {
|
||||
__packed_bytes_strong_inline static value_type load_unaligned(const void* ptr)
|
||||
{
|
||||
return _mm_loadu_si128(reinterpret_cast<const __m128i*>(ptr));
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type less(value_type x, uint8_t n) {
|
||||
__packed_bytes_strong_inline static value_type less(value_type x, uint8_t n)
|
||||
{
|
||||
auto bcast = _mm_set1_epi8(static_cast<char>(n));
|
||||
auto all1 = _mm_set1_epi8(-1);
|
||||
auto max_with_n = _mm_max_epu8(x, bcast);
|
||||
@@ -25,19 +30,17 @@ struct packed_bytes_trait_sse {
|
||||
return is_less;
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, uint8_t n) {
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, uint8_t n)
|
||||
{
|
||||
return _mm_cmpeq_epi8(x, _mm_set1_epi8(static_cast<char>(n)));
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, value_type y) {
|
||||
return _mm_cmpeq_epi8(x, y);
|
||||
}
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, value_type y) { return _mm_cmpeq_epi8(x, y); }
|
||||
|
||||
__packed_bytes_strong_inline static value_type bitwise_or(value_type a, value_type b) {
|
||||
return _mm_or_si128(a, b);
|
||||
}
|
||||
__packed_bytes_strong_inline static value_type bitwise_or(value_type a, value_type b) { return _mm_or_si128(a, b); }
|
||||
|
||||
__packed_bytes_strong_inline static bool is_all_zero(value_type x) {
|
||||
__packed_bytes_strong_inline static bool is_all_zero(value_type x)
|
||||
{
|
||||
#if defined(__SSE4_1__) || defined(__AVX2__) || defined(_MSC_VER)
|
||||
// SSE4.1 path
|
||||
return !!_mm_testz_si128(x, x);
|
||||
@@ -49,22 +52,25 @@ struct packed_bytes_trait_sse {
|
||||
#endif
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static size_t first_nonzero_byte(value_type x) {
|
||||
__packed_bytes_strong_inline static size_t first_nonzero_byte(value_type x)
|
||||
{
|
||||
auto cmp = _mm_cmpeq_epi8(x, _mm_set1_epi8(0));
|
||||
auto mask = (uint16_t)_mm_movemask_epi8(cmp);
|
||||
return json::__bitops::countr_one((uint32_t)mask);
|
||||
return _bitops::countr_one((uint32_t)mask);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct packed_bytes<16> {
|
||||
struct packed_bytes<16>
|
||||
{
|
||||
using traits = packed_bytes_trait_sse;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
#ifdef __AVX2__
|
||||
#include <immintrin.h>
|
||||
|
||||
namespace json::_packed_bytes
|
||||
{
|
||||
struct packed_bytes_trait_avx2
|
||||
{
|
||||
static constexpr bool available = true;
|
||||
@@ -91,33 +97,29 @@ struct packed_bytes_trait_avx2
|
||||
return _mm256_cmpeq_epi8(x, _mm256_set1_epi8(static_cast<char>(n)));
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, value_type y)
|
||||
{
|
||||
return _mm256_cmpeq_epi8(x, y);
|
||||
}
|
||||
__packed_bytes_strong_inline static value_type equal(value_type x, value_type y) { return _mm256_cmpeq_epi8(x, y); }
|
||||
|
||||
__packed_bytes_strong_inline static value_type bitwise_or(value_type a, value_type b)
|
||||
{
|
||||
return _mm256_or_si256(a, b);
|
||||
}
|
||||
|
||||
__packed_bytes_strong_inline static bool is_all_zero(value_type x)
|
||||
{
|
||||
return (bool)_mm256_testz_si256(x, x);
|
||||
}
|
||||
__packed_bytes_strong_inline static bool is_all_zero(value_type x) { return (bool)_mm256_testz_si256(x, x); }
|
||||
|
||||
__packed_bytes_strong_inline static size_t first_nonzero_byte(value_type x)
|
||||
{
|
||||
auto cmp = _mm256_cmpeq_epi8(x, _mm256_set1_epi8(0));
|
||||
auto mask = (uint32_t)_mm256_movemask_epi8(cmp);
|
||||
// AVX512 alternative: _mm_cmpeq_epi8_mask
|
||||
return json::__bitops::countr_one(mask);
|
||||
return _bitops::countr_one(mask);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct packed_bytes<32> {
|
||||
struct packed_bytes<32>
|
||||
{
|
||||
using traits = packed_bytes_trait_avx2;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
627
3rdparty/include/meojson/parser/parser.hpp
vendored
Normal file
@@ -0,0 +1,627 @@
|
||||
#pragma once
|
||||
|
||||
#include <fstream>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
#include "../common/types.hpp"
|
||||
#include "packed_bytes.hpp"
|
||||
|
||||
namespace json
|
||||
{
|
||||
// ****************************
|
||||
// * parser declare *
|
||||
// ****************************
|
||||
|
||||
template <typename string_t = default_string_t, typename parsing_t = void,
|
||||
typename accel_traits = _packed_bytes::packed_bytes_trait_max>
|
||||
class parser
|
||||
{
|
||||
public:
|
||||
using parsing_iter_t = typename parsing_t::const_iterator;
|
||||
|
||||
public:
|
||||
~parser() noexcept = default;
|
||||
|
||||
static std::optional<basic_value<string_t>> parse(const parsing_t& content);
|
||||
|
||||
private:
|
||||
parser(parsing_iter_t cbegin, parsing_iter_t cend) noexcept : _cur(cbegin), _end(cend) { ; }
|
||||
|
||||
std::optional<basic_value<string_t>> parse();
|
||||
basic_value<string_t> parse_value();
|
||||
|
||||
basic_value<string_t> parse_null();
|
||||
basic_value<string_t> parse_boolean();
|
||||
basic_value<string_t> parse_number();
|
||||
// parse and return a basic_value<string_t> whose type is value_type::string
|
||||
basic_value<string_t> parse_string();
|
||||
basic_value<string_t> parse_array();
|
||||
basic_value<string_t> parse_object();
|
||||
|
||||
// parse and return a string_t
|
||||
std::optional<string_t> parse_stdstring();
|
||||
|
||||
bool skip_string_literal_with_accel();
|
||||
bool skip_whitespace() noexcept;
|
||||
bool skip_digit();
|
||||
|
||||
private:
|
||||
parsing_iter_t _cur;
|
||||
parsing_iter_t _end;
|
||||
};
|
||||
|
||||
// ***************************
|
||||
// * utils declare *
|
||||
// ***************************
|
||||
|
||||
template <typename parsing_t>
|
||||
auto parse(const parsing_t& content);
|
||||
|
||||
template <typename char_t>
|
||||
auto parse(char_t* content);
|
||||
|
||||
template <typename istream_t,
|
||||
typename = std::enable_if_t<std::is_base_of_v<std::basic_istream<typename istream_t::char_type>, istream_t>>>
|
||||
auto parse(istream_t& istream, bool check_bom);
|
||||
|
||||
template <typename ifstream_t = std::ifstream, typename path_t = void>
|
||||
auto open(const path_t& path, bool check_bom = false);
|
||||
|
||||
namespace literals
|
||||
{
|
||||
value operator""_json(const char* str, size_t len);
|
||||
wvalue operator""_json(const wchar_t* str, size_t len);
|
||||
|
||||
value operator""_jvalue(const char* str, size_t len);
|
||||
wvalue operator""_jvalue(const wchar_t* str, size_t len);
|
||||
|
||||
array operator""_jarray(const char* str, size_t len);
|
||||
warray operator""_jarray(const wchar_t* str, size_t len);
|
||||
|
||||
object operator""_jobject(const char* str, size_t len);
|
||||
wobject operator""_jobject(const wchar_t* str, size_t len);
|
||||
}
|
||||
|
||||
template <typename string_t = default_string_t>
|
||||
const basic_value<string_t> invalid_value();
|
||||
|
||||
// *************************
|
||||
// * parser impl *
|
||||
// *************************
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline std::optional<basic_value<string_t>> parser<string_t, parsing_t, accel_traits>::parse(const parsing_t& content)
|
||||
{
|
||||
return parser<string_t, parsing_t, accel_traits>(content.cbegin(), content.cend()).parse();
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline std::optional<basic_value<string_t>> parser<string_t, parsing_t, accel_traits>::parse()
|
||||
{
|
||||
if (!skip_whitespace()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
basic_value<string_t> result_value;
|
||||
switch (*_cur) {
|
||||
case '[':
|
||||
result_value = parse_array();
|
||||
break;
|
||||
case '{':
|
||||
result_value = parse_object();
|
||||
break;
|
||||
default: // A JSON payload should be an basic_object or basic_array
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (!result_value.valid()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// After the parsing is complete, there should be no more content other than
|
||||
// spaces behind
|
||||
if (skip_whitespace()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return result_value;
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_value()
|
||||
{
|
||||
switch (*_cur) {
|
||||
case 'n':
|
||||
return parse_null();
|
||||
case 't':
|
||||
case 'f':
|
||||
return parse_boolean();
|
||||
case '-':
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
return parse_number();
|
||||
case '"':
|
||||
return parse_string();
|
||||
case '[':
|
||||
return parse_array();
|
||||
case '{':
|
||||
return parse_object();
|
||||
default:
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_null()
|
||||
{
|
||||
for (const auto& ch : _utils::null_string<string_t>()) {
|
||||
if (_cur != _end && *_cur == ch) {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
}
|
||||
|
||||
return basic_value<string_t>();
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_boolean()
|
||||
{
|
||||
switch (*_cur) {
|
||||
case 't':
|
||||
for (const auto& ch : _utils::true_string<string_t>()) {
|
||||
if (_cur != _end && *_cur == ch) {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case 'f':
|
||||
for (const auto& ch : _utils::false_string<string_t>()) {
|
||||
if (_cur != _end && *_cur == ch) {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_number()
|
||||
{
|
||||
const auto first = _cur;
|
||||
if (*_cur == '-') {
|
||||
++_cur;
|
||||
}
|
||||
|
||||
// numbers cannot have leading zeroes
|
||||
if (_cur != _end && *_cur == '0' && _cur + 1 != _end && std::isdigit(*(_cur + 1))) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
if (!skip_digit()) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
if (*_cur == '.') {
|
||||
++_cur;
|
||||
if (!skip_digit()) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
}
|
||||
|
||||
if (*_cur == 'e' || *_cur == 'E') {
|
||||
if (++_cur == _end) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
if (*_cur == '+' || *_cur == '-') {
|
||||
++_cur;
|
||||
}
|
||||
if (!skip_digit()) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
}
|
||||
|
||||
return basic_value<string_t>(basic_value<string_t>::value_type::number, string_t(first, _cur));
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_string()
|
||||
{
|
||||
auto string_opt = parse_stdstring();
|
||||
if (!string_opt) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
return basic_value<string_t>(basic_value<string_t>::value_type::string, std::move(string_opt).value());
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_array()
|
||||
{
|
||||
if (*_cur == '[') {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
if (!skip_whitespace()) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
else if (*_cur == ']') {
|
||||
++_cur;
|
||||
// empty basic_array
|
||||
return basic_array<string_t>();
|
||||
}
|
||||
|
||||
typename basic_array<string_t>::raw_array result;
|
||||
while (true) {
|
||||
if (!skip_whitespace()) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
basic_value<string_t> val = parse_value();
|
||||
|
||||
if (!val.valid() || !skip_whitespace()) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
result.emplace_back(std::move(val));
|
||||
|
||||
if (*_cur == ',') {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (skip_whitespace() && *_cur == ']') {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
return basic_array<string_t>(std::move(result));
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_object()
|
||||
{
|
||||
if (*_cur == '{') {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
if (!skip_whitespace()) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
else if (*_cur == '}') {
|
||||
++_cur;
|
||||
// empty basic_object
|
||||
return basic_object<string_t>();
|
||||
}
|
||||
|
||||
typename basic_object<string_t>::raw_object result;
|
||||
while (true) {
|
||||
if (!skip_whitespace()) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
auto key_opt = parse_stdstring();
|
||||
|
||||
if (key_opt && skip_whitespace() && *_cur == ':') {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
if (!skip_whitespace()) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
basic_value<string_t> val = parse_value();
|
||||
|
||||
if (!val.valid() || !skip_whitespace()) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
result.emplace(std::move(*key_opt), std::move(val));
|
||||
|
||||
if (*_cur == ',') {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (skip_whitespace() && *_cur == '}') {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
return basic_object<string_t>(std::move(result));
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline std::optional<string_t> parser<string_t, parsing_t, accel_traits>::parse_stdstring()
|
||||
{
|
||||
if (*_cur == '"') {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
string_t result;
|
||||
auto no_escape_beg = _cur;
|
||||
|
||||
while (_cur != _end) {
|
||||
if constexpr (sizeof(*_cur) == 1 && accel_traits::available) {
|
||||
if (!skip_string_literal_with_accel()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
switch (*_cur) {
|
||||
case '\t':
|
||||
case '\r':
|
||||
case '\n':
|
||||
return std::nullopt;
|
||||
case '\\': {
|
||||
result += string_t(no_escape_beg, _cur++);
|
||||
if (_cur == _end) {
|
||||
return std::nullopt;
|
||||
}
|
||||
switch (*_cur) {
|
||||
case '"':
|
||||
result.push_back('"');
|
||||
break;
|
||||
case '\\':
|
||||
result.push_back('\\');
|
||||
break;
|
||||
case '/':
|
||||
result.push_back('/');
|
||||
break;
|
||||
case 'b':
|
||||
result.push_back('\b');
|
||||
break;
|
||||
case 'f':
|
||||
result.push_back('\f');
|
||||
break;
|
||||
case 'n':
|
||||
result.push_back('\n');
|
||||
break;
|
||||
case 'r':
|
||||
result.push_back('\r');
|
||||
break;
|
||||
case 't':
|
||||
result.push_back('\t');
|
||||
break;
|
||||
// case 'u':
|
||||
// result.push_back('\u');
|
||||
// break;
|
||||
default:
|
||||
// Illegal backslash escape
|
||||
return std::nullopt;
|
||||
}
|
||||
no_escape_beg = ++_cur;
|
||||
break;
|
||||
}
|
||||
case '"': {
|
||||
result += string_t(no_escape_beg, _cur++);
|
||||
return result;
|
||||
}
|
||||
default:
|
||||
++_cur;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline bool parser<string_t, parsing_t, accel_traits>::skip_string_literal_with_accel()
|
||||
{
|
||||
if constexpr (sizeof(*_cur) != 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while (_end - _cur >= accel_traits::step) {
|
||||
auto pack = accel_traits::load_unaligned(&(*_cur));
|
||||
auto result = accel_traits::less(pack, 32);
|
||||
result = accel_traits::bitwise_or(result, accel_traits::equal(pack, static_cast<uint8_t>('"')));
|
||||
result = accel_traits::bitwise_or(result, accel_traits::equal(pack, static_cast<uint8_t>('\\')));
|
||||
|
||||
if (accel_traits::is_all_zero(result)) {
|
||||
_cur += accel_traits::step;
|
||||
}
|
||||
else {
|
||||
auto index = accel_traits::first_nonzero_byte(result);
|
||||
_cur += index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return _cur != _end;
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline bool parser<string_t, parsing_t, accel_traits>::skip_whitespace() noexcept
|
||||
{
|
||||
while (_cur != _end) {
|
||||
switch (*_cur) {
|
||||
case ' ':
|
||||
case '\t':
|
||||
case '\r':
|
||||
case '\n':
|
||||
++_cur;
|
||||
break;
|
||||
case '\0':
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline bool parser<string_t, parsing_t, accel_traits>::skip_digit()
|
||||
{
|
||||
// At least one digit
|
||||
if (_cur != _end && std::isdigit(*_cur)) {
|
||||
++_cur;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
while (_cur != _end && std::isdigit(*_cur)) {
|
||||
++_cur;
|
||||
}
|
||||
|
||||
if (_cur != _end) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// *************************
|
||||
// * utils impl *
|
||||
// *************************
|
||||
|
||||
template <typename parsing_t>
|
||||
auto parse(const parsing_t& content)
|
||||
{
|
||||
using string_t = std::basic_string<typename parsing_t::value_type>;
|
||||
return parser<string_t, parsing_t>::parse(content);
|
||||
}
|
||||
|
||||
template <typename char_t>
|
||||
auto parse(char_t* content)
|
||||
{
|
||||
return parse(std::basic_string_view<std::decay_t<char_t>> { content });
|
||||
}
|
||||
|
||||
template <typename istream_t, typename _>
|
||||
auto parse(istream_t& ifs, bool check_bom)
|
||||
{
|
||||
using string_t = std::basic_string<typename istream_t::char_type>;
|
||||
|
||||
ifs.seekg(0, std::ios::end);
|
||||
auto file_size = ifs.tellg();
|
||||
|
||||
ifs.seekg(0, std::ios::beg);
|
||||
string_t str(file_size, '\0');
|
||||
|
||||
ifs.read(str.data(), file_size);
|
||||
|
||||
if (check_bom) {
|
||||
using uchar = unsigned char;
|
||||
static constexpr uchar Bom_0 = 0xEF;
|
||||
static constexpr uchar Bom_1 = 0xBB;
|
||||
static constexpr uchar Bom_2 = 0xBF;
|
||||
|
||||
if (str.size() >= 3 && static_cast<uchar>(str.at(0)) == Bom_0 && static_cast<uchar>(str.at(1)) == Bom_1 &&
|
||||
static_cast<uchar>(str.at(2)) == Bom_2) {
|
||||
str.assign(str.begin() + 3, str.end());
|
||||
}
|
||||
}
|
||||
return parse(str);
|
||||
}
|
||||
|
||||
template <typename ifstream_t, typename path_t>
|
||||
auto open(const path_t& filepath, bool check_bom)
|
||||
{
|
||||
using char_t = typename ifstream_t::char_type;
|
||||
using string_t = std::basic_string<char_t>;
|
||||
using json_t = json::basic_value<string_t>;
|
||||
using return_t = std::optional<json_t>;
|
||||
|
||||
ifstream_t ifs(filepath, std::ios::in);
|
||||
if (!ifs.is_open()) {
|
||||
return return_t(std::nullopt);
|
||||
}
|
||||
auto opt = parse(ifs, check_bom);
|
||||
ifs.close();
|
||||
return opt;
|
||||
}
|
||||
|
||||
namespace literals
|
||||
{
|
||||
inline value operator""_json(const char* str, size_t len)
|
||||
{
|
||||
return operator""_jvalue(str, len);
|
||||
}
|
||||
inline wvalue operator""_json(const wchar_t* str, size_t len)
|
||||
{
|
||||
return operator""_jvalue(str, len);
|
||||
}
|
||||
|
||||
inline value operator""_jvalue(const char* str, size_t len)
|
||||
{
|
||||
return parse(std::string_view(str, len)).value_or(value());
|
||||
}
|
||||
inline wvalue operator""_jvalue(const wchar_t* str, size_t len)
|
||||
{
|
||||
return parse(std::wstring_view(str, len)).value_or(wvalue());
|
||||
}
|
||||
|
||||
inline array operator""_jarray(const char* str, size_t len)
|
||||
{
|
||||
auto val = parse(std::string_view(str, len)).value_or(value());
|
||||
return val.is_array() ? val.as_array() : array();
|
||||
}
|
||||
inline warray operator""_jarray(const wchar_t* str, size_t len)
|
||||
{
|
||||
auto val = parse(std::wstring_view(str, len)).value_or(wvalue());
|
||||
return val.is_array() ? val.as_array() : warray();
|
||||
}
|
||||
|
||||
inline object operator""_jobject(const char* str, size_t len)
|
||||
{
|
||||
auto val = parse(std::string_view(str, len)).value_or(value());
|
||||
return val.is_object() ? val.as_object() : object();
|
||||
}
|
||||
inline wobject operator""_jobject(const wchar_t* str, size_t len)
|
||||
{
|
||||
auto val = parse(std::wstring_view(str, len)).value_or(wvalue());
|
||||
return val.is_object() ? val.as_object() : wobject();
|
||||
}
|
||||
} // namespace literals
|
||||
|
||||
template <typename string_t>
|
||||
const basic_value<string_t> invalid_value()
|
||||
{
|
||||
return basic_value<string_t>(basic_value<string_t>::value_type::invalid, typename basic_value<string_t>::var_t());
|
||||
}
|
||||
} // namespace json
|
||||
1502
3rdparty/include/meojson/parser5/parser5.hpp
vendored
Normal file
16
3rdparty/include/meojson/parser5/unicode.h
vendored
Normal file
241
3rdparty/include/meojson/reflection/jsonization.hpp
vendored
Normal file
@@ -0,0 +1,241 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#include "../common/types.hpp"
|
||||
|
||||
namespace json::_jsonization_helper
|
||||
{
|
||||
struct next_is_optional_t
|
||||
{};
|
||||
struct va_arg_end
|
||||
{};
|
||||
|
||||
struct dumper
|
||||
{
|
||||
template <typename var_t, typename... rest_t>
|
||||
json::value _to_json(const char* key, const var_t& var, rest_t&&... rest) const
|
||||
{
|
||||
json::value result = _to_json(std::forward<rest_t>(rest)...);
|
||||
result.emplace(key, var);
|
||||
return result;
|
||||
}
|
||||
template <typename... rest_t>
|
||||
json::value _to_json(const char*, next_is_optional_t, rest_t&&... rest) const
|
||||
{
|
||||
return _to_json(std::forward<rest_t>(rest)...);
|
||||
}
|
||||
json::value _to_json(va_arg_end) const { return {}; }
|
||||
};
|
||||
|
||||
struct checker
|
||||
{
|
||||
template <typename var_t, typename... rest_t>
|
||||
bool _check_json(const json::value& in, std::string& error_key, const char* key, const var_t&,
|
||||
rest_t&&... rest) const
|
||||
{
|
||||
auto opt = in.find(key);
|
||||
if (!opt || !opt->is<var_t>()) {
|
||||
error_key = key;
|
||||
return false;
|
||||
}
|
||||
return _check_json(in, error_key, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
template <typename var_t, typename... rest_t>
|
||||
bool _check_json(const json::value& in, std::string& error_key, const char*, next_is_optional_t, const char* key,
|
||||
const var_t&, rest_t&&... rest) const
|
||||
{
|
||||
auto opt = in.find(key);
|
||||
if (opt) {
|
||||
if (!opt->is<var_t>()) {
|
||||
error_key = key;
|
||||
return false;
|
||||
}
|
||||
} // next_is_optional_t, ignore key not found
|
||||
|
||||
return _check_json(in, error_key, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
bool _check_json(const json::value&, std::string&, va_arg_end) const { return true; }
|
||||
};
|
||||
|
||||
struct loader
|
||||
{
|
||||
template <typename var_t, typename... rest_t>
|
||||
bool _from_json(const json::value& in, std::string& error_key, const char* key, var_t& var, rest_t&&... rest) const
|
||||
{
|
||||
auto opt = in.find(key);
|
||||
if (!opt || !opt->is<var_t>()) {
|
||||
error_key = key;
|
||||
return false;
|
||||
}
|
||||
var = std::move(opt)->as<var_t>();
|
||||
|
||||
return _from_json(in, error_key, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
template <typename var_t, typename... rest_t>
|
||||
bool _from_json(const json::value& in, std::string& error_key, const char*, next_is_optional_t, const char* key,
|
||||
var_t& var, rest_t&&... rest) const
|
||||
{
|
||||
auto opt = in.find(key);
|
||||
if (opt) {
|
||||
if (!opt->is<var_t>()) {
|
||||
error_key = key;
|
||||
return false;
|
||||
}
|
||||
var = std::move(opt)->as<var_t>();
|
||||
} // next_is_optional_t, ignore key not found
|
||||
|
||||
return _from_json(in, error_key, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
bool _from_json(const json::value&, std::string&, va_arg_end) const { return true; }
|
||||
};
|
||||
} // namespace json::_jsonization_helper
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
|
||||
#endif
|
||||
|
||||
namespace json::_private_macro
|
||||
{
|
||||
#define _MEOJSON_STRINGIZE(arg) _MEOJSON_STRINGIZE1(arg)
|
||||
#define _MEOJSON_STRINGIZE1(arg) _MEOJSON_STRINGIZE2(arg)
|
||||
#define _MEOJSON_STRINGIZE2(arg) #arg
|
||||
|
||||
#define _MEOJSON_CONCATENATE(arg1, arg2) _MEOJSON_CONCATENATE1(arg1, arg2)
|
||||
#define _MEOJSON_CONCATENATE1(arg1, arg2) _MEOJSON_CONCATENATE2(arg1, arg2)
|
||||
#define _MEOJSON_CONCATENATE2(arg1, arg2) arg1##arg2
|
||||
|
||||
#define _MEOJSON_EXPAND(x) x
|
||||
|
||||
#define _MEOJSON_FOR_EACH_0(pred, ...)
|
||||
#define _MEOJSON_FOR_EACH_1(pred, x, ...) pred(x)
|
||||
#define _MEOJSON_FOR_EACH_2(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_1(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_3(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_2(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_4(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_3(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_5(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_4(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_6(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_5(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_7(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_6(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_8(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_7(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_9(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_8(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_10(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_9(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_11(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_10(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_12(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_11(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_13(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_12(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_14(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_13(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_15(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_14(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_16(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_15(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_17(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_16(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_18(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_17(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_19(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_18(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_20(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_19(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_21(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_20(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_22(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_21(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_23(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_22(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_24(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_23(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_25(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_24(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_26(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_25(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_27(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_26(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_28(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_27(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_29(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_28(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_30(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_29(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_31(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_30(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_32(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_31(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_33(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_32(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_34(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_33(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_35(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_34(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_36(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_35(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_37(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_36(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_38(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_37(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_39(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_38(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_40(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_39(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_41(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_40(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_42(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_41(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_43(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_42(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_44(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_43(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_45(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_44(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_46(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_45(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_47(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_46(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_48(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_47(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_49(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_48(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_50(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_49(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_51(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_50(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_52(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_51(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_53(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_52(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_54(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_53(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_55(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_54(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_56(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_55(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_57(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_56(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_58(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_57(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_59(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_58(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_60(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_59(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_61(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_60(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_62(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_61(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_63(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_62(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH_64(pred, x, ...) pred(x) _MEOJSON_EXPAND(_MEOJSON_FOR_EACH_63(pred, __VA_ARGS__))
|
||||
|
||||
#define _MEOJSON_ARG_COUNT(...) \
|
||||
_MEOJSON_EXPAND(_MEOJSON_ARG_COUNT1(0, ##__VA_ARGS__, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, \
|
||||
49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, \
|
||||
30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, \
|
||||
11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
|
||||
#define _MEOJSON_ARG_COUNT1(_0, _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, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, \
|
||||
_56, _57, _58, _59, _60, _61, _62, _63, _64, N, ...) \
|
||||
N
|
||||
|
||||
#define _MEOJSON_FOR_EACH_(N, pred, ...) _MEOJSON_EXPAND(_MEOJSON_CONCATENATE(_MEOJSON_FOR_EACH_, N)(pred, __VA_ARGS__))
|
||||
#define _MEOJSON_FOR_EACH(pred, ...) \
|
||||
_MEOJSON_EXPAND(_MEOJSON_FOR_EACH_(_MEOJSON_EXPAND(_MEOJSON_ARG_COUNT(__VA_ARGS__)), pred, __VA_ARGS__))
|
||||
|
||||
#define _MEOJSON_VARNAME(x) _MEOJSON_CONCATENATE(_meojson_jsonization_, x)
|
||||
#define _MEOJSON_KEY_VALUE(x) _MEOJSON_STRINGIZE(x), x,
|
||||
} // namespace json::_private_macro
|
||||
|
||||
#define MEO_TOJSON(...) \
|
||||
json::value to_json() const \
|
||||
{ \
|
||||
return json::_jsonization_helper::dumper()._to_json(_MEOJSON_EXPAND( \
|
||||
_MEOJSON_FOR_EACH(_MEOJSON_KEY_VALUE, __VA_ARGS__)) json::_jsonization_helper::va_arg_end {}); \
|
||||
}
|
||||
|
||||
#define MEO_CHECKJSON(...) \
|
||||
bool check_json(const json::value& _MEOJSON_VARNAME(in)) const \
|
||||
{ \
|
||||
std::string _MEOJSON_VARNAME(error_key); \
|
||||
return check_json(_MEOJSON_VARNAME(in), _MEOJSON_VARNAME(error_key)); \
|
||||
} \
|
||||
bool check_json(const json::value& _MEOJSON_VARNAME(in), std::string& _MEOJSON_VARNAME(error_key)) const \
|
||||
{ \
|
||||
return json::_jsonization_helper::checker()._check_json( \
|
||||
_MEOJSON_VARNAME(in), _MEOJSON_VARNAME(error_key), \
|
||||
_MEOJSON_EXPAND(_MEOJSON_FOR_EACH(_MEOJSON_KEY_VALUE, __VA_ARGS__)) \
|
||||
json::_jsonization_helper::va_arg_end {}); \
|
||||
}
|
||||
|
||||
#define MEO_FROMJSON(...) \
|
||||
bool from_json(const json::value& _MEOJSON_VARNAME(in)) \
|
||||
{ \
|
||||
std::string _MEOJSON_VARNAME(error_key); \
|
||||
return from_json(_MEOJSON_VARNAME(in), _MEOJSON_VARNAME(error_key)); \
|
||||
} \
|
||||
bool from_json(const json::value& _MEOJSON_VARNAME(in), std::string& _MEOJSON_VARNAME(error_key)) \
|
||||
{ \
|
||||
return json::_jsonization_helper::loader()._from_json( \
|
||||
_MEOJSON_VARNAME(in), _MEOJSON_VARNAME(error_key), \
|
||||
_MEOJSON_EXPAND(_MEOJSON_FOR_EACH(_MEOJSON_KEY_VALUE, __VA_ARGS__)) \
|
||||
json::_jsonization_helper::va_arg_end {}); \
|
||||
}
|
||||
|
||||
#define MEO_JSONIZATION(...) \
|
||||
_MEOJSON_EXPAND(MEO_TOJSON(__VA_ARGS__)) \
|
||||
_MEOJSON_EXPAND(MEO_CHECKJSON(__VA_ARGS__)) \
|
||||
_MEOJSON_EXPAND(MEO_FROMJSON(__VA_ARGS__))
|
||||
|
||||
#define MEO_OPT json::_jsonization_helper::next_is_optional_t {},
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop // -Wgnu-zero-variadic-macro-arguments
|
||||
#endif
|
||||
32
CHANGELOG.md
@@ -1,27 +1,15 @@
|
||||
## v4.28.2
|
||||
## v5.4.1
|
||||
|
||||
### 新增 | New
|
||||
### 文档 | Docs
|
||||
|
||||
- 基建新增领取专精功能 (#7164) @broken-paint @ABA2396 @SherkeyXD @Constrat
|
||||
* website docs (#9287) @ABA2396 @Rbqwow @Constrat @wangl-cc @HX3N @SherkeyXD
|
||||
* 修改win7相关问题描述&更新运行库 @Rbqwow
|
||||
* fix a bad link @Rbqwow
|
||||
* make i18n warnings show only once @Rbqwow
|
||||
* 修复字体和评论区分类 @Rbqwow
|
||||
|
||||
### 改进 | Improved
|
||||
### For Overseas
|
||||
|
||||
- 当战斗列表中添加多次相同作业时,只有都通过才会点赞 (#7571) @status102
|
||||
- removed unused templates (#7485) @Constrat
|
||||
#### YostarEN
|
||||
|
||||
### 修复 | Fix
|
||||
|
||||
- 肉鸽宣告成功后闪退 @ABA2396
|
||||
- 修复readme文档链接 (#7594) @Rbqwow
|
||||
- 日服 火龙S黑角 识别 @ABA2396
|
||||
- 修改特别关注干员的正则 @ABA2396
|
||||
- 尝试修复肉鸽 OptionUnknown 引起的卡住的问题 (#7581) @zzyyyl
|
||||
- 尝试修复肉鸽策略未随层数改变的问题 (#7582) @zzyyyl
|
||||
- 修改文档后maa本体中的链接错误 @ABA2396
|
||||
- 编队选择三技能的滑动整体上移,避免误触导航栏(#7550) @zzyyyl
|
||||
|
||||
### 其他 | Other
|
||||
|
||||
- 更改changelog生成时检查coauthor的逻辑 (#7589) @SherkeyXD
|
||||
- qodana @ABA2396
|
||||
- 补全pr-checker所需要的权限 @SherkeyXD
|
||||
* YoStarEN resolution warning on client switch (#9539) @Constrat @ABA2396
|
||||
|
||||
17
CITATION.cff
Normal file
@@ -0,0 +1,17 @@
|
||||
# This CITATION.cff file was generated with cffinit.
|
||||
# Visit https://bit.ly/cffinit to generate yours today!
|
||||
|
||||
cff-version: 1.2.0
|
||||
title: MaaAssistantArknights
|
||||
message: >-
|
||||
If you use this software, please cite it using the
|
||||
metadata from this file.
|
||||
type: software
|
||||
authors:
|
||||
- name: Maa Team
|
||||
website: 'https://maa.plus/'
|
||||
date-start: '2021-07-10'
|
||||
repository-code: >-
|
||||
https://github.com/MaaAssistantArknights/MaaAssistantArknights/
|
||||
url: 'https://maa.plus/'
|
||||
license: AGPL-3.0-only
|
||||
101
CMakeLists.txt
@@ -13,9 +13,13 @@ option(BUILD_UNIVERSAL "build both arm64 and x86_64 on macOS" OFF)
|
||||
option(INSTALL_PYTHON "install python ffi" OFF)
|
||||
option(INSTALL_RESOURCE "install resource" OFF)
|
||||
option(INSTALL_DEVEL "install development files" OFF)
|
||||
option(INSTALL_FLATTEN "do not use bin lib include directory" ON)
|
||||
option(INSTALL_THIRD_LIBS "install third party libraries" ON)
|
||||
option(USE_MAADEPS "use third-party libraries built by MaaDeps" ON)
|
||||
option(USE_RANGE_V3 "use range-v3" OFF)
|
||||
option(WITH_EMULATOR_EXTRAS "build with emulator extras" ${WIN32})
|
||||
option(WITH_THRIFT "build with thrift" OFF)
|
||||
option(WITH_ASST_DEBUG "build with ASST_DEBUG defined" OFF)
|
||||
|
||||
include(${PROJECT_SOURCE_DIR}/cmake/utils.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/cmake/thrift-gen.cmake)
|
||||
@@ -24,29 +28,28 @@ if(USE_MAADEPS)
|
||||
include(${PROJECT_SOURCE_DIR}/MaaDeps/maadeps.cmake)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_compile_options("/utf-8")
|
||||
add_compile_options("/MP")
|
||||
add_compile_options("/W4;/WX")
|
||||
add_compile_options("/wd4127") # conditional expression is constant
|
||||
add_compile_options("/Wv:19.35.32217") # disable warning introduced after this version
|
||||
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
else ()
|
||||
add_compile_options("-Wall;-Werror;-Wextra;-Wpedantic;-Wno-missing-field-initializers")
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
|
||||
add_compile_options("-Wno-restrict")
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
|
||||
add_library(header_only_libraries INTERFACE)
|
||||
target_include_directories(header_only_libraries INTERFACE 3rdparty/include)
|
||||
target_include_directories(header_only_libraries INTERFACE 3rdparty/include 3rdparty/EmulatorExtras)
|
||||
|
||||
file(GLOB_RECURSE maa_src src/MaaCore/*.cpp)
|
||||
|
||||
add_library(MaaCore SHARED ${maa_src})
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(MaaCore PRIVATE "/utf-8")
|
||||
target_compile_options(MaaCore PRIVATE "/MP")
|
||||
target_compile_options(MaaCore PRIVATE "/W4;/WX")
|
||||
target_compile_options(MaaCore PRIVATE "/wd4127") # conditional expression is constant
|
||||
target_compile_options(MaaCore PRIVATE "/Wv:19.35.32217") # disable warning introduced after this version
|
||||
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
else ()
|
||||
target_compile_options(MaaCore PRIVATE "-Wall;-Werror;-Wextra;-Wpedantic;-Wno-missing-field-initializers")
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
|
||||
target_compile_options(MaaCore PRIVATE "-Wno-restrict")
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
#注意:相比VS版本缺少了 -D_CONSOLE -D_WINDLL 两项
|
||||
target_compile_definitions(MaaCore PRIVATE ASST_DLL_EXPORTS _UNICODE UNICODE)
|
||||
@@ -77,26 +80,61 @@ endif (BUILD_TEST)
|
||||
|
||||
find_package(OpenCV REQUIRED COMPONENTS core imgproc imgcodecs videoio)
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(MaaDerpLearning REQUIRED)
|
||||
find_package(asio REQUIRED)
|
||||
find_package(ONNXRuntime)
|
||||
find_package(cpr CONFIG REQUIRED)
|
||||
|
||||
list(APPEND maa_libs ${OpenCV_LIBS} ZLIB::ZLIB cpr::cpr header_only_libraries)
|
||||
|
||||
if(USE_MAADEPS)
|
||||
find_package(asio REQUIRED)
|
||||
list(APPEND maa_libs asio::asio)
|
||||
endif()
|
||||
|
||||
find_package(onnxruntime CONFIG REQUIRED) # provided by onnxruntime>=1.16
|
||||
list(APPEND maa_libs onnxruntime::onnxruntime)
|
||||
if(DEFINED fastdeploy_SOURCE_DIR)
|
||||
# TODO: FetchContent github.com/MaaAssistantArknights/FastDeploy
|
||||
if(NOT DEFINED fastdeploy_BINARY_DIR)
|
||||
set(fastdeploy_BINARY_DIR ${CMAKE_BINARY_DIR}/fastdeploy)
|
||||
endif()
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
add_subdirectory(${fastdeploy_SOURCE_DIR} ${fastdeploy_BINARY_DIR} EXCLUDE_FROM_ALL SYSTEM)
|
||||
if(NOT DEFINED fastdeploy_INCLUDE_DIRS)
|
||||
set(fastdeploy_INCLUDE_DIRS ${fastdeploy_SOURCE_DIR})
|
||||
endif()
|
||||
target_include_directories(MaaCore SYSTEM PRIVATE ${fastdeploy_INCLUDE_DIRS})
|
||||
get_target_property(fastdeploy_type fastdeploy_ppocr TYPE)
|
||||
if(fastdeploy_type STREQUAL "SHARED_LIBRARY")
|
||||
install(TARGETS fastdeploy_ppocr)
|
||||
endif()
|
||||
else()
|
||||
find_package(fastdeploy_ppocr REQUIRED)
|
||||
endif()
|
||||
list(APPEND maa_libs fastdeploy_ppocr)
|
||||
|
||||
target_link_libraries(MaaCore ${maa_libs})
|
||||
|
||||
if(WITH_EMULATOR_EXTRAS AND NOT EXISTS ${PROJECT_SOURCE_DIR}/3rdparty/EmulatorExtras/Mumu)
|
||||
message(WARNING "EmulatorExtras not found, please run `git submodule update --init 3rdparty/EmulatorExtras`")
|
||||
set(WITH_EMULATOR_EXTRAS OFF)
|
||||
endif()
|
||||
target_compile_definitions(MaaCore PRIVATE ASST_WITH_EMULATOR_EXTRAS=$<BOOL:${WITH_EMULATOR_EXTRAS}>)
|
||||
|
||||
if(WITH_THRIFT)
|
||||
find_package(Thrift CONFIG REQUIRED)
|
||||
endif(WITH_THRIFT)
|
||||
|
||||
target_link_libraries(MaaCore ${OpenCV_LIBS} MaaDerpLearning asio::asio ZLIB::ZLIB ONNXRuntime::ONNXRuntime cpr::cpr header_only_libraries)
|
||||
|
||||
if(WITH_THRIFT)
|
||||
add_subdirectory(src/MaaThriftController)
|
||||
target_link_libraries(MaaCore MaaThriftController)
|
||||
endif(WITH_THRIFT)
|
||||
|
||||
if (WITH_ASST_DEBUG)
|
||||
target_compile_definitions(MaaCore PRIVATE ASST_DEBUG)
|
||||
endif ()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(MaaCore ws2_32)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
|
||||
if (USE_RANGE_V3)
|
||||
target_compile_definitions(MaaCore PRIVATE ASST_USE_RANGES_RANGE_V3)
|
||||
find_package(range-v3 REQUIRED)
|
||||
target_link_libraries(MaaCore range-v3::range-v3)
|
||||
endif ()
|
||||
@@ -105,12 +143,11 @@ if(INSTALL_DEVEL)
|
||||
set(MaaCore_install_extra_args PUBLIC_HEADER DESTINATION devel/include ARCHIVE DESTINATION devel/lib)
|
||||
endif()
|
||||
|
||||
install(TARGETS MaaCore
|
||||
RUNTIME DESTINATION .
|
||||
LIBRARY DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
${MaaCore_install_extra_args}
|
||||
)
|
||||
if(INSTALL_FLATTEN)
|
||||
set(MaaCore_install_flatten_args RUNTIME DESTINATION . LIBRARY DESTINATION . PUBLIC_HEADER DESTINATION .)
|
||||
endif()
|
||||
|
||||
install(TARGETS MaaCore ${MaaCore_install_flatten_args} ${MaaCore_install_extra_args})
|
||||
|
||||
if(INSTALL_THIRD_LIBS AND USE_MAADEPS)
|
||||
maadeps_install()
|
||||
|
||||
6
LICENSE.spdx
Normal file
@@ -0,0 +1,6 @@
|
||||
SPDXVersion: SPDX-2.3
|
||||
DataLicense: CC0-1.0
|
||||
PackageName: MaaAssistantArknights
|
||||
PackageOriginator: Maa Team and all contributors
|
||||
PackageHomePage: https://github.com/MaaAssistantArknights/MaaAssistantArknights
|
||||
PackageLicenseDeclared: AGPL-3.0-only
|
||||
1
MAA.sln
@@ -10,6 +10,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MaaWpfGui", "src\MaaWpfGui\
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MaaCore", "src\MaaCore\MaaCore.vcxproj", "{362D1E30-F5AE-4279-9985-65C27B3BA300}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MaaThriftController", "src\MaaThriftController\MaaThriftController.vcxproj", "{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{11F02235-5785-408B-9651-8A4B41FF36F4}"
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=autofill/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Bilibili/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Bluestacks/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=bsconsole/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ctrler/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=desp/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=dnplayer/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ehem/@EntryIndexedValue">True</s:Boolean>
|
||||
@@ -49,21 +51,28 @@
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=FLASHW/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=FLASHWINFO/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=foldartal/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Foldartals/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=framerate/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=furni/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gacha/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gavial/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Grandet/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Hotkey/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=hwnd/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Infrast/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Inited/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ldconsole/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Lolicon/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=lpwndpl/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ls_005B_0022sub/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=luestacks/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=maatouch/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=memuc/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Minitouch/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mizuki/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mumu/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nemu/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Netease/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=netstat/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nonfriend/@EntryIndexedValue">True</s:Boolean>
|
||||
@@ -82,7 +91,6 @@
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ppidl/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Prts/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=pwfi/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=qodana/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=rcast/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=rdfend/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=rguard/@EntryIndexedValue">True</s:Boolean>
|
||||
@@ -95,6 +103,7 @@
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=serilog/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Showminimized/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Shownormal/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=specialaccess/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=SSS/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=STGM/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=strlen/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
2
MaaDeps
162
README.md
@@ -1,3 +1,5 @@
|
||||
<!-- markdownlint-disable -->
|
||||
|
||||
<div align="center">
|
||||
|
||||
<img alt="LOGO" src="https://cdn.jsdelivr.net/gh/MaaAssistantArknights/design@main/logo/maa-logo_512x512.png" width="256" height="256" />
|
||||
@@ -21,7 +23,9 @@
|
||||
</div>
|
||||
<br>
|
||||
|
||||
[简体中文](https://maa.plus/docs/) | [繁體中文](https://maa.plus/docs/zh-tw/) | [English](https://maa.plus/docs/en-us/) | [日本語](https://maa.plus/docs/ja-jp/) | [한국어](https://maa.plus/docs/ko-kr/)
|
||||
<!-- markdownlint-restore -->
|
||||
|
||||
[简体中文](https://maa.plus/docs/zh-cn/) | [繁體中文](https://maa.plus/docs/zh-tw/) | [English](https://maa.plus/docs/en-us/) | [日本語](https://maa.plus/docs/ja-jp/) | [한국어](https://maa.plus/docs/ko-kr/)
|
||||
|
||||
MAA 的意思是 MAA Assistant Arknights
|
||||
|
||||
@@ -29,33 +33,52 @@ MAA 的意思是 MAA Assistant Arknights
|
||||
|
||||
基于图像识别技术,一键完成全部日常任务!
|
||||
|
||||
绝赞更新中 ✿✿ヽ(°▽°)ノ✿<br>
|
||||
绝赞更新中 ✿✿ヽ(°▽°)ノ✿
|
||||
|
||||
</div>
|
||||
|
||||
## 亮点功能
|
||||
|
||||
- 刷理智,掉落识别及上传 [企鹅物流](https://penguin-stats.cn/);
|
||||
- 智能基建换班,自动计算干员效率,单设施内最优解;同时也支持 [自定义排班](https://maa.plus/docs/协议文档/基建排班协议.html);
|
||||
- 自动公招,可选使用加急许可,一次全部刷完!公招数据上传 [企鹅物流](https://penguin-stats.cn/result/stage/recruit/recruit),[一图流](https://yituliu.site/maarecruitdata);
|
||||
- 支持手动识别公招界面,方便对高星公招做出选择; ~~(你的这个高姿回费出的是推王呢还是推王呢)~~
|
||||
- 支持识别干员列表,统计已有和未有干员(还能为手动识别公招界面提供已有潜能数据提示);
|
||||
- 支持识别养成材料,并可导出至 [企鹅物流刷图规划](https://penguin-stats.cn/planner) 和 [明日方舟工具箱](https://arkn.lolicon.app/#/material) 计算缺少的养成材料;
|
||||
- 访问好友、收取信用及购物、领取日常奖励等,一键全日常自动长草;
|
||||
- 肉鸽全自动刷源石锭和蜡烛,自动识别干员及练度;
|
||||
- 选择作业 JSON 文件,自动抄作业, [视频演示](https://www.bilibili.com/video/BV1H841177Fk/);
|
||||
- 仓库识别并支持导出至 [企鹅物流刷图规划器](https://penguin-stats.cn/planner), [明日方舟工具箱](https://arkn.lolicon.app/#/material), [ARK-NIGHTS 干员培养表](https://ark-nights.com/settings);
|
||||
- 刷理智,掉落识别及上传 [企鹅物流](https://penguin-stats.cn/),[一图流](https://ark.yituliu.cn/)
|
||||
- 智能基建换班,自动计算干员效率,单设施内最优解;同时也支持 [自定义排班](https://maa.plus/docs/zh-cn/protocol/base-scheduling-schema.html)
|
||||
- 自动公招,可选使用加急许可,一次全部刷完!公招数据自动上传 [企鹅物流](https://penguin-stats.cn/result/stage/recruit/recruit),[一图流](https://ark.yituliu.cn/survey/maarecruitdata)
|
||||
- 支持手动识别公招界面,方便对高星公招做出选择 ~~(你的这个高姿回费出的是推王呢还是推王呢)~~
|
||||
- 支持识别干员列表,统计已有和未有干员及潜能,并在公招识别显示
|
||||
- 支持识别养成材料,并导出至 [企鹅物流刷图规划](https://penguin-stats.cn/planner)、[明日方舟工具箱](https://arkntools.app/#/material)、[ARK-NIGHTS 干员培养表](https://ark-nights.com/settings)
|
||||
- 访问好友、收取信用及购物、领取日常奖励等,一键全日常自动长草
|
||||
- 肉鸽全自动刷源石锭和等级,自动烧水和凹直升,智能识别干员及练度
|
||||
- 选择作业 JSON 文件,自动抄作业, [视频演示](https://www.bilibili.com/video/BV1H841177Fk/)
|
||||
- 支持 C, Python, Java, Rust, Golang, Java HTTP, Rust HTTP 等多种接口,方便集成调用,自定义你的 MAA!
|
||||
|
||||
话不多说,看图!<br>
|
||||
<!-- markdownlint-disable -->
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
<details><summary>话不多说,看图!</summary>
|
||||
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/image/zh-cn/readme/1-dark.png">
|
||||
<img alt="zh1" src="./docs/.vuepress/public/image/zh-cn/readme/1-light.png">
|
||||
</picture>
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/image/zh-cn/readme/2-dark.png">
|
||||
<img alt="zh2" src="./docs/.vuepress/public/image/zh-cn/readme/2-light.png">
|
||||
</picture>
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/image/zh-cn/readme/3-dark.png">
|
||||
<img alt="zh3" src="./docs/.vuepress/public/image/zh-cn/readme/3-light.png">
|
||||
</picture>
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/image/zh-cn/readme/4-dark.png">
|
||||
<img alt="zh4" src="./docs/.vuepress/public/image/zh-cn/readme/4-light.png">
|
||||
</picture>
|
||||
|
||||
</details>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
|
||||
## 下载地址
|
||||
|
||||
前往[官网](https://maa.plus)自动匹配镜像源并下载稳定版,或:
|
||||
|
||||
- [稳定版/公测版](https://github.com/MaaAssistantArknights/MaaAssistantArknights/releases)
|
||||
- [内测版](https://github.com/MaaAssistantArknights/MaaRelease/releases)
|
||||
|
||||
@@ -63,33 +86,28 @@ MAA 的意思是 MAA Assistant Arknights
|
||||
|
||||
### 基本说明
|
||||
|
||||
1. 请根据 [模拟器和设备支持情况](https://maa.plus/docs/用户手册/模拟器和设备支持),进行对应的操作;
|
||||
2. 修改模拟器分辨率为 `16:9` 比例,最低 `1280 * 720`,更高不限;<br>
|
||||
对于国际服(美服)玩家,由于界面布局、字号等问题,我们则建议您将分辨率修改为 `1920 * 1080`;
|
||||
3. 开始使用吧!
|
||||
|
||||
更多使用说明请参考 [详细介绍](https://maa.plus/docs/用户手册/详细介绍.html)
|
||||
请参阅 [新手上路](https://maa.plus/docs/zh-cn/manual/newbie.html) 与 [功能介绍](https://maa.plus/docs/zh-cn/manual/introduction/)。
|
||||
|
||||
### 常见问题
|
||||
|
||||
- 软件一打开就闪退;
|
||||
- 连接错误、不知道 adb 路径怎么填写;
|
||||
- 连接错误、不知道 ADB 路径怎么填写;
|
||||
- 连接成功了,但没反应;
|
||||
- 如何连接自定义端口;
|
||||
- 下载速度慢,且镜像站无法打开网页;
|
||||
- 下载到一半提示“登陆”/“鉴权”;
|
||||
- 连接正常,任务开始了,但是没反应。
|
||||
|
||||
请参考 [常见问题](https://maa.plus/docs/用户手册/常见问题.html)
|
||||
请参阅 [常见问题](https://maa.plus/docs/zh-cn/manual/faq.html)
|
||||
|
||||
### 外服支持
|
||||
|
||||
目前国际服(美服)、日服、韩服、繁中服的绝大部分功能均已支持。但由于外服用户较少及项目人手不足,很多功能并没有进行全面的测试,所以请自行体验。<br>
|
||||
若您遇到了 Bug,或对某个功能有强需求,欢迎在 [Issues](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues) 和 [讨论区](https://github.com/MaaAssistantArknights/MaaAssistantArknights/discussions) 催更;或加入我们一起建设 MAA!请参考 [外服适配教程](#外服适配)
|
||||
目前国际服(美服)、日服、韩服、繁中服的绝大部分功能均已支持。但由于外服用户较少及项目人手不足,很多功能并没有进行全面的测试,所以请自行体验。
|
||||
若您遇到了 Bug,或对某个功能有强需求,欢迎在 [Issues](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues) 和 [讨论区](https://github.com/MaaAssistantArknights/MaaAssistantArknights/discussions) 催更;或加入我们一起建设 MAA!请参阅 [外服适配教程](https://maa.plus/docs/zh-cn/develop/overseas-client-adaptation.html)
|
||||
|
||||
### CLI支持
|
||||
### CLI 支持
|
||||
|
||||
MAA 支持命令行界面(CLI)操作,支持 Linux,macOS 和 Windows,可用于自动化脚本或在无图形界面的服务器上使用。请参考 [CLI 使用指南](https://maa.plus/docs/用户手册/CLI使用指南.html)
|
||||
MAA 支持命令行界面(CLI)操作,支持 Linux,macOS 和 Windows,可用于自动化脚本或在无图形界面的服务器上使用。请参阅 [CLI 使用指南](https://maa.plus/docs/zh-cn/manual/cli/intro.html)
|
||||
|
||||
## 加入我们
|
||||
|
||||
@@ -97,7 +115,7 @@ MAA 支持命令行界面(CLI)操作,支持 Linux,macOS 和 Windows,
|
||||
|
||||
**目前项目组非常缺前端大佬,若您有相关经验,欢迎加入我们!**
|
||||
|
||||
- 全新框架:[MaaFramework](https://github.com/MaaAssistantArknights/MaaFramework)
|
||||
- 全新框架:[MaaFramework](https://github.com/MaaXYZ/MaaFramework)
|
||||
- 全新 GUI:[MaaX](https://github.com/MaaAssistantArknights/MaaX)
|
||||
- [作业站](https://prts.plus) 前端:[maa-copilot-frontend](https://github.com/MaaAssistantArknights/maa-copilot-frontend)
|
||||
- [作业站](https://prts.plus) 后端:[MaaBackendCenter](https://github.com/MaaAssistantArknights/MaaBackendCenter)
|
||||
@@ -110,52 +128,45 @@ MAA 支持多国语言,并使用 Weblate 进行本地化管理。如果您通
|
||||
|
||||
MAA 以中文(简体)为第一语言,翻译词条均以中文(简体)为准。
|
||||
|
||||
[](https://weblate.maa-org.net/engage/maa-assistant-arknights/zh_Hans/)
|
||||
[](https://weblate.maa-org.net/engage/maa/)
|
||||
|
||||
### Windows
|
||||
### 参与开发
|
||||
|
||||
1. 下载预构建的第三方库
|
||||
#### Windows
|
||||
|
||||
```cmd
|
||||
python maadeps-download.py
|
||||
```
|
||||
请参阅 [开始开发](https://maa.plus/docs/zh-cn/develop/development.html)。
|
||||
|
||||
2. 使用 Visual Studio 2022 打开 `MAA.sln`,右键 `MaaWpfGui`,设为启动项目
|
||||
3. VS 上方配置选择 `RelWithDebInfo` `x64` (如果编译 Release 包 或 ARM 平台,请忽略这步)
|
||||
4. 右键 `MaaWpfGui` - 属性 - 调试 - 启用本地调试(这样就能把断点挂到 C++ Core 那边了)
|
||||
5. (可选)若准备提交 PR,建议启用 [clang-format 支持](https://maa.plus/docs/开发文档/开发相关.html#在-visual-studio-中启用-clang-format)
|
||||
#### Linux | macOS
|
||||
|
||||
### Linux | macOS
|
||||
请参阅 [Linux 编译教程](https://maa.plus/docs/zh-cn/develop/linux-tutorial.html)。
|
||||
|
||||
请参考 [Linux 编译教程](https://maa.plus/docs/开发文档/Linux编译教程.html)
|
||||
|
||||
### API
|
||||
#### API
|
||||
|
||||
- [C 接口](include/AsstCaller.h):[集成示例](src/Cpp/main.cpp)
|
||||
- [Python 接口](src/Python/asst/asst.py):[集成示例](src/Python/sample.py)
|
||||
- [Golang 接口](src/Golang/):[集成示例](src/Golang/maa/maa.go)
|
||||
- [Dart 接口](src/Dart/)
|
||||
- [Golang 接口](src/Golang):[集成示例](src/Golang/maa/maa.go)
|
||||
- [Dart 接口](src/Dart)
|
||||
- [Java 接口](src/Java/src/main/java/com/iguigui/maaj/easySample/MaaCore.java):[集成示例](src/Java/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java)
|
||||
- [Java HTTP 接口](src/Java/Readme.md)
|
||||
- [Rust 接口](src/Rust/src/maa_sys/):[HTTP 接口](src/Rust)
|
||||
- [TypeScript 接口](https://github.com/MaaAssistantArknights/MaaAsstElectronUI/tree/main/packages/main/coreLoader)
|
||||
- [Woolang 接口](src/Woolang/maa.wo):[集成示例](src/Woolang/main.wo)
|
||||
- [集成文档](https://maa.plus/docs/协议文档/集成文档.html)
|
||||
- [回调消息协议](https://maa.plus/docs/协议文档/回调消息协议.html)
|
||||
- [任务流程协议](https://maa.plus/docs/协议文档/任务流程协议.html)
|
||||
- [自动抄作业协议](https://maa.plus/docs/协议文档/战斗流程协议.html)
|
||||
- [Rust 接口](src/Rust/src/maa_sys):[HTTP 接口](src/Rust)
|
||||
- [TypeScript 接口](https://github.com/MaaAssistantArknights/MaaX/tree/main/packages/main/coreLoader)
|
||||
- [Woolang 接口](src/Woolang/maa.wo):[集成示例](src/Woolang/demo.wo)
|
||||
- [集成文档](https://maa.plus/docs/zh-cn/protocol/integration.html)
|
||||
- [回调消息协议](https://maa.plus/docs/zh-cn/protocol/callback-schema.html)
|
||||
- [任务流程协议](https://maa.plus/docs/zh-cn/protocol/task-schema.html)
|
||||
- [自动抄作业协议](https://maa.plus/docs/zh-cn/protocol/copilot-schema.html)
|
||||
|
||||
### 外服适配
|
||||
#### 外服适配
|
||||
|
||||
请参考 [外服适配教程](https://maa.plus/docs/开发文档/外服适配教程.html),对于国服已支持的功能,绝大部分的外服适配工作仅需要截图 + 简单的 JSON 修改即可。
|
||||
请参阅 [外服适配教程](https://maa.plus/docs/zh-cn/develop/overseas-client-adaptation.html),对于国服已支持的功能,绝大部分的外服适配工作仅需要截图 + 简单的 JSON 修改即可。
|
||||
|
||||
### 想参与开发,但不太会用 GitHub?
|
||||
#### 想参与开发,但不太会用 GitHub?
|
||||
|
||||
[GitHub Pull Request 流程简述](https://maa.plus/docs/开发文档/开始开发.html#github-pull-request-流程简述)
|
||||
[GitHub Pull Request 流程简述](https://maa.plus/docs/zh-cn/develop/development.html#github-pull-request-流程简述)
|
||||
|
||||
### Issue bot
|
||||
#### Issue bot
|
||||
|
||||
请参考 [Issue bot 使用方法](https://maa.plus/docs/开发文档/IssueBot使用方法.html)
|
||||
请参阅 [Issue Bot 使用方法](https://maa.plus/docs/zh-cn/develop/issue-bot-usage.html)
|
||||
|
||||
## 致谢
|
||||
|
||||
@@ -168,23 +179,23 @@ MAA 以中文(简体)为第一语言,翻译词条均以中文(简体)
|
||||
- 机器学习加速器:[onnxruntime](https://github.com/microsoft/onnxruntime)
|
||||
- ~~关卡掉落识别:[企鹅物流识别](https://github.com/penguin-statistics/recognizer)~~
|
||||
- 地图格子识别:[Arknights-Tile-Pos](https://github.com/yuanyan3060/Arknights-Tile-Pos)
|
||||
- C++ JSON库:[meojson](https://github.com/MistEO/meojson.git)
|
||||
- C++ JSON 库:[meojson](https://github.com/MistEO/meojson.git)
|
||||
- C++ 运算符解析器:[calculator](https://github.com/kimwalisch/calculator)
|
||||
- ~~C++ base64编解码:[cpp-base64](https://github.com/ReneNyffenegger/cpp-base64)~~
|
||||
- ~~C++ base64 编解码:[cpp-base64](https://github.com/ReneNyffenegger/cpp-base64)~~
|
||||
- C++ 解压压缩库:[zlib](https://github.com/madler/zlib)
|
||||
- C++ Gzip封装:[gzip-hpp](https://github.com/mapbox/gzip-hpp)
|
||||
- 安卓触控事件器:[minitouch](https://github.com/openstf/minitouch)
|
||||
- C++ Gzip 封装:[gzip-hpp](https://github.com/mapbox/gzip-hpp)
|
||||
- 安卓触控事件器:[Minitouch](https://github.com/DeviceFarmer/minitouch)
|
||||
- 安卓触控事件器:[MaaTouch](https://github.com/MaaAssistantArknights/MaaTouch)
|
||||
- WPF MVVM框架:[Stylet](https://github.com/canton7/Stylet)
|
||||
- WPF控件库:[HandyControl](https://github.com/HandyOrg/HandyControl) -> [HandyControls](https://github.com/ghost1372/HandyControls)
|
||||
- WPF MVVM 框架:[Stylet](https://github.com/canton7/Stylet)
|
||||
- WPF 控件库:[HandyControl](https://github.com/HandyOrg/HandyControl) -> [HandyControls](https://github.com/ghost1372/HandyControls)
|
||||
- C# 日志:[Serilog](https://github.com/serilog/serilog)
|
||||
- C# JSON库:[Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) & [System.Text.Json](https://github.com/dotnet/runtime)
|
||||
- C# JSON 库:[Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) & [System.Text.Json](https://github.com/dotnet/runtime)
|
||||
- ~~下载器:[aria2](https://github.com/aria2/aria2)~~
|
||||
|
||||
### 数据源
|
||||
|
||||
- ~~公开招募数据:[明日方舟工具箱](https://www.bigfun.cn/tools/aktools/hr)~~
|
||||
- ~~干员及基建数据:[PRTS明日方舟中文WIKI](http://prts.wiki/)~~
|
||||
- ~~干员及基建数据:[PRTS Wiki](http://prts.wiki/)~~
|
||||
- 关卡数据:[企鹅物流数据统计](https://penguin-stats.cn/)
|
||||
- 游戏数据及资源:[明日方舟客户端素材](https://github.com/yuanyan3060/ArknightsGameResource)
|
||||
- ~~游戏数据:[《明日方舟》游戏数据](https://github.com/Kengxxiao/ArknightsGameData)~~
|
||||
@@ -197,17 +208,18 @@ MAA 以中文(简体)为第一语言,翻译词条均以中文(简体)
|
||||
|
||||
## 声明
|
||||
|
||||
- 本软件 logo 并非使用 AGPL 3.0 协议开源,[耗毛](https://weibo.com/u/3251357314)、vie 两位画师及软件全体开发者保留所有权利。不得以 AGPL 3.0 协议已授权为由在未经授权的情况下使用本软件 logo,不得在未经授权的情况下将本软件 logo 用于任何商业用途。
|
||||
- 本软件开源、免费,仅供学习交流使用。若您遇到商家使用本软件进行代练并收费,可能是设备与时间等费用,产生的问题及后果与本软件无关。
|
||||
- 本软件使用 [GNU Affero General Public License v3.0 only](https://spdx.org/licenses/AGPL-3.0-only.html) 开源。
|
||||
- 本软件 logo 并非使用 AGPL 3.0 协议开源,[耗毛](https://weibo.com/u/3251357314)、vie 两位画师及软件全体开发者保留所有权利。不得以 AGPL 3.0 协议已授权为由在未经授权的情况下使用本软件 logo,不得在未经授权的情况下将本软件 logo 用于任何用途。
|
||||
- 本软件开源、免费,仅供学习交流使用。若您遇到商家使用本软件进行代练并收费,可能由于设备或时间等原因,产生的任何问题及后果与本软件无关。
|
||||
|
||||
## 广告
|
||||
|
||||
用户交流 QQ 群:[MAA 使用 & 粥游交流 QQ 群](https://ota.maa.plus/MaaAssistantArknights/api/qqgroup/index.html)<br>
|
||||
用户交流 TG 群:[Telegram 群](https://t.me/+Mgc2Zngr-hs3ZjU1)<br>
|
||||
自动战斗 JSON 作业分享:[prts.plus](https://prts.plus) 或 [抄作业.com](http://抄作业.com)<br>
|
||||
Bilibili 直播间:[直播间](https://live.bilibili.com/2808861) 每晚直播敲代码,近期很长一段时间应该都是在写本软件~<br>
|
||||
用户交流 QQ 群:[MAA 使用 & 粥游交流 QQ 群](https://ota.maa.plus/MaaAssistantArknights/api/qqgroup/index.html)
|
||||
用户交流 TG 群:[Telegram 群](https://t.me/+Mgc2Zngr-hs3ZjU1)
|
||||
自动战斗 JSON 作业分享:[prts.plus](https://prts.plus) 或 [抄作业.com](http://抄作业.com)
|
||||
Bilibili 直播间:[直播间](https://live.bilibili.com/2808861) 每晚直播敲代码,近期很长一段时间应该都是在写本软件~
|
||||
|
||||
技术群(舟无关、禁水):[内卷地狱!(QQ 群)](https://jq.qq.com/?_wv=1027&k=ypbzXcA2)<br>
|
||||
开发者群:[QQ 群](https://jq.qq.com/?_wv=1027&k=JM9oCk3C)<br>
|
||||
技术群(舟无关、禁水):[内卷地狱!(QQ 群)](https://jq.qq.com/?_wv=1027&k=ypbzXcA2)
|
||||
开发者群:[QQ 群](https://jq.qq.com/?_wv=1027&k=JM9oCk3C)
|
||||
|
||||
如果觉得软件对你有帮助,帮忙点个 Star 吧!~(网页最上方右上角的小星星),这就是对我们最大的支持了!
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
# TODO: replace with cmake-generated interface file
|
||||
|
||||
find_path(FastDeploy_INCLUDE_DIR NAMES fastdeploy/fastdeploy_model.h)
|
||||
|
||||
find_library(FastDeploy_LIBRARY NAMES fastdeploy)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
FastDeploy
|
||||
REQUIRED_VARS FastDeploy_LIBRARY FastDeploy_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if(FastDeploy_FOUND)
|
||||
set(FastDeploy_INCLUDE_DIRS ${FastDeploy_INCLUDE_DIR})
|
||||
if(NOT TARGET FastDeploy::FastDeploy)
|
||||
add_library(FastDeploy::FastDeploy UNKNOWN IMPORTED)
|
||||
set_target_properties(FastDeploy::FastDeploy PROPERTIES
|
||||
IMPORTED_LOCATION "${FastDeploy_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FastDeploy_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,20 +0,0 @@
|
||||
find_path(ONNXRuntime_INCLUDE_DIR NAMES onnxruntime/core/session/onnxruntime_c_api.h)
|
||||
|
||||
find_library(ONNXRuntime_LIBRARY NAMES onnxruntime)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
ONNXRuntime
|
||||
REQUIRED_VARS ONNXRuntime_LIBRARY ONNXRuntime_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if(ONNXRuntime_FOUND)
|
||||
set(ONNXRuntime_INCLUDE_DIRS ${ONNXRuntime_INCLUDE_DIR})
|
||||
if(NOT TARGET ONNXRuntime::ONNXRuntime)
|
||||
add_library(ONNXRuntime::ONNXRuntime UNKNOWN IMPORTED)
|
||||
set_target_properties(ONNXRuntime::ONNXRuntime PROPERTIES
|
||||
IMPORTED_LOCATION "${ONNXRuntime_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${ONNXRuntime_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,50 +0,0 @@
|
||||
|
||||
|
||||
set(FASTDEPLOY_URL_PREFIX "https://github.com/MaaAssistantArknights/build-fastdeploy/releases/download")
|
||||
|
||||
set(FASTDEPLOY_TAG "gac255b8a")
|
||||
|
||||
set(COMPRESSED_SUFFIX ".tar.gz")
|
||||
|
||||
if(WIN32)
|
||||
set(FASTDEPLOY_FILENAME "FastDeploy-Windows")
|
||||
set(FASTDEPLOY_CHECKSUM "0a0700d4e8923bcd4c387a658e5e9a689ed9e0d114c260b11d082a2176c233d4")
|
||||
elseif(APPLE)
|
||||
if (CURRENT_OSX_ARCH STREQUAL "arm64")
|
||||
set(FASTDEPLOY_FILENAME "FastDeploy-macOS-arm64")
|
||||
set(FASTDEPLOY_CHECKSUM "28a771814d197ba8056f1fcb7cc0671facec90a8733a0dac2cf0b68a8cc36d24")
|
||||
else()
|
||||
set(FASTDEPLOY_FILENAME "FastDeploy-macOS-x86_64")
|
||||
set(FASTDEPLOY_CHECKSUM "76e97c7e944a18eb160646fa32ac0a7e24c87751b2b127dc33454f993f6d4b97")
|
||||
endif()
|
||||
else()
|
||||
set(FASTDEPLOY_FILENAME "FastDeploy-Linux")
|
||||
set(FASTDEPLOY_CHECKSUM "4d106e5499e9b5b29426667617215ac7e4e70d2353af10caccdfdf6c1f1534a7")
|
||||
endif(WIN32)
|
||||
|
||||
set(FASTDEPLOY_URL ${FASTDEPLOY_URL_PREFIX}/${FASTDEPLOY_TAG}/${FASTDEPLOY_FILENAME}${COMPRESSED_SUFFIX})
|
||||
|
||||
if (FASTDEPLOY_DIRECTORY)
|
||||
set(FastDeploy_DIR ${FASTDEPLOY_DIRECTORY})
|
||||
find_package(FastDeploy REQUIRED PATHS ${FastDeploy_DIR})
|
||||
include_directories(${FastDeploy_INCLUDE_DIRS})
|
||||
list(APPEND DEPEND_LIBS ${FastDeploy_LIBS})
|
||||
else ()
|
||||
download_and_decompress(${FASTDEPLOY_URL}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${FASTDEPLOY_FILENAME}${COMPRESSED_SUFFIX}
|
||||
${FASTDEPLOY_CHECKSUM}
|
||||
${THIRD_PARTY_PATH}/install/)
|
||||
set(FASTDEPLOY_FILENAME fastdeploy)
|
||||
set(FastDeploy_DIR ${THIRD_PARTY_PATH}/install/${FASTDEPLOY_FILENAME})
|
||||
|
||||
find_package(FastDeploy REQUIRED PATHS ${FastDeploy_DIR} NO_DEFAULT_PATH)
|
||||
include_directories(${FastDeploy_INCLUDE_DIRS})
|
||||
list(APPEND DEPEND_LIBS ${FastDeploy_LIBS})
|
||||
endif (FASTDEPLOY_DIRECTORY)
|
||||
|
||||
if (INSTALL_THIRD_LIBS)
|
||||
install(DIRECTORY ${FastDeploy_DIR}/lib/ DESTINATION . USE_SOURCE_PERMISSIONS)
|
||||
install(DIRECTORY ${ORT_LIB_PATH}/ DESTINATION . USE_SOURCE_PERMISSIONS)
|
||||
install(DIRECTORY ${FastDeploy_DIR}/third_libs/install/paddle2onnx/lib/
|
||||
DESTINATION . USE_SOURCE_PERMISSIONS)
|
||||
endif (INSTALL_THIRD_LIBS)
|
||||
@@ -15,13 +15,13 @@ if (BUILD_XCFRAMEWORK)
|
||||
COMMAND xcodebuild -create-xcframework -library "${PROJECT_SOURCE_DIR}/MaaDeps/runtime/${MAADEPS_TRIPLET}/libonnxruntime.1.14.1.dylib" -output ONNXRuntime.xcframework
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT MaaDerpLearning.xcframework
|
||||
COMMAND rm -rf MaaDerpLearning.xcframework
|
||||
COMMAND xcodebuild -create-xcframework -library "${PROJECT_SOURCE_DIR}/MaaDeps/runtime/${MAADEPS_TRIPLET}/libMaaDerpLearning.dylib" -output MaaDerpLearning.xcframework
|
||||
add_custom_command(OUTPUT fastdeploy_ppocr.xcframework
|
||||
COMMAND rm -rf fastdeploy_ppocr.xcframework
|
||||
COMMAND xcodebuild -create-xcframework -library "${PROJECT_SOURCE_DIR}/MaaDeps/runtime/${MAADEPS_TRIPLET}/libfastdeploy_ppocr.dylib" -output fastdeploy_ppocr.xcframework
|
||||
)
|
||||
|
||||
add_custom_target(MaaXCFramework ALL
|
||||
DEPENDS MaaCore MaaCore.xcframework OpenCV.xcframework ONNXRuntime.xcframework MaaDerpLearning.xcframework
|
||||
DEPENDS MaaCore MaaCore.xcframework OpenCV.xcframework ONNXRuntime.xcframework fastdeploy_ppocr.xcframework
|
||||
)
|
||||
endif (BUILD_XCFRAMEWORK)
|
||||
|
||||
|
||||
8
docs/.vuepress/client.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { defineClientConfig } from "vuepress/client";
|
||||
import ImageGrid from "../components/ImageGrid.vue";
|
||||
|
||||
export default defineClientConfig({
|
||||
enhance: ({ app }) => {
|
||||
app.component("ImageGrid", ImageGrid);
|
||||
},
|
||||
});
|
||||
@@ -1,35 +1,36 @@
|
||||
import { defineUserConfig } from 'vuepress';
|
||||
import Theme from './theme';
|
||||
import SearchPlugin from './plugins/search';
|
||||
import { defineUserConfig } from "vuepress";
|
||||
import { viteBundler } from "@vuepress/bundler-vite";
|
||||
import { googleAnalyticsPlugin } from "@vuepress/plugin-google-analytics";
|
||||
import Theme from "./theme";
|
||||
|
||||
export default defineUserConfig({
|
||||
base: '/docs/',
|
||||
base: "/docs/",
|
||||
lang: "zh-CN",
|
||||
title: "MaaAssistantArknights",
|
||||
description: "MAA",
|
||||
port: 3001,
|
||||
|
||||
locales: {
|
||||
'/': {
|
||||
lang: 'zh-CN',
|
||||
description: '开发者文档',
|
||||
"/zh-cn/": {
|
||||
lang: "zh-CN",
|
||||
description: "文档",
|
||||
},
|
||||
'/zh-tw/': {
|
||||
lang: 'zh-TW',
|
||||
description: '開發者文件',
|
||||
"/zh-tw/": {
|
||||
lang: "zh-TW",
|
||||
description: "文件",
|
||||
},
|
||||
'/en-us/': {
|
||||
lang: 'en-US',
|
||||
title: 'Documents'
|
||||
"/en-us/": {
|
||||
lang: "en-US",
|
||||
description: "Documentation",
|
||||
},
|
||||
'/ja-jp/': {
|
||||
lang: 'ja-JP',
|
||||
description: 'ドキュメント'
|
||||
"/ja-jp/": {
|
||||
lang: "ja-JP",
|
||||
description: "ドキュメンテーション",
|
||||
},
|
||||
"/ko-kr/": {
|
||||
lang: "ko-KR",
|
||||
description: "선적 서류 비치",
|
||||
},
|
||||
'/ko-kr/': {
|
||||
lang: 'ko-KR',
|
||||
description: '문서'
|
||||
}
|
||||
},
|
||||
|
||||
markdown: {
|
||||
@@ -41,6 +42,42 @@ export default defineUserConfig({
|
||||
theme: Theme,
|
||||
|
||||
plugins: [
|
||||
SearchPlugin(),
|
||||
googleAnalyticsPlugin({
|
||||
id: "G-FJQDKG394Z",
|
||||
}),
|
||||
],
|
||||
|
||||
head: [
|
||||
["link", { rel: "preconnect", href: "https://fonts.googleapis.com" }],
|
||||
[
|
||||
"link",
|
||||
{ rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: "" },
|
||||
],
|
||||
[
|
||||
"link",
|
||||
{
|
||||
href: "https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@100..900&display=swap",
|
||||
rel: "stylesheet",
|
||||
},
|
||||
],
|
||||
[
|
||||
"link",
|
||||
{
|
||||
href: "https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@200..900&display=swap",
|
||||
rel: "stylesheet",
|
||||
},
|
||||
],
|
||||
[
|
||||
"link",
|
||||
{
|
||||
href: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap",
|
||||
rel: "stylesheet",
|
||||
},
|
||||
],
|
||||
],
|
||||
|
||||
bundler: viteBundler({
|
||||
viteOptions: {},
|
||||
vuePluginOptions: {},
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -9,17 +9,17 @@ export const enusNavbar = navbar([
|
||||
{
|
||||
text: "User Manual",
|
||||
icon: "mdi:user",
|
||||
link: "/en-us/1.1-USER_MANUAL",
|
||||
link: "/en-us/manual/",
|
||||
},
|
||||
{
|
||||
text: "Development Docs",
|
||||
icon: "ph:code-bold",
|
||||
link: "/en-us/2.1-LINUX_TUTORIAL",
|
||||
link: "/en-us/develop/",
|
||||
},
|
||||
{
|
||||
text: "Protocol Docs",
|
||||
icon: "basil:document-solid",
|
||||
link: "/en-us/3.1-INTEGRATION",
|
||||
link: "/en-us/protocol/",
|
||||
},
|
||||
{
|
||||
text: "MAA Website",
|
||||
|
||||
@@ -2,24 +2,24 @@ import { navbar } from "vuepress-theme-hope";
|
||||
|
||||
export const jajpNavbar = navbar([
|
||||
{
|
||||
text: "主页",
|
||||
text: "ホームページ",
|
||||
icon: "ic:round-home",
|
||||
link: "/ja-jp/",
|
||||
},
|
||||
{
|
||||
text: "使用説明",
|
||||
icon: "mdi:user",
|
||||
link: "/ja-jp/1.1-詳細説明",
|
||||
link: "/ja-jp/manual/",
|
||||
},
|
||||
{
|
||||
text: "開発関連",
|
||||
icon: "ph:code-bold",
|
||||
link: "/ja-jp/2.1-Linuxチュートリアル",
|
||||
link: "/ja-jp/develop/",
|
||||
},
|
||||
{
|
||||
text: "プロトコルドキュメント",
|
||||
icon: "basil:document-solid",
|
||||
link: "/ja-jp/3.1-統合ドキュメント",
|
||||
link: "/ja-jp/protocol/",
|
||||
},
|
||||
{
|
||||
text: "MAA 公式サイト",
|
||||
|
||||
@@ -2,24 +2,24 @@ import { navbar } from "vuepress-theme-hope";
|
||||
|
||||
export const kokrNavbar = navbar([
|
||||
{
|
||||
text: "主页",
|
||||
text: "홈페이지",
|
||||
icon: "ic:round-home",
|
||||
link: "/ko-kr/",
|
||||
},
|
||||
{
|
||||
text: "사용자 설명서",
|
||||
icon: "mdi:user",
|
||||
link: "/ko-kr/1.1-사용자_설명서",
|
||||
link: "/ko-kr/manual/",
|
||||
},
|
||||
{
|
||||
text: "개발 관련",
|
||||
text: "개발 문서",
|
||||
icon: "ph:code-bold",
|
||||
link: "/ko-kr/2.1-LINUX_튜토리얼",
|
||||
link: "/ko-kr/develop/",
|
||||
},
|
||||
{
|
||||
text: "프로토콜 문서",
|
||||
icon: "basil:document-solid",
|
||||
link: "/ko-kr/3.1-연동",
|
||||
link: "/ko-kr/protocol/",
|
||||
},
|
||||
{
|
||||
text: "MAA 공식 홈페이지",
|
||||
|
||||
@@ -4,22 +4,22 @@ export const zhcnNavbar = navbar([
|
||||
{
|
||||
text: "主页",
|
||||
icon: "ic:round-home",
|
||||
link: "/",
|
||||
link: "/zh-cn/",
|
||||
},
|
||||
{
|
||||
text: "用户手册",
|
||||
icon: "mdi:user",
|
||||
link: "/用户手册",
|
||||
link: "/zh-cn/manual/",
|
||||
},
|
||||
{
|
||||
text: "开发文档",
|
||||
icon: "ph:code-bold",
|
||||
link: "/开发文档",
|
||||
link: "/zh-cn/develop/",
|
||||
},
|
||||
{
|
||||
text: "协议文档",
|
||||
icon: "basil:document-solid",
|
||||
link: "/协议文档",
|
||||
link: "/zh-cn/protocol/",
|
||||
},
|
||||
{
|
||||
text: "MAA 官网",
|
||||
|
||||
@@ -9,17 +9,17 @@ export const zhtwNavbar = navbar([
|
||||
{
|
||||
text: "用戶說明書",
|
||||
icon: "mdi:user",
|
||||
link: "/zh-tw/1.1-詳細介紹",
|
||||
link: "/zh-tw/manual/",
|
||||
},
|
||||
{
|
||||
text: "開發文件",
|
||||
icon: "ph:code-bold",
|
||||
link: "/zh-tw/2.1-Linux編譯教學",
|
||||
link: "/zh-tw/develop/",
|
||||
},
|
||||
{
|
||||
text: "協議文件",
|
||||
icon: "basil:document-solid",
|
||||
link: "/zh-tw/3.1-集成文件",
|
||||
link: "/zh-tw/protocol/",
|
||||
},
|
||||
{
|
||||
text: "MAA 官網",
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import { docsearchPlugin } from "@vuepress/plugin-docsearch";
|
||||
|
||||
export default function SearchPlugin() {
|
||||
return docsearchPlugin({
|
||||
export default {
|
||||
appId: '99JM20SIFG',
|
||||
apiKey: '32ad931040facd36d2e99c3cb8e425e1',
|
||||
indexName: 'maa',
|
||||
@@ -44,43 +41,6 @@ export default function SearchPlugin() {
|
||||
}
|
||||
}
|
||||
},
|
||||
'/zh-tw/': {
|
||||
placeholder: '搜尋',
|
||||
translations: {
|
||||
button: {
|
||||
buttonText: '搜尋',
|
||||
},
|
||||
modal: {
|
||||
searchBox: {
|
||||
resetButtonTitle: '清除查詢條件',
|
||||
cancelButtonText: '取消',
|
||||
},
|
||||
startScreen: {
|
||||
recentSearchesTitle: '搜尋歷史',
|
||||
noRecentSearchesText: '沒有搜尋歷史',
|
||||
saveRecentSearchButtonTitle: '保存至搜尋歷史',
|
||||
removeRecentSearchButtonTitle: '從搜尋歷史中移除',
|
||||
favoriteSearchesTitle: '收藏',
|
||||
removeFavoriteSearchButtonTitle: '從收藏中移除',
|
||||
},
|
||||
errorScreen: {
|
||||
titleText: '無法獲取結果',
|
||||
helpText: '你可能需要檢查你的網路連接',
|
||||
},
|
||||
footer: {
|
||||
selectText: '選擇',
|
||||
navigateText: '切換',
|
||||
closeText: '關閉',
|
||||
searchByText: '搜尋提供者',
|
||||
},
|
||||
noResultsScreen: {
|
||||
noResultsText: '無法找到相關結果',
|
||||
suggestedQueryText: '你可以嘗試查詢',
|
||||
reportMissingResultsText: '你認為該查詢應該有結果?',
|
||||
reportMissingResultsLinkText: '點擊反饋',
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
'/en-us/': {
|
||||
placeholder: 'Search',
|
||||
@@ -120,9 +80,4 @@ export default function SearchPlugin() {
|
||||
}
|
||||
}
|
||||
},
|
||||
'/ja-jp/': {
|
||||
placeholder: '検索する',
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
BIN
docs/.vuepress/public/image/en-us/readme/1-dark.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
docs/.vuepress/public/image/en-us/readme/1-light.png
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
docs/.vuepress/public/image/en-us/readme/2-dark.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
docs/.vuepress/public/image/en-us/readme/2-light.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
docs/.vuepress/public/image/en-us/readme/3-dark.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
docs/.vuepress/public/image/en-us/readme/3-light.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
docs/.vuepress/public/image/en-us/readme/4-dark.png
Normal file
|
After Width: | Height: | Size: 89 KiB |
BIN
docs/.vuepress/public/image/en-us/readme/4-light.png
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
docs/.vuepress/public/image/ja-jp/readme/1-light.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
docs/.vuepress/public/image/ja-jp/readme/2-light.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
docs/.vuepress/public/image/ko-kr/readme/1-light.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
docs/.vuepress/public/image/ko-kr/readme/2-light.png
Normal file
|
After Width: | Height: | Size: 71 KiB |
BIN
docs/.vuepress/public/image/zh-cn/readme/1-dark.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
docs/.vuepress/public/image/zh-cn/readme/1-light.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
docs/.vuepress/public/image/zh-cn/readme/2-dark.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
docs/.vuepress/public/image/zh-cn/readme/2-light.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
docs/.vuepress/public/image/zh-cn/readme/3-dark.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
docs/.vuepress/public/image/zh-cn/readme/3-light.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
docs/.vuepress/public/image/zh-cn/readme/4-dark.png
Normal file
|
After Width: | Height: | Size: 71 KiB |
BIN
docs/.vuepress/public/image/zh-cn/readme/4-light.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
0
docs/.vuepress/public/image/zh-tw/readme/TODO
Normal file
@@ -10,115 +10,23 @@ export const enusSidebar = sidebar({
|
||||
{
|
||||
text: "User Manual",
|
||||
icon: "mdi:user",
|
||||
prefix: "manual/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "Introduction",
|
||||
icon: "mdi:information-outline",
|
||||
link: "/en-us/1.1-USER_MANUAL",
|
||||
},
|
||||
{
|
||||
text: "FAQs",
|
||||
icon: "ph:question-fill",
|
||||
link: "/en-us/1.2-FAQ",
|
||||
},
|
||||
{
|
||||
text: "Emulator Supports",
|
||||
icon: "mingcute:laptop-fill",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "Windows",
|
||||
icon: "ri:windows-fill",
|
||||
link: "/en-us/1.3-EMULATOR_SUPPORTS",
|
||||
},
|
||||
{
|
||||
text: "Mac",
|
||||
icon: "basil:apple-solid",
|
||||
link: "/en-us/1.4-EMULATOR_SUPPORTS_FOR_MAC",
|
||||
},
|
||||
{
|
||||
text: "Linux",
|
||||
icon: "teenyicons:linux-alt-solid",
|
||||
link: "/en-us/1.5-EMULATOR_SUPPORTS_FOR_LINUX",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "Development Docs",
|
||||
icon: "ph:code-bold",
|
||||
prefix: "develop/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "Linux Compilation Tutorial",
|
||||
icon: "teenyicons:linux-alt-solid",
|
||||
link: "/en-us/2.1-LINUX_TUTORIAL",
|
||||
},
|
||||
{
|
||||
text: "Development",
|
||||
icon: "iconoir:developer",
|
||||
link: "/en-us/2.2-DEVELOPMENT",
|
||||
},
|
||||
{
|
||||
text: "IssueBot Usage",
|
||||
icon: "bxs:bot",
|
||||
link: "/en-us/2.3-ISSUE_BOT_USAGE",
|
||||
},
|
||||
{
|
||||
text: "Web PR Tutorial",
|
||||
icon: "mingcute:git-pull-request-fill",
|
||||
link: "/en-us/2.4-PURE_WEB_PR_TUTORIAL",
|
||||
},
|
||||
{
|
||||
text: "Overseas Clients Adaptation",
|
||||
icon: "ri:earth-fill",
|
||||
link: "/en-us/2.5-OVERSEAS_CLIENTS_ADAPTATION",
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "Protocol Docs",
|
||||
icon: "basil:document-solid",
|
||||
prefix: "protocol/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "Integration",
|
||||
icon: "bxs:book",
|
||||
link: "/en-us/3.1-INTEGRATION",
|
||||
},
|
||||
{
|
||||
text: "Callback Schema",
|
||||
icon: "material-symbols:u-turn-left",
|
||||
link: "/en-us/3.2-CALLBACK_SCHEMA",
|
||||
},
|
||||
{
|
||||
text: "Copilot Schema",
|
||||
icon: "ph:sword-bold",
|
||||
link: "/en-us/3.3-COPILOT_SCHEMA",
|
||||
},
|
||||
{
|
||||
text: "Task Schema",
|
||||
icon: "material-symbols:task",
|
||||
link: "/en-us/3.4-TASK_SCHEMA",
|
||||
},
|
||||
{
|
||||
text: "Integrated Strategy Schema",
|
||||
icon: "ri:game-fill",
|
||||
link: "/en-us/3.5-INTEGRATED_STRATEGY_SCHEMA",
|
||||
},
|
||||
{
|
||||
text: "Infrastructure Scheduling Schema",
|
||||
icon: "material-symbols:view-quilt-rounded",
|
||||
link: "/en-us/3.6-INFRASTRUCTURE_SCHEDULING_SCHEMA",
|
||||
},
|
||||
{
|
||||
text: "Security Presence Schema",
|
||||
icon: "game-icons:prisoner",
|
||||
link: "/en-us/3.7-SECURITY_PRESENCE_SCHEMA",
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@@ -10,98 +10,23 @@ export const jajpSidebar = sidebar({
|
||||
{
|
||||
text: "使用説明",
|
||||
icon: "mdi:user",
|
||||
prefix: "manual/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "詳細説明",
|
||||
icon: "mdi:information-outline",
|
||||
link: "/ja-jp/1.1-詳細説明",
|
||||
},
|
||||
{
|
||||
text: "よくある質問",
|
||||
icon: "ph:question-fill",
|
||||
link: "/ja-jp/1.2-よくある質問",
|
||||
},
|
||||
{
|
||||
text: "エミュレータのサポート",
|
||||
icon: "mingcute:laptop-fill",
|
||||
link: "/ja-jp/1.3-エミュレータのサポート",
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "開発関連",
|
||||
icon: "ph:code-bold",
|
||||
prefix: "develop/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "Linuxコンパイルチュートリアル",
|
||||
icon: "teenyicons:linux-alt-solid",
|
||||
link: "/ja-jp/2.1-Linuxチュートリアル",
|
||||
},
|
||||
{
|
||||
text: "開発関連",
|
||||
icon: "iconoir:developer",
|
||||
link: "/ja-jp/2.2-プルリクエスト",
|
||||
},
|
||||
{
|
||||
text: "IssueBotの使用方法",
|
||||
icon: "bxs:bot",
|
||||
link: "/ja-jp/2.3-IssueBotの使用方法",
|
||||
},
|
||||
{
|
||||
text: "純WebサイトのPRチュートリアル",
|
||||
icon: "mingcute:git-pull-request-fill",
|
||||
link: "/ja-jp/2.4-純WebサイトのPRチュートリアル",
|
||||
},
|
||||
{
|
||||
text: "グローバル版を含む海外クライアントの対応について",
|
||||
icon: "ri:earth-fill",
|
||||
link: "/ja-jp/2.5-OVERSEAS_CLIENTS_ADAPTATION",
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "プロトコルドキュメント",
|
||||
icon: "basil:document-solid",
|
||||
prefix: "protocol/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "インテグレーション",
|
||||
icon: "bxs:book",
|
||||
link: "/ja-jp/3.1-統合ドキュメント",
|
||||
},
|
||||
{
|
||||
text: "コールバック図解",
|
||||
icon: "material-symbols:u-turn-left",
|
||||
link: "/ja-jp/3.2-コールバックAPI",
|
||||
},
|
||||
{
|
||||
text: "自動作戦図解",
|
||||
icon: "ph:sword-bold",
|
||||
link: "/ja-jp/3.3-自動作戦API",
|
||||
},
|
||||
{
|
||||
text: "タスク図解",
|
||||
icon: "material-symbols:task",
|
||||
link: "/ja-jp/3.4-タスクAPI",
|
||||
},
|
||||
{
|
||||
text: "統合戦略図解",
|
||||
icon: "ri:game-fill",
|
||||
link: "/ja-jp/3.5-統合戦略API",
|
||||
},
|
||||
{
|
||||
text: "インフラスケジュール図解",
|
||||
icon: "material-symbols:view-quilt-rounded",
|
||||
link: "/ja-jp/3.6-インフラスケジュール設定",
|
||||
},
|
||||
{
|
||||
text: "セキュリティプレゼンス図解",
|
||||
icon: "game-icons:prisoner",
|
||||
link: "/ja-jp/3.7-SECURITY_PRESENCE_SCHEMA",
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@@ -10,115 +10,23 @@ export const kokrSidebar = sidebar({
|
||||
{
|
||||
text: "사용자 설명서",
|
||||
icon: "mdi:user",
|
||||
prefix: "manual/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "기능",
|
||||
icon: "mdi:information-outline",
|
||||
link: "/ko-kr/1.1-사용자_설명서",
|
||||
},
|
||||
{
|
||||
text: "자주 묻는 질문",
|
||||
icon: "ph:question-fill",
|
||||
link: "/ko-kr/1.2-FAQ",
|
||||
},
|
||||
{
|
||||
text: "에뮬레이터 지원",
|
||||
icon: "mingcute:laptop-fill",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "Windows",
|
||||
icon: "ri:windows-fill",
|
||||
link: "/ko-kr/1.3-에뮬레이터_지원",
|
||||
},
|
||||
{
|
||||
text: "Mac",
|
||||
icon: "basil:apple-solid",
|
||||
link: "/ko-kr/1.4-Mac에뮬레이터_지원",
|
||||
},
|
||||
{
|
||||
text: "Linux",
|
||||
icon: "teenyicons:linux-alt-solid",
|
||||
link: "/ko-kr/1.5-LINUX용_에뮬레이터 지원",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "개발 관련",
|
||||
icon: "ph:code-bold",
|
||||
prefix: "develop/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "리눅스 컴파일 튜토리얼",
|
||||
icon: "teenyicons:linux-alt-solid",
|
||||
link: "/ko-kr/2.1-LINUX_튜토리얼",
|
||||
},
|
||||
{
|
||||
text: "개발 환경 구축하기",
|
||||
icon: "iconoir:developer",
|
||||
link: "/ko-kr/2.2-개발_환경_구축하기",
|
||||
},
|
||||
{
|
||||
text: "Issue Bot 사용 방법",
|
||||
icon: "bxs:bot",
|
||||
link: "/ko-kr/2.3-Issue_Bot_사용방법",
|
||||
},
|
||||
{
|
||||
text: "GitHub Pull Request 사용 가이드",
|
||||
icon: "mingcute:git-pull-request-fill",
|
||||
link: "/ko-kr/2.4-웹을_통한_풀리퀘스트_튜토리얼",
|
||||
},
|
||||
{
|
||||
text: "해외 클라이언트 현지화",
|
||||
icon: "ri:earth-fill",
|
||||
link: "/ko-kr/2.5-해외_클라이언트_현지화",
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "프로토콜 문서",
|
||||
icon: "basil:document-solid",
|
||||
prefix: "protocol/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "연동",
|
||||
icon: "bxs:book",
|
||||
link: "/ko-kr/3.1-연동",
|
||||
},
|
||||
{
|
||||
text: "콜백 스키마",
|
||||
icon: "material-symbols:u-turn-left",
|
||||
link: "/ko-kr/3.2-콜백_스키마",
|
||||
},
|
||||
{
|
||||
text: "전투 스키마",
|
||||
icon: "ph:sword-bold",
|
||||
link: "/ko-kr/3.3-전투_스키마",
|
||||
},
|
||||
{
|
||||
text: "작업 스키마",
|
||||
icon: "material-symbols:task",
|
||||
link: "/ko-kr/3.4-작업_스키마",
|
||||
},
|
||||
{
|
||||
text: "통합전략 스키마",
|
||||
icon: "ri:game-fill",
|
||||
link: "/ko-kr/3.5-통합전략_스키마",
|
||||
},
|
||||
{
|
||||
text: "기반시설 예약 스키마",
|
||||
icon: "material-symbols:view-quilt-rounded",
|
||||
link: "/ko-kr/3.6-기반시설_예약_스키마",
|
||||
},
|
||||
{
|
||||
text: "보안파견 스키마",
|
||||
icon: "game-icons:prisoner",
|
||||
link: "/ko-kr/3.7-보안파견_스키마",
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@@ -1,53 +1,30 @@
|
||||
import { sidebar } from "vuepress-theme-hope";
|
||||
|
||||
export const zhcnSidebar = sidebar({
|
||||
"/": [
|
||||
"/zh-cn/": [
|
||||
{
|
||||
text: "MAA",
|
||||
icon: "ic:round-home",
|
||||
link: "/",
|
||||
link: "/zh-cn/",
|
||||
},
|
||||
{
|
||||
text: "用户手册",
|
||||
icon: "mdi:user",
|
||||
prefix: "用户手册/",
|
||||
prefix: "manual/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "功能介绍",
|
||||
icon: "mdi:information-outline",
|
||||
link: "详细介绍",
|
||||
},
|
||||
{
|
||||
text: "常见问题",
|
||||
icon: "ph:question-fill",
|
||||
link: "常见问题",
|
||||
},
|
||||
{
|
||||
text: "模拟器和设备支持",
|
||||
icon: "mingcute:laptop-fill",
|
||||
prefix: "模拟器和设备支持/",
|
||||
collapsible: true,
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "CLI使用指南",
|
||||
icon: "material-symbols:terminal",
|
||||
link: "CLI使用指南",
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "开发文档",
|
||||
icon: "ph:code-bold",
|
||||
prefix: "开发文档/",
|
||||
prefix: "develop/",
|
||||
collapsible: true,
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "协议文档",
|
||||
icon: "basil:document-solid",
|
||||
prefix: "协议文档/",
|
||||
prefix: "protocol/",
|
||||
collapsible: true,
|
||||
children: "structure",
|
||||
},
|
||||
|
||||
@@ -10,120 +10,23 @@ export const zhtwSidebar = sidebar({
|
||||
{
|
||||
text: "用戶說明書",
|
||||
icon: "mdi:user",
|
||||
prefix: "manual/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "功能介绍",
|
||||
icon: "mdi:information-outline",
|
||||
link: "/zh-tw/1.1-詳細介紹",
|
||||
},
|
||||
{
|
||||
text: "常見問題",
|
||||
icon: "ph:question-fill",
|
||||
link: "/zh-tw/1.2-常見問題",
|
||||
},
|
||||
{
|
||||
text: "模擬器支援",
|
||||
icon: "mingcute:laptop-fill",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "Windows",
|
||||
icon: "ri:windows-fill",
|
||||
link: "/zh-tw/1.3-模擬器支援",
|
||||
},
|
||||
{
|
||||
text: "Mac",
|
||||
icon: "basil:apple-solid",
|
||||
link: "/zh-tw/1.4-Mac模擬器支援",
|
||||
},
|
||||
{
|
||||
text: "Linux",
|
||||
icon: "teenyicons:linux-alt-solid",
|
||||
link: "/zh-tw/1.5-Linux模擬器支援",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "CLI使用說明",
|
||||
icon: "material-symbols:terminal",
|
||||
link: "/zh-tw/1.6-CLI使用說明",
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "開發文件",
|
||||
icon: "ph:code-bold",
|
||||
prefix: "develop/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "Linux編譯教學",
|
||||
icon: "teenyicons:linux-alt-solid",
|
||||
link: "/zh-tw/2.1-Linux編譯教學",
|
||||
},
|
||||
{
|
||||
text: "開發相關",
|
||||
icon: "iconoir:developer",
|
||||
link: "/zh-tw/2.2-開發相關",
|
||||
},
|
||||
{
|
||||
text: "IssueBot使用方法",
|
||||
icon: "bxs:bot",
|
||||
link: "/zh-tw/2.3-IssueBot使用方法",
|
||||
},
|
||||
{
|
||||
text: "純網頁端PR教學",
|
||||
icon: "mingcute:git-pull-request-fill",
|
||||
link: "/zh-tw/2.4-純網頁端PR教學",
|
||||
},
|
||||
{
|
||||
text: "外服適配教學",
|
||||
icon: "ri:earth-fill",
|
||||
link: "/zh-tw/2.5-外服適配教學",
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "協議文件",
|
||||
icon: "basil:document-solid",
|
||||
prefix: "protocol/",
|
||||
collapsible: true,
|
||||
children: [
|
||||
{
|
||||
text: "集成文件",
|
||||
icon: "bxs:book",
|
||||
link: "/zh-tw/3.1-集成文件",
|
||||
},
|
||||
{
|
||||
text: "回呼訊息協議",
|
||||
icon: "material-symbols:u-turn-left",
|
||||
link: "/zh-tw/3.2-回呼訊息協議",
|
||||
},
|
||||
{
|
||||
text: "戰鬥流程協議",
|
||||
icon: "ph:sword-bold",
|
||||
link: "/zh-tw/3.3-戰鬥流程協議",
|
||||
},
|
||||
{
|
||||
text: "任務流程協議",
|
||||
icon: "material-symbols:task",
|
||||
link: "/zh-tw/3.4-任務流程協議",
|
||||
},
|
||||
{
|
||||
text: "肉鴿輔助協議",
|
||||
icon: "ri:game-fill",
|
||||
link: "/zh-tw/3.5-肉鴿輔助協議",
|
||||
},
|
||||
{
|
||||
text: "基建排班協議",
|
||||
icon: "material-symbols:view-quilt-rounded",
|
||||
link: "/zh-tw/3.6-基建排班協議",
|
||||
},
|
||||
{
|
||||
text: "保全派駐協議",
|
||||
icon: "game-icons:prisoner",
|
||||
link: "/zh-tw/3.7-保全派駐協議",
|
||||
},
|
||||
],
|
||||
children: "structure",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
.home {
|
||||
.vp-hero-info-wrapper {
|
||||
min-height: 600px;
|
||||
}
|
||||
}
|
||||
|
||||
.catalog-display-container {
|
||||
overflow-x: visible;
|
||||
overflow-y: auto;
|
||||
|
||||
max-height: 75vh;
|
||||
margin: 0.5rem;
|
||||
border-radius: 0.5rem;
|
||||
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
$sidebar-width: 16rem;
|
||||
$content-width: 1000px;
|
||||
|
||||
$font-family-mono: '"Sarasa Gothic", "Jetbrains mono", consolas';
|
||||
$font-family: '-apple-system, BlinkMacSystemFont, "Noto Sans SC", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", STHeiti, "Microsoft YaHei", sans-serif';
|
||||
$font-family-heading: 'Georgia, -apple-system, "Nimbus Roman No9 L", "PingFang SC", "Hiragino Sans GB", "Noto Serif SC", "Microsoft Yahei", "WenQuanYi Micro Hei", "ST Heiti", sans-serif';
|
||||
$font-family-mono: '"Sarasa Gothic", "Jetbrains mono", "Fira Code", "Noto Sans SC", Consolas, monospace, Menlo, "Courier New"';
|
||||
|
||||
html[lang="ja-JP"] {
|
||||
$font-family: "Helvetica Neue, Arial, Hiragino Kaku Gothic ProN, Hiragino Sans, Meiryo, sans-serif";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { hopeTheme } from "vuepress-theme-hope";
|
||||
import DocSearchConfig from './plugins/search';
|
||||
import { zhcnNavbar, zhtwNavbar, enusNavbar, jajpNavbar, kokrNavbar } from "./navbar/index";
|
||||
import { zhcnSidebar, zhtwSidebar, enusSidebar, jajpSidebar, kokrSidebar } from "./sidebar/index";
|
||||
|
||||
@@ -10,12 +11,12 @@ export default hopeTheme({
|
||||
docsDir: "/docs",
|
||||
|
||||
locales: {
|
||||
"/": {
|
||||
"/zh-cn/": {
|
||||
navbar: zhcnNavbar,
|
||||
sidebar: zhcnSidebar,
|
||||
displayFooter: false,
|
||||
metaLocales: {
|
||||
editLink: "在Github上编辑此页面",
|
||||
editLink: "在 Github 上编辑此页面",
|
||||
},
|
||||
},
|
||||
"/zh-tw/": {
|
||||
@@ -23,7 +24,7 @@ export default hopeTheme({
|
||||
sidebar: zhtwSidebar,
|
||||
displayFooter: false,
|
||||
metaLocales: {
|
||||
editLink: "在Github上編輯此頁面",
|
||||
editLink: "在 Github 上編輯此頁面",
|
||||
},
|
||||
},
|
||||
"/en-us/": {
|
||||
@@ -39,7 +40,7 @@ export default hopeTheme({
|
||||
sidebar: jajpSidebar,
|
||||
displayFooter: false,
|
||||
metaLocales: {
|
||||
editLink: "このページをGithubで編集する",
|
||||
editLink: "このページを Github で編集する",
|
||||
},
|
||||
},
|
||||
"/ko-kr/": {
|
||||
@@ -47,13 +48,11 @@ export default hopeTheme({
|
||||
sidebar: kokrSidebar,
|
||||
displayFooter: false,
|
||||
metaLocales: {
|
||||
editLink: "Github에서 이 페이지를 편집",
|
||||
editLink: "Github 에서 이 페이지를 편집",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
sidebarIcon: true,
|
||||
|
||||
plugins: {
|
||||
activeHeaderLinks: false,
|
||||
|
||||
@@ -61,43 +60,117 @@ export default hopeTheme({
|
||||
provider: "Giscus",
|
||||
repo: "MaaAssistantArknights/maa-website",
|
||||
repoId: "R_kgDOHY7Gyg",
|
||||
category: "General",
|
||||
categoryId: "DIC_kwDOHY7Gys4CYefe",
|
||||
mapping: "title",
|
||||
strict: false,
|
||||
category: "Comments",
|
||||
categoryId: "DIC_kwDOHY7Gys4CgoVH",
|
||||
mapping: "pathname",
|
||||
strict: true,
|
||||
},
|
||||
|
||||
copyright: {
|
||||
license: "AGPL-3.0",
|
||||
},
|
||||
|
||||
docsearch: DocSearchConfig,
|
||||
|
||||
mdEnhance: {
|
||||
align: true,
|
||||
card: true,
|
||||
chart: true,
|
||||
codetabs: true,
|
||||
container: true,
|
||||
echarts: true,
|
||||
//echarts: true,
|
||||
footnote: true,
|
||||
gfm: true,
|
||||
hint: true,
|
||||
imgLazyload: true,
|
||||
imgMark: true,
|
||||
imgSize: true,
|
||||
mathjax: true,
|
||||
//mathjax: true,
|
||||
mark: true,
|
||||
mermaid: true,
|
||||
//mermaid: true,
|
||||
tabs: true,
|
||||
tasklist: true,
|
||||
vPre: true,
|
||||
component: true,
|
||||
},
|
||||
|
||||
prismjs: {
|
||||
light: "one-dark",
|
||||
dark: "nord",
|
||||
shiki: {
|
||||
themes: {
|
||||
light: "light-plus",
|
||||
dark: "nord",
|
||||
}
|
||||
},
|
||||
|
||||
sitemap: true,
|
||||
|
||||
notice: [
|
||||
{
|
||||
path: "/zh-tw/",
|
||||
title: "翻译警告",
|
||||
content: "MAA 的文檔以簡體中文為主,其他語言的文檔可能品質低或尚未翻譯,請諒解。",
|
||||
fullscreen: true,
|
||||
confirm: true,
|
||||
showOnce: true,
|
||||
actions: [
|
||||
{
|
||||
text: "我知道了",
|
||||
type: "primary",
|
||||
},
|
||||
{ text: "前往簡體中文",
|
||||
link: "/zh-cn/",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/en-us/",
|
||||
title: "Translation Warning",
|
||||
content: "MAA's documents are mainly in Simplified Chinese. Documents in other languages may be of low quality or not yet translated. Please understand.",
|
||||
fullscreen: true,
|
||||
confirm: true,
|
||||
showOnce: true,
|
||||
actions: [
|
||||
{
|
||||
text: "Okay",
|
||||
type: "primary",
|
||||
},
|
||||
{ text: "Take me to zh-CN",
|
||||
link: "/zh-cn/",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/ja-jp/",
|
||||
title: "翻訳に関する警告",
|
||||
content: "MAA のドキュメントは主に簡体字中国語で書かれており、他の言語のドキュメントは低品質であるか、翻訳されていない可能性がありますので、ご了承ください。",
|
||||
fullscreen: true,
|
||||
confirm: true,
|
||||
showOnce: true,
|
||||
actions: [
|
||||
{
|
||||
text: "OK",
|
||||
type: "primary",
|
||||
},
|
||||
{ text: "中国語サイトへ行く",
|
||||
link: "/zh-cn/",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/ko-kr/",
|
||||
title: "번역 경고",
|
||||
content: "MAA의 문서는 주로 중국어 간체로 되어 있습니다. 다른 언어로 된 문서는 번역이 이상하거나, 번역이 되어있지 않을 수 있습니다.",
|
||||
fullscreen: true,
|
||||
confirm: true,
|
||||
showOnce: true,
|
||||
actions: [
|
||||
{
|
||||
text: "OK",
|
||||
type: "primary",
|
||||
},
|
||||
{ text: "중국어 간체로 이동",
|
||||
link: "/zh-cn/",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
@@ -58,3 +58,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- markdownlint-disable-file -->
|
||||
|
||||
52
docs/components/ImageGrid.vue
Normal file
@@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<div>
|
||||
<img v-for="src of displayImageList" class="image" :src="src" alt="" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { PropType, defineComponent } from "vue";
|
||||
import { withBase } from "vuepress/client";
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
imageList: Array as PropType<
|
||||
Array<{ light: string; dark: string } | string>
|
||||
>,
|
||||
},
|
||||
computed: {
|
||||
displayImageList() {
|
||||
return this.imageList.map((item) => {
|
||||
const src =
|
||||
typeof item === "string"
|
||||
? item
|
||||
: this.$isDarkmode
|
||||
? item.dark
|
||||
: item.light;
|
||||
return withBase(src);
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.image {
|
||||
box-sizing: border-box;
|
||||
width: 25%;
|
||||
padding: 9px;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
@media (max-width: 719px) {
|
||||
.image {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 419px) {
|
||||
.image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,253 +0,0 @@
|
||||
# MAA User Manual
|
||||
|
||||
## Features
|
||||
|
||||
### Operations
|
||||
|
||||
- If the stage you need is not available in the selection, please choose "Current/Previous" in MAA and manually locate the stage in the game, making sure the screen stays on the stage detail page with the **Start** and **Delegate** buttons available.
|
||||
- If you are not on this page, `Current/Previous` will automatically navigate to the last stage played according to the record in the lower right corner of the terminal homepage.
|
||||
- You can also enable `Manually input stage name` in `Task Settings` - `Combat` - `Advanced` and enter the stage number manually. Currently supported stages include:
|
||||
- All main theme stages, where `-NORMAL` or `-HARD` can be added at the end to switch between standard and challenge modes.
|
||||
- LMD stages and Battle Record stages 5/6. The input should be `CE-6` or `LS-6` even if you have not unlocked it yet. In that case, the program will automatically switch to corresponding stage 5.
|
||||
- Skill Summary, Shop Voucher, and Carbon Stages 5. The input also should be `CA-5`, `AP-5`, and `SK-5` respectively.
|
||||
- Chip stages. The input should be complete with stage number, such as `PR-A-1`.
|
||||
- Annihilation. The input should be `Annihilation`.
|
||||
- Certain side story stages. This includes `OF-1`, `OF-F3` and `GT-5`.
|
||||
- The last three stages of the current SS event. This is available after downloading updates automatically from the [API](https://ota.maa.plus/MaaAssistantArknights/api/gui/StageActivity.json) when the event is on. Prompt will be shown in the main page when this is available.
|
||||
<!--For the re-engraved SS event, you can enter `SSReopen-XX` to clear XX-1 ~ XX-9 levels at one time. Such as `SSReopen-IC`.-->
|
||||
|
||||
- Fight options include `Use Sanity Potion`, `Use Originium`, `Perform Battles` and `Material`, you can specific any of them. The fight tasks stops once one of the specifications is met.
|
||||
- `Use Sanity Potion` specifies the number of sanity potions to use at most. Multiple medicines may be used at a time.
|
||||
- `Use Originium` specifies the number of Originium to use at most. It is used one at a time.
|
||||
- `Perform Battles` specifies the number of battles to perform at most.
|
||||
- `Material` specifies the number of materials to collect.
|
||||
|
||||
| Example | Use Sanity Potion | Use Originium | Perform Battles | Material | Result |
|
||||
|:-------:|:-----------------:|:-------------:|:---------------:|:--------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| A | 999 | 10 | 1 | x | The AI will attempt to use sanity potions and/or originium until **one** full run is completed, satisfying the condition `Perform Battles: 1`. If there are not enough sanity potions, originium, or initial sanity to start, the AI will stop without starting the run. |
|
||||
| B | x | x | 100 | x | The AI will attempt to complete 100 runs, but if all available sanity is used up (which may be less than 100 runs), and the conditions `Use Sanity Potion: No` and `Use Originium: No` are met, the AI will stop without completing the full 100 runs. |
|
||||
| C | 1 | x | 100 | x | The AI will attempt to complete 100 runs, using at most one sanity potion. If the AI uses a sanity potion and runs out of sanity during the process, and the conditions `Use Sanity Potion: 1` and `Use Originium: No` are met, the AI will stop without completing the full 100 runs. |
|
||||
| D | 999 | x | 100 | 3 Orirock| The AI will attempt to complete 100 runs, using up to 999 sanity potions. If during the process, the AI accumulates 3 Orirock cubes, satisfying the condition `Material: 3 Orirock`, the AI will stop without completing the full 100 runs. |
|
||||
|
||||
- Note that `Material` and `Stage` are independent options which means the program is not going to automatically navigate the the stage for the specified material. You still to mannually configure the stage option.
|
||||
- `Delegate` will be automatically selected if not already in case you forget to do so.
|
||||
- Material drops are automatically recognized and printed to the program log. The data also gets uploaded to [Penguin Stats](https://penguin-stats.io/). You can also manually set your Penguin Stats user ID in the settings.
|
||||
- After disconnection or flashing at 4 am, it will automatically reconnect and continue to play the last stage selected in the game. If you need to cross the day, please check the last stage selection.
|
||||
- A level up situation can be automatically handled as well as a failed delegation in which case this time of the operation will be given up.
|
||||
|
||||
### Infrastructure
|
||||
|
||||
#### Shifting Strategy
|
||||
|
||||
- Automatically calculate and choose the **optimal solution within a single facility**. Supports all general and special skill combinations. Supports recognition of Battle Record, Pure Gold, Originium Shard, Chip, etc. for different operators.
|
||||
|
||||
#### Morale Threshold for Working in Infrastructure
|
||||
|
||||
- Recognizes the percentage of the Morale bar. When Morale is below some threshold, the operator will be moved to the dormitory.
|
||||
|
||||
#### Note
|
||||
|
||||
- The shifting strategy is based on the optimal solution within a single facility instead of multiple facilities. Combination such as: `Shamare-Tequila`, `Vermeil-Scene` within a single facility can be recognized correctly; while combination like `Rosmontis`, `Pinus Sylvestris` among facilities is not supported yet.
|
||||
- If `Usage of Drone` is selected with the option `Trading Post-LMD`, it will recognize `Shamare` and reserve it for her.
|
||||
- Operators of corresponding fraction will be selected when only one Clue is needed Reception Room; otherwise general operators will be chosen.
|
||||
- Reception Room will send out Clues only when your Clues are full. Three Clues will be send out at most. You can edit `SelectClue` - `maxTimes` field in `resource/tasks.json` to edit number of Clues sent if you want.
|
||||
- If you do not want operators like `Irene` or someone else to be put into the dormitory when the training room is not in use, you can switch off `Working operator shall not be put into the dormitory` in the settings. Note that this may cause the operators with non-full fatigue not entering the dormitory as well.
|
||||
- Due to the complexity of Control Center, only `Amiya`, `Swire`, `Kal'tsit`, `Team Rainbow` and other Morale+0.05 operators will be considered. To be improved in future.
|
||||
- Some alternate operators may have conflicts in Infrastructure. Please notice if there is "Operator conflict" warnings on the UI, and double check the Infrastructure to shift manually (e.g. some facilities may not have any operator).
|
||||
|
||||
#### Custom infrastructure shift change (test function)
|
||||
|
||||
- The experts of Yituliu with a one-picture flow have helped to create a shift generator, which can be referenced in the documentation.
|
||||
- Several sets of extremely efficient tasks are built-in under the MAA folder `/resource/custom_infrast/`, which can be used as a reference. (Fully upgraded operators at elite 2 level can try to use them directly.)
|
||||
|
||||
### Credit Store
|
||||
|
||||
- Automatically visit friends to obtain credit points.
|
||||
- With the help of Warfarin's credit:
|
||||
- Use a support operator to clear the `OF-1` stage in Heart of Surging Flame. If the stage is not unlocked, please do not select this option.
|
||||
- You can modify the automatic combat flow of OF-1 by editing `resource\copilot\OF-1_credit_fight.json` (it is generally not recommended to modify).
|
||||
- It does not take effect when the stage selection is set to `current/last`.
|
||||
|
||||
### Integrated Strategy (I.S.) Support
|
||||
|
||||
- Please select the theme you want to explore in the MAA `Task Settings` - `Auto I.S.`, otherwise there may be problems due to the default selection of the latest theme.
|
||||
- Please pin the corresponding I.S. theme to the terminal in the game.
|
||||
- If there is exploration of non-target themes (such as if you plan to use MAA to brush Mizuki, but there is still an unfinished exploration of Phantom), please end it manually.
|
||||
- If MAA gets stuck/repeatedly enters and exits on the difficulty selection interface, please manually select the difficulty before starting this function.
|
||||
- In the settings, you can choose the team, starting operator (only one operator name), etc.
|
||||
- It supports automatic recognition of operators and proficiency, and automatically selects better operators and skills.
|
||||
- It supports identifying store items and prioritizes purchasing more powerful collectibles.
|
||||
- It supports reconnection after disconnection and supports continuing to return to brush after 4 a.m. update.
|
||||
- If the scraping cannot be completed during the battle, all ground units will be automatically withdrawn after more than 5 minutes; if it exceeds 6 minutes, the current battle will be automatically abandoned without getting stuck.
|
||||
- If the task gets stuck, it will automatically abandon the exploration and retry. However, if it often gets stuck in a certain place and then gives up, seriously affecting efficiency, please feel free to submit an issue for feedback~
|
||||
|
||||
### Share Your Tasks
|
||||
|
||||
- Welcome to share your tasks with [www.抄作业.com](https://www.抄作业.com), or [www.prts.plus](https://www.prts.plus)!
|
||||
|
||||
#### Load Tasks
|
||||
|
||||
- Please run it on the screen with `Start Operation` button.
|
||||
- If you need to make your own build manually, turn off `auto build` to do so.
|
||||
- Remember to like the tasks that you think helpful!
|
||||
|
||||

|
||||
|
||||
#### Create Tasks
|
||||
|
||||
- A tool for creating tasks is provided in the directory of MAA. See also: [Copilot Schema](3.3-COPILOT_SCHEMA.md) for help.
|
||||
- How to get map coordinates: start an operation after filling in `stage_name`. A file named `map.png` will be generated for your reference. Or you can refer to [PRTS.map](https://map.ark-nights.com/), with the `coordinates` set to `MAA` mode.
|
||||
- Drill plan is recommended for testing.
|
||||
- Welcome to share your tasks with [www.抄作业.com](https://www.抄作业.com), or [www.prts.plus](https://www.prts.plus)!
|
||||
- It is recommended to write your own name, video walkthrough URL, or other things that you think helpful in the description.
|
||||
|
||||
### Task Video Recognition
|
||||
|
||||
- Drag and drop the video file to the `Copilot` section and click `Start` to initialize the video recognition.
|
||||
- Only 16:9 aspect ratio videos with a resolution of 720p or higher are supported. The video content must not contain any black borders, distortion correction, emulator borders or other elements.
|
||||
|
||||
### Recruitment Recognition
|
||||
|
||||
- Auto-recruitment and recruitment recognition are two different features!
|
||||
- Auto-recruitment supports using `Expedited Plan` to make it fully automated! Please enable `Auto use Expedited` in `Task Settings` - `Recruit` , and modify `Recruit max times`.
|
||||
- Pop-up notification when 5★, 6★ operators are recruited.
|
||||
- Auto-uploading recruitment data to [Penguin Stats](https://penguin-stats.io/) and [Yituliu](https://yituliu.site/) while auto-recruitment.
|
||||
|
||||
### Depot Recognition (test function)
|
||||
|
||||
- Please start with the `Upgrade materials` screen. Currently, exporting is only supported to [penguin-stats](https://penguin-stats.io/), [Arknights Toolbox](https://arkn.lolicon.app/#/material), and [Arknights | Planner](https://ark-nights.com/table). More useful features may be added in the future.
|
||||
- Please feel free to contact us if you hope to integrate with our JSON schema.
|
||||
|
||||
## Setting Introduction
|
||||
|
||||
In addition to the `Settings` tab, there are also `Task Settings` in Windows MAA. Click the `gear` on the right side of the task list of `Farming` to switch between different task settings in the farming interface.
|
||||
|
||||
Note that clicking `General` `Advanced` will also switch `Task Settings`.
|
||||
|
||||
### Custom Connection
|
||||
|
||||
#### Obtain adb path
|
||||
|
||||
- Method 1: Download adb and set up connection manually
|
||||
- (Only for Windows users) Download [adb](https://dl.google.com/android/repository/platform-tools-latest-windows.zip) and unzip it. It is recommended to unzip to the MAA directory.
|
||||
- Go to the "Settings" - "Connection Settings" of the software, select the file path of `adb.exe`, fill in the adb address (IP + port need to be filled in, such as `127.0.0.1:5555`), and select the emulator type.
|
||||
|
||||
- Method 2: Find the adb execution port of the emulator and connect
|
||||
- For emulators that come with adb, you can find the location of the adb executable file according to the [Confirm adb address section](1.2-FAQ.md#Method-1-Confirm-that-the-adb-and-connection-address-are-correct).
|
||||
- Mac Android emulators are generally installed in the `/Application/` directory. Right-click on `[emulator name].app` and select "Show Package Contents". Find the adb executable file in the directory.
|
||||
|
||||
#### Get the port number
|
||||
|
||||
- Method 1: Use the adb command to view the running port directly
|
||||
|
||||
**Replace adb in the command below with the name of the found adb executable file**, and then execute:
|
||||
|
||||
```sh
|
||||
# mac/linux/windows cmd
|
||||
adb devices
|
||||
# windows PowerShell
|
||||
.\adb devices
|
||||
```
|
||||
|
||||
After most emulator adb execution commands are run, they will be output in the following form, where `[ADBPORT]` is a specific number:
|
||||
|
||||
```sh
|
||||
List of devices attached
|
||||
127.0.0.1:[ADBPORT] device
|
||||
# may be more output like the above one
|
||||
```
|
||||
|
||||
Use `127.0.0.1:[ADBPORT]` as the connection address (replace `[ADBPORT]` with the actual number).
|
||||
|
||||
- Method 2: Use system command to check emulator debugging port
|
||||
|
||||
If the output of the adb command does not display the port information in the form of `127.0.0.1:[port]`, you can use the following method to check:
|
||||
1. First, run the adb executable program once (need to start the adb daemon process), and run the Arknights emulator application.
|
||||
2. Then use the system command to check the port information of the adb process.
|
||||
|
||||
Windows Command
|
||||
|
||||
You can use `win` + `R` to open the command line by entering `cmd`, and use the following command to check:
|
||||
|
||||
```sh
|
||||
for /F "tokens=1,2" %A in ('"tasklist | findstr "adb""') do ( ^
|
||||
netstat -ano | findstr "%B" |)
|
||||
```
|
||||
|
||||
Mac / Linux Command
|
||||
|
||||
Enter the following command in the terminal after starting the emulator:
|
||||
|
||||
```sh
|
||||
tmp=$(sudo ps aux | grep "[a]db" | awk '{print $2}') && \
|
||||
sudo netstat -vanp tcp | grep -e "\b$tmp"
|
||||
```
|
||||
|
||||
The output will be in the following format, where `[PID]` is the actual process number of the adb, `[ADBPORT]` is the remote connection port of the target emulator adb, and `[localport]` is the local address of the process, which does not need to be concerned (there will also be other irrelevant indicators in the Mac operation result):
|
||||
|
||||
```sh
|
||||
> ( netstat -ano | findstr "[PID]" )
|
||||
TCP 127.0.0.1:[localport] 127.0.0.1:0.0.0.0 LISTENING [PID]
|
||||
TCP 127.0.0.1:[localport] 127.0.0.1:[ADBPORT] ESTABLISHED [PID]
|
||||
# ...
|
||||
# maybe more output like the above line
|
||||
```
|
||||
|
||||
Use `127.0.0.1:[ADBPORT]` (replace `[ADBPORT]` with the actual number) in the results as the actual connection address of the emulator adb and fill it in `Settings` - `Connection Settings` - `Connection Address`.
|
||||
|
||||
### Automatically Start Multiple Emulators
|
||||
|
||||
- If you need to operate multiple emulators simultaneously, you can copy the MAA folder multiple times, and use **different MAAs**, **the same adb.exe**, and **different connection addresses** to connect.
|
||||
- Taking `BlueStacks International Version` as an example, two ways to start multiple emulators are introduced.
|
||||
|
||||
- Perform multiple operations by attaching commands to `HD-Player.exe`.
|
||||
|
||||
1. Start the corresponding emulator separately.
|
||||
2. Open the Task Manager, find the corresponding emulator process, go to the Details tab, right-click the column above, click `Select Columns`, and check `Command Line`.
|
||||
3. In the newly added `Command Line` column, find the content after `"...\Bluestacks_nxt\HD-Player.exe"`.
|
||||
4. Fill in the found content, similar to `--instance Nougat32`, in `Startup Settings` - `Additional Commands`.
|
||||
|
||||
Note: After the operation is completed, it is recommended to hide the `Command Line` column opened in `Step 2` to prevent freezing.
|
||||
- Example:
|
||||
|
||||
```bash
|
||||
Multi-instance 1:
|
||||
Emulator Path: C:\Program Files\BlueStacks_nxt\HD-Player.exe
|
||||
Additional Commands: --instance Nougat32 --cmd launchApp --package "com.hypergryph.arknights"
|
||||
Multi-instance 2:
|
||||
Emulator Path: C:\Program Files\BlueStacks_nxt\HD-Player.exe
|
||||
Additional Commands: --instance Nougat32_1 --cmd launchApp --package "com.hypergryph.arknights.bilibili"
|
||||
```
|
||||
|
||||
The `--cmd launchApp --package` part starts and automatically runs the specified package name application after startup, which can be changed as needed.
|
||||
|
||||
- Perform multi-instance operation by using the shortcut of emulators or apps.
|
||||
|
||||
1. Open the multi-instance manager and add the corresponding emulator's shortcut.
|
||||
2. Fill in the path of the emulator shortcut in `Startup Settings` - `Emulator Path`.
|
||||
|
||||
Note: Some emulators support creating app shortcuts, which can directly launch the emulator and open Arknights with the app shortcut.
|
||||
- Example:
|
||||
|
||||
```bash
|
||||
Multi-instance 1:
|
||||
Emulator Path: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\BlueStacks\Multi-instance 1.lnk
|
||||
Multi-instance 2:
|
||||
Emulator Path: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\BlueStacks\Multi-instance 2 - Arknights.lnk
|
||||
```
|
||||
|
||||
If using `Emulator Path` for multi-instance operation, it is recommended to leave `Additional Commands` in `Startup Settings` empty.
|
||||
|
||||
### Pre/Post-Script
|
||||
|
||||
- Starting from v4.13.0, it is possible to set pre/post-script that automatically executes batch files before and after the task.
|
||||
- You need to provide the path to the batch file, which should have a `.bat` extension.
|
||||
|
||||
## Miscellaneous
|
||||
|
||||
- Tasks order can be changed on the UI. So can the shifting order in the infrastructure.
|
||||
- Almost all configuration changes will be saved automatically, except for options containing an *.
|
||||
- All clicking event is randomized within a region, following Poisson distribution (higher probability at the center, lower probability around).
|
||||
- Developed in C++, the core algorithm supports multi-level cache, in order to reduce CPU and memory usage as much as possible.
|
||||
- Our software supports auto-update ✿✿ヽ(°▽°)ノ✿ Beta-testers can try beta versions, which updates faster and less buggy (maybe).
|
||||
- If auto-update fails, you can download manually and put the ZIP file under the same directory. The update will start automatically.
|
||||
@@ -1,189 +0,0 @@
|
||||
# Emulator Supports
|
||||
|
||||
## ✅ [Bluestacks-CN 5](https://www.bluestacks.cn/)
|
||||
|
||||
Fully compatible. Need to turn on `Settings` - `Engine Settings` - `Allow ADB connection`.
|
||||
|
||||
## ✅ [Bluestacks 5](https://www.bluestacks.com/) (Recommended👍)
|
||||
|
||||
Fully compatible. Need to turn on `Settings` - `Advanced` - `Android Debug Bridge`.
|
||||
|
||||
## ✅ [Bluestacks 5 Hyper-V Version](https://support.bluestacks.com/hc/en-us/articles/4415238471053-System-requirements-for-BlueStacks-5-on-Hyper-V-enabled-Windows-10-and-11-)
|
||||
|
||||
Compatible.
|
||||
|
||||
- Turn on `Settings` - `Advanced` - `Android Debug Bridge`.
|
||||
- Bluestack Hyper-V port changes frequently. Here is a simple hack:
|
||||
|
||||
1. Find `bluestacks.conf` in the data location of the emulator. (Default is `C:\ProgramData\BlueStacks_nxt\bluestacks.conf`)
|
||||
2. If you are using MAA for the first time, Launch it, which generates `gui.json`.
|
||||
3. **Exit** MAA, **then** open the `gui.json`, and add a new field `Bluestacks.Config.Path`, with the value of the full path of `bluestacks.conf` (backslashes should be escaped like `\\`).
|
||||
For example: (suppose the file is at `C:\ProgramData\BlueStacks_nxt\bluestacks.conf`)
|
||||
|
||||
```json
|
||||
{
|
||||
"Configurations": {
|
||||
"Default": {
|
||||
"Bluestacks.Config.Path":"C:\\ProgramData\\BlueStacks_nxt\\bluestacks.conf",
|
||||
// ...
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
4. LinkStart!
|
||||
|
||||
- If you need to run multiple emulators (ignore this step if you do not need to do so), you can change the keywords for MAA to detect configuration files.
|
||||
Add field `Bluestacks.Config.Keyword` following the steps above
|
||||
Example:
|
||||
|
||||
```json
|
||||
"Bluestacks.Config.Keyword":"bst.instance.Nougat64.status.adb_port",
|
||||
```
|
||||
|
||||
## ✅ [Nox](https://en.bignox.com/)
|
||||
|
||||
Fully compatible.
|
||||
|
||||
## ✅ [Nox Android 9](https://en.bignox.com/)
|
||||
|
||||
Fully compatible.
|
||||
|
||||
## ⚠️ [MuMu](https://www.mumuglobal.com/)
|
||||
|
||||
Compatible but:
|
||||
|
||||
- Requires MAA to "Run as Administrator" to get ADB path and address (since MuMu runs as admin).
|
||||
- You can also fill in the ADB path and address if you do not wish to run as admin.
|
||||
- It is not recommended to use the default odd resolutions of MuMu, it is better to change to mainstream resolutions such as 1280x720, 1920x1080, 2560x1440, etc.
|
||||
- MuMu uses the same adb port for multi-instance, so multi-instance is not supported.
|
||||
|
||||
## 🚫 MuMu Mobile Game Assistant
|
||||
|
||||
Incompatible. The ADB port is unavailable.
|
||||
|
||||
## ⚠️ [MuMu emulator X (Android 12)](https://www.mumuglobal.com/) (most smooth👍)
|
||||
|
||||
Compatible but:
|
||||
|
||||
- This emulator is still in the testing phase and it is uncertain whether unknown issues will occur.
|
||||
- Requires MAA to "Run as Administrator" to get ADB path and address (since MuMu runs as admin).
|
||||
- You can also fill in the ADB path and address if you do not wish to run as admin.
|
||||
- It is not recommended to use the default odd resolutions of MuMu, it is better to change to mainstream resolutions such as 1280x720, 1920x1080, 2560x1440, etc.
|
||||
- MuMu uses the same adb port for multi-instance, so multi-instance is not supported.
|
||||
|
||||
## ⚠️ [LDPlayer](https://www.ldplayer.net/)
|
||||
|
||||
The recent official update has fixed some issues and provided corresponding support. After some time of testing, we have basically confirmed that it can be used normally.
|
||||
While using it, please still pay attention to the following points, but overall, the user experience has been greatly improved.
|
||||
|
||||
- **For LDPlayer 9, it is recommended to use version 9.0.37 or above; for LDPlayer 5, it is recommended to use version 5.0.44 or above.**
|
||||
- We cannot guarantee that the LDPlayer emulator can run perfectly on all computers, but we are working hard to optimize the adaptation.
|
||||
- If you encounter any problems when using the LDPlayer emulator, please update to the latest version of the emulator and try to solve the problem by yourself first. If you encounter difficulties, please feel free to provide feedback, and we will try our best to provide support.
|
||||
- Note: We welcome feedback on issues related to the LDPlayer emulator, and will try to solve them. We would be very grateful if you could provide relevant code or contributions.
|
||||
|
||||
## ✅ [Memu](https://www.memuplay.com)
|
||||
|
||||
Compatible, but there are fewer tests and there may be unknown issues
|
||||
|
||||
## 🚫 Tencent Mobile Game Assistant
|
||||
|
||||
Incompatible. The ADB port is unavailable.
|
||||
|
||||
## 🚫 [Google Play Games Beta](https://developer.android.com/games/playgames/pg-emulator?hl=zh-cn#installing-game-consumer)
|
||||
|
||||
Incompatible. The ADB port of [the consumer client](https://developer.android.com/games/playgames/pg-emulator?hl=zh-cn#installing-game-consumer)is unavailable.
|
||||
|
||||
## ⚠️ [Win11 WSA](https://docs.microsoft.com/en-us/windows/android/wsa/)
|
||||
|
||||
Partially compatible.
|
||||
|
||||
- Need to connect with [Custom Connection](#%EF%B8%8F-custom-connection).
|
||||
- For WSA 2204 or higher (version is in the `About` window of system settings), try `General Configuration` to connect.
|
||||
- For WSA 2203 or older (version is in the top of the system settings window), try `Legacy WSA` to connect.
|
||||
- Since WSA does not support changing resolution, please resize the window manually because this program supports 720p or higher `16:9` resolution better. (Or you can simply maximize the window with `F11` if your monitor is 16:9.)
|
||||
- Please ensure that your emulator is at the top of other windows in most of the time and there are no other android applications running. Otherwise the game may pause or the recognition may fail.
|
||||
- Sometimes the screenshot of WSA may be blank, causing recognition failure. So it is not recommended to use WSA.
|
||||
|
||||
## ✅ [AVD](https://developer.android.com/studio/run/managing-avds)
|
||||
|
||||
Compatible.
|
||||
|
||||
### ⚙️ Non-`16:9` devices like smartphones or tablets
|
||||
|
||||
You may need to change the resolution manually since MAA supports only `16:9` resolution.
|
||||
|
||||
1. Turn on USB debugging mode and connect your device to the computer with a cable, or debug with ADB remotely.
|
||||
2. Run `Command Prompt (CMD)`, check the device address and connect.
|
||||
|
||||
- Use the following command to check device ID if you are using USB cable to connect:
|
||||
|
||||
```bash
|
||||
adb devices # Checks the connection status of the current device, with the first column to be the device ID
|
||||
```
|
||||
|
||||
After successful connection, you will see the following messages:
|
||||
|
||||
```bash
|
||||
C:\Users\username>adb devices
|
||||
List of devices attached
|
||||
VFNDU1682100xxxx device # The data before "device" is the device ID
|
||||
```
|
||||
|
||||
- If you are using remote ADB connection: go to `Settings -> WLAN -> View` to find the corresponding IP address, and the port will usually be 5555 or 5037.
|
||||
|
||||
```bash
|
||||
adb connect <IP Address + Port> # E.g. 192.168.0.10:5555
|
||||
```
|
||||
|
||||
- If it prompts `'adb' is not recognized as an internal or external command`, it is because the environment variable is not configured correctly. You need to give the full path of ADB to run it. For example:
|
||||
|
||||
```bash
|
||||
D:\adb_unzip_path\adb.exe devices # Or you can simply drag the adb.exe to CMD window and type [SPACE] devices
|
||||
```
|
||||
|
||||
It is suggested that you configure the environment variable for ADB if you need to run it frequently. Please refer to the articles on the Internet about how to configure it for help.
|
||||
|
||||
3. Enter the command prompt to proceed
|
||||
|
||||
```bash
|
||||
adb -s <Device ID or IP + Port> shell # Enters the command prompt of the device
|
||||
wm size # Checks the resolution of the current device
|
||||
wm size 720x1280 # Changes the resolution to 720p
|
||||
```
|
||||
|
||||
4. Fill in the ADB path and the address of your smartphone (device ID or IP + port) in MAA
|
||||
5. Set the `Special-shaped screen adaptation` to 0 (off) in the game settings.
|
||||
Otherwise, your phone UI and click response may be dislocated if you change the resolution with ADB later.
|
||||
6. Use MAA (≧∇≦)ノ
|
||||
7. Before exiting MAA, reset the resolution of your phone.
|
||||
|
||||
```bash
|
||||
wm size reset # Resets resolution
|
||||
```
|
||||
#### Using `Starts/End with Script` Options
|
||||
|
||||
After MAA version 4.13.0, you're able to utilize `Starts/End with Script` options to apply resolution changes on startup and revert the changes on finishing.
|
||||
|
||||
Create two script files: `startup.bat` & `finish.bat` in appropriate path and edit them using your favored text editor.
|
||||
|
||||
In `startup.bat`:
|
||||
|
||||
```bash
|
||||
adb shell wm size 1080x1920
|
||||
::If long-time operation is required, add the following line to save the power and protect your screen.
|
||||
adb shell settings put system screen_brightness 1
|
||||
```
|
||||
|
||||
In `finish.bat`:
|
||||
|
||||
```bash
|
||||
adb shell wm size reset
|
||||
::Add the following line to brighten your screen
|
||||
adb shell settings put system screen_brightness 20
|
||||
::Add the following line to lock (Command may differ in different device, test it first)
|
||||
adb shell input keyevent 26
|
||||
```
|
||||
|
||||
Then go to `Settings` - `Connection Settings` and add the paths of files above to `Starts with Script` & `End with Script` options, the script will be executed at corresponding timing.
|
||||
|
||||