mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-03 11:10:26 +08:00
Compare commits
2242 Commits
docs/troub
...
docs/task-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78c1ff3a5c | ||
|
|
53052833f4 | ||
|
|
cd17cced22 | ||
|
|
a8ef1420b6 | ||
|
|
1d7a893950 | ||
|
|
ef8964e0a7 | ||
|
|
775c640dba | ||
|
|
634ebb55db | ||
|
|
5ac171d40c | ||
|
|
0ae323c855 | ||
|
|
8aaba7d60e | ||
|
|
caed828770 | ||
|
|
3f252eb12e | ||
|
|
e8051a6a39 | ||
|
|
e0860ed779 | ||
|
|
1324165cfe | ||
|
|
96aa7ada11 | ||
|
|
ca3160bd72 | ||
|
|
c3bac8b504 | ||
|
|
642c62498c | ||
|
|
56cf52808d | ||
|
|
5d47ede186 | ||
|
|
a48fe44663 | ||
|
|
a872081615 | ||
|
|
485ef8fcbf | ||
|
|
c450e596f7 | ||
|
|
f9c16319a8 | ||
|
|
5db20fe2c4 | ||
|
|
e12c7f948d | ||
|
|
cb546b4370 | ||
|
|
c193b26b62 | ||
|
|
91c8a22d1c | ||
|
|
b8205b5593 | ||
|
|
68248df197 | ||
|
|
db98bb370e | ||
|
|
bf2375a44f | ||
|
|
d12fb7d565 | ||
|
|
9838dec4fd | ||
|
|
793d03d47b | ||
|
|
56d796c92e | ||
|
|
aae995aef5 | ||
|
|
9159e5d979 | ||
|
|
705c5a4c68 | ||
|
|
a563b14f47 | ||
|
|
400fd6bf53 | ||
|
|
2915338cac | ||
|
|
09dc393c98 | ||
|
|
0650cdb64e | ||
|
|
385c521eb4 | ||
|
|
a37a74a4e2 | ||
|
|
1d2d49920a | ||
|
|
da82e14efc | ||
|
|
ad9103ea12 | ||
|
|
26296b3b82 | ||
|
|
72ba949f1c | ||
|
|
1102771ea1 | ||
|
|
9d9f95ea4a | ||
|
|
0e33a53068 | ||
|
|
081c0b7597 | ||
|
|
e3de09ddcc | ||
|
|
81e22e5bf9 | ||
|
|
424687c3e1 | ||
|
|
94e6fabb76 | ||
|
|
8d346ed392 | ||
|
|
fd3204e965 | ||
|
|
7109310145 | ||
|
|
a424520a1d | ||
|
|
b98ae1be2d | ||
|
|
5eaf466128 | ||
|
|
8dc7893459 | ||
|
|
e891471750 | ||
|
|
9014a20c25 | ||
|
|
4280d9356a | ||
|
|
b8e739bcad | ||
|
|
f9c76d4995 | ||
|
|
28ca820784 | ||
|
|
d8dbec69ca | ||
|
|
ada9b0849b | ||
|
|
99e64b3ea8 | ||
|
|
e7be333557 | ||
|
|
8da2271af1 | ||
|
|
7b58ddee5b | ||
|
|
fcfa9c033c | ||
|
|
1992af7159 | ||
|
|
a6b5101e0c | ||
|
|
e03a96774d | ||
|
|
261ddc49d9 | ||
|
|
bb735b6ee7 | ||
|
|
c54b45c09f | ||
|
|
eb061dcc59 | ||
|
|
bc7dc763fe | ||
|
|
3bfc2662e3 | ||
|
|
f4c21be051 | ||
|
|
2936006087 | ||
|
|
efa364043d | ||
|
|
7b6dada3ea | ||
|
|
be3b1a2057 | ||
|
|
67ceb02116 | ||
|
|
aa7a2731e0 | ||
|
|
df8f3786f0 | ||
|
|
20b167119a | ||
|
|
b1f02a2eb5 | ||
|
|
f9e424cd3b | ||
|
|
5eecbe21c1 | ||
|
|
32a3523bc4 | ||
|
|
7dd2dbdcbe | ||
|
|
27f9df768d | ||
|
|
2350a05fc4 | ||
|
|
3ea9912802 | ||
|
|
a9e31c75d0 | ||
|
|
4e46a392a3 | ||
|
|
2f09f9e591 | ||
|
|
55f675fb8d | ||
|
|
36fc9a8e0a | ||
|
|
cfd463a7fd | ||
|
|
2884f2d0ae | ||
|
|
0af752b083 | ||
|
|
212cb506d6 | ||
|
|
6ed32b3344 | ||
|
|
4a2901c473 | ||
|
|
18bec2504d | ||
|
|
7c4002351e | ||
|
|
4e0b5ace24 | ||
|
|
acfb173cc3 | ||
|
|
feb7b6109f | ||
|
|
552d7784a2 | ||
|
|
b1d10a87dc | ||
|
|
30bb86bade | ||
|
|
80511c660f | ||
|
|
45ca28ed74 | ||
|
|
a208c1f03b | ||
|
|
5b33bc3f00 | ||
|
|
6202eedeb3 | ||
|
|
a70502521d | ||
|
|
66a5095ede | ||
|
|
5b750ca194 | ||
|
|
b18e4e6ff6 | ||
|
|
31761d7e5d | ||
|
|
c881362cb1 | ||
|
|
00e5c1eb9f | ||
|
|
7e3ab62aae | ||
|
|
b0713bb9df | ||
|
|
42343f8978 | ||
|
|
e9383a7783 | ||
|
|
e0ee76115b | ||
|
|
d6bf677bb1 | ||
|
|
746816c6c7 | ||
|
|
4d74abfd8f | ||
|
|
5853354357 | ||
|
|
022ab93c1c | ||
|
|
cd8d22d23e | ||
|
|
da1170ecc9 | ||
|
|
df46d6bcb0 | ||
|
|
bf27a7fc86 | ||
|
|
482f21620e | ||
|
|
1472d80c12 | ||
|
|
5bfc5fce9f | ||
|
|
dcd2d52a5a | ||
|
|
2c87975e52 | ||
|
|
e3245a4163 | ||
|
|
43ea1f94df | ||
|
|
1077b08c19 | ||
|
|
d02393f174 | ||
|
|
bc59477b24 | ||
|
|
e4cb99c0c0 | ||
|
|
e65219efc5 | ||
|
|
8bffeaa368 | ||
|
|
b017e90b6b | ||
|
|
36da60ed9d | ||
|
|
a71eb71eff | ||
|
|
283329f8ea | ||
|
|
01eed2a376 | ||
|
|
a13212ea6e | ||
|
|
cb31aa0dbd | ||
|
|
61265768e5 | ||
|
|
85975d642c | ||
|
|
8d5806b9e1 | ||
|
|
5b32c3a985 | ||
|
|
4dc488229d | ||
|
|
f021c66fa5 | ||
|
|
1bc06de043 | ||
|
|
e278577435 | ||
|
|
9911d82dce | ||
|
|
ebcb4c561b | ||
|
|
29c2f8f44e | ||
|
|
d239cbad5c | ||
|
|
5a25cf70a9 | ||
|
|
7144821351 | ||
|
|
68ff234848 | ||
|
|
98e16bd915 | ||
|
|
108979ef5f | ||
|
|
e42b1dde8f | ||
|
|
ee8ceba005 | ||
|
|
1792dae76e | ||
|
|
7ac3851c71 | ||
|
|
23acf4735a | ||
|
|
1aaf852a80 | ||
|
|
c093cdeac8 | ||
|
|
cc36807ec9 | ||
|
|
ebbc9620d9 | ||
|
|
36e744dabf | ||
|
|
5aa8f43d42 | ||
|
|
54593075c3 | ||
|
|
a3ad69e189 | ||
|
|
71b2ce80a5 | ||
|
|
8d5459d7d2 | ||
|
|
f74296a01a | ||
|
|
139e79655d | ||
|
|
694d78be1c | ||
|
|
08562dc4e9 | ||
|
|
1acbcd493c | ||
|
|
69fdf39f09 | ||
|
|
c94d2d55d7 | ||
|
|
09bf0268ac | ||
|
|
a92f5eb354 | ||
|
|
54031c5858 | ||
|
|
51529ad257 | ||
|
|
14120ecc2b | ||
|
|
01a36cf0be | ||
|
|
c0da8956f8 | ||
|
|
9ac783219d | ||
|
|
950522fda0 | ||
|
|
5a7030ad50 | ||
|
|
907324370a | ||
|
|
03f6657244 | ||
|
|
de60b0d05a | ||
|
|
37958ab9e5 | ||
|
|
dab18e1964 | ||
|
|
f4b7e39b01 | ||
|
|
91a0e51142 | ||
|
|
2bbc7d6546 | ||
|
|
8e7a9e8691 | ||
|
|
8082c9913b | ||
|
|
f00e580884 | ||
|
|
7c1b897caa | ||
|
|
d799e8e800 | ||
|
|
b22cfad361 | ||
|
|
f67a31224c | ||
|
|
c0a5a9bd46 | ||
|
|
74bf88523f | ||
|
|
3372c7c82a | ||
|
|
069e159f33 | ||
|
|
b6552c19a6 | ||
|
|
d4a79ba9db | ||
|
|
523b496daa | ||
|
|
c9337f90f0 | ||
|
|
512bd90433 | ||
|
|
8f906d159e | ||
|
|
6410c3c5a5 | ||
|
|
bb922d8833 | ||
|
|
f65e370620 | ||
|
|
546d4b860a | ||
|
|
0f29aa369e | ||
|
|
f5d6b6cd8f | ||
|
|
7b29be6faf | ||
|
|
87e6484cb2 | ||
|
|
51ab24945b | ||
|
|
918a41ac3a | ||
|
|
29b889372a | ||
|
|
77891805d0 | ||
|
|
e9206f4244 | ||
|
|
7807577312 | ||
|
|
c4c6297370 | ||
|
|
8a5c3029c4 | ||
|
|
92631c999c | ||
|
|
e48049f198 | ||
|
|
407b140bca | ||
|
|
0e865982c6 | ||
|
|
1d62c972b7 | ||
|
|
890fce3567 | ||
|
|
cc0b229cdf | ||
|
|
bcd0ed5711 | ||
|
|
29a34766e7 | ||
|
|
ada54eef32 | ||
|
|
dc0e63f83e | ||
|
|
ffbb3ed798 | ||
|
|
8e9a408997 | ||
|
|
3bf9a67d56 | ||
|
|
c3a35b6df5 | ||
|
|
241b5c0047 | ||
|
|
4895a37278 | ||
|
|
d7ed013825 | ||
|
|
981f71f024 | ||
|
|
7e6216d573 | ||
|
|
b81e49636d | ||
|
|
f17c4bfd37 | ||
|
|
cfe40ad57b | ||
|
|
343e7831da | ||
|
|
a50f7a0c90 | ||
|
|
58acb92740 | ||
|
|
b26d656d94 | ||
|
|
7fed3d1e36 | ||
|
|
550386bb63 | ||
|
|
09638b2c4e | ||
|
|
06265f99c5 | ||
|
|
12ef622ff3 | ||
|
|
4219064117 | ||
|
|
83343de32b | ||
|
|
6e3230b508 | ||
|
|
bec3394521 | ||
|
|
9749c858f7 | ||
|
|
4d14212f15 | ||
|
|
a8d6068e87 | ||
|
|
f4d89ea93c | ||
|
|
08c32c6f15 | ||
|
|
3293ce5beb | ||
|
|
390cfc38a0 | ||
|
|
b23e63e352 | ||
|
|
7deaf65c06 | ||
|
|
25b1c73659 | ||
|
|
6a58723398 | ||
|
|
94ecbe2cb5 | ||
|
|
8b6c5e3011 | ||
|
|
041c03d9be | ||
|
|
a1fe1ad099 | ||
|
|
47f3a33167 | ||
|
|
5ff283cd18 | ||
|
|
c8dee82a3b | ||
|
|
5245bd6fbc | ||
|
|
bfb5deca88 | ||
|
|
2bfd2257b4 | ||
|
|
7b36d43e5e | ||
|
|
3943189550 | ||
|
|
f7eeffba9b | ||
|
|
27830218bc | ||
|
|
79e32af4eb | ||
|
|
9d8dbe80cc | ||
|
|
0056a50a8e | ||
|
|
0b22410351 | ||
|
|
9d0df414c9 | ||
|
|
2cac439e5f | ||
|
|
4a9e8f5d1e | ||
|
|
556d1bda73 | ||
|
|
b7681becd3 | ||
|
|
7b169cb441 | ||
|
|
aca317e67e | ||
|
|
f9e0ef32bc | ||
|
|
46216817c4 | ||
|
|
1cc3268f70 | ||
|
|
f45d051b79 | ||
|
|
b72a3569bf | ||
|
|
e1f766e23f | ||
|
|
2add7f1173 | ||
|
|
198f81812a | ||
|
|
fc711c9dbd | ||
|
|
fb52a07353 | ||
|
|
ca44b82acd | ||
|
|
53b22fe6b9 | ||
|
|
062f7480d7 | ||
|
|
f97f6a2cb3 | ||
|
|
12de1806f1 | ||
|
|
1a374a3129 | ||
|
|
7593ef29a9 | ||
|
|
ae0da25d36 | ||
|
|
3a197c4445 | ||
|
|
51a073221b | ||
|
|
a267cc5f66 | ||
|
|
a6e61f7a6b | ||
|
|
642c8eefe6 | ||
|
|
a54433ad8c | ||
|
|
af68bf918b | ||
|
|
ad2945a815 | ||
|
|
64e0c4ac3c | ||
|
|
3d88182c44 | ||
|
|
3a12869b7e | ||
|
|
433e8d910f | ||
|
|
b789183f6d | ||
|
|
887574aa6e | ||
|
|
5676a2df3b | ||
|
|
36536d9a13 | ||
|
|
63fd4ca0d8 | ||
|
|
b1a2999c15 | ||
|
|
6770ec19c8 | ||
|
|
2086377f48 | ||
|
|
d282b5b999 | ||
|
|
fac1f265d7 | ||
|
|
5376157f69 | ||
|
|
7e3a133066 | ||
|
|
05e3933115 | ||
|
|
8ee7f31887 | ||
|
|
44dd7c5501 | ||
|
|
aa21512ab9 | ||
|
|
714e37ded2 | ||
|
|
f5aee4f3fb | ||
|
|
c10df90fbf | ||
|
|
79e311185a | ||
|
|
016783c86c | ||
|
|
770130e774 | ||
|
|
363aa99b83 | ||
|
|
2710664a79 | ||
|
|
388b3627cb | ||
|
|
3359fa618e | ||
|
|
0c3c3df8f2 | ||
|
|
1691f828ff | ||
|
|
1fed8feed0 | ||
|
|
351ce45a52 | ||
|
|
c56e81e8be | ||
|
|
c3bcb3105c | ||
|
|
0bf9379d35 | ||
|
|
a3dba0b54a | ||
|
|
a5dcfd9100 | ||
|
|
5f1159b2d6 | ||
|
|
9c6df33d77 | ||
|
|
2b7894886f | ||
|
|
7ce19904c0 | ||
|
|
5b2b2b7fe8 | ||
|
|
385c26b065 | ||
|
|
9d60945af9 | ||
|
|
8f1dbb64c3 | ||
|
|
1ca9c3823b | ||
|
|
27b0ddaf2f | ||
|
|
ec4a86fab2 | ||
|
|
86fbd1061b | ||
|
|
8aada79ef5 | ||
|
|
b150c0d97b | ||
|
|
3b5ef33daa | ||
|
|
e9f9e5a6b3 | ||
|
|
c7cc4fe836 | ||
|
|
d6822fed31 | ||
|
|
c6e5fd43cb | ||
|
|
a8164506d9 | ||
|
|
83ef927474 | ||
|
|
798db61999 | ||
|
|
ade3e7963a | ||
|
|
9f899dd96e | ||
|
|
39f45e623a | ||
|
|
39ba4e91f5 | ||
|
|
25878b5380 | ||
|
|
b62dea6a19 | ||
|
|
6cf7272aff | ||
|
|
2c5568d4f8 | ||
|
|
46beb3308e | ||
|
|
7514438144 | ||
|
|
39de085354 | ||
|
|
ad4e32a92b | ||
|
|
114900e815 | ||
|
|
6db11fa846 | ||
|
|
c14225f54f | ||
|
|
62b7b0c645 | ||
|
|
ee3a95f092 | ||
|
|
eb370ae792 | ||
|
|
4077100aa8 | ||
|
|
d2ada336e5 | ||
|
|
b58a0c7bde | ||
|
|
ee37851d16 | ||
|
|
71ec401cde | ||
|
|
f8c79833a1 | ||
|
|
710515f581 | ||
|
|
36c8ee9942 | ||
|
|
5c4a9338e1 | ||
|
|
f9d5b2b417 | ||
|
|
8b9fe3fecc | ||
|
|
dc02a754d1 | ||
|
|
b9bd50d1c5 | ||
|
|
f29d9784f7 | ||
|
|
c7c9f2d3c5 | ||
|
|
8e53d6a036 | ||
|
|
43d86b717a | ||
|
|
8aa65c6146 | ||
|
|
0dee92ab2c | ||
|
|
cd078e924d | ||
|
|
234b75dec2 | ||
|
|
3009055cb0 | ||
|
|
d1175ee34b | ||
|
|
433a009835 | ||
|
|
84f3a7cc5d | ||
|
|
f6c9960300 | ||
|
|
09ff523de7 | ||
|
|
e0b230a259 | ||
|
|
8628130cd3 | ||
|
|
0644592e42 | ||
|
|
331ec96ac8 | ||
|
|
3be18fd67d | ||
|
|
c963ab5a41 | ||
|
|
29fca06687 | ||
|
|
ef1fd744d1 | ||
|
|
099359bb5d | ||
|
|
e2a869e547 | ||
|
|
ac527b3617 | ||
|
|
2ded386178 | ||
|
|
d609d6a667 | ||
|
|
9a7ac0c1fe | ||
|
|
01b84292d9 | ||
|
|
3fe5caadd0 | ||
|
|
c5a7fe10fa | ||
|
|
33b7fc4166 | ||
|
|
f4b5672f0c | ||
|
|
781e29c1e2 | ||
|
|
55168098db | ||
|
|
6f46e94754 | ||
|
|
eb0396cc88 | ||
|
|
7bcf0897a5 | ||
|
|
b63ef6dc66 | ||
|
|
65c7158d1c | ||
|
|
62619170da | ||
|
|
730e7258bc | ||
|
|
586220d9d8 | ||
|
|
ba44ec6a40 | ||
|
|
db2e1ccf4e | ||
|
|
a8d293999e | ||
|
|
3ae526ff72 | ||
|
|
e99e44ee91 | ||
|
|
ea55e0463b | ||
|
|
b6a953cb1d | ||
|
|
38aa0618d0 | ||
|
|
14963a21c4 | ||
|
|
943cf646bf | ||
|
|
693caf6781 | ||
|
|
aed3f29598 | ||
|
|
22a806d699 | ||
|
|
baef3b8868 | ||
|
|
a7197084c5 | ||
|
|
d50f86a9c7 | ||
|
|
2d6eff9cb3 | ||
|
|
d9bd770a4a | ||
|
|
9a3bdf18d9 | ||
|
|
be6d7d7c88 | ||
|
|
1b789ec3c3 | ||
|
|
7b6046b682 | ||
|
|
6877941188 | ||
|
|
364f9886f7 | ||
|
|
692c301dc0 | ||
|
|
b154022100 | ||
|
|
89e71dce76 | ||
|
|
beb561a94f | ||
|
|
59b4ace20b | ||
|
|
95d27786dd | ||
|
|
3bef81c23e | ||
|
|
80fd44728b | ||
|
|
63cfa6e17d | ||
|
|
02d646e9aa | ||
|
|
e0c72a81d4 | ||
|
|
25d2497a47 | ||
|
|
892d46e640 | ||
|
|
e55c22d45a | ||
|
|
3c82f6894e | ||
|
|
b80f2c45df | ||
|
|
6e6ca1ef7d | ||
|
|
3148354640 | ||
|
|
15502a1d6d | ||
|
|
ab312ec9fe | ||
|
|
2b13f21908 | ||
|
|
8ef3e48492 | ||
|
|
df1c6b4fa7 | ||
|
|
37600ac2d9 | ||
|
|
140b041164 | ||
|
|
17f5d9e2b1 | ||
|
|
646424347e | ||
|
|
427f2996e0 | ||
|
|
83f28cb49b | ||
|
|
902a3e9ebe | ||
|
|
ca916c9455 | ||
|
|
16968ee2ef | ||
|
|
89f6330e48 | ||
|
|
597830850b | ||
|
|
e1e57b99c0 | ||
|
|
e7aed3250b | ||
|
|
60eea0e176 | ||
|
|
e1cc30b9db | ||
|
|
24e519bbe6 | ||
|
|
066c735967 | ||
|
|
1e935aeda9 | ||
|
|
755a3b97ee | ||
|
|
0032b6834a | ||
|
|
1f0cf7393c | ||
|
|
fb63fdac56 | ||
|
|
6c5870b146 | ||
|
|
e01e4d2f90 | ||
|
|
b6e3df45c8 | ||
|
|
90570fbad3 | ||
|
|
b26f6be364 | ||
|
|
23469665ea | ||
|
|
1874d187d6 | ||
|
|
f1b3dadc54 | ||
|
|
d5f7c00cdd | ||
|
|
9126d92774 | ||
|
|
5dd8ee8f55 | ||
|
|
4ed4e53f46 | ||
|
|
e6f29ecac6 | ||
|
|
6983c9cab9 | ||
|
|
ed4c7b3a2b | ||
|
|
c00fa86d0b | ||
|
|
baff5b46a7 | ||
|
|
be96b6a160 | ||
|
|
640bdfa72b | ||
|
|
3b4917e9e1 | ||
|
|
3596eb284f | ||
|
|
3ca1d0a16c | ||
|
|
aeb9ebda3c | ||
|
|
fb99df8a9f | ||
|
|
09784802d4 | ||
|
|
96011a2294 | ||
|
|
f83f3c83fa | ||
|
|
b18d57923b | ||
|
|
43a38ff1d8 | ||
|
|
a6bad9b029 | ||
|
|
a13a011580 | ||
|
|
d46066a26d | ||
|
|
8b133ef43f | ||
|
|
5e9ba974b4 | ||
|
|
beb6711b82 | ||
|
|
172f33d093 | ||
|
|
b9f57a4c44 | ||
|
|
6f025d1480 | ||
|
|
6e8ed67dc5 | ||
|
|
f68d8878e9 | ||
|
|
170d02f082 | ||
|
|
612c66b010 | ||
|
|
6f8e8e8ea4 | ||
|
|
8c33554a2e | ||
|
|
99175acc30 | ||
|
|
8137754462 | ||
|
|
fd91375007 | ||
|
|
63a8fe5be4 | ||
|
|
6c3ec3130e | ||
|
|
287d7e6597 | ||
|
|
5321cd9f42 | ||
|
|
8e0519f549 | ||
|
|
d82f230069 | ||
|
|
cafd6d82f1 | ||
|
|
1aad8f7bc4 | ||
|
|
5a75870169 | ||
|
|
f98ff9cc5e | ||
|
|
e3add87dc6 | ||
|
|
50f4f1612c | ||
|
|
3c959a32b8 | ||
|
|
e1ebfb255d | ||
|
|
48cb4ad49d | ||
|
|
ddb840d21f | ||
|
|
09840fc138 | ||
|
|
51d56151e6 | ||
|
|
119e5c9ce5 | ||
|
|
490329fad8 | ||
|
|
852c35c068 | ||
|
|
eff86fb645 | ||
|
|
670d855651 | ||
|
|
0bf28fc7d7 | ||
|
|
2053f14d55 | ||
|
|
40fd94d40d | ||
|
|
a6a4c2c934 | ||
|
|
48189efb4b | ||
|
|
f52658609a | ||
|
|
0b9d0fbcdd | ||
|
|
2d9624bbc6 | ||
|
|
f8c728fed9 | ||
|
|
8db6c3c679 | ||
|
|
c97bed87f6 | ||
|
|
913bef8329 | ||
|
|
e0bd8cf89b | ||
|
|
8868eeea98 | ||
|
|
cf0849aed3 | ||
|
|
89051521c9 | ||
|
|
ff9f4b7207 | ||
|
|
a0b63cc67c | ||
|
|
d3cbb31399 | ||
|
|
7212f160ee | ||
|
|
8e26f6e94a | ||
|
|
d66158482a | ||
|
|
112e5d2ef9 | ||
|
|
b60f8ffd00 | ||
|
|
dd51f70f6e | ||
|
|
2ee9743915 | ||
|
|
ebc149a755 | ||
|
|
bda4900ffc | ||
|
|
456a7aa8d4 | ||
|
|
05275bbc0a | ||
|
|
56a45cec9e | ||
|
|
2495e01e1b | ||
|
|
5bbe6c7427 | ||
|
|
36eda14549 | ||
|
|
63187cfe83 | ||
|
|
577e23d961 | ||
|
|
01fd697276 | ||
|
|
df880a55fa | ||
|
|
3f271f9bb6 | ||
|
|
69478a939c | ||
|
|
ed81d609f6 | ||
|
|
1176822d0e | ||
|
|
abae2b77a2 | ||
|
|
6be474c67f | ||
|
|
95c1138a74 | ||
|
|
bff0c82b1e | ||
|
|
0826607897 | ||
|
|
d7e42b0600 | ||
|
|
52cc4971ff | ||
|
|
35fb0e0f4e | ||
|
|
eebe0a9328 | ||
|
|
b708dd9f98 | ||
|
|
ffa0699f89 | ||
|
|
d0d691043e | ||
|
|
801bb5eb4e | ||
|
|
e792af6d45 | ||
|
|
8f47e000b7 | ||
|
|
812f918311 | ||
|
|
a285c3b518 | ||
|
|
7f625e780d | ||
|
|
8d3e0e2231 | ||
|
|
110eeb98c1 | ||
|
|
6e821d02d4 | ||
|
|
e5f8e3cdfc | ||
|
|
558a03d6ce | ||
|
|
a2593c6d61 | ||
|
|
05b6a6ca07 | ||
|
|
3f64adc6bc | ||
|
|
b2c06dd192 | ||
|
|
ee6877c111 | ||
|
|
44ef5b5ab2 | ||
|
|
d20212dea0 | ||
|
|
788d9293a6 | ||
|
|
1874174a70 | ||
|
|
e2a6b6644b | ||
|
|
e8bb1a97e3 | ||
|
|
e2519114b6 | ||
|
|
0148492916 | ||
|
|
7845dab791 | ||
|
|
0f83706c3f | ||
|
|
d05aae5b1c | ||
|
|
a1025fa2c7 | ||
|
|
40163dacf4 | ||
|
|
f20da513b7 | ||
|
|
041d4f9525 | ||
|
|
6ab772238c | ||
|
|
792abcd180 | ||
|
|
ffa8b4b2d4 | ||
|
|
bcd709265e | ||
|
|
62cbeba7fc | ||
|
|
c6e491eada | ||
|
|
3ac005d75a | ||
|
|
a979b7f33e | ||
|
|
678f076f60 | ||
|
|
8bf856505b | ||
|
|
b7933ef7f2 | ||
|
|
41432ca341 | ||
|
|
5bf78a9cba | ||
|
|
51619da8dd | ||
|
|
1d6b585c07 | ||
|
|
226a45b8ff | ||
|
|
6dba614726 | ||
|
|
3ebc095d37 | ||
|
|
3514651f75 | ||
|
|
94d71b1db4 | ||
|
|
61b968c58f | ||
|
|
e045adc4dc | ||
|
|
53b1032e24 | ||
|
|
b19c836e35 | ||
|
|
107f67c3a7 | ||
|
|
2aa63c77e6 | ||
|
|
d339731987 | ||
|
|
b611b35248 | ||
|
|
aaefd75ef3 | ||
|
|
7aae2318f8 | ||
|
|
906cb5624f | ||
|
|
36d44d7897 | ||
|
|
8cceb5ccd7 | ||
|
|
1ba86d879c | ||
|
|
cf930ef66a | ||
|
|
b1138f5b68 | ||
|
|
da7f9ffbc6 | ||
|
|
5ec8bbf5a0 | ||
|
|
8ffbf4e053 | ||
|
|
f82257d2cb | ||
|
|
695f6425c5 | ||
|
|
57f76ccb20 | ||
|
|
f100a7ba81 | ||
|
|
fbf683480b | ||
|
|
d79bf3724b | ||
|
|
cd2d1c448c | ||
|
|
819014983c | ||
|
|
579e34bd50 | ||
|
|
77ed38127e | ||
|
|
65311bbd6c | ||
|
|
da16cc95ad | ||
|
|
22842034ae | ||
|
|
ffa6724397 | ||
|
|
7b66511566 | ||
|
|
2ca5c83542 | ||
|
|
26703b0014 | ||
|
|
4b6222b118 | ||
|
|
7b765d8fdc | ||
|
|
ec974f8648 | ||
|
|
c79856b81e | ||
|
|
22eb038a9e | ||
|
|
7b40c11df4 | ||
|
|
64ac7f5d64 | ||
|
|
aa8f02aa3e | ||
|
|
e27566deb5 | ||
|
|
53a4e125ca | ||
|
|
fbece132b0 | ||
|
|
dd1328f2c1 | ||
|
|
7b841fca84 | ||
|
|
dd3233ff34 | ||
|
|
d2c159590d | ||
|
|
c85849651f | ||
|
|
dba8f4f3c4 | ||
|
|
ee64c2051b | ||
|
|
0ed14899f9 | ||
|
|
5452ed2a96 | ||
|
|
718026c513 | ||
|
|
c2dab28d51 | ||
|
|
1bd11a988c | ||
|
|
e3d708f4a9 | ||
|
|
9b8c1b4e1e | ||
|
|
97b3f9af38 | ||
|
|
a04760272b | ||
|
|
64c349b75f | ||
|
|
7e8cc2d137 | ||
|
|
084bc5a6cd | ||
|
|
fa90157c36 | ||
|
|
948ad064e3 | ||
|
|
fd71f70d22 | ||
|
|
38bf8af185 | ||
|
|
6c07625302 | ||
|
|
2526f1465f | ||
|
|
299990833f | ||
|
|
a60d6732f0 | ||
|
|
b0a53cd5b0 | ||
|
|
2fb58192a9 | ||
|
|
2fa1b2158c | ||
|
|
4705cd7078 | ||
|
|
643f2070c4 | ||
|
|
8b6da9b8bf | ||
|
|
d9788dba84 | ||
|
|
167ac2d2d5 | ||
|
|
a2e8d82562 | ||
|
|
3538ab525c | ||
|
|
810008d84b | ||
|
|
59aae8a055 | ||
|
|
386264b689 | ||
|
|
fa0f3317f2 | ||
|
|
e8798391d4 | ||
|
|
fbdba4a2c6 | ||
|
|
4e10ff5a38 | ||
|
|
85fe148d92 | ||
|
|
8ee8fc9e6b | ||
|
|
65941ee574 | ||
|
|
8ca03b5dd7 | ||
|
|
00c9b053b1 | ||
|
|
613da05a40 | ||
|
|
3cb5318aa4 | ||
|
|
acf81e46e5 | ||
|
|
e6efc49ddc | ||
|
|
0078564a06 | ||
|
|
b5c7bde5ac | ||
|
|
b8b3f57790 | ||
|
|
ee73e7609c | ||
|
|
5ce0a7ea4e | ||
|
|
a07d3cc7fc | ||
|
|
10f2268b1e | ||
|
|
0c96e22845 | ||
|
|
17ca363515 | ||
|
|
76816c4f8e | ||
|
|
db114a17b1 | ||
|
|
1b14ff8d9a | ||
|
|
b84ba22c8f | ||
|
|
8ca3df6d5c | ||
|
|
bf6be133c5 | ||
|
|
8fcf9e13f7 | ||
|
|
3caa2f8d7c | ||
|
|
7937bbcb21 | ||
|
|
aeb8ad36a7 | ||
|
|
604879eac1 | ||
|
|
7419ed762f | ||
|
|
c0cc7d119f | ||
|
|
4d615dafd4 | ||
|
|
12fd336f8a | ||
|
|
983a511329 | ||
|
|
3b5ebf8f24 | ||
|
|
f41174fd43 | ||
|
|
587c980621 | ||
|
|
78812d47f2 | ||
|
|
b8c4f73da2 | ||
|
|
48412e2c92 | ||
|
|
4a68fac639 | ||
|
|
4739feb8ff | ||
|
|
2eed3b87d4 | ||
|
|
e1caa6ebe8 | ||
|
|
7ca1ed1d4e | ||
|
|
658e141dd5 | ||
|
|
62bd414ed7 | ||
|
|
bbe771dc1b | ||
|
|
68094ee2d9 | ||
|
|
2884cdb808 | ||
|
|
6c405305b9 | ||
|
|
99befd7582 | ||
|
|
45eb731d30 | ||
|
|
37057885b9 | ||
|
|
cc21ce7b9b | ||
|
|
2472363b05 | ||
|
|
3169d5826f | ||
|
|
e14dcc4f48 | ||
|
|
467b32a324 | ||
|
|
f6b019bbff | ||
|
|
b3310992db | ||
|
|
5a0c35d4e7 | ||
|
|
950952e16c | ||
|
|
53f4cd9ead | ||
|
|
7c2e440b4e | ||
|
|
f799924d9b | ||
|
|
72acbd0ecf | ||
|
|
dd26bd55ea | ||
|
|
bb5d155b08 | ||
|
|
a7dbfad774 | ||
|
|
fbc16dc868 | ||
|
|
a93cbdcab6 | ||
|
|
fe5d34c360 | ||
|
|
ee7ca9cd22 | ||
|
|
1380ae172f | ||
|
|
671d72c5bc | ||
|
|
23b06335d7 | ||
|
|
7981c87b0c | ||
|
|
77a7dbf6c0 | ||
|
|
676716494d | ||
|
|
36ceaa34e8 | ||
|
|
7b1e14214a | ||
|
|
5a480f80e1 | ||
|
|
0ddf11c357 | ||
|
|
d39e342b3b | ||
|
|
14479cbee8 | ||
|
|
7b00ccc9d3 | ||
|
|
549f5d19b5 | ||
|
|
6d45acf7fb | ||
|
|
2b9dd49634 | ||
|
|
38cfee1437 | ||
|
|
86c00934d8 | ||
|
|
0c1edc9626 | ||
|
|
f49687fc1c | ||
|
|
711ce7179d | ||
|
|
f161d855a4 | ||
|
|
cd73d929fd | ||
|
|
c18dfa0335 | ||
|
|
2fbf3cc669 | ||
|
|
b4c8a6e1fb | ||
|
|
0f5ff16afe | ||
|
|
8f215d1f5f | ||
|
|
6cf152a151 | ||
|
|
c0846a26cc | ||
|
|
9b61fd611e | ||
|
|
1c10a7b1ff | ||
|
|
0a7d51dcfb | ||
|
|
fd91aebd42 | ||
|
|
37e1477948 | ||
|
|
f443ce6580 | ||
|
|
4a9f39137c | ||
|
|
903d7140f1 | ||
|
|
f3448ff13c | ||
|
|
86aced1930 | ||
|
|
9e9005099c | ||
|
|
55f03641aa | ||
|
|
ed5a5327f9 | ||
|
|
2eb5f55f9f | ||
|
|
546e02f713 | ||
|
|
0a60709ea1 | ||
|
|
523d2d0de3 | ||
|
|
8732cbc131 | ||
|
|
6e59f0cc83 | ||
|
|
d90ed6d198 | ||
|
|
2c997233f4 | ||
|
|
86203e1292 | ||
|
|
845ca36f5b | ||
|
|
663a5beeae | ||
|
|
e926beb206 | ||
|
|
edda79aa6d | ||
|
|
e712053603 | ||
|
|
98e0bb6d1d | ||
|
|
ff553f7c36 | ||
|
|
91d6cdb099 | ||
|
|
9a20625f07 | ||
|
|
8d19836739 | ||
|
|
05fddebb9c | ||
|
|
30f582e908 | ||
|
|
3d026d1b59 | ||
|
|
0b4db32b53 | ||
|
|
4e65ce5635 | ||
|
|
5586c00385 | ||
|
|
937e3777f4 | ||
|
|
21a06e9011 | ||
|
|
7f905d4e61 | ||
|
|
e85813902d | ||
|
|
bc15d09557 | ||
|
|
4703656bf8 | ||
|
|
0508d56c78 | ||
|
|
885ddc7b39 | ||
|
|
5c5867c2c0 | ||
|
|
6747c35e8b | ||
|
|
dbdb98a514 | ||
|
|
af9507e373 | ||
|
|
a36060125e | ||
|
|
1081d3e6e8 | ||
|
|
03842af13d | ||
|
|
4f518b6e52 | ||
|
|
e7a273e9c8 | ||
|
|
e4bee97168 | ||
|
|
782371d2ca | ||
|
|
96b1c05ca0 | ||
|
|
46bb00b8e9 | ||
|
|
6f38008240 | ||
|
|
51fe97b5ac | ||
|
|
3be1dda845 | ||
|
|
b703b95048 | ||
|
|
2fea17d261 | ||
|
|
c21d15dde6 | ||
|
|
2f48781396 | ||
|
|
4f775a04fd | ||
|
|
699273b08a | ||
|
|
460253d5d3 | ||
|
|
9ee0aabf7b | ||
|
|
f5301595cc | ||
|
|
86accdee86 | ||
|
|
9a5b5fdc8d | ||
|
|
60630a8435 | ||
|
|
ce088d8ee4 | ||
|
|
065bd3dde0 | ||
|
|
410c81c36c | ||
|
|
1bd416dcce | ||
|
|
517886234e | ||
|
|
7208f1b352 | ||
|
|
ab85561833 | ||
|
|
1c6ec1b47e | ||
|
|
257d1c02b0 | ||
|
|
036be03459 | ||
|
|
4974ab6535 | ||
|
|
c3f1068edf | ||
|
|
6a4ade5093 | ||
|
|
0ef1501a53 | ||
|
|
ae744d05c8 | ||
|
|
be8eaa57c7 | ||
|
|
1f7d83e5c4 | ||
|
|
7b7875fa24 | ||
|
|
00fa73551c | ||
|
|
144ab609c5 | ||
|
|
55f6620e0f | ||
|
|
f6de7f4298 | ||
|
|
6a706c6f8a | ||
|
|
4ffc987f07 | ||
|
|
7abc4086b0 | ||
|
|
fb241c5cb9 | ||
|
|
28d9cf2a52 | ||
|
|
b4479a2e4f | ||
|
|
02e5c3c9b7 | ||
|
|
ce9e0cfd04 | ||
|
|
b42d7d7d17 | ||
|
|
3273f7ec7a | ||
|
|
991474debd | ||
|
|
cde48162ea | ||
|
|
a63e637b55 | ||
|
|
95d2eb374d | ||
|
|
d1cedf57ad | ||
|
|
e0641d165d | ||
|
|
2d88e43139 | ||
|
|
265aca3724 | ||
|
|
864f824d7b | ||
|
|
ea247333d0 | ||
|
|
6f29ca0d8f | ||
|
|
83dd7b5914 | ||
|
|
3a763fb12b | ||
|
|
d0eedc7faf | ||
|
|
b01cfaf9c4 | ||
|
|
f4864c7e5e | ||
|
|
05387bf915 | ||
|
|
b3a3d88b1d | ||
|
|
fec780e3d8 | ||
|
|
ab92d12108 | ||
|
|
8cfe4fd626 | ||
|
|
fb188b51a2 | ||
|
|
0ec9573bef | ||
|
|
404d11aad4 | ||
|
|
4c4b24e573 | ||
|
|
f8077d6084 | ||
|
|
9b9dc35580 | ||
|
|
927def4ed3 | ||
|
|
0d5d03d580 | ||
|
|
f0219dc7a6 | ||
|
|
a538ed2291 | ||
|
|
54cf5ae7d6 | ||
|
|
2b7f5f5e60 | ||
|
|
913aad2d6b | ||
|
|
7078f1b8a1 | ||
|
|
f2b34b29a3 | ||
|
|
29d66dc202 | ||
|
|
c901ba43c8 | ||
|
|
0273f1a940 | ||
|
|
c52d6d66ce | ||
|
|
e35512bd9d | ||
|
|
64bcc201ee | ||
|
|
319e384239 | ||
|
|
1a41b53a49 | ||
|
|
08997048e0 | ||
|
|
210fb23e57 | ||
|
|
4e2afb23e2 | ||
|
|
9e9fa712ef | ||
|
|
6819e05642 | ||
|
|
9559659d15 | ||
|
|
a8704bb862 | ||
|
|
e00b601f12 | ||
|
|
c0516089db | ||
|
|
8a751e4a2e | ||
|
|
6821899c84 | ||
|
|
dd08f96419 | ||
|
|
53a7deff9a | ||
|
|
74bb69b69d | ||
|
|
f5a747527e | ||
|
|
5aa369cdad | ||
|
|
5bc90917a6 | ||
|
|
232367afca | ||
|
|
87dd61b269 | ||
|
|
81e9bfa848 | ||
|
|
627ffed461 | ||
|
|
6721a575e7 | ||
|
|
13c7d43920 | ||
|
|
dbd9f16627 | ||
|
|
7037991d56 | ||
|
|
45465d8ad2 | ||
|
|
aa07356b07 | ||
|
|
e0b2b580b7 | ||
|
|
35b060bb7a | ||
|
|
d267bbc213 | ||
|
|
bb7a03e1e9 | ||
|
|
46c6392b82 | ||
|
|
3e374232f2 | ||
|
|
59b6a4050a | ||
|
|
116b953085 | ||
|
|
3c85e0b745 | ||
|
|
008b194cee | ||
|
|
4e1d5982b1 | ||
|
|
d222a6df83 | ||
|
|
7f3cac14bc | ||
|
|
ef600c09c9 | ||
|
|
688d036b34 | ||
|
|
aa948748e9 | ||
|
|
40981a8063 | ||
|
|
f3c491c01b | ||
|
|
b5753af639 | ||
|
|
4d780df455 | ||
|
|
c71fd90868 | ||
|
|
0db63172c6 | ||
|
|
295782cfb8 | ||
|
|
ccc1dd65cc | ||
|
|
a541da064a | ||
|
|
a2de7ac376 | ||
|
|
8cff328e92 | ||
|
|
7c2072ee1f | ||
|
|
8052b16ca1 | ||
|
|
10765dfddb | ||
|
|
13fc438a62 | ||
|
|
0b7f8186ed | ||
|
|
e57df86a00 | ||
|
|
878100ef1b | ||
|
|
64d92dc3b3 | ||
|
|
ec5c0afa29 | ||
|
|
2b0109127f | ||
|
|
462bf51dce | ||
|
|
bf0943066a | ||
|
|
0153486afb | ||
|
|
c8e8b3949e | ||
|
|
6eda663bcf | ||
|
|
ef0864c084 | ||
|
|
12b8f46bd8 | ||
|
|
ab0c9eb5bd | ||
|
|
d2ff015c1c | ||
|
|
5bb12ce6e8 | ||
|
|
5135028df4 | ||
|
|
1728a2bd8f | ||
|
|
263f6edd05 | ||
|
|
c4fd6449fc | ||
|
|
5fa5b97399 | ||
|
|
b6896898ec | ||
|
|
6bde9b97af | ||
|
|
ecf0d4e732 | ||
|
|
b1fc706a6a | ||
|
|
24718ec243 | ||
|
|
c876874cf5 | ||
|
|
a3cdc98031 | ||
|
|
cc995da6af | ||
|
|
a41d4f7885 | ||
|
|
a6e90ac65e | ||
|
|
59e31663c4 | ||
|
|
bf759da599 | ||
|
|
49753de8b8 | ||
|
|
763e5605cf | ||
|
|
7555119b03 | ||
|
|
8b5a60d79e | ||
|
|
bb329afea0 | ||
|
|
62984d1026 | ||
|
|
034ecff647 | ||
|
|
58b8e167ca | ||
|
|
653fed53bb | ||
|
|
8e05cdaecb | ||
|
|
1e8d8ce91a | ||
|
|
3f310ecede | ||
|
|
f14bf295c7 | ||
|
|
7a8586a6d7 | ||
|
|
8acf9ececb | ||
|
|
4ea3900941 | ||
|
|
ca81ddc4d9 | ||
|
|
5a55b4d4dc | ||
|
|
4e3c75b17b | ||
|
|
0478306149 | ||
|
|
3b40e07088 | ||
|
|
e38e8cf01a | ||
|
|
b0462076ea | ||
|
|
53e5c9b53d | ||
|
|
f19d4631b0 | ||
|
|
96f8d25e47 | ||
|
|
e3f01f83da | ||
|
|
ff18028781 | ||
|
|
9c0c4e6da0 | ||
|
|
cfc7bfd02e | ||
|
|
ce96cef6ec | ||
|
|
c3c69c7e1f | ||
|
|
7dd977f525 | ||
|
|
7fb2d0686e | ||
|
|
8c8be278ea | ||
|
|
f4b71bd0be | ||
|
|
d8515b15a2 | ||
|
|
049f244a95 | ||
|
|
0dc6af17a3 | ||
|
|
078ce0860d | ||
|
|
184bdd3dd1 | ||
|
|
5e165319e5 | ||
|
|
47357b2baa | ||
|
|
f5301faafb | ||
|
|
f1d05cd70e | ||
|
|
edca2ea538 | ||
|
|
6778ad4f6e | ||
|
|
eb096e257c | ||
|
|
6df743041f | ||
|
|
38cf01b66e | ||
|
|
4cb6744e01 | ||
|
|
9ee3520634 | ||
|
|
b16942cb2e | ||
|
|
72d1956643 | ||
|
|
8293bcf978 | ||
|
|
c6e1e039bb | ||
|
|
bc998e4902 | ||
|
|
9bbde2199f | ||
|
|
9c991631f0 | ||
|
|
52f534cf43 | ||
|
|
270cfc19bc | ||
|
|
9bed2f4bcc | ||
|
|
e3736bb4e4 | ||
|
|
4a8ace53cc | ||
|
|
d0374037fa | ||
|
|
4850da4acb | ||
|
|
ba161b98eb | ||
|
|
d1ff5c2400 | ||
|
|
442d7d5b70 | ||
|
|
29f93616ff | ||
|
|
aa7b5aeb77 | ||
|
|
ec4f3f98f5 | ||
|
|
38ca800031 | ||
|
|
650a48b8a5 | ||
|
|
b16231698b | ||
|
|
13bef6c4b6 | ||
|
|
f6b0ca7754 | ||
|
|
f4489f4afb | ||
|
|
209da3da03 | ||
|
|
773a26fb1b | ||
|
|
bf2d6dcb5f | ||
|
|
b5adf5b949 | ||
|
|
cd4b28cc59 | ||
|
|
ff2fc2e888 | ||
|
|
f7f9d709b5 | ||
|
|
a63bd7ffbf | ||
|
|
401cd76c2d | ||
|
|
4cef1b1a24 | ||
|
|
7775e3889d | ||
|
|
1f132c7adc | ||
|
|
af9eab239d | ||
|
|
43a5802652 | ||
|
|
23743558ad | ||
|
|
cd6bd95445 | ||
|
|
5ecec67bf2 | ||
|
|
e8bcf55546 | ||
|
|
83bc2649a0 | ||
|
|
6102d7bf43 | ||
|
|
c1b9a158a0 | ||
|
|
a79980daf2 | ||
|
|
b7d8577023 | ||
|
|
874db89c8a | ||
|
|
f41356f683 | ||
|
|
c285d53404 | ||
|
|
b82081769f | ||
|
|
89969d2101 | ||
|
|
73f53e1f9c | ||
|
|
5aff0583f7 | ||
|
|
a4efe0aa3c | ||
|
|
313e46153f | ||
|
|
e76e21d986 | ||
|
|
0d19298f4b | ||
|
|
4bc67b33f5 | ||
|
|
5ee2b96938 | ||
|
|
f6ee7f6ab4 | ||
|
|
4f3300fa17 | ||
|
|
db9a402bd8 | ||
|
|
6ce5c5ca7d | ||
|
|
8805d1a3f1 | ||
|
|
d2bc88896c | ||
|
|
3e56b73283 | ||
|
|
dc2754bf39 | ||
|
|
9f9f0270a8 | ||
|
|
a0dbca0816 | ||
|
|
323d991308 | ||
|
|
94f58586b7 | ||
|
|
9c05d6e18b | ||
|
|
fdeae7b28f | ||
|
|
399eb27360 | ||
|
|
39a8e0c766 | ||
|
|
e098c55223 | ||
|
|
bf80696a80 | ||
|
|
bc560cf9af | ||
|
|
e73635339d | ||
|
|
d341d95372 | ||
|
|
e1ff78240e | ||
|
|
ae38ad904b | ||
|
|
3f07bfc52d | ||
|
|
a1c11bdb32 | ||
|
|
4a4b3fae3b | ||
|
|
5e435f2cd7 | ||
|
|
eac28232a9 | ||
|
|
6af04f4232 | ||
|
|
96c007274d | ||
|
|
fd4bdb6f4a | ||
|
|
be18f7304b | ||
|
|
eebcf78aaf | ||
|
|
1328545320 | ||
|
|
303c7bca17 | ||
|
|
56875aec85 | ||
|
|
1e3afd8c12 | ||
|
|
c1fcf95a49 | ||
|
|
02964cd38e | ||
|
|
ff3a06cf71 | ||
|
|
17c98f18e4 | ||
|
|
0f25adfd83 | ||
|
|
5dcfd8ce2a | ||
|
|
cd3b0d9e08 | ||
|
|
e0724ed92c | ||
|
|
cf7c8e66bb | ||
|
|
cafb520b29 | ||
|
|
2e21799cc8 | ||
|
|
911f910990 | ||
|
|
0b91daba21 | ||
|
|
eed13a6869 | ||
|
|
b5798a8096 | ||
|
|
b30f2eadc1 | ||
|
|
14a3455ee8 | ||
|
|
3e06cece23 | ||
|
|
264a27e82b | ||
|
|
32a627d980 | ||
|
|
17c93f91d4 | ||
|
|
70e6261a98 | ||
|
|
bd8a2ee886 | ||
|
|
5af96ea1ce | ||
|
|
09432c2247 | ||
|
|
d85c049ee3 | ||
|
|
40ae3a2866 | ||
|
|
12fa8eba2c | ||
|
|
8476d5bebe | ||
|
|
4f9dcbbd42 | ||
|
|
2db6c4a459 | ||
|
|
7c3ac7066e | ||
|
|
3355bf13b3 | ||
|
|
f2fabb392e | ||
|
|
e209727448 | ||
|
|
27762ce24d | ||
|
|
335bf74e89 | ||
|
|
fece54bfb4 | ||
|
|
7994bc2384 | ||
|
|
a10e3be350 | ||
|
|
7af5574bf9 | ||
|
|
9cf913dc3a | ||
|
|
14360ed869 | ||
|
|
02156ebb0c | ||
|
|
a16e399ae1 | ||
|
|
7a658d4712 | ||
|
|
0b6c1ef843 | ||
|
|
54ed65fb9d | ||
|
|
3289bbabb8 | ||
|
|
219ec7278a | ||
|
|
2b7b020b51 | ||
|
|
28a768a8f5 | ||
|
|
66d2614d82 | ||
|
|
2b5857a955 | ||
|
|
4de3bf3fef | ||
|
|
852a7da8eb | ||
|
|
7bc25bc952 | ||
|
|
268ee6ba0f | ||
|
|
117cbb4561 | ||
|
|
7b550516cc | ||
|
|
eec8880bd5 | ||
|
|
69ae0eaa1b | ||
|
|
4c4b2e8510 | ||
|
|
649ca6452e | ||
|
|
fe13df4806 | ||
|
|
46f7ee6e33 | ||
|
|
948f38b2ac | ||
|
|
ac9a339d47 | ||
|
|
371f4e814a | ||
|
|
e8e9d7a38a | ||
|
|
907947a02e | ||
|
|
b40a18f591 | ||
|
|
007b04eaf0 | ||
|
|
09a4931ba1 | ||
|
|
0da24487c9 | ||
|
|
7ff2bbdbbf | ||
|
|
13ef0ca3fe | ||
|
|
801afef4e5 | ||
|
|
124df0612c | ||
|
|
f2eb22be4c | ||
|
|
256feb33c7 | ||
|
|
5b39e69317 | ||
|
|
87ed43301c | ||
|
|
3c628e95dd | ||
|
|
21a40cc685 | ||
|
|
cbe1c991cc | ||
|
|
f68d1dd308 | ||
|
|
bbe22ea5a2 | ||
|
|
8d29464ed3 | ||
|
|
c97c525d74 | ||
|
|
c6536af73d | ||
|
|
a903486c71 | ||
|
|
725a178708 | ||
|
|
12cbc7d47b | ||
|
|
620c63c6b0 | ||
|
|
bcd61de277 | ||
|
|
53cb5cc3e8 | ||
|
|
839835fcba | ||
|
|
466cd719d7 | ||
|
|
ee9a44b957 | ||
|
|
1b2df5ff5d | ||
|
|
3db8613a43 | ||
|
|
499564694c | ||
|
|
88eb57d63d | ||
|
|
4aeeac2e65 | ||
|
|
ce2031704f | ||
|
|
f2558002f0 | ||
|
|
99958533ef | ||
|
|
b6e6080f36 | ||
|
|
96df05800c | ||
|
|
625db77e00 | ||
|
|
96d9cad344 | ||
|
|
12f165e08d | ||
|
|
d96143eab2 | ||
|
|
673b1b082f | ||
|
|
3a15195178 | ||
|
|
59c632f628 | ||
|
|
1d54b13f6d | ||
|
|
2e9408efa9 | ||
|
|
02ec0426f0 | ||
|
|
5bc4a68a71 | ||
|
|
3682278967 | ||
|
|
ff40ff6e91 | ||
|
|
f329411768 | ||
|
|
7988229cba | ||
|
|
67eb0aa7ca | ||
|
|
cd25bb9fa9 | ||
|
|
503029581a | ||
|
|
5b3d638048 | ||
|
|
edf4905733 | ||
|
|
09de23dd26 | ||
|
|
b96bcc2e2b | ||
|
|
14d740afe3 | ||
|
|
7ac4fc6ccc | ||
|
|
af3e4b144f | ||
|
|
5aed8be27e | ||
|
|
27516baf54 | ||
|
|
2609f159ab | ||
|
|
d06535bf92 | ||
|
|
bb930cd341 | ||
|
|
c27a03623b | ||
|
|
33f850b0f7 | ||
|
|
8a2a93c543 | ||
|
|
235f83acfb | ||
|
|
ab36ae88d6 | ||
|
|
56c95f6891 | ||
|
|
21435c8850 | ||
|
|
93a5392028 | ||
|
|
7464b5fce3 | ||
|
|
521ec62b4d | ||
|
|
4fa9639802 | ||
|
|
eef39ba079 | ||
|
|
dcf816118f | ||
|
|
1056ad043c | ||
|
|
3864b54b0f | ||
|
|
dd21ff29db | ||
|
|
daaf9dc02e | ||
|
|
89d16721df | ||
|
|
90b752fb81 | ||
|
|
8d6b16b200 | ||
|
|
fd0dafcbd2 | ||
|
|
8141c9f197 | ||
|
|
58450ea856 | ||
|
|
4a22870377 | ||
|
|
75f4c8d01e | ||
|
|
5a235f92d0 | ||
|
|
dfa722d6a9 | ||
|
|
532acde4c3 | ||
|
|
b4cdd15901 | ||
|
|
12c70a0fda | ||
|
|
916ad56431 | ||
|
|
bea6f015a4 | ||
|
|
f616d89f5c | ||
|
|
63502600aa | ||
|
|
b56ed10424 | ||
|
|
6b0ba2afed | ||
|
|
bd779697b7 | ||
|
|
094f76f5e5 | ||
|
|
e7601b1fb7 | ||
|
|
9b2c051758 | ||
|
|
59ec169a9d | ||
|
|
59dd27f209 | ||
|
|
505823afbb | ||
|
|
6f98f3600d | ||
|
|
950532604e | ||
|
|
2d20c4e465 | ||
|
|
2e63cbfb56 | ||
|
|
a78d875434 | ||
|
|
3acbf33046 | ||
|
|
cd560f1ae1 | ||
|
|
baf25450ed | ||
|
|
6965c7190a | ||
|
|
ff3d416664 | ||
|
|
2bb47a5c55 | ||
|
|
943f2bdea3 | ||
|
|
b91bc9dfe8 | ||
|
|
8f096c4aa6 | ||
|
|
8e5709fa90 | ||
|
|
6e68b488d0 | ||
|
|
34a1e8266b | ||
|
|
b814961559 | ||
|
|
87642f513d | ||
|
|
586c87233f | ||
|
|
1d7832c152 | ||
|
|
78a81f34c3 | ||
|
|
0a8f78858f | ||
|
|
2c3d0fd8ec | ||
|
|
79174381b3 | ||
|
|
bb8a890194 | ||
|
|
c609433c8f | ||
|
|
b1c9102a8f | ||
|
|
ee66844d9c | ||
|
|
eca2e41c99 | ||
|
|
70fc130f4a | ||
|
|
68d7f4ab41 | ||
|
|
45765a3932 | ||
|
|
4de88035be | ||
|
|
e1fea2032a | ||
|
|
a0ef939648 | ||
|
|
9ea2c8c8e5 | ||
|
|
4285132852 | ||
|
|
9c79a8d09c | ||
|
|
fcf026104c | ||
|
|
7baad81b84 | ||
|
|
f72b834d12 | ||
|
|
2c8efbbcb9 | ||
|
|
d20b539f06 | ||
|
|
66d7659e9a | ||
|
|
8995b04a22 | ||
|
|
4d74da147a | ||
|
|
4a6f357b73 | ||
|
|
e2a9ed7bb0 | ||
|
|
ecd1153238 | ||
|
|
2f5d5774be | ||
|
|
8752da1c06 | ||
|
|
a6de3f83ba | ||
|
|
4f2e9c6409 | ||
|
|
09bbf1a2ed | ||
|
|
25ecadf0d5 | ||
|
|
ca2dfda207 | ||
|
|
6e3f402dec | ||
|
|
7944608267 | ||
|
|
1663df1263 | ||
|
|
3fbc8655de | ||
|
|
81bc7a3a39 | ||
|
|
1d530522b0 | ||
|
|
a33535e073 | ||
|
|
7e9806e697 | ||
|
|
b814c76135 | ||
|
|
4b9098769e | ||
|
|
f8725f5cd2 | ||
|
|
ad54d797d1 | ||
|
|
8fe23adba0 | ||
|
|
21fa83b749 | ||
|
|
5458ae642a | ||
|
|
df7cdf6608 | ||
|
|
d25ac0990f | ||
|
|
498736ec22 | ||
|
|
d42944e3b5 | ||
|
|
1ab6f93358 | ||
|
|
3f3262a82b | ||
|
|
75464abd73 | ||
|
|
a017fe9a9f | ||
|
|
3cfc853d10 | ||
|
|
b516bbf7fd | ||
|
|
2b7ea316d1 | ||
|
|
a59219ea66 | ||
|
|
4fec94f580 | ||
|
|
d50c4a4f82 | ||
|
|
ca65482ca8 | ||
|
|
4bac9f6c71 | ||
|
|
332f890b11 | ||
|
|
38a7f78dd7 | ||
|
|
38b0742a4a | ||
|
|
03a966d66d | ||
|
|
e1d81e40cb | ||
|
|
ef1da986b5 | ||
|
|
8b144fe4de | ||
|
|
db18965bff | ||
|
|
59ba947489 | ||
|
|
d0abdde209 | ||
|
|
81c27e1a0a | ||
|
|
d7d438e067 | ||
|
|
bc9afbd20c | ||
|
|
b9032ccf2e | ||
|
|
5bab8053b2 | ||
|
|
b1e064a5db | ||
|
|
8eb09c9992 | ||
|
|
1f583c3cbe | ||
|
|
99ea5dc070 | ||
|
|
07d2decb11 | ||
|
|
e23c362cf3 | ||
|
|
4c9a19b81a | ||
|
|
17fe445d50 | ||
|
|
87bbd07ecf | ||
|
|
1803f77325 | ||
|
|
4b6c7319bd | ||
|
|
1c49ccaf23 | ||
|
|
15d921e21d | ||
|
|
515f8b2c5f | ||
|
|
295a6f8753 | ||
|
|
3799d6cfd0 | ||
|
|
13e69e09e9 | ||
|
|
c58f525155 | ||
|
|
f96e41da1d | ||
|
|
6a697a7142 | ||
|
|
023499b2ba | ||
|
|
c921eafe48 | ||
|
|
3c547ebc7a | ||
|
|
4abecee9c7 | ||
|
|
c9d4a1bbac | ||
|
|
efe817d45a | ||
|
|
1679cea5c5 | ||
|
|
75012b2252 | ||
|
|
bc6059b33c | ||
|
|
a7f78b5650 | ||
|
|
1d7efcd07b | ||
|
|
ec6c219673 | ||
|
|
7a86355a96 | ||
|
|
ac4a1c6b4b | ||
|
|
025c7fa72b | ||
|
|
937ce54362 | ||
|
|
7a86697006 | ||
|
|
4bf790ab3e | ||
|
|
63fc00a077 | ||
|
|
549e244605 | ||
|
|
99d5cf63f8 | ||
|
|
604ab8f603 | ||
|
|
6840318470 | ||
|
|
b6a9c5e671 | ||
|
|
27f471fa07 | ||
|
|
f3686ebbd3 | ||
|
|
aa0eaea4dd | ||
|
|
566ff62cb0 | ||
|
|
739110255b | ||
|
|
f6c6fca5ca | ||
|
|
cb9eae7bed | ||
|
|
913c4b1f8a | ||
|
|
4fe35cbb81 | ||
|
|
b9eea18342 | ||
|
|
0552f8690b | ||
|
|
f06657867a | ||
|
|
0ab8bf1b7a | ||
|
|
b259f13202 | ||
|
|
4d554f413e | ||
|
|
01d187a943 | ||
|
|
e898eee450 | ||
|
|
aeed5b4fa0 | ||
|
|
162908dfdf | ||
|
|
ee97a4528f | ||
|
|
0228156cde | ||
|
|
04a95fb27b | ||
|
|
b5d372ab52 | ||
|
|
32986f40c8 | ||
|
|
e4aa0b7a11 | ||
|
|
c7cd335a2e | ||
|
|
81a98638b0 | ||
|
|
c92502aed1 | ||
|
|
49d4dc78b1 | ||
|
|
9d85c3c3b4 | ||
|
|
d96c26471b | ||
|
|
bdc3630b7a | ||
|
|
f76db36364 | ||
|
|
7f4a95280c | ||
|
|
711041f190 | ||
|
|
21086dcf68 | ||
|
|
2c3b6ac50a | ||
|
|
743c51a4b5 | ||
|
|
61ce039b12 | ||
|
|
f6788e6029 | ||
|
|
a7ed964cb0 | ||
|
|
a91fc84942 | ||
|
|
66ef1f0836 | ||
|
|
f0a3bbf16a | ||
|
|
529fedd95e | ||
|
|
434932d39a | ||
|
|
6601c6621c | ||
|
|
7a65be5fa5 | ||
|
|
0ca0de9663 | ||
|
|
c69ce8ca7a | ||
|
|
9bccb24654 | ||
|
|
0d4ffca813 | ||
|
|
b13e4d022b | ||
|
|
110847e005 | ||
|
|
772424e920 | ||
|
|
57888f783e | ||
|
|
f4ee5356d1 | ||
|
|
035fdaa6ca | ||
|
|
2d4c556bc6 | ||
|
|
58a3157bb3 | ||
|
|
848ebeb747 | ||
|
|
989ba7ee52 | ||
|
|
53e3ec8273 | ||
|
|
dbc1f1f6da | ||
|
|
0d57e73bb4 | ||
|
|
cf4553fa0a | ||
|
|
0af71a9f32 | ||
|
|
6ab3b6cc56 | ||
|
|
ec1de48e42 | ||
|
|
87e43d91f0 | ||
|
|
6104d0602b | ||
|
|
f04b9a6409 | ||
|
|
4fbb831c44 | ||
|
|
9301ea44b1 | ||
|
|
7e7beabb35 | ||
|
|
eb5803fef7 | ||
|
|
24f2cb5cbf | ||
|
|
fb8f3b78ad | ||
|
|
abcaf2ee06 | ||
|
|
03188824f7 | ||
|
|
340e2798a0 | ||
|
|
f9d468f557 | ||
|
|
e71eb3985d | ||
|
|
5adb76e377 | ||
|
|
be0ff90b8a | ||
|
|
cd723f2210 | ||
|
|
93ab1cc811 | ||
|
|
92421d464c | ||
|
|
260ab6e839 | ||
|
|
7e3e43e81a | ||
|
|
3b3056a65f | ||
|
|
5aa1d74b96 | ||
|
|
b9f196c3a1 | ||
|
|
c7a8191e03 | ||
|
|
3a87307bda | ||
|
|
f0ff035546 | ||
|
|
81504417c7 | ||
|
|
771c3e53b7 | ||
|
|
5cc7861d5c | ||
|
|
61f25c94e5 | ||
|
|
8da46bf991 | ||
|
|
26f421418e | ||
|
|
82dbe28b5e | ||
|
|
cc7c740921 | ||
|
|
4396c71802 | ||
|
|
351529d4cf | ||
|
|
eeeca5aa0f | ||
|
|
37c712637c | ||
|
|
3c995514a6 | ||
|
|
5038576b75 | ||
|
|
43952444bb | ||
|
|
1848caf82a | ||
|
|
baff16c024 | ||
|
|
894d540649 | ||
|
|
aef60f179c | ||
|
|
25903aba2d | ||
|
|
42f57797d7 | ||
|
|
30ade6e2a6 | ||
|
|
017147f3f6 | ||
|
|
4c5afa12c7 | ||
|
|
2fa5c743cc | ||
|
|
1702372f0f | ||
|
|
3dc32c1368 | ||
|
|
d6415c301b | ||
|
|
9bd75e6692 | ||
|
|
9dc8c05a73 | ||
|
|
00d1f93472 | ||
|
|
639c6d711b | ||
|
|
bd6176b25f | ||
|
|
e60a065ba4 | ||
|
|
41c9643b38 | ||
|
|
1e9d9ba5a0 | ||
|
|
678f0bd60e | ||
|
|
9bffc02d7f | ||
|
|
9c020dd5f9 | ||
|
|
e159598dc8 | ||
|
|
022b39c25a | ||
|
|
e94e3888bb | ||
|
|
ed2c55e81c | ||
|
|
b861c544a6 | ||
|
|
c72d99a030 | ||
|
|
4a836290b9 | ||
|
|
34a5bfdd3d | ||
|
|
1a072e302e | ||
|
|
e2e496122a | ||
|
|
6ac61f2274 | ||
|
|
a68ee788e1 | ||
|
|
7022a6d298 | ||
|
|
5cda61f8a6 | ||
|
|
b37afbaec1 | ||
|
|
be075ab749 | ||
|
|
6461d6a7e2 | ||
|
|
68130ede6d | ||
|
|
2f7d4a6c91 | ||
|
|
8a6982a144 | ||
|
|
5a2e2f2d6a | ||
|
|
754b4135cc | ||
|
|
966ded3836 | ||
|
|
b9e69dde73 | ||
|
|
f184093732 | ||
|
|
ef844da918 | ||
|
|
a3ac79d999 | ||
|
|
29b25079b8 | ||
|
|
7059375a2f | ||
|
|
062397669f | ||
|
|
c7d1718d97 | ||
|
|
9d875538bf | ||
|
|
6a05dfa694 | ||
|
|
109d20d3fd | ||
|
|
e579d2c683 | ||
|
|
c3a7ae0c22 | ||
|
|
558746add6 | ||
|
|
d51895af57 | ||
|
|
512ffa55bb | ||
|
|
56f2b35ea7 | ||
|
|
3086cee0cc | ||
|
|
66577b193c | ||
|
|
35f28a7c29 | ||
|
|
245279711d | ||
|
|
979f6699cc | ||
|
|
7359653317 | ||
|
|
f311f8525e | ||
|
|
4debf210bd | ||
|
|
1eeae5326f | ||
|
|
ce3624cfbb | ||
|
|
632447e8d3 | ||
|
|
a5917adc1c | ||
|
|
c86ea9fa12 | ||
|
|
539e2b48b2 | ||
|
|
58c2c6eccd | ||
|
|
8eb49dc463 | ||
|
|
cd44b22b8c | ||
|
|
1f7b675d04 | ||
|
|
e89e3d3f35 | ||
|
|
a47b1d427b | ||
|
|
774cc6d6fe | ||
|
|
c740e71900 | ||
|
|
a73eb5d52d | ||
|
|
7dfae900f1 | ||
|
|
edb5e0f7fc | ||
|
|
e9f0353d01 | ||
|
|
bc734f288b | ||
|
|
89f4d927a4 | ||
|
|
54c434c547 | ||
|
|
bb0d148fae | ||
|
|
cd42686824 | ||
|
|
7c9b12113f | ||
|
|
22f88ef718 | ||
|
|
722302bc28 | ||
|
|
188e55450a | ||
|
|
df2edc4bd4 | ||
|
|
c9672599a0 | ||
|
|
6c80f26542 | ||
|
|
7cd6873085 | ||
|
|
254db83bf6 | ||
|
|
6b6bed6c4d | ||
|
|
c11543f5a4 | ||
|
|
31cc95fb7f | ||
|
|
457ffe67de | ||
|
|
d53509ff06 | ||
|
|
6d8a4c7a5b | ||
|
|
e2c19995c2 | ||
|
|
3f10c972cd | ||
|
|
d3730cc0da | ||
|
|
b5b357938e | ||
|
|
805b76f113 | ||
|
|
4c5ae67063 | ||
|
|
8a97330be3 | ||
|
|
623e542f45 | ||
|
|
7350401ddd | ||
|
|
c4db21dd2b | ||
|
|
d713ca59e3 | ||
|
|
b3203ad848 | ||
|
|
89a42be269 | ||
|
|
218e9ec31a | ||
|
|
ba26b64b22 | ||
|
|
33b54e81b0 | ||
|
|
cb64ca4b13 | ||
|
|
e6549f0bf6 | ||
|
|
5466678785 | ||
|
|
8f279dc1b4 | ||
|
|
60c83e78e1 | ||
|
|
e63de8df32 | ||
|
|
053e11c9ba | ||
|
|
fbf48ebefd | ||
|
|
7ef4343f16 | ||
|
|
3e75ec507f | ||
|
|
94a0a4d916 | ||
|
|
ca605edffd | ||
|
|
7177e48d5c | ||
|
|
14c809a9ac | ||
|
|
ad4f4a93c0 | ||
|
|
5add3a5d8a | ||
|
|
f3f8264b53 | ||
|
|
3e30750da7 | ||
|
|
715c2c13b5 | ||
|
|
8d02395657 | ||
|
|
824d3bfebe | ||
|
|
88a0b97224 | ||
|
|
d6f73bc753 | ||
|
|
d1c09cc01a | ||
|
|
d65cde7574 | ||
|
|
afaeb011cf | ||
|
|
fa42a0880e | ||
|
|
2a32052ab0 | ||
|
|
1dba23a93e | ||
|
|
9592b1fd40 | ||
|
|
6deea622bd | ||
|
|
503d653330 | ||
|
|
fe5744f328 | ||
|
|
abcc3ba100 | ||
|
|
0b058bb0d9 | ||
|
|
c62d2ac4f8 | ||
|
|
9a81315b7f | ||
|
|
42f9b80be3 | ||
|
|
57cde24e99 | ||
|
|
f775b2a551 | ||
|
|
756f352c02 | ||
|
|
f574b14ed4 | ||
|
|
ef99f63311 | ||
|
|
62b72b0faa | ||
|
|
c988b7463d | ||
|
|
ee281863ff | ||
|
|
08f78a3151 | ||
|
|
af34bb6a6f | ||
|
|
0e5ed3be50 | ||
|
|
6f3bc269d6 | ||
|
|
68d7ac593b | ||
|
|
ab664d74fb | ||
|
|
aba41f09c0 | ||
|
|
2dc6745fdb | ||
|
|
5820fb202d | ||
|
|
cba20d7835 | ||
|
|
81f8ad902d | ||
|
|
426d76ee50 | ||
|
|
dd82fa0075 | ||
|
|
91b53a4b73 | ||
|
|
12fc5bbde3 | ||
|
|
6cfab2c1f0 | ||
|
|
730b9b2ad9 | ||
|
|
ddbf647524 | ||
|
|
6e9ef3c66e | ||
|
|
1ad6f70b55 | ||
|
|
9e990c337a | ||
|
|
8733055e83 | ||
|
|
e8885dc095 | ||
|
|
0d140c1b46 | ||
|
|
1f29f9dc16 | ||
|
|
505ba76fea | ||
|
|
e76e95c0a4 | ||
|
|
aff4ef43fa | ||
|
|
e4aa506cb4 | ||
|
|
7c5fe215ac | ||
|
|
ced3843c4b | ||
|
|
5f30226d99 | ||
|
|
2e30ef6169 | ||
|
|
3b0093c13c | ||
|
|
3416a47b26 | ||
|
|
d646af45ca | ||
|
|
c69fd51bc9 | ||
|
|
4fb83a9bca | ||
|
|
abf69a9c63 | ||
|
|
436643db9c | ||
|
|
1311a40126 | ||
|
|
dc49df6c0d | ||
|
|
209902466a | ||
|
|
6f0426b285 | ||
|
|
317a0d5224 | ||
|
|
193525cacb | ||
|
|
e32b526e81 | ||
|
|
96751335d3 | ||
|
|
2e6df0af8e | ||
|
|
43d13f5aaf | ||
|
|
6c405da322 | ||
|
|
dce6e317c8 | ||
|
|
fdc76bc5b5 | ||
|
|
2f8840feac | ||
|
|
f98a595620 | ||
|
|
2a7729074a | ||
|
|
40e607c98f | ||
|
|
351395f5b9 | ||
|
|
3e38b59f0c | ||
|
|
079932e34c | ||
|
|
9666b4a42b | ||
|
|
8779c867bf | ||
|
|
d10c90bc79 | ||
|
|
ac83069b99 | ||
|
|
8077d73a9b | ||
|
|
e5357e7dd7 | ||
|
|
f87be175e1 | ||
|
|
316dd9a005 | ||
|
|
6f07b16388 | ||
|
|
b59b42345a | ||
|
|
f80ec0b232 | ||
|
|
0cab88a1fb | ||
|
|
f5b8fe18e1 | ||
|
|
8fb76030b2 | ||
|
|
0234f2d274 | ||
|
|
018955d010 | ||
|
|
ed361efcd3 | ||
|
|
08665869ea | ||
|
|
2b0ad53830 | ||
|
|
f5010a3681 | ||
|
|
072592c49a | ||
|
|
45e55c0eaf | ||
|
|
d32ed24879 | ||
|
|
8c83b5e2d2 | ||
|
|
8a33102408 | ||
|
|
432a51a238 | ||
|
|
39dce2a0e1 | ||
|
|
c58e0a0e92 | ||
|
|
5e30ffc714 | ||
|
|
68a5ef3f85 | ||
|
|
d1bb221096 | ||
|
|
0743e1773b | ||
|
|
fafd1970be | ||
|
|
446ec8b8f6 | ||
|
|
07e561fae8 | ||
|
|
d42a8ba42e | ||
|
|
86a861f1c1 | ||
|
|
73801e5eae | ||
|
|
085444f25f | ||
|
|
81f6540170 | ||
|
|
66d49a7e81 | ||
|
|
9982545c99 | ||
|
|
eaf3b93c8e | ||
|
|
e29d506cf2 | ||
|
|
e4e9c8264c | ||
|
|
7204d0f62a | ||
|
|
60308846f3 | ||
|
|
e8717c0936 | ||
|
|
786518917c | ||
|
|
91195d3c02 | ||
|
|
09608430a9 | ||
|
|
f09e4de87e | ||
|
|
d306941c4f | ||
|
|
288fa379d3 | ||
|
|
66c9e3c65c | ||
|
|
f2586ec7fe | ||
|
|
63a30d96f6 | ||
|
|
99db411ea6 | ||
|
|
b330cb465b | ||
|
|
3c76830ad5 | ||
|
|
2b87578d53 | ||
|
|
a4420961ce | ||
|
|
4d76fabd77 | ||
|
|
457023106c | ||
|
|
e1b000631a | ||
|
|
04531f33c7 | ||
|
|
d3d8e1a5cf | ||
|
|
deb5fa3044 | ||
|
|
18a4a3fc31 | ||
|
|
3f5a7322e5 | ||
|
|
fc4437183d | ||
|
|
1d8068daf0 | ||
|
|
b0d14b4820 | ||
|
|
26caabb8d0 | ||
|
|
9443c835fa | ||
|
|
b981160487 | ||
|
|
9ed30c5658 | ||
|
|
cc7891c11d | ||
|
|
21f9864140 | ||
|
|
de2c50ec7e | ||
|
|
c447ee3568 | ||
|
|
5727be3b3a | ||
|
|
debcf92010 | ||
|
|
0839de2c94 | ||
|
|
c9374383c1 | ||
|
|
1c321bb313 | ||
|
|
4d975a1633 | ||
|
|
6137cc701b | ||
|
|
e15b95c084 | ||
|
|
660bb141aa | ||
|
|
d3981265bb | ||
|
|
d801be3fc1 | ||
|
|
8abff51da2 | ||
|
|
28ad1f2816 | ||
|
|
6bbc15040a | ||
|
|
86cbff2cab | ||
|
|
c3dc7d3711 | ||
|
|
4e3b10ded7 | ||
|
|
1a8e1bc989 | ||
|
|
814d9a651f | ||
|
|
5c9a01be2a | ||
|
|
13fa90a214 | ||
|
|
ae9a1f1cf0 | ||
|
|
21bc191a96 | ||
|
|
aa754996f0 | ||
|
|
631466cfff | ||
|
|
3d64624ad4 | ||
|
|
76a007501a | ||
|
|
cfad7fc743 | ||
|
|
e99dcb3e10 | ||
|
|
0b16a4fb26 | ||
|
|
8586c21312 | ||
|
|
80aa7c3bee | ||
|
|
3cb0a8ac08 | ||
|
|
40a614df0d | ||
|
|
30276f9c2d | ||
|
|
6c62cc373b | ||
|
|
31bf864f78 | ||
|
|
6196676eb3 | ||
|
|
856e2a140f | ||
|
|
d32f0c202f | ||
|
|
cf496728a3 | ||
|
|
2f9c187916 | ||
|
|
a265d0c06b | ||
|
|
4a5c808e21 | ||
|
|
fab8731f50 | ||
|
|
9eda7095e7 | ||
|
|
ee29f65a8e | ||
|
|
d2298e0105 | ||
|
|
f0b318fed3 | ||
|
|
68641758ab | ||
|
|
4302611bf7 | ||
|
|
9310f2e204 | ||
|
|
3685dae146 | ||
|
|
7ed3da2bee | ||
|
|
edfb4ce73a | ||
|
|
f679256612 | ||
|
|
383c38831a | ||
|
|
c3dc844b9a | ||
|
|
a7f909cad0 | ||
|
|
2df97627fe | ||
|
|
5d5492b018 | ||
|
|
741eaafee1 | ||
|
|
f0d7840b51 | ||
|
|
3d62daed59 | ||
|
|
d85b69632f | ||
|
|
c64c80b7fc | ||
|
|
875a8dbe65 | ||
|
|
c3bf90dd44 | ||
|
|
6db893a23d | ||
|
|
db03ab5976 | ||
|
|
55721e9e35 | ||
|
|
3d7b7d5e58 | ||
|
|
8971893e81 | ||
|
|
af68ac46cf | ||
|
|
951ed330a8 | ||
|
|
3babe9d76e | ||
|
|
adf6f1f80c | ||
|
|
ebaf3f9307 | ||
|
|
60f0d56ddf | ||
|
|
f94ddabeef | ||
|
|
74f85680e8 | ||
|
|
60f6b910cd | ||
|
|
e9bf062b55 | ||
|
|
4142896c82 | ||
|
|
70398dda8b | ||
|
|
63bedace6e | ||
|
|
bc677b69ca | ||
|
|
3bb0833704 | ||
|
|
29dad9ac7f | ||
|
|
ea29cc2c20 | ||
|
|
934f752820 | ||
|
|
bd28098db9 | ||
|
|
a1ff2a522d | ||
|
|
7a329c8647 | ||
|
|
f74a04155f | ||
|
|
e95f5f5ad7 | ||
|
|
8ffc1a253d | ||
|
|
b22805843b | ||
|
|
0045bbcd8b | ||
|
|
90ed19b192 | ||
|
|
402ececdde | ||
|
|
4c4b56c1a8 | ||
|
|
7277b7e8ec | ||
|
|
7f1466eeb0 | ||
|
|
fb8ba366ca | ||
|
|
fd5b5cab4e | ||
|
|
62abaf51d7 | ||
|
|
51926cd41c | ||
|
|
fef3fd4817 | ||
|
|
11a120b056 | ||
|
|
86f76f71ea | ||
|
|
ee41f9c322 | ||
|
|
5ad0f1e1fc | ||
|
|
e432deee2c | ||
|
|
2b64f974ec | ||
|
|
46d3e91483 | ||
|
|
105bf5b865 | ||
|
|
73be332b4d | ||
|
|
eb69190f18 | ||
|
|
3096f8e311 | ||
|
|
419b3ae82d | ||
|
|
563c9507d5 | ||
|
|
13ccf1b851 | ||
|
|
e312d425b8 | ||
|
|
517141a5f4 | ||
|
|
433eb0aa0b | ||
|
|
5680895daa | ||
|
|
3f426ffd35 | ||
|
|
2ec5caf456 | ||
|
|
2540ec0bc3 | ||
|
|
4f81046a40 | ||
|
|
1e6ae76a2e | ||
|
|
e2afc7a0cd | ||
|
|
9c30e9e83e | ||
|
|
b28ebf3ca9 | ||
|
|
a642024500 | ||
|
|
4b61fdf5d9 | ||
|
|
0e13f97b8c | ||
|
|
0475421520 | ||
|
|
c7c17676e2 | ||
|
|
6a85baede6 | ||
|
|
a935caf588 | ||
|
|
34ac9b69f4 | ||
|
|
7174edab5a | ||
|
|
6bc2c2167e | ||
|
|
634738a24d | ||
|
|
567e62abe2 | ||
|
|
b508d9e306 | ||
|
|
768c0e289a | ||
|
|
f9319906b0 | ||
|
|
b33d88861c | ||
|
|
088be6e970 | ||
|
|
a6d52b4a44 | ||
|
|
0ff82e143f | ||
|
|
977cd6c9b6 | ||
|
|
53b0d56209 | ||
|
|
079359749d | ||
|
|
0b92134160 | ||
|
|
1a7b615cf8 | ||
|
|
7479b95179 |
@@ -1,5 +1,5 @@
|
||||
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||
# for clang-format 17.0.1
|
||||
# for clang-format 20.0.0
|
||||
Language: Cpp
|
||||
BasedOnStyle: "WebKit"
|
||||
# AccessModifierOffset: 2
|
||||
@@ -26,9 +26,9 @@ AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: Inline
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
BreakAfterReturnType: Automatic
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BreakTemplateDeclarations: Yes
|
||||
# AttributeMacros:
|
||||
# - __pragma
|
||||
# - _Pragma
|
||||
@@ -145,7 +145,7 @@ PointerAlignment: Left
|
||||
# - constexpr
|
||||
# - type
|
||||
ReferenceAlignment: Left
|
||||
ReflowComments: true
|
||||
ReflowComments: Always
|
||||
RemoveBracesLLVM: false
|
||||
RemoveParentheses: Leave
|
||||
RemoveSemicolon: false
|
||||
@@ -188,3 +188,4 @@ TabWidth: 4
|
||||
UseTab: Never
|
||||
# VerilogBreakBetweenInstancePorts:
|
||||
# WhitespaceSensitiveMacros:
|
||||
RemoveEmptyLinesInUnwrappedLines: true
|
||||
|
||||
29
.devcontainer/Dockerfile
Normal file
29
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
FROM mcr.microsoft.com/devcontainers/base:ubuntu
|
||||
|
||||
USER vscode
|
||||
|
||||
ENV CONDA_DIR=/home/vscode/miniconda
|
||||
ENV PATH="$CONDA_DIR/bin:$PATH"
|
||||
|
||||
ARG PYTHON_VERSION=3.12
|
||||
ARG NODEJS_VERSION=24
|
||||
|
||||
# Install Miniconda
|
||||
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh \
|
||||
&& bash ~/miniconda.sh -b -p $CONDA_DIR \
|
||||
&& rm ~/miniconda.sh \
|
||||
&& conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main \
|
||||
&& conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
|
||||
|
||||
# Configure conda environment
|
||||
RUN eval "$(conda shell.bash hook)" \
|
||||
&& conda create -n maa python=$PYTHON_VERSION -y \
|
||||
&& conda activate maa \
|
||||
&& conda install -y conda-forge::nodejs=$NODEJS_VERSION \
|
||||
&& pip install pre-commit black \
|
||||
&& npm install -g pnpm
|
||||
|
||||
# Finalize conda setup
|
||||
RUN conda init \
|
||||
&& conda config --set auto_activate false \
|
||||
&& echo "conda activate maa" >> ~/.bashrc
|
||||
@@ -1,13 +1,50 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
|
||||
{
|
||||
"image": "mcr.microsoft.com/devcontainers/cpp:ubuntu-22.04",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/python:1": {},
|
||||
"ghcr.io/devcontainers/features/sshd:1": {}
|
||||
"name": "MAA",
|
||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||
// "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
"postCreateCommand": "sudo sh -ce 'apt update && apt install g++-12 -y && echo export CC=gcc-12 CXX=g++-12 >> /etc/profile.d/set-compiler.sh'",
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
// "features": {},
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
"forwardPorts": [3001],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
"postCreateCommand": "bash .devcontainer/post-create.sh",
|
||||
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": ["llvm-vs-code-extensions.vscode-clangd", "DavidAnson.vscode-markdownlint"]
|
||||
"extensions": [
|
||||
"mkxml.vscode-filesize",
|
||||
"nekosu.maa-support",
|
||||
"DavidAnson.vscode-markdownlint",
|
||||
"esbenp.prettier-vscode",
|
||||
"vue.volar",
|
||||
"ms-python.python",
|
||||
"ms-python.black-formatter"
|
||||
],
|
||||
"settings": {
|
||||
// format
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[markdown]": {
|
||||
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
|
||||
},
|
||||
"[python]": {
|
||||
"editor.defaultFormatter": "ms-python.black-formatter"
|
||||
},
|
||||
// python
|
||||
"python.terminal.launchArgs": ["-u"],
|
||||
"python.defaultInterpreterPath": "/home/vscode/miniconda/envs/maa/bin/python",
|
||||
"python.terminal.activateEnvironment": false
|
||||
}
|
||||
}
|
||||
}
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
}
|
||||
|
||||
21
.devcontainer/post-create.sh
Normal file
21
.devcontainer/post-create.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
WORKSPACE=$(pwd)
|
||||
|
||||
# conda activate maa
|
||||
|
||||
echo "===================="
|
||||
echo "Setting up git safe.directory for $WORKSPACE and its submodules..."
|
||||
cd "$WORKSPACE"
|
||||
git config --global --add safe.directory "$WORKSPACE"
|
||||
git submodule foreach --recursive 'git config --global --add safe.directory "$toplevel/$path"'
|
||||
|
||||
echo "===================="
|
||||
cd "$WORKSPACE"
|
||||
echo "Installing dependencies for python..."
|
||||
# pip install -r tools/.../requirements.txt
|
||||
# pip install -r tools/.../requirements-dev.txt
|
||||
|
||||
echo "===================="
|
||||
echo "Installing dependencies for nodejs..."
|
||||
cd "$WORKSPACE"/docs
|
||||
pnpm install --frozen-lockfile
|
||||
@@ -13,6 +13,7 @@
|
||||
290cc30f153a0206bd870a0a58cb6338aa16ea34
|
||||
db9afdc77e85d5fc462d923fca5318be021656cd
|
||||
a5daac889a55baf8895918d4964f20dad1938470
|
||||
9ed30c5658c88edf1ef839771a53c7d599183b8b
|
||||
|
||||
# incorrect format of 3rdparty/resource/Arknights-Tile-Pos/levels.json
|
||||
65d654e54b9d04d1902c9ee9f9fb2679520adafd
|
||||
@@ -42,6 +43,9 @@ bc3ad67a02cb3b8e154c06955cf17091c4265000
|
||||
# oxipng template optimization
|
||||
e3d63894b28b2ef5e2405e144a32a6981de5e1b2
|
||||
|
||||
# refactor: divide tasks.json into multiple jsons
|
||||
dce6e317c8e56836662b64ac4b3d1a69b4ff4dd8
|
||||
|
||||
# usage: add "[blame ignore]" to the commit message
|
||||
# This file is managed by an automated workflow
|
||||
# Do not add, remove or modify lines below this comment
|
||||
|
||||
25
.github/ISSUE_TEMPLATE/cn-bug-report.yaml
vendored
25
.github/ISSUE_TEMPLATE/cn-bug-report.yaml
vendored
@@ -5,16 +5,18 @@ body:
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: 请确认自己完成了下列要求之后再进行勾选,若未完成但勾选将被直接关闭 Issue
|
||||
label: 请确认自己完成了下列必选项之后再进行勾选,若未完成必选项或勾选了"我未仔细阅读"选项将视为自愿接受被直接关闭 Issue
|
||||
options:
|
||||
- label: 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决
|
||||
required: true
|
||||
required: false
|
||||
- label: 我未仔细阅读这些内容,只是一键已读[所有内容](/MaaAssistantArknights/MaaAssistantArknights/issues),并相信这不会影响问题的处理
|
||||
required: false
|
||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等
|
||||
required: true
|
||||
- label: 我使用的是当前更新版本的最新版,且已查看版本发布至今的 [更新内容](https://github.com/MaaAssistantArknights/MaaAssistantArknights/commits/dev/) 和 [Pull Requests](https://github.com/MaaAssistantArknights/MaaAssistantArknights/pulls) 中尚未发布的更新内容,并未提及该 Bug 已被修复的情况
|
||||
required: true
|
||||
- label: 我已检查了[常见问题](https://maa.plus/docs/zh-cn/manual/faq.html)、[公告](/MaaAssistantArknights/MaaAssistantArknights/issues/7732)、[活跃议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues)、[已关闭议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues?q=is%3Aissue%20state%3Aclosed),确认我的问题未被提及
|
||||
required: true
|
||||
required: false
|
||||
- label: 我使用的是当前更新版本的最新版, 并已查看版本发布至今的 [更新内容](https://github.com/MaaAssistantArknights/MaaAssistantArknights/commits/dev/), [Pull Requests](https://github.com/MaaAssistantArknights/MaaAssistantArknights/pulls) 中尚未发布的更新内容并未提及该 Bug 已被修复的情况
|
||||
required: false
|
||||
- label: 我已检查了 [常见问题](https://docs.maa.plus/zh-cn/manual/faq.html), [公告](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/7732), [活跃议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues), [已关闭议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues?q=is%3Aissue%20state%3Aclosed) 确认我的问题未被提及
|
||||
required: false
|
||||
- type: textarea
|
||||
id: describe
|
||||
attributes:
|
||||
@@ -39,12 +41,11 @@ body:
|
||||
attributes:
|
||||
label: 日志和配置文件
|
||||
description: |
|
||||
**请在关闭 MAA 后,上传以下 5 个文件:**
|
||||
1. `debug` 文件夹中的 `asst.log` `gui.log` `asst.bak.log` 和 `gui.bak.log` 日志文件,并说明问题出现的大致时间点
|
||||
2. `config` 文件夹中的 `gui.json` 配置文件
|
||||
**请在 MAA -> 设置 -> 问题反馈中找到生成日志压缩包按钮,点击并上传压缩包**
|
||||
|
||||
**请直接将完整的文件拖拽进来,而非自己裁切或复制的片段;若文件体积过大可压缩后再上传**
|
||||
|
||||
如果你在使用 MacBook,请点击屏幕左上角的“文件”,点击“打开日志文件夹”
|
||||
**请直接将完整的文件拖拽进来,而非自己裁切或复制的片段;若文件体积过大可压缩后再上传**
|
||||
placeholder: |
|
||||
请确认上传文件前已关闭 MAA
|
||||
validations:
|
||||
@@ -55,7 +56,7 @@ body:
|
||||
label: 配置信息
|
||||
description: |
|
||||
请说明操作系统及版本、模拟器品牌、模拟器分辨率、DPI、帧率;
|
||||
若正在使用 MuMu 12 或雷电 9,请说明截图增强是否开启;
|
||||
若正在使用 MuMu 或雷电 9,请说明截图增强是否开启;
|
||||
最后请说明 GPU 加速推理是否开启,若开启请提供 GPU 型号。
|
||||
validations:
|
||||
required: true
|
||||
|
||||
18
.github/ISSUE_TEMPLATE/cn-feature-request.yaml
vendored
18
.github/ISSUE_TEMPLATE/cn-feature-request.yaml
vendored
@@ -5,16 +5,18 @@ body:
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: 在提问之前...
|
||||
label: 请确认自己完成了下列必选项之后再进行勾选,若未完成必选项或勾选了"我未仔细阅读"选项将视为自愿接受被直接关闭 Issue
|
||||
options:
|
||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等
|
||||
required: true
|
||||
- label: 我基本确定这是一个新功能/建议,而不是遇到了 Bug(不确定的话请附上日志)
|
||||
required: true
|
||||
- label: 我使用的是当前更新版本的最新版,且已查看版本发布至今的 [更新内容](https://github.com/MaaAssistantArknights/MaaAssistantArknights/commits/dev/) 和 [Pull Requests](https://github.com/MaaAssistantArknights/MaaAssistantArknights/pulls) 中尚未发布的更新内容,确认我的建议未被提及
|
||||
required: true
|
||||
- label: 我已检查了 [公告](/MaaAssistantArknights/MaaAssistantArknights/issues/7732)、[活跃议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues)、[已关闭议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues?q=is%3Aissue%20state%3Aclosed),确认我的建议未被提及
|
||||
required: true
|
||||
required: false
|
||||
- label: 我未仔细阅读这些内容,只是一键已读[所有内容](/MaaAssistantArknights/MaaAssistantArknights/issues),并相信这不会影响问题的处理
|
||||
required: false
|
||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等
|
||||
required: false
|
||||
- label: 我使用的是当前更新版本的最新版, 并已查看版本发布至今的 [更新内容](https://github.com/MaaAssistantArknights/MaaAssistantArknights/commits/dev/), [Pull Requests](https://github.com/MaaAssistantArknights/MaaAssistantArknights/pulls) 中尚未发布的更新内容,确认我的建议未被提及
|
||||
required: false
|
||||
- label: 我已检查了 [常见问题](https://docs.maa.plus/zh-cn/manual/faq.html), [公告](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/7732), [活跃议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues), [已关闭议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues?q=is%3Aissue%20state%3Aclosed) 确认我的建议未被提及
|
||||
required: false
|
||||
- type: textarea
|
||||
id: describe
|
||||
attributes:
|
||||
|
||||
20
.github/ISSUE_TEMPLATE/cn-ld-report.yaml
vendored
20
.github/ISSUE_TEMPLATE/cn-ld-report.yaml
vendored
@@ -8,15 +8,17 @@ body:
|
||||
label: 在提问之前...
|
||||
options:
|
||||
- label: 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决
|
||||
required: true
|
||||
required: false
|
||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等
|
||||
required: true
|
||||
- label: 我已检查了置顶议题(Pinned Issue),确认我的问题未被提及
|
||||
required: true
|
||||
required: false
|
||||
- label: 我已检查了[公告](/MaaAssistantArknights/MaaAssistantArknights/issues/7732)、[活跃议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues)、[已关闭议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues?q=is%3Aissue%20state%3Aclosed),确认我的问题未被提及
|
||||
required: false
|
||||
- label: 我未仔细阅读这些内容,只是一键已读[所有内容](/MaaAssistantArknights/MaaAssistantArknights/issues),并相信这不会影响问题的处理
|
||||
required: false
|
||||
- label: 我正在使用最新的 MAA 公测版本和最新的官版雷电 9 模拟器
|
||||
required: true
|
||||
required: false
|
||||
- label: 我已参考文档确定安装路径、实例编号填写正确,并确认在关闭截图增强模式后问题消失
|
||||
required: true
|
||||
required: false
|
||||
- label: 我未开启高帧率,且模拟器帧数设置为 60
|
||||
required: false
|
||||
- type: textarea
|
||||
@@ -44,10 +46,8 @@ body:
|
||||
attributes:
|
||||
label: MAA 日志和配置文件
|
||||
description: |
|
||||
**请在关闭 MAA 后,上传以下三个文件:**
|
||||
1. `debug` 文件夹中的 `asst.log` 和 `gui.log` 日志文件,并说明问题出现的大致时间点
|
||||
若 asst.log 文件小于 10 KB,则需同时上传 asst.log.bak 文件
|
||||
2. `config` 文件夹中的 `gui.json` 配置文件
|
||||
**请在 MAA -> 设置 -> 问题反馈中找到生成日志压缩包按钮,点击并上传压缩包**
|
||||
|
||||
**请直接将完整的文件拖拽进来,而非自己裁切或复制的片段;若文件体积过大可压缩后再上传**
|
||||
placeholder: |
|
||||
请确认上传文件前已关闭 MAA
|
||||
|
||||
22
.github/ISSUE_TEMPLATE/cn-mumu-report.yaml
vendored
22
.github/ISSUE_TEMPLATE/cn-mumu-report.yaml
vendored
@@ -8,16 +8,18 @@ body:
|
||||
label: 在提问之前...
|
||||
options:
|
||||
- label: 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决
|
||||
required: true
|
||||
required: false
|
||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等
|
||||
required: true
|
||||
- label: 我已检查了置顶议题(Pinned Issue),确认我的问题未被提及
|
||||
required: true
|
||||
required: false
|
||||
- label: 我已检查了[公告](/MaaAssistantArknights/MaaAssistantArknights/issues/7732)、[活跃议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues)、[已关闭议题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues?q=is%3Aissue%20state%3Aclosed),确认我的问题未被提及
|
||||
required: false
|
||||
- label: 我未仔细阅读这些内容,只是一键已读[所有内容](/MaaAssistantArknights/MaaAssistantArknights/issues),并相信这不会影响问题的处理
|
||||
required: false
|
||||
- label: 我正在使用最新的 MAA 公测版本和最新的官版或方舟专版 MuMu 模拟器
|
||||
required: true
|
||||
required: false
|
||||
- label: 我已参考文档确定安装路径、实例编号、屏幕编号填写正确,并确认在关闭截图增强模式后问题消失
|
||||
required: true
|
||||
- label: 我未开启后台保活,模拟器帧数为 60,显存使用策略为“画面表现更好”
|
||||
required: false
|
||||
- label: 我未开启动态帧率及后台保活,模拟器帧数为 60,显存使用策略为“画面表现更好”
|
||||
required: false
|
||||
- type: textarea
|
||||
id: describe
|
||||
@@ -44,10 +46,8 @@ body:
|
||||
attributes:
|
||||
label: MAA 日志和配置文件
|
||||
description: |
|
||||
**请在关闭 MAA 后,上传以下三个文件:**
|
||||
1. `debug` 文件夹中的 `asst.log` 和 `gui.log` 日志文件,并说明问题出现的大致时间点
|
||||
若 asst.log 文件小于 10 KB,则需同时上传 asst.log.bak 文件
|
||||
2. `config` 文件夹中的 `gui.json` 配置文件
|
||||
**请在 MAA -> 设置 -> 问题反馈中找到生成日志压缩包按钮,点击并上传压缩包**
|
||||
|
||||
**请直接将完整的文件拖拽进来,而非自己裁切或复制的片段;若文件体积过大可压缩后再上传**
|
||||
placeholder: |
|
||||
请确认上传文件前已关闭 MAA
|
||||
|
||||
36
.github/ISSUE_TEMPLATE/en-bug-report.yaml
vendored
36
.github/ISSUE_TEMPLATE/en-bug-report.yaml
vendored
@@ -1,24 +1,23 @@
|
||||
name: Bug Report (in English)
|
||||
description: >-
|
||||
Recognition errors, operation abnormalities,
|
||||
connection errors, etc.
|
||||
description: Recognition errors, operation abnormalities, connection errors, etc.
|
||||
labels: ["bug"]
|
||||
body:
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: Before raising the issue...
|
||||
description: |
|
||||
Please ensure that you have completed the requirements before checking the box.
|
||||
Issues with the checkbox checked but not completed will be directly closed.
|
||||
label: |
|
||||
Please ensure that you have completed the required items before checking the boxes.
|
||||
Issues with incomplete required items or with the 'I did not read carefully' option checked will be considered voluntary acceptance of direct closure.
|
||||
options:
|
||||
- label: I understand that Issues are for feedback and problem solving, not trolling the comments section, and will provide as much information as possible to help solve the problem.
|
||||
required: true
|
||||
- label: I filled in a short, clear title so that developers could quickly identify the general problem when going through the issue list. Instead of "Some suggestions", "Stuck", etc.
|
||||
required: true
|
||||
- label: I am using the latest version of the current update version and have reviewed both the [Unreleased changes](https://github.com/MaaAssistantArknights/MaaAssistantArknights/commits/dev/) and there is no mention of the bug being fixed.
|
||||
- label: I am using the latest version of the current update version, and have reviewed the [update content](https://github.com/MaaAssistantArknights/MaaAssistantArknights/commits/dev/) released to date, [Pull Requests](https://github.com/MaaAssistantArknights/MaaAssistantArknights/pulls) unreleased update content and there is no mention of the bug being fixed.
|
||||
required: true
|
||||
- label: I have reviewed the [FAQs](https://maa.plus/docs/en-us/manual/faq.html), [Announcement](/MaaAssistantArknights/MaaAssistantArknights/issues/7732), [Open Issue](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues), [Closed Issue](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues?q=is%3Aissue%20state%3Aclosed) to ensure that my issue/bug has not been mentioned.
|
||||
- label: I have checked all the options without carefully reading the content and believe this will not affect issue resolution.
|
||||
required: false
|
||||
- label: I have reviewed the [FAQs](https://docs.maa.plus/en-us/manual/faq.html), [Announcement](/MaaAssistantArknights/MaaAssistantArknights/issues/7732), [Open Issues](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues), [Closed Issues](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues?q=is%3Aissue%20state%3Aclosed) to ensure that my issue has not been mentioned.
|
||||
required: true
|
||||
- type: textarea
|
||||
id: describe
|
||||
@@ -43,14 +42,12 @@ body:
|
||||
id: logs
|
||||
attributes:
|
||||
label: Log and config files
|
||||
description: >-
|
||||
**After closing MAA, upload the following 5 files:**
|
||||
1. The `asst.log` `gui.log` `asst.bak.log` and `gui.bak.log` log file in the `debug` folder, and indicate the approximate point in time when the problem occurred.
|
||||
2. The `gui.json` config file in the `config` folder
|
||||
description: |
|
||||
**Please locate the Generate Support Payload button under MAA Settings -> Issue Report, click the button, and upload the generated zip file**
|
||||
|
||||
**Please drag and drop the full file in, not your own cuttings or copies; compress it before uploading if too large.**
|
||||
|
||||
If you are using MacBook, please click the "File" option in the top-left corner of the screen, then click "Open Log Folder".
|
||||
**Please drag and drop the full file in, not your own cuttings or copies;**
|
||||
**compress it before uploading if too large.**
|
||||
placeholder: |
|
||||
Please confirm that MAA is not running before uploading files.
|
||||
validations:
|
||||
@@ -61,7 +58,7 @@ body:
|
||||
label: Configuration information
|
||||
description: |
|
||||
Please specify the operating system and version, emulator brand, emulator resolution, DPI, and frame rate;
|
||||
If you are using MuMu 12 or LDPlayer 9, please specify whether Screenshot Enhancement is enabled;
|
||||
If you are using MuMu or LDPlayer 9, please specify whether Screenshot Enhancement is enabled;
|
||||
Finally, please specify whether GPU accelerated inference is enabled, and if so, provide the GPU model.
|
||||
validations:
|
||||
required: true
|
||||
@@ -69,7 +66,7 @@ body:
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshots or recordings
|
||||
description: >-
|
||||
description: |
|
||||
In the `debug` directory, within the functionally categorized folders,
|
||||
there are some error images captured automatically.
|
||||
If related to this issue, please upload them together.
|
||||
@@ -86,14 +83,13 @@ body:
|
||||
and their aspect ratio and resolution are inconsistent,
|
||||
which makes it harder for us to debug.
|
||||
|
||||
If the file siz is too large, you may compress it before uploading.
|
||||
|
||||
If the file size is too large, you may compress it before uploading.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: others
|
||||
attributes:
|
||||
label: Anthing else?
|
||||
label: Anything else?
|
||||
description: |
|
||||
Anything that will give us more insight into the problem you are having.
|
||||
validations:
|
||||
|
||||
20
.github/ISSUE_TEMPLATE/en-feature-request.yaml
vendored
20
.github/ISSUE_TEMPLATE/en-feature-request.yaml
vendored
@@ -5,21 +5,19 @@ body:
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: Before raising the issue...
|
||||
label: |
|
||||
Please ensure that you have completed the required items before checking the boxes.
|
||||
Issues with incomplete required items or with the 'I did not read carefully' option checked will be considered voluntary acceptance of direct closure.
|
||||
options:
|
||||
- label: |
|
||||
I filled in a short, clear title so that developers could quickly identify the general problem when going through the issue list.
|
||||
Instead of "Some suggestions", "Stuck", etc.
|
||||
- label: I'm probably sure this is a new feature/suggestion and not a bug encountered (please attach logs if you're not sure).
|
||||
required: true
|
||||
- label: |
|
||||
I'm probably sure this is a new feature/suggestion and not a bug encountered (please attach logs if you're not sure).
|
||||
- label: I filled in a short, clear title so that developers could quickly identify the general problem when going through the issue list. Instead of "Some suggestions", "Stuck", etc.
|
||||
required: true
|
||||
- label: |
|
||||
I am using the latest version of the current update version and have reviewed both the [Unreleased changes](https://github.com/MaaAssistantArknights/MaaAssistantArknights/commits/dev/) and the [Pull requests](https://github.com/MaaAssistantArknights/MaaAssistantArknights/pulls),
|
||||
but there is no mention of this feature/suggestion being added.
|
||||
- label: I am using the latest version of the current update version, and have reviewed the [update content](https://github.com/MaaAssistantArknights/MaaAssistantArknights/commits/dev/) released to date, [Pull Requests](https://github.com/MaaAssistantArknights/MaaAssistantArknights/pulls) unreleased update content and there is no mention of this feature/suggestion being added.
|
||||
required: true
|
||||
- label: |
|
||||
I have reviewed the [Announcement](/MaaAssistantArknights/MaaAssistantArknights/issues/7732), [Open Issue](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues), [Closed Issue](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues?q=is%3Aissue%20state%3Aclosed) to ensure that my feature/suggestion has not been mentioned.
|
||||
- label: I have checked all the options without carefully reading the content and believe this will not affect issue resolution.
|
||||
required: false
|
||||
- label: I have reviewed the [FAQs](https://docs.maa.plus/en-us/manual/faq.html), [Announcement](/MaaAssistantArknights/MaaAssistantArknights/issues/7732), [Open Issues](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues), [Closed Issues](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues?q=is%3Aissue%20state%3Aclosed) to ensure that my feature/suggestion has not been mentioned.
|
||||
required: true
|
||||
- type: textarea
|
||||
id: describe
|
||||
|
||||
2
.github/dependabot.yaml
vendored
2
.github/dependabot.yaml
vendored
@@ -7,8 +7,8 @@ updates:
|
||||
commit-message:
|
||||
prefix: ci
|
||||
assignees:
|
||||
- constrat
|
||||
- AnnAngela
|
||||
- Constrat
|
||||
groups:
|
||||
github-actions:
|
||||
patterns:
|
||||
|
||||
8
.github/issue-checker.yml
vendored
8
.github/issue-checker.yml
vendored
@@ -522,7 +522,7 @@ labels:
|
||||
# `incomplete`
|
||||
- name: incomplete
|
||||
content: incomplete
|
||||
regexes: '(?:\[Uploading asst(?:.bak|)(?: - 副本|)(?:.log|)(?:.zip|)…\]\(\))'
|
||||
regexes: '(?:\[Uploading asst(?:.bak|)(?: - 副本|)(?:.log|)(?:.zip|)…\]\(\))|<!-- Uploading "(log|report)[^"]*\.zip"\.\.\. -->'
|
||||
mode: add
|
||||
skip-if:
|
||||
- skip all
|
||||
@@ -532,7 +532,7 @@ labels:
|
||||
- remove incomplete
|
||||
- name: complete
|
||||
content:
|
||||
regexes: '(?:\[asst(?:.bak|)(?: - 副本|)(?:.log|)(?:.zip|)\]\([^\)]+\))'
|
||||
regexes: '(?:\[asst(?:.bak|)(?: - 副本|)(?:.log|)(?:.zip|)\]\([^\)]+\))|(log|report)[^.]*.zip'
|
||||
- name: remove incomplete
|
||||
content: incomplete
|
||||
mode: remove
|
||||
@@ -547,12 +547,12 @@ labels:
|
||||
|
||||
comments:
|
||||
- name: Log upload failed
|
||||
regexes: '\[Uploading asst(?:.bak|)(?: - 副本|)(?:.log|)(?:.zip|)…\]\(\)'
|
||||
regexes: '\[Uploading asst(?:.bak|)(?: - 副本|)(?:.log|)(?:.zip|)…\]\(\)|<!-- Uploading "log[^"]*\.zip"\.\.\. -->'
|
||||
content: "你的日志没有上传成功,请重新上传。\n\n\
|
||||
Your log did not upload successfully, please re-upload it."
|
||||
mode: add
|
||||
- name: Upload failed
|
||||
regexes: "^[^`]*(`[^`]+`[^`]*)*\\[Uploading[^\\]]*…\\]\\(\\)"
|
||||
regexes: "^[^`]*(`[^`]+`[^`]*)*(\\[Uploading[^\\]]*…\\]\\(\\)|<!-- Failed to upload|<!-- Uploading)"
|
||||
content: "你有一些文件没有上传成功,请重新上传。\n\n\
|
||||
You have some files that did not upload successfully, please re-upload them."
|
||||
mode: add
|
||||
|
||||
75
.github/stale_cache_cleanup.ps1
vendored
Normal file
75
.github/stale_cache_cleanup.ps1
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
$totalClearedSize = 0
|
||||
$cacheList = gh cache list --json id,key,ref,sizeInBytes,createdAt | ConvertFrom-Json
|
||||
|
||||
# List of keys to process
|
||||
$keyPatterns = @(
|
||||
"Windows-x64-nuget",
|
||||
"Windows-x64-maadeps",
|
||||
"Windows-arm64-nuget",
|
||||
"Windows-arm64-maadeps",
|
||||
"macOS-x64-maadeps",
|
||||
"macOS-arm64-maadeps",
|
||||
"Linux-x64-maadeps",
|
||||
"Linux-arm64-maadeps",
|
||||
"Smoke-testing"
|
||||
)
|
||||
|
||||
# Filter caches matching any of our key patterns
|
||||
$matchingCaches = $cacheList | Where-Object {
|
||||
$cache = $_
|
||||
($keyPatterns | Where-Object { $cache.key -like "*$_*" }).Count -gt 0
|
||||
}
|
||||
|
||||
# Get unique branch references from the matching caches
|
||||
$branches = $matchingCaches | Select-Object -Property ref -Unique | ForEach-Object { $_.ref }
|
||||
|
||||
Write-Output "Found caches across $($branches.Count) branches"
|
||||
|
||||
foreach ($branch in $branches) {
|
||||
# Extract branch name from ref for display
|
||||
$branchName = $branch -replace "refs/heads/", ""
|
||||
if ($branch -match "refs/pull/(\d+)/merge") {
|
||||
$branchName = "PR #$($matches[1])"
|
||||
}
|
||||
|
||||
Write-Output "Processing caches for branch: $branchName"
|
||||
|
||||
# Filter for current branch caches
|
||||
$branchCaches = $matchingCaches | Where-Object { $_.ref -eq $branch }
|
||||
|
||||
foreach ($pattern in $keyPatterns) {
|
||||
Write-Output " Processing $branchName branch caches for pattern: $pattern"
|
||||
|
||||
# Filter for caches matching the current key pattern within branch
|
||||
$patternCaches = $branchCaches | Where-Object { $_.key -like "*$pattern*" }
|
||||
|
||||
if (-not $patternCaches) {
|
||||
Write-Output " No $branchName branch caches found for pattern: $pattern"
|
||||
continue
|
||||
}
|
||||
|
||||
# Sort by creation time (newest first)
|
||||
$sortedCaches = $patternCaches | Sort-Object -Property createdAt -Descending
|
||||
|
||||
# Keep the first one (latest) and delete the rest
|
||||
$latestCache = $sortedCaches[0]
|
||||
Write-Output " Keeping latest cache for $branchName/${pattern}: '$($latestCache.key)' (ID: $($latestCache.id))"
|
||||
|
||||
# Delete all except the latest one
|
||||
for ($i = 1; $i -lt $sortedCaches.Count; $i++) {
|
||||
$cache = $sortedCaches[$i]
|
||||
$cacheId = $cache.id
|
||||
$cacheKey = $cache.key
|
||||
|
||||
Write-Output " Deleting cache for $branchName/${pattern}: '$cacheKey' (ID: $cacheId)"
|
||||
gh cache delete $cacheId
|
||||
|
||||
$totalClearedSize += $cache.sizeInBytes
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
}
|
||||
|
||||
$formattedSize = "{0:N2}" -f ($totalClearedSize / 1MB)
|
||||
Write-Output "Total cleared size: $formattedSize MB"
|
||||
59
.github/stale_cache_dev.ps1
vendored
Normal file
59
.github/stale_cache_dev.ps1
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
$totalClearedSize = 0
|
||||
$cacheList = gh cache list --json id,key,ref,sizeInBytes,createdAt | ConvertFrom-Json
|
||||
|
||||
# Filter for dev branch caches only
|
||||
$devCaches = $cacheList | Where-Object { $_.ref -eq "refs/heads/dev" }
|
||||
|
||||
if (-not $devCaches) {
|
||||
Write-Output "No caches found for dev branch."
|
||||
exit
|
||||
}
|
||||
|
||||
# List of keys to process
|
||||
$keyPatterns = @(
|
||||
"Windows-x64-nuget",
|
||||
"Windows-x64-maadeps",
|
||||
"Windows-arm64-nuget",
|
||||
"Windows-arm64-maadeps",
|
||||
"macOS-x64-maadeps",
|
||||
"macOS-arm64-maadeps",
|
||||
"Linux-x64-maadeps",
|
||||
"Linux-arm64-maadeps",
|
||||
"Smoke-testing"
|
||||
)
|
||||
|
||||
foreach ($pattern in $keyPatterns) {
|
||||
Write-Output "Processing dev branch caches for pattern: $pattern"
|
||||
|
||||
# Filter for caches matching the current key pattern within dev branch
|
||||
$matchingCaches = $devCaches | Where-Object { $_.key -like "*$pattern*" }
|
||||
|
||||
if (-not $matchingCaches) {
|
||||
Write-Output " No dev branch caches found for pattern: $pattern"
|
||||
continue
|
||||
}
|
||||
|
||||
# Sort by creation time (newest first)
|
||||
$sortedCaches = $matchingCaches | Sort-Object -Property createdAt -Descending
|
||||
|
||||
# Keep the first one (latest) and delete the rest
|
||||
$latestCache = $sortedCaches[0]
|
||||
Write-Output " Keeping latest dev branch cache: '$($latestCache.key)' (ID: $($latestCache.id))"
|
||||
|
||||
# Delete all except the latest one
|
||||
for ($i = 1; $i -lt $sortedCaches.Count; $i++) {
|
||||
$cache = $sortedCaches[$i]
|
||||
$cacheId = $cache.id
|
||||
$cacheKey = $cache.key
|
||||
|
||||
Write-Output " Deleting dev branch cache: '$cacheKey' (ID: $cacheId)"
|
||||
gh cache delete $cacheId
|
||||
|
||||
$totalClearedSize += $cache.sizeInBytes
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
}
|
||||
|
||||
$formattedSize = "{0:N2}" -f ($totalClearedSize / 1MB)
|
||||
Write-Output "Total cleared size: $formattedSize MB"
|
||||
2
.github/workflows/blame-ignore.yml
vendored
2
.github/workflows/blame-ignore.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false # Needed to bypass protection rules in Push changes
|
||||
|
||||
220
.github/workflows/ci.yml
vendored
220
.github/workflows/ci.yml
vendored
@@ -12,9 +12,9 @@ on:
|
||||
- "src/**"
|
||||
- "cmake/**"
|
||||
- "CMakeLists.txt"
|
||||
- "MAA.sln"
|
||||
- ".github/workflows/ci.yml"
|
||||
- "!**/*.md"
|
||||
- "tools/maadeps-download.py"
|
||||
pull_request:
|
||||
branches:
|
||||
- "dev"
|
||||
@@ -24,8 +24,8 @@ on:
|
||||
- "src/**"
|
||||
- "cmake/**"
|
||||
- "CMakeLists.txt"
|
||||
- "MAA.sln"
|
||||
- "!**/*.md"
|
||||
- "tools/maadeps-download.py"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
prerelease: ${{ steps.set_pre.outputs.prerelease }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
path: temp
|
||||
show-progress: false
|
||||
@@ -89,6 +89,8 @@ jobs:
|
||||
fi
|
||||
echo >> CHANGELOG.md
|
||||
echo "**Full Changelog**: [$last_tag -> $this_tag](https://github.com/MaaAssistantArknights/MaaAssistantArknights/compare/${last_tag}...${this_tag})" >> CHANGELOG.md
|
||||
echo >> CHANGELOG.md
|
||||
echo "[已有 Mirror酱 CDK?前往 Mirror酱 高速下载](https://mirrorchyan.com/zh/projects?rid=MAA&source=maagh-release)" >> CHANGELOG.md
|
||||
|
||||
- name: Upload changelog to Github
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -106,18 +108,13 @@ jobs:
|
||||
needs: meta
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- msbuild_target: x64
|
||||
lowercase_target: x64
|
||||
- msbuild_target: ARM64
|
||||
lowercase_target: arm64
|
||||
env:
|
||||
MAABUILDER_TARGET_PLATFORM: ${{ matrix.msbuild_target }}
|
||||
arch: [arm64, x64]
|
||||
fail-fast: false
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
@@ -125,6 +122,35 @@ jobs:
|
||||
run: |
|
||||
git submodule update --init --depth 1 3rdparty/EmulatorExtras
|
||||
|
||||
- name: Cache MaaDeps
|
||||
id: cache-maadeps
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
./MaaDeps
|
||||
key: ${{ runner.os }}-${{ matrix.arch }}-maadeps-${{ hashFiles('tools/maadeps-download.py') }}
|
||||
|
||||
- name: Bootstrap MaaDeps
|
||||
if: steps.cache-maadeps.outputs.cache-hit != 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
python3 tools/maadeps-download.py ${{ matrix.arch }}-windows
|
||||
|
||||
- name: Config cmake
|
||||
run: |
|
||||
mkdir -p build
|
||||
cmake -B build ${{ matrix.arch == 'arm64' && '-A ARM64' }} -DCMAKE_BUILD_TYPE=Release -DMAADEPS_TRIPLET='maa-${{ matrix.arch }}-windows' -DINSTALL_RESOURCE=ON -DINSTALL_PYTHON=ON -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' -DBUILD_WPF_GUI=OFF
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build build --config Release --parallel $env:NUMBER_OF_PROCESSORS
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
mkdir -p install
|
||||
cmake --install build --prefix install --config Release
|
||||
|
||||
- name: Cache .nuke/temp, ~/.nuget/packages
|
||||
id: cache-nuget
|
||||
uses: actions/cache@v4
|
||||
@@ -132,38 +158,13 @@ jobs:
|
||||
path: |
|
||||
.nuke/temp
|
||||
~/.nuget/packages
|
||||
key: ${{ runner.os }}-${{ matrix.msbuild_target }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
|
||||
key: ${{ runner.os }}-${{ matrix.arch }}-nuget-${{ hashFiles('**/*.csproj') }}
|
||||
|
||||
- name: Restore dependencies
|
||||
if: steps.cache-nuget.outputs.cache-hit != 'true'
|
||||
run: dotnet restore
|
||||
run: dotnet restore src/MaaWpfGui/MaaWpfGui.csproj
|
||||
|
||||
- name: Cache MaaDeps
|
||||
id: cache-maadeps
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
./MaaDeps
|
||||
key: ${{ runner.os }}-${{ matrix.lowercase_target }}-maadeps-${{ hashFiles('./maadeps-download.py') }}
|
||||
|
||||
- name: Bootstrap MaaDeps
|
||||
if: steps.cache-maadeps.outputs.cache-hit != 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
python3 maadeps-download.py ${{ matrix.lowercase_target }}-windows
|
||||
|
||||
- name: Create fake event file
|
||||
shell: bash
|
||||
run: cp -v "$GITHUB_EVENT_PATH" ./event.json
|
||||
|
||||
- name: Merge Event Data with Inputs
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
shell: bash
|
||||
run: |
|
||||
cat "$GITHUB_EVENT_PATH" | jq '. + { "inputs": {"ReleaseSimulation": "${{ needs.meta.outputs.tag }}"} }' | tee ./event.json
|
||||
|
||||
- name: Taggify Version
|
||||
- name: Taggify Version for csproj
|
||||
run: |
|
||||
$csprojPath = "src/MaaWpfGui/MaaWpfGui.csproj"
|
||||
$csprojPath = Resolve-Path -Path $csprojPath
|
||||
@@ -180,29 +181,31 @@ jobs:
|
||||
$node.FileVersion = $match
|
||||
$node.AssemblyVersion = $match
|
||||
$csproj.Save($csprojPath)
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build
|
||||
- name: Publish WPF GUI
|
||||
continue-on-error: true
|
||||
run: |
|
||||
$env:GITHUB_WORKFLOW = 'dev-build-win' # pretend this is a dev-build-win workflow
|
||||
$env:GITHUB_EVENT_PATH = "$pwd\\event.json"
|
||||
$env:GITHUB_REF = "refs/heads/not_master"
|
||||
$env:MAA_BUILDER_MAA_VERSION = '${{ needs.meta.outputs.tag }}'
|
||||
./build.cmd DevBuild
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
dotnet publish src/MaaWpfGui/MaaWpfGui.csproj -c Release -o install
|
||||
|
||||
- name: Cleanup checksum file
|
||||
run: |
|
||||
rm -vf ./artifacts/checksum.json
|
||||
- name: Organize Install Files
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf install/*.pdb
|
||||
rm -rf install/msvc-debug
|
||||
rm -rf install/*.h
|
||||
|
||||
cp tools/DependencySetup_依赖库安装.bat install
|
||||
|
||||
- name: Zip files
|
||||
run: |
|
||||
cd install
|
||||
Compress-Archive -Destination MAA-${{ needs.meta.outputs.tag }}-win-${{ matrix.arch }}.zip -Path ./*
|
||||
|
||||
- name: Upload MAA to Github
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MAA-win-${{ matrix.lowercase_target }}
|
||||
path: artifacts
|
||||
name: MAA-win-${{ matrix.arch }}
|
||||
path: install/*.zip
|
||||
|
||||
ubuntu:
|
||||
# Prevent duplicate runs on organization branches with PRs
|
||||
@@ -211,15 +214,14 @@ jobs:
|
||||
github.event.pull_request.base.repo.full_name
|
||||
|
||||
needs: meta
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [aarch64, x86_64]
|
||||
permissions:
|
||||
actions: write
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
@@ -228,40 +230,41 @@ jobs:
|
||||
git submodule update --init --depth 1 3rdparty/EmulatorExtras
|
||||
git submodule update --init --depth 1 src/maa-cli
|
||||
|
||||
- name: Install cross compile toolchains
|
||||
if: ${{ matrix.arch != 'x86_64' }}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install g++-12-aarch64-linux-gnu g++-12-aarch64-linux-gnu
|
||||
- name: Cache MaaDeps
|
||||
id: cache-maadeps
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./MaaDeps
|
||||
key: ${{ runner.os }}-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-maadeps-${{ hashFiles('tools/maadeps-download.py') }}
|
||||
|
||||
# Caching not necessary on ubuntu runner
|
||||
- name: Bootstrap MaaDeps
|
||||
if: steps.cache-maadeps.outputs.cache-hit != 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
python3 maadeps-download.py ${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-linux
|
||||
python3 tools/maadeps-download.py ${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-linux
|
||||
|
||||
- name: Build MAA
|
||||
- name: Config cmake
|
||||
run: |
|
||||
mkdir -p build
|
||||
cmake -B build \
|
||||
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DMAADEPS_TRIPLET='maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-linux' \
|
||||
-DINSTALL_THIRD_LIBS=ON \
|
||||
-DINSTALL_RESOURCE=ON \
|
||||
-DINSTALL_PYTHON=ON \
|
||||
-DMAA_VERSION='${{ needs.meta.outputs.tag }}'
|
||||
cmake --build build --parallel $(nproc --all)
|
||||
-DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' \
|
||||
-DCMAKE_TOOLCHAIN_FILE=MaaDeps/cmake/maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-linux-toolchain.cmake
|
||||
|
||||
mkdir -p install
|
||||
cmake --install build --prefix install
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build build --config Release --parallel $(nproc)
|
||||
env:
|
||||
CC: ${{ matrix.arch == 'x86_64' && 'gcc-12' || 'aarch64-linux-gnu-gcc-12' }}
|
||||
CXX: ${{ matrix.arch == 'x86_64' && 'g++-12' || 'aarch64-linux-gnu-g++-12' }}
|
||||
CMAKE_COLOR_DIAGNOSTICS: ON
|
||||
CLICOLOR_FORCE: 1
|
||||
CXXFLAGS: | # workaround for gcc bugs
|
||||
-Wno-error=restrict -Wno-error=array-bounds -Wno-error=stringop-overread -Wno-error=missing-field-initializers
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
mkdir -p install
|
||||
cmake --install build --prefix install --config Release
|
||||
|
||||
- name: Setup Cross Compile Toolchains for CLI
|
||||
uses: ./src/maa-cli/.github/actions/setup
|
||||
@@ -306,7 +309,7 @@ jobs:
|
||||
ln -sv usr/share/maa/maa Maa.AppDir/AppRun
|
||||
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"
|
||||
wget "https://github.com/AppImage/appimagetool/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/old/runtime-fuse3-${{ matrix.arch }}"
|
||||
chmod a+x appimagetool-x86_64.AppImage
|
||||
@@ -335,36 +338,50 @@ jobs:
|
||||
github.event.pull_request.base.repo.full_name
|
||||
|
||||
needs: meta
|
||||
runs-on: macos-14
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [arm64, x86_64]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
brew install ninja
|
||||
# ninja 1.13.1 is already installed and up-to-date.
|
||||
# - name: Install Dependencies
|
||||
# run: |
|
||||
# brew install ninja
|
||||
|
||||
- name: Cache MaaDeps
|
||||
id: cache-maadeps
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./MaaDeps
|
||||
key: ${{ runner.os }}-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-maadeps-${{ hashFiles('tools/maadeps-download.py') }}
|
||||
|
||||
# Caching not necessary on macOS runner
|
||||
- name: Bootstrap MaaDeps
|
||||
run: |
|
||||
[[ ${{ matrix.arch }} = "arm64" ]] && triplet="arm64-osx" || triplet="x64-osx"
|
||||
python3 maadeps-download.py ${triplet}
|
||||
python3 tools/maadeps-download.py ${triplet}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Configure MaaCore
|
||||
- name: Config cmake
|
||||
run: |
|
||||
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES='${{ matrix.arch }}' -DMAA_VERSION='${{ needs.meta.outputs.tag }}'
|
||||
cmake -B build -GNinja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.arch }}' \
|
||||
-DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}'
|
||||
|
||||
- name: Build MaaCore
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build build
|
||||
cmake --install build --prefix install
|
||||
cmake --build build --config Release --parallel $(sysctl -n hw.logicalcpu)
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
cmake --install build --prefix install --config Release
|
||||
|
||||
- name: Upload MAA to Github
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -379,10 +396,10 @@ jobs:
|
||||
github.event.pull_request.base.repo.full_name
|
||||
|
||||
needs: [meta, macOS-Core]
|
||||
runs-on: macos-14
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
@@ -397,13 +414,13 @@ jobs:
|
||||
git submodule update --init --depth 1 src/MaaMacGui
|
||||
|
||||
- name: Download Arm64 MAA from Github
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: MAACore-macos-arm64
|
||||
path: install-arm64
|
||||
|
||||
- name: Download x64 MAA from Github
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: MAACore-macos-x86_64
|
||||
path: install-x86_64
|
||||
@@ -417,7 +434,7 @@ jobs:
|
||||
|
||||
- name: Download Provisioning Profiles
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: apple-actions/download-provisioning-profiles@v3
|
||||
uses: apple-actions/download-provisioning-profiles@v4
|
||||
with:
|
||||
bundle-id: "com.hguandl.MeoAsstMac"
|
||||
issuer-id: ${{ secrets.HGUANDL_APPSTORE_ISSUER }}
|
||||
@@ -545,7 +562,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download MAA from Github
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
path: assets
|
||||
|
||||
@@ -558,7 +575,7 @@ jobs:
|
||||
find . -type f | while read f; do mv -fvt . $f; done
|
||||
|
||||
- name: Release to Github
|
||||
uses: softprops/action-gh-release@v2
|
||||
uses: softprops/action-gh-release@v2.3.3
|
||||
with:
|
||||
body_path: CHANGELOG.md
|
||||
files: |
|
||||
@@ -577,3 +594,12 @@ jobs:
|
||||
gh workflow run --repo $GITHUB_REPOSITORY release-ota
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.MISTEOWORKFLOW }}
|
||||
|
||||
- name: Create issue if failed
|
||||
if: failure()
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "create-issue"
|
||||
title: "Failed Release"
|
||||
body: |
|
||||
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
|
||||
57
.github/workflows/codeql-core.yml
vendored
Normal file
57
.github/workflows/codeql-core.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: "CodeQL MaaCore and MaaWpfGui Analysis"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: ["dev"]
|
||||
paths:
|
||||
- "3rdparty/include/**"
|
||||
- "include/**"
|
||||
- "src/**"
|
||||
- "cmake/**"
|
||||
- "CMakeLists.txt"
|
||||
- ".github/workflows/codeql-core.yml"
|
||||
- "!**/*.md"
|
||||
- "!**/*.xaml"
|
||||
schedule:
|
||||
- cron: "45 11 * * *" # Runs daily at 11:45 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
contents: read
|
||||
packages: read
|
||||
security-events: write
|
||||
|
||||
jobs:
|
||||
analyze-manual:
|
||||
name: Analyze MaaCore and MaaWpfGui
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
- name: Setup CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: c-cpp,csharp
|
||||
build-mode: manual
|
||||
|
||||
- name: Run CodeQL
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:multi-manual"
|
||||
|
||||
- name: Delete old caches
|
||||
shell: pwsh
|
||||
run: |
|
||||
$oldCaches = gh cache list --key codeql --order asc --json key | ConvertFrom-Json | Select-Object -SkipLast 1
|
||||
foreach ($cache in $oldCaches) {
|
||||
if ($cache.key) {
|
||||
Write-Host "Deleting cache: $($cache.key)"
|
||||
gh cache delete $cache.key
|
||||
}
|
||||
}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
36
.github/workflows/codeql-wf.yml
vendored
Normal file
36
.github/workflows/codeql-wf.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: "CodeQL Workflows Analysis"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: ["dev"]
|
||||
paths:
|
||||
- ".github/**/*.yml"
|
||||
schedule:
|
||||
- cron: "00 12 * * *" # Runs daily at 12:00 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
jobs:
|
||||
analyze-workflows:
|
||||
name: Analyze GitHub Workflows
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
- name: Setup CodeQL for GitHub Actions
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: actions
|
||||
build-mode: none
|
||||
|
||||
- name: Run CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:multi-none"
|
||||
4
.github/workflows/gen-changelog.yml
vendored
4
.github/workflows/gen-changelog.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
show-progress: false
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
|
||||
echo '======='
|
||||
|
||||
echo 'Target RP: ${{ github.event.pull_request.html_url }}' >> $PR_BODY
|
||||
echo 'Target PR: ${{ github.event.pull_request.html_url }}' >> $PR_BODY
|
||||
echo '' >> $PR_BODY
|
||||
echo '<details><summary>Debug info</summary>' >> $PR_BODY
|
||||
echo '' >> $PR_BODY
|
||||
|
||||
152
.github/workflows/issue-checkbox-checker.yml
vendored
Normal file
152
.github/workflows/issue-checkbox-checker.yml
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
name: Auto Close not reading issues or Fold checkboxes
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
check-then-close-or-fold:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
steps:
|
||||
- name: Check for duplicate issues in last hour
|
||||
id: duplicate-check
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
const oneHourAgo = new Date(Date.now() - 60 * 60 * 1000);
|
||||
const currentIssueCreatedAt = new Date(context.payload.issue.created_at);
|
||||
const issueAuthor = context.payload.issue.user.login;
|
||||
|
||||
// 重新获取该用户最近的 issues
|
||||
const { data: userIssues } = await github.rest.issues.listForRepo({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
creator: issueAuthor,
|
||||
state: 'all',
|
||||
since: oneHourAgo.toISOString(),
|
||||
per_page: 30
|
||||
});
|
||||
|
||||
// 过滤出1小时内创建的其他 issues(排除当前 issue)
|
||||
const recentIssues = userIssues.filter(issue => {
|
||||
const issueCreatedAt = new Date(issue.created_at);
|
||||
return issue.number !== context.issue.number &&
|
||||
issueCreatedAt >= oneHourAgo &&
|
||||
issueCreatedAt < currentIssueCreatedAt;
|
||||
});
|
||||
|
||||
if (recentIssues.length > 0) {
|
||||
// 给当前 issue 添加标签
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
labels: ['rapid-submission']
|
||||
});
|
||||
|
||||
// 给1小时内的其他 issues 也添加标签
|
||||
for (const issue of recentIssues) {
|
||||
try {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
labels: ['rapid-submission']
|
||||
});
|
||||
console.log(`Added rapid-submission label to issue #${issue.number}`);
|
||||
} catch (error) {
|
||||
console.log(`Failed to add label to issue #${issue.number}: ${error.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- name: Check checkbox status
|
||||
id: unread-checkbox-check
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
// 找不到###就算了
|
||||
if (!/###([^#]+)###/.test(context.payload.issue.body)) {
|
||||
return false;
|
||||
}
|
||||
var checkList = /###([^#]+)###/.exec(context.payload.issue.body)[1];
|
||||
const UnreadRegexCn = /- \[x\]\s*.*?我.*未仔细阅读/i;
|
||||
const UnreadRegexCn_ = /- \[ \]\s*.*?我.*未仔细阅读/i;
|
||||
if (/- \[(x| )\]\s*.*?[\u4e00-\u9fa5]+/i.test(checkList)) { // 中英区分
|
||||
if (UnreadRegexCn.test(checkList)) {
|
||||
return true;
|
||||
}
|
||||
checkList = checkList.replace(UnreadRegexCn_, "");
|
||||
return /- \[ \]\s*.*?[\u4e00-\u9fa5]+/i.test(checkList);
|
||||
}
|
||||
const texts = [
|
||||
'I have checked all the options without carefully reading the content and believe this will not affect issue resolution.'];
|
||||
return texts.some(text => new RegExp(`- \\[x\\]\\s*${text}`).test(context.payload.issue.body));
|
||||
|
||||
- name: Close and lock issue
|
||||
if: steps.unread-checkbox-check.outputs.result == 'true'
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
await github.rest.issues.update({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
state: 'closed',
|
||||
state_reason: 'not_planned'
|
||||
});
|
||||
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
labels: ['low-quality-report']
|
||||
});
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
body: '因为未阅读模板提示并正确提交,触发了自动关闭规则\n\nBecause the template prompt was not read and submitted correctly, the automatic closing rule was triggered'
|
||||
});
|
||||
|
||||
- name: Fold checkboxes
|
||||
if: steps.unread-checkbox-check.outputs.result == 'false'
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
const originalBody = context.payload.issue.body;
|
||||
if (originalBody.includes('<details><summary>Checkboxes</summary>\n\n')) {
|
||||
return;
|
||||
}
|
||||
const checkboxSectionRegex_cn_bug = /([\s\S]*?)(### 问题描述\n\n)/;
|
||||
const checkboxSectionRegex_cn_feat = /([\s\S]*?)(### 说说你遇到的问题?\n\n)/;
|
||||
const checkboxSectionRegex_en_bug = /([\s\S]*?)(### Description\n\n)/;
|
||||
const checkboxSectionRegex_en_feat = /([\s\S]*?)(### The problems you have encountered?\n\n)/;
|
||||
|
||||
const foldedBody_cn_bug = originalBody.replace(
|
||||
checkboxSectionRegex_cn_bug,
|
||||
`<details><summary>Checkboxes</summary>\n\n$1\n\n</details>\n\n$2`
|
||||
);
|
||||
const foldedBody_cn_feat = foldedBody_cn_bug.replace(
|
||||
checkboxSectionRegex_cn_feat,
|
||||
`<details><summary>Checkboxes</summary>\n\n$1\n\n</details>\n\n$2`
|
||||
);
|
||||
const foldedBody_en_bug = foldedBody_cn_feat.replace(
|
||||
checkboxSectionRegex_en_bug,
|
||||
`<details><summary>Checkboxes</summary>\n\n$1\n\n</details>\n\n$2`
|
||||
);
|
||||
const foldedBody = foldedBody_en_bug.replace(
|
||||
checkboxSectionRegex_en_feat,
|
||||
`<details><summary>Checkboxes</summary>\n\n$1\n\n</details>\n\n$2`
|
||||
);
|
||||
|
||||
await github.rest.issues.update({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
body: foldedBody
|
||||
});
|
||||
21
.github/workflows/markdown-checker.yml
vendored
21
.github/workflows/markdown-checker.yml
vendored
@@ -26,25 +26,32 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
- name: Cache Primes
|
||||
id: cache-primes
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .lycheecache
|
||||
key: lychee-cache
|
||||
|
||||
- name: Check dead links
|
||||
uses: lycheeverse/lychee-action@v2
|
||||
with:
|
||||
# 仅检查内部链接和 Github 相关链接
|
||||
# 仅检查内部链接,排除所有外部链接
|
||||
args: >
|
||||
--verbose --no-progress --cache --max-cache-age 1d
|
||||
--verbose --no-progress
|
||||
--cache --max-cache-age 1d --cache-exclude-status '429, 500..599'
|
||||
--exclude 'https?://.*'
|
||||
--include 'https?://github\.com/.*'
|
||||
--include 'https?://raw\.githubusercontent\.com/.*'
|
||||
--include 'https?://user-images\.githubusercontent\.com/.*'
|
||||
--exclude-path 'docs/zh-tw/manual/introduction/introduction_old.md'
|
||||
--exclude-path 'docs/ja-jp/manual/introduction/introduction_old.md'
|
||||
--exclude 'files/MAA_Runtime_Fix_Pwsh.ps1$'
|
||||
-- './docs/**/*.md' './README.md'
|
||||
|
||||
- name: Comment (only for PR)
|
||||
|
||||
38
.github/workflows/mirrorchyan.yml
vendored
38
.github/workflows/mirrorchyan.yml
vendored
@@ -8,7 +8,8 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: MirrorChyan/uploading-action@v1
|
||||
- name: Upload MAA win x64
|
||||
uses: MirrorChyan/uploading-action@v1
|
||||
if: always()
|
||||
with:
|
||||
filetype: latest-release
|
||||
@@ -22,7 +23,8 @@ jobs:
|
||||
os: win
|
||||
arch: x64
|
||||
|
||||
- uses: MirrorChyan/uploading-action@v1
|
||||
- name: Upload MAA win arm64
|
||||
uses: MirrorChyan/uploading-action@v1
|
||||
if: always()
|
||||
with:
|
||||
filetype: latest-release
|
||||
@@ -35,3 +37,35 @@ jobs:
|
||||
upload_token: ${{ secrets.MirrorChyanUploadToken }}
|
||||
os: win
|
||||
arch: arm64
|
||||
|
||||
- name: Upload MAA macos arm64
|
||||
uses: MirrorChyan/uploading-action@v1
|
||||
if: always()
|
||||
with:
|
||||
filetype: latest-release
|
||||
filename: "MAA-*-macos-universal.dmg"
|
||||
extra_zip: true
|
||||
mirrorchyan_rid: MAA
|
||||
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
repo: ${{ github.event.repository.name }}
|
||||
upload_token: ${{ secrets.MirrorChyanUploadToken }}
|
||||
os: macos
|
||||
arch: arm64
|
||||
|
||||
- name: Upload MAA macos x64
|
||||
uses: MirrorChyan/uploading-action@v1
|
||||
if: always()
|
||||
with:
|
||||
filetype: latest-release
|
||||
filename: "MAA-*-macos-universal.dmg"
|
||||
extra_zip: true
|
||||
mirrorchyan_rid: MAA
|
||||
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
repo: ${{ github.event.repository.name }}
|
||||
upload_token: ${{ secrets.MirrorChyanUploadToken }}
|
||||
os: macos
|
||||
arch: x64
|
||||
|
||||
@@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- id: uploading
|
||||
- name: Release Note for MAA
|
||||
uses: MirrorChyan/release-note-action@v1
|
||||
with:
|
||||
mirrorchyan_rid: MAA
|
||||
|
||||
23
.github/workflows/optimize-templates.yml
vendored
23
.github/workflows/optimize-templates.yml
vendored
@@ -44,27 +44,28 @@ jobs:
|
||||
|
||||
- name: Checkout repository
|
||||
if: steps.check_push.outputs.is_pr != 'True'
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup python
|
||||
if: steps.check_push.outputs.is_pr != 'True'
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Cache Python packages
|
||||
id: cache_python
|
||||
if: steps.check_push.outputs.is_pr != 'True' && always()
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.pythonLocation }}/lib/python3.11/site-packages
|
||||
key: ${{ runner.os }}-pip-optimize-templates-${{ hashFiles('./tools/OptimizeTemplates/requirements.txt') }}
|
||||
# - name: Cache Python packages
|
||||
# id: cache_python
|
||||
# if: steps.check_push.outputs.is_pr != 'True' && always()
|
||||
# uses: actions/cache@v4
|
||||
# with:
|
||||
# path: ${{ env.pythonLocation }}/lib/python3.11/site-packages
|
||||
# key: ${{ runner.os }}-pip-optimize-templates-${{ hashFiles('./tools/OptimizeTemplates/requirements.txt') }}
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.check_push.outputs.is_pr != 'True' && steps.cache_python.outputs.cache-hit != 'true'
|
||||
# if: steps.check_push.outputs.is_pr != 'True' && steps.cache_python.outputs.cache-hit != 'true'
|
||||
if: steps.check_push.outputs.is_pr != 'True'
|
||||
run: |
|
||||
pip install -r tools/OptimizeTemplates/requirements.txt
|
||||
|
||||
@@ -101,7 +102,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Push changes
|
||||
if: steps.check_push.outputs.is_pr != 'True' && steps.commit_changes.outputs.have_commits == 'True'
|
||||
if: steps.check_push.outputs.is_pr != 'True' && steps.commit_changes.outputs.have_commits == 'True' && github.repository_owner == 'MaaAssistantArknights'
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.MAA_RESOURCE_SYNC }}
|
||||
|
||||
3
.github/workflows/pr-auto-tag.yml
vendored
3
.github/workflows/pr-auto-tag.yml
vendored
@@ -9,6 +9,7 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Name of the tag to create for the release"
|
||||
type: string
|
||||
required: true
|
||||
|
||||
@@ -19,7 +20,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.MAARELEASE_RELEASE }}
|
||||
|
||||
4
.github/workflows/pr-checker.yml
vendored
4
.github/workflows/pr-checker.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cleanup Previous Comment
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
const { data: comments } = await github.rest.issues.listComments({
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
});
|
||||
}
|
||||
- name: Check Commits
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
const { data: commits } = await github.rest.pulls.listCommits({
|
||||
|
||||
105
.github/workflows/release-nightly-ota.yml
vendored
105
.github/workflows/release-nightly-ota.yml
vendored
@@ -16,12 +16,12 @@ on:
|
||||
limit_maa:
|
||||
description: "Number of releases to fetch from MaaAssistantArknights"
|
||||
required: true
|
||||
default: "10"
|
||||
default: 10
|
||||
type: number
|
||||
limit_mr:
|
||||
limit_maarelease:
|
||||
description: "Number of releases to fetch from MaaRelease"
|
||||
required: true
|
||||
default: "10"
|
||||
default: 10
|
||||
type: number
|
||||
|
||||
jobs:
|
||||
@@ -30,17 +30,15 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
msbuild_target: [x64]
|
||||
arch: [x64]
|
||||
fail-fast: false
|
||||
env:
|
||||
MAABUILDER_TARGET_PLATFORM: ${{ matrix.msbuild_target }}
|
||||
outputs:
|
||||
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.read_changelog.outputs.content }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
# repository: 'MaaAssistantArknights/MaaAssistantArknights'
|
||||
#ref: ${{ inputs.ref }}
|
||||
@@ -168,6 +166,35 @@ jobs:
|
||||
with:
|
||||
path: ./changelog_notag.md
|
||||
|
||||
- name: Cache MaaDeps
|
||||
id: cache-maadeps
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
./MaaDeps
|
||||
key: ${{ runner.os }}-${{ matrix.arch }}-maadeps-${{ hashFiles('tools/maadeps-download.py') }}
|
||||
|
||||
- name: Bootstrap MaaDeps
|
||||
if: steps.cache-maadeps.outputs.cache-hit != 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
python3 tools/maadeps-download.py ${{ matrix.arch }}-windows
|
||||
|
||||
- name: Config cmake
|
||||
run: |
|
||||
mkdir -p build
|
||||
cmake -B build ${{ matrix.arch == 'arm64' && '-A ARM64' }} -DCMAKE_BUILD_TYPE=Release -DMAADEPS_TRIPLET='maa-${{ matrix.arch }}-windows' -DINSTALL_RESOURCE=ON -DINSTALL_PYTHON=ON -DMAA_HASH_VERSION='${{ steps.set_tag.outputs.tag }}' -DBUILD_WPF_GUI=OFF
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build build --config Release --parallel $env:NUMBER_OF_PROCESSORS
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
mkdir -p install
|
||||
cmake --install build --prefix install --config Release
|
||||
|
||||
- name: Cache .nuke/temp, ~/.nuget/packages
|
||||
id: cache-nuget
|
||||
uses: actions/cache@v4
|
||||
@@ -175,28 +202,13 @@ jobs:
|
||||
path: |
|
||||
.nuke/temp
|
||||
~/.nuget/packages
|
||||
key: ${{ runner.os }}-${{ matrix.msbuild_target }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
|
||||
key: ${{ runner.os }}-${{ matrix.arch }}-nuget-${{ hashFiles('**/*.csproj') }}
|
||||
|
||||
- name: Restore dependencies
|
||||
if: steps.cache-nuget.outputs.cache-hit != 'true'
|
||||
run: dotnet restore
|
||||
run: dotnet restore src/MaaWpfGui/MaaWpfGui.csproj
|
||||
|
||||
- name: Cache MaaDeps
|
||||
id: cache-maadeps
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
./MaaDeps
|
||||
key: ${{ runner.os }}-${{ matrix.msbuild_target }}-maadeps-${{ hashFiles('./maadeps-download.py') }}
|
||||
|
||||
- name: Bootstrap MaaDeps
|
||||
if: steps.cache-maadeps.outputs.cache-hit != 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
python3 maadeps-download.py ${{ matrix.msbuild_target }}-windows
|
||||
|
||||
- name: Taggify Version
|
||||
- name: Taggify Version for csproj
|
||||
run: |
|
||||
$csprojPath = "src/MaaWpfGui/MaaWpfGui.csproj"
|
||||
$csprojPath = Resolve-Path -Path $csprojPath
|
||||
@@ -206,8 +218,6 @@ jobs:
|
||||
} 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
|
||||
@@ -215,25 +225,25 @@ jobs:
|
||||
$node.FileVersion = $match
|
||||
$node.AssemblyVersion = $match
|
||||
$csproj.Save($csprojPath)
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Run './build.cmd DevBuild'
|
||||
- name: Publish WPF GUI
|
||||
run: |
|
||||
$env:GITHUB_WORKFLOW = 'dev-build-win' # pretend this is a dev-build-win workflow
|
||||
$env:MAA_BUILDER_MAA_VERSION = "${{ steps.set_tag.outputs.tag }}"
|
||||
echo "tag: " $env:MAA_BUILDER_MAA_VERSION
|
||||
dotnet publish src/MaaWpfGui/MaaWpfGui.csproj -c Release -o install
|
||||
|
||||
./build.cmd DevBuild
|
||||
env:
|
||||
Reason: "Build nightly version"
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Organize Install Files
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf install/*.pdb
|
||||
rm -rf install/msvc-debug
|
||||
rm -rf install/*.h
|
||||
|
||||
cp tools/DependencySetup_依赖库安装.bat install
|
||||
|
||||
- name: Upload MAA to Github
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MAA-win-${{ matrix.msbuild_target }}
|
||||
path: artifacts
|
||||
name: MAA-win-${{ matrix.arch }}
|
||||
path: install
|
||||
|
||||
- name: Push tag to main repo
|
||||
id: push_main_tag
|
||||
@@ -252,7 +262,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch MaaRelease
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: ${{ format('{0}/{1}', github.repository_owner, 'MaaRelease') }}
|
||||
fetch-depth: 0
|
||||
@@ -282,14 +292,14 @@ jobs:
|
||||
echo ${{ needs.build-win-nightly.outputs.tag }}
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
path: MaaAssistantArknights
|
||||
token: ${{ secrets.MAARELEASE_RELEASE }}
|
||||
show-progress: false
|
||||
|
||||
- name: Download MAA from Github
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: MAA-win-${{ matrix.target }}
|
||||
path: ${{ format('{0}/{1}', 'build-ota', needs.build-win-nightly.outputs.tag) }}
|
||||
@@ -303,12 +313,12 @@ jobs:
|
||||
limit_maa=${limit_maa%.*}
|
||||
echo "Parsed limit_maa: $limit_maa"
|
||||
|
||||
limit_mr=${{ inputs.limit_mr || 10 }}
|
||||
limit_mr=${limit_mr%.*}
|
||||
echo "Parsed limit_mr: $limit_mr"
|
||||
limit_maarelease=${{ inputs.limit_maarelease || 10 }}
|
||||
limit_maarelease=${limit_maarelease%.*}
|
||||
echo "Parsed limit_maarelease: $limit_maarelease"
|
||||
|
||||
gh release list --repo 'MaaAssistantArknights/MaaAssistantArknights' --limit $limit_maa | tee ./release_maa.txt
|
||||
gh release list --repo "${{ github.repository_owner }}/MaaRelease" --limit $limit_mr | tee ./release_mr.txt
|
||||
gh release list --repo "${{ github.repository_owner }}/MaaRelease" --limit $limit_maarelease | tee ./release_mr.txt
|
||||
echo ${{ needs.build-win-nightly.outputs.tag }} > ./config
|
||||
|
||||
cat ./release_maa.txt | awk '{ print $1 }' > ./tags_maa.txt
|
||||
@@ -328,8 +338,7 @@ jobs:
|
||||
cd build-ota
|
||||
|
||||
pushd ${{ needs.build-win-nightly.outputs.tag }}
|
||||
zip -d *.zip '*.lib' '*.pdb' '*.exp' '*.config' '*.xml'
|
||||
mv *.zip MAA-${{ env.release_tag }}-win-${{ matrix.target }}.zip
|
||||
zip -r MAA-${{ env.release_tag }}-win-${{ matrix.target }}.zip ./*
|
||||
popd
|
||||
|
||||
$GITHUB_WORKSPACE/MaaAssistantArknights/tools/OTAPacker/build.sh 'MaaAssistantArknights/MaaAssistantArknights' ./config ${{ matrix.target }} "${{ github.repository_owner }}/MaaRelease"
|
||||
|
||||
33
.github/workflows/release-ota.yml
vendored
33
.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,7 +25,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch MaaRelease
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
repository: ${{ format('{0}/{1}', github.repository_owner, 'MaaRelease') }}
|
||||
@@ -94,10 +94,13 @@ jobs:
|
||||
- x64
|
||||
steps:
|
||||
- name: Download release config
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: MaaReleaseConfig
|
||||
path: ./MaaReleaseConfig
|
||||
|
||||
- name: Fetch MaaRelease
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
repository: ${{ format('{0}/{1}', github.repository_owner, 'MaaRelease') }}
|
||||
@@ -106,7 +109,7 @@ jobs:
|
||||
token: ${{ secrets.MAARELEASE_RELEASE }}
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
path: MaaAssistantArknights
|
||||
@@ -134,6 +137,15 @@ jobs:
|
||||
prerelease: ${{ fromJSON(needs.create-tag.outputs.prerelease) }}
|
||||
overwrite: true
|
||||
|
||||
- name: Create issue if failed
|
||||
if: failure()
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "create-issue"
|
||||
title: "Failed make release OTA for Windows"
|
||||
body: |
|
||||
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
|
||||
make-ota-mac:
|
||||
needs: create-tag
|
||||
runs-on: macos-14
|
||||
@@ -177,6 +189,15 @@ jobs:
|
||||
prerelease: ${{ fromJSON(needs.create-tag.outputs.prerelease) }}
|
||||
overwrite: true
|
||||
|
||||
- name: Create issue if failed
|
||||
if: failure()
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "create-issue"
|
||||
title: "Failed make release OTA for macos"
|
||||
body: |
|
||||
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
|
||||
release:
|
||||
needs:
|
||||
- make-ota
|
||||
|
||||
196
.github/workflows/res-update-game.yml
vendored
196
.github/workflows/res-update-game.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: res-update-game
|
||||
name: Resource Updater
|
||||
|
||||
on:
|
||||
schedule:
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone ArknightsGameResource for Official
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
repository: yuanyan3060/ArknightsGameResource
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone ArknightsGameResource_Yostar for Overseas
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
repository: ArknightsAssets/ArknightsGamedata
|
||||
@@ -89,7 +89,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone arknights-toolbox-update for Taiwan
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
repository: arkntools/arknights-toolbox-update
|
||||
@@ -124,52 +124,15 @@ jobs:
|
||||
path: ./excel
|
||||
compression-level: 0
|
||||
|
||||
original-json:
|
||||
if: github.repository_owner == 'MaaAssistantArknights'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initializization
|
||||
run: |
|
||||
urls=(
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/.prettierrc|.prettierrc"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/tools/TaskSorter/TaskSorter.py|TaskSorter.py"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/resource/tasks.json|tasks.json"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/resource/global/txwy/resource/tasks.json|original/txwy.json"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/resource/global/YoStarEN/resource/tasks.json|original/YoStarEN.json"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/resource/global/YoStarJP/resource/tasks.json|original/YoStarJP.json"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/resource/global/YoStarKR/resource/tasks.json|original/YoStarKR.json"
|
||||
)
|
||||
|
||||
mkdir -p original
|
||||
|
||||
printf "%s\n" "${urls[@]}" | xargs -P 6 -I {} bash -c '
|
||||
url=$(echo "{}" | cut -d"|" -f1)
|
||||
filename=$(echo "{}" | cut -d"|" -f2)
|
||||
curl -s -o "$filename" "$url" && echo "Downloaded $filename" || echo "Failed to download $filename" >&2
|
||||
'
|
||||
python3 TaskSorter.py --cn tasks.json --overseas EN:original/YoStarEN.json,JP:original/YoStarJP.json,KR:original/YoStarKR.json,TW:original/txwy.json
|
||||
|
||||
- name: Prettify original JSON
|
||||
uses: Nerixyz/actionsx-prettier@v3-adj
|
||||
with:
|
||||
args: -w original/YoStarEN.json original/YoStarJP.json original/YoStarKR.json original/txwy.json
|
||||
|
||||
- name: Upload Original
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: original
|
||||
path: ./original
|
||||
compression-level: 0
|
||||
|
||||
update-game-resources:
|
||||
# In case of rate limitations on the runners/instances, add dependency, by removing the comment
|
||||
|
||||
# needs: [clone-resources-official, clone-resources-overseas, clone-resources-txwy, original-json]
|
||||
# needs: [clone-resources-official, clone-resources-overseas, clone-resources-txwy]
|
||||
if: github.repository_owner == 'MaaAssistantArknights'
|
||||
runs-on: windows-latest
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout MAA
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
# TL;DR https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/9872#issuecomment-2251378371
|
||||
# actions/checkout uses ${{ secrets.GITHUB_TOKEN }} by default, meaning all steps will inherit it
|
||||
@@ -177,125 +140,129 @@ jobs:
|
||||
show-progress: false
|
||||
fetch-depth: 3
|
||||
|
||||
- name: Restore ResourceUpdater.exe from cache
|
||||
id: cache-resupd
|
||||
- name: Restore ResourceUpdater from cache
|
||||
id: resupd-cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
key: Resource-updater-${{ hashFiles('./tools/ResourceUpdater/main.cpp') }}
|
||||
key: ResourceUpdater-${{ runner.os }}-${{ hashFiles('tools/ResourceUpdater/main.cpp') }}
|
||||
path: |
|
||||
./tools/ResourceUpdater/x64/Release/opencv_world4_maa.dll
|
||||
./tools/ResourceUpdater/x64/Release/ResourceUpdater.exe
|
||||
./tools/ResourceUpdater/libopencv_world4.4.11.0.dylib
|
||||
./tools/ResourceUpdater/res_updater
|
||||
|
||||
- name: Cache MaaDeps
|
||||
if: steps.cache-resupd.outputs.cache-hit != 'true'
|
||||
id: cache-maadeps
|
||||
if: steps.resupd-cache.outputs.cache-hit != 'true'
|
||||
id: maadeps-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
./MaaDeps
|
||||
key: ${{ runner.os }}-x64-maadeps-${{ hashFiles('./maadeps-download.py') }}
|
||||
key: ${{ runner.os }}-arm64-maadeps-${{ hashFiles('tools/maadeps-download.py') }}
|
||||
|
||||
- name: Bootstrap MaaDeps
|
||||
if: steps.cache-resupd.outputs.cache-hit != 'true' && steps.cache-maadeps.outputs.cache-hit != 'true'
|
||||
if: steps.resupd-cache.outputs.cache-hit != 'true' && steps.maadeps-cache.outputs.cache-hit != 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
python3 maadeps-download.py x64-windows
|
||||
python3 tools/maadeps-download.py arm64-osx
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
if: steps.cache-resupd.outputs.cache-hit != 'true'
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Build Resource Updater
|
||||
if: steps.cache-resupd.outputs.cache-hit != 'true'
|
||||
- name: Config cmake
|
||||
if: steps.resupd-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
MSBUILD tools/ResourceUpdater/ResourceUpdater.vcxproj /t:rebuild /p:Configuration="Release" /p:Platform="x64" /p:BuildProjectReferences=false /m
|
||||
cd tools/ResourceUpdater
|
||||
mkdir -p build
|
||||
cmake -B build -GNinja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DMAADEPS_TRIPLET='maa-arm64-osx' \
|
||||
-DWITH_HASH_VERSION=ON
|
||||
|
||||
- name: Save ResourceUpdater.exe to cache
|
||||
if: always() && steps.cache-resupd.outputs.cache-hit != 'true'
|
||||
- name: Build
|
||||
if: steps.resupd-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cmake --build tools/ResourceUpdater/build --config Release --parallel $(sysctl -n hw.logicalcpu)
|
||||
|
||||
- name: Install
|
||||
if: steps.resupd-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cmake --install tools/ResourceUpdater/build --prefix tools/ResourceUpdater --config Release
|
||||
|
||||
- name: Save ResourceUpdater to cache
|
||||
if: always() && steps.resupd-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
key: Resource-updater-${{ hashFiles('./tools/ResourceUpdater/main.cpp') }}
|
||||
key: ResourceUpdater-${{ runner.os }}-${{ hashFiles('tools/ResourceUpdater/main.cpp') }}
|
||||
path: |
|
||||
./tools/ResourceUpdater/x64/Release/opencv_world4_maa.dll
|
||||
./tools/ResourceUpdater/x64/Release/ResourceUpdater.exe
|
||||
|
||||
- name: Download original JSON
|
||||
id: download-original
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
with:
|
||||
name: original
|
||||
path: ./original
|
||||
./tools/ResourceUpdater/libopencv_world4.4.11.0.dylib
|
||||
./tools/ResourceUpdater/res_updater
|
||||
|
||||
- name: Download txwy
|
||||
id: download-txwy
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
uses: actions/download-artifact@v5
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: txwy
|
||||
path: ./tools/ResourceUpdater/x64/Release/Overseas/tw/gamedata/excel
|
||||
path: ./tools/ResourceUpdater/Overseas/tw/gamedata/excel
|
||||
|
||||
- name: Delay txwy
|
||||
if: steps.download-txwy.outcome == 'failure'
|
||||
run: |
|
||||
Start-Sleep -s 20
|
||||
sleep 10
|
||||
|
||||
- name: Re-download txwy
|
||||
if: steps.download-txwy.outcome == 'failure'
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: txwy
|
||||
path: ./tools/ResourceUpdater/x64/Release/Overseas/tw/gamedata/excel
|
||||
path: ./tools/ResourceUpdater/Overseas/tw/gamedata/excel
|
||||
|
||||
- name: Download Overseas
|
||||
id: download-overseas
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
uses: actions/download-artifact@v5
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: overseas
|
||||
path: ./tools/ResourceUpdater/x64/Release/Overseas
|
||||
path: ./tools/ResourceUpdater/Overseas
|
||||
|
||||
- name: Delay Overseas
|
||||
if: steps.download-overseas.outcome == 'failure'
|
||||
run: |
|
||||
Start-Sleep -s 20
|
||||
sleep 10
|
||||
|
||||
- name: Re-download Overseas
|
||||
if: steps.download-overseas.outcome == 'failure'
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: overseas
|
||||
path: ./tools/ResourceUpdater/x64/Release/Overseas
|
||||
path: ./tools/ResourceUpdater/Overseas
|
||||
|
||||
- name: Download Official
|
||||
id: download-official
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
uses: actions/download-artifact@v5
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: official
|
||||
path: ./tools/ResourceUpdater/x64/Release/Official
|
||||
path: ./tools/ResourceUpdater/Official
|
||||
|
||||
- name: Delay Official
|
||||
if: steps.download-official.outcome == 'failure'
|
||||
run: |
|
||||
Start-Sleep -s 20
|
||||
sleep 10
|
||||
|
||||
- name: Re-download Official
|
||||
if: steps.download-official.outcome == 'failure'
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: official
|
||||
path: ./tools/ResourceUpdater/x64/Release/Official
|
||||
path: ./tools/ResourceUpdater/Official
|
||||
|
||||
- name: Run Resource Updater
|
||||
run: |
|
||||
./tools/ResourceUpdater/x64/Release/ResourceUpdater.exe
|
||||
./tools/ResourceUpdater/res_updater
|
||||
|
||||
- name: Task Sorting
|
||||
id: task_sorting
|
||||
run: |
|
||||
python3 tools/TaskSorter/TaskSorter.py
|
||||
Write-Output "gitdiff=$(git diff --name-only --diff-filter=ACM 2>$null | Select-String -Pattern '\.json$' -List)" >> $env:GITHUB_OUTPUT
|
||||
echo "gitdiff=$(echo $(git diff --name-only --diff-filter=ACM 2>/dev/null | grep '\.json$'))" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Run prettier
|
||||
uses: Nerixyz/actionsx-prettier@v3-adj
|
||||
@@ -304,11 +271,12 @@ jobs:
|
||||
|
||||
- name: Update version.json date if necessary
|
||||
id: update_version
|
||||
run: pwsh tools/ResourceUpdater/version.ps1
|
||||
run: |
|
||||
./tools/ResourceUpdater/version.zsh
|
||||
|
||||
- name: Setup python
|
||||
if: steps.update_version.outputs.contains_png == 'True'
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
@@ -344,19 +312,19 @@ jobs:
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add .
|
||||
|
||||
$commit_msg = "${{ github.event.inputs.commit_message }}"
|
||||
if ([string]::IsNullOrWhiteSpace($commit_msg)) {
|
||||
$commit_msg = "chore: Auto Update Game Resources - $(Get-Date -Format 'yyyy-MM-dd')"
|
||||
} else {
|
||||
$commit_msg = $commit_msg.Trim()
|
||||
}
|
||||
commit_msg="${{ github.event.inputs.commit_message }}"
|
||||
if [ -z "$commit_msg" ]; then
|
||||
commit_msg="chore: Auto Update Game Resources - $(date '+%Y-%m-%d')"
|
||||
else
|
||||
commit_msg=$(echo "$commit_msg" | xargs) # Trim whitespace
|
||||
fi
|
||||
|
||||
$run_url = "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
run_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
|
||||
git commit -m "$commit_msg" -m "$run_url" -m "[skip changelog]"
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Output "have_commits=True" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "have_commits=True" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
git pull origin ${{ github.ref_name }} --rebase
|
||||
|
||||
@@ -367,26 +335,18 @@ jobs:
|
||||
branch: ${{ github.ref }}
|
||||
github_token: ${{ secrets.MAA_RESOURCE_SYNC }}
|
||||
|
||||
- name: Update OTA resource
|
||||
if: steps.update_version.outputs.update_resources == 'True'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.MISTEOWORKFLOW }}
|
||||
run: |
|
||||
gh workflow --repo MaaAssistantArknights/MaaRelease run update-resource.yml
|
||||
|
||||
# - name: Delete cache
|
||||
# if: always()
|
||||
# - name: Update OTA resource
|
||||
# if: steps.update_version.outputs.update_resources == 'True'
|
||||
# env:
|
||||
# GH_TOKEN: ${{ github.token }}
|
||||
# GH_TOKEN: ${{ secrets.MISTEOWORKFLOW }}
|
||||
# run: |
|
||||
# echo "Deleting the cache..."
|
||||
# gh cache delete
|
||||
# gh workflow --repo MaaAssistantArknights/MaaRelease run update-resource.yml
|
||||
|
||||
- name: Add cancelled status
|
||||
if: steps.update_version.outputs.changes != 'True' || steps.add_files.outputs.have_commits != 'True'
|
||||
uses: andymckay/cancel-action@0.5
|
||||
|
||||
# - name: Release # ref: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
|
||||
# if: steps.add_files.outputs.have_commits == 'True'
|
||||
# run: |
|
||||
# gh workflow run release-nightly-ota -f release_body="Auto Release of Resource Updates"
|
||||
# - name: Release # ref: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
|
||||
# if: steps.add_files.outputs.have_commits == 'True'
|
||||
# run: |
|
||||
# gh workflow run release-nightly-ota -f release_body="Auto Release of Resource Updates"
|
||||
|
||||
103
.github/workflows/smoke-testing.yml
vendored
103
.github/workflows/smoke-testing.yml
vendored
@@ -3,119 +3,126 @@ name: smoke-testing
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ".github/workflows/smoke-testing.yml"
|
||||
- "3rdparty/include/**"
|
||||
- "include/**"
|
||||
- "src/Cpp/**"
|
||||
- "src/MaaCore/**"
|
||||
- "src/SyncRes/**"
|
||||
- "MAA.sln"
|
||||
- "resource/**"
|
||||
- "!**/*.md"
|
||||
- "cmake/**"
|
||||
- "CMakeLists.txt"
|
||||
- "tools/maadeps-download.py"
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/smoke-testing.yml"
|
||||
- "3rdparty/include/**"
|
||||
- "include/**"
|
||||
- "src/Cpp/**"
|
||||
- "src/MaaCore/**"
|
||||
- "src/SyncRes/**"
|
||||
- "MAA.sln"
|
||||
- "resource/**"
|
||||
- "!**/*.md"
|
||||
- "cmake/**"
|
||||
- "CMakeLists.txt"
|
||||
- "tools/maadeps-download.py"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
smoke-testing:
|
||||
# Prevent duplicate runs on organization branches with PRs
|
||||
if: github.event_name != 'pull_request' ||
|
||||
github.event.pull_request.head.repo.full_name !=
|
||||
github.event.pull_request.base.repo.full_name
|
||||
runs-on: windows-latest
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
- name: Generate cache key
|
||||
id: cache_key
|
||||
run: |
|
||||
Write-Output "key=Smoke-testing-${{ hashFiles('src/Cpp/**', 'src/MaaCore/**', 'src/SyncRes/**', '3rdparty/include/**', 'include/**', 'MAA.sln') }}" >> $env:GITHUB_OUTPUT
|
||||
echo "key=Smoke-testing-${{ hashFiles('src/Cpp/**', 'src/MaaCore/**', '3rdparty/include/**', 'include/**', 'cmake/**', 'CMakeLists.txt', 'tools/maadeps-download.py', 'tools/linux-toolchain-download.py') }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Restore cache smoke-testing
|
||||
id: cache-exe
|
||||
id: smoke-cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
key: ${{ steps.cache_key.outputs.key }}
|
||||
path: |
|
||||
./x64/Debug/Sample.exe
|
||||
./x64/Debug/fastdeploy_ppocr.dll
|
||||
./x64/Debug/MaaCore.dll
|
||||
./x64/Debug/onnxruntime_maa.dll
|
||||
./x64/Debug/opencv_world4d_maa.dll
|
||||
./install/libfastdeploy_ppocr.dylib
|
||||
./install/libMaaCore.dylib
|
||||
./install/libonnxruntime.1.19.2.dylib
|
||||
./install/libopencv_world4.4.11.0.dylib
|
||||
./install/smoke_test
|
||||
|
||||
- name: Fetch submodules
|
||||
if: steps.cache-exe.outputs.cache-hit != 'true'
|
||||
if: steps.smoke-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
git submodule update --init --depth 1 3rdparty/EmulatorExtras
|
||||
|
||||
- name: Cache MaaDeps
|
||||
if: steps.cache-exe.outputs.cache-hit != 'true'
|
||||
id: cache-maadeps
|
||||
if: steps.smoke-cache.outputs.cache-hit != 'true'
|
||||
id: maadeps-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
./MaaDeps
|
||||
key: ${{ runner.os }}-x64-maadeps-${{ hashFiles('./maadeps-download.py') }}
|
||||
path: ./MaaDeps
|
||||
key: ${{ runner.os }}-arm64-maadeps-${{ hashFiles('tools/maadeps-download.py') }}
|
||||
|
||||
- name: Bootstrap MaaDeps
|
||||
if: steps.cache-exe.outputs.cache-hit != 'true' && steps.cache-maadeps.outputs.cache-hit != 'true'
|
||||
if: steps.smoke-cache.outputs.cache-hit != 'true' && steps.maadeps-cache.outputs.cache-hit != 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
python3 maadeps-download.py x64-windows
|
||||
python3 tools/maadeps-download.py arm64-osx
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
if: steps.cache-exe.outputs.cache-hit != 'true'
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
with:
|
||||
msbuild-architecture: x64
|
||||
|
||||
- name: Build MaaSample
|
||||
if: steps.cache-exe.outputs.cache-hit != 'true'
|
||||
- name: Config cmake
|
||||
if: steps.smoke-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
MSBUILD src/Cpp/MaaSample.slnf -t:restore,build -p:Configuration="Debug" -p:Platform="x64" -m
|
||||
mkdir -p build
|
||||
cmake -B build -GNinja \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
-DMAADEPS_TRIPLET='maa-arm64-osx' \
|
||||
-DBUILD_SMOKE_TEST=ON \
|
||||
-DINSTALL_RESOURCE=ON \
|
||||
-DWITH_HASH_VERSION=ON
|
||||
|
||||
- name: Copy resource to build directory
|
||||
if: steps.cache-exe.outputs.cache-hit == 'true'
|
||||
- name: Build
|
||||
if: steps.smoke-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
(robocopy "resource" "x64/Debug/resource" /E /XD "Arknights-Tile-Pos" /MT:4 > $null);
|
||||
if ($LASTEXITCODE -lt 2) { $global:LASTEXITCODE = $null }
|
||||
(robocopy "resource/Arknights-Tile-Pos" "x64/Debug/resource/Arknights-Tile-Pos" "overview.json" > $null);
|
||||
if ($LASTEXITCODE -lt 2) { $global:LASTEXITCODE= $null }
|
||||
cmake --build build --config Debug --parallel $(sysctl -n hw.logicalcpu)
|
||||
|
||||
- name: Install
|
||||
if: steps.smoke-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
mkdir -p install
|
||||
cmake --install build --prefix install --config Debug
|
||||
|
||||
- name: Make link for cache smoke-testing
|
||||
if: steps.smoke-cache.outputs.cache-hit == 'true'
|
||||
run: |
|
||||
ln -s "$(pwd)/resource" install/resource
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
pwsh tools/SmokeTesting/run_tests.ps1
|
||||
./tools/SmokeTesting/run_tests.zsh
|
||||
|
||||
- name: Save cache smoke-testing (only in dev)
|
||||
if: steps.cache-exe.outputs.cache-hit != 'true' && github.ref == 'refs/heads/dev'
|
||||
if: steps.smoke-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/dev'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
key: ${{ steps.cache_key.outputs.key }}
|
||||
path: |
|
||||
./x64/Debug/Sample.exe
|
||||
./x64/Debug/fastdeploy_ppocr.dll
|
||||
./x64/Debug/MaaCore.dll
|
||||
./x64/Debug/onnxruntime_maa.dll
|
||||
./x64/Debug/opencv_world4d_maa.dll
|
||||
./install/libfastdeploy_ppocr.dylib
|
||||
./install/libMaaCore.dylib
|
||||
./install/libonnxruntime.1.19.2.dylib
|
||||
./install/libopencv_world4.4.11.0.dylib
|
||||
./install/smoke_test
|
||||
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: logs
|
||||
path: ./x64/Debug/debug
|
||||
path: ./install/debug
|
||||
|
||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
contents: none
|
||||
steps:
|
||||
- name: Close inactive issues
|
||||
uses: actions/stale@v9
|
||||
uses: actions/stale@v10
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: ${{ env.daysBeforeStale }}
|
||||
|
||||
10
.github/workflows/sync-resource.yml
vendored
10
.github/workflows/sync-resource.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout MaaAssistantArknights
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
git show -s
|
||||
|
||||
- name: Checkout MaaResource
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: MaaAssistantArknights/MaaResource
|
||||
show-progress: false
|
||||
@@ -49,9 +49,3 @@ jobs:
|
||||
git status
|
||||
git commit -m "$commit_msg" || exit 0
|
||||
git push
|
||||
|
||||
- name: Setup resource update
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.MISTEOWORKFLOW }}
|
||||
run: |
|
||||
gh workflow --repo MaaAssistantArknights/MaaRelease run update-resource.yml
|
||||
|
||||
93
.github/workflows/website-workflow.yml
vendored
93
.github/workflows/website-workflow.yml
vendored
@@ -8,100 +8,65 @@ on:
|
||||
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"
|
||||
deploy-to-prod:
|
||||
description: "Deploy to prod"
|
||||
default: false
|
||||
required: true
|
||||
type: boolean
|
||||
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
timeout-minutes: 20
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
show-progress: false
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
version: 10
|
||||
run_install: false
|
||||
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 24
|
||||
cache: pnpm
|
||||
cache-dependency-path: "./docs/pnpm-lock.yaml"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
working-directory: "./website"
|
||||
working-directory: "./docs"
|
||||
|
||||
- name: Build
|
||||
- name: Build documentation
|
||||
run: pnpm run build
|
||||
working-directory: "./website"
|
||||
working-directory: "./docs"
|
||||
|
||||
- name: Upload artifact to GitHub
|
||||
uses: actions/upload-artifact@v4
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
name: dist
|
||||
path: "./website/dist"
|
||||
path: "./docs/.vuepress/dist"
|
||||
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.event_name != 'pull_request'
|
||||
steps:
|
||||
- name: Download website artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
if: ${{ inputs.deploy-to-prod == true || github.ref == 'refs/heads/master' }}
|
||||
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
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: "./docs/.vuepress/dist"
|
||||
publish_branch: gh-pages
|
||||
|
||||
11
.gitignore
vendored
11
.gitignore
vendored
@@ -451,6 +451,7 @@ tools/RoguelikeRecruitmentTool/output
|
||||
# CF 活动关卡(异格夜刀),手动改的地图
|
||||
/resource/Arknights-Tile-Pos/act24side_09-activities-act24side-level_act24side_09.json
|
||||
/src/MaaWpfGui/FodyWeavers.xml
|
||||
*.lnk
|
||||
|
||||
# 链接检查缓存
|
||||
.lycheecache
|
||||
@@ -467,3 +468,13 @@ Thumbs.db
|
||||
|
||||
# macOS Finder Shit
|
||||
.DS_Store
|
||||
|
||||
# MaaSupportExtension config
|
||||
/config/maa_pi_config.json
|
||||
|
||||
# build & install
|
||||
build
|
||||
install
|
||||
|
||||
# pnpm cache
|
||||
.pnpm-store
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "Build Schema",
|
||||
"$ref": "#/definitions/build",
|
||||
"definitions": {
|
||||
"build": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Continue": {
|
||||
"type": "boolean",
|
||||
"description": "Indicates to continue a previously failed build attempt"
|
||||
},
|
||||
"Help": {
|
||||
"type": "boolean",
|
||||
"description": "Shows the help text for this build assembly"
|
||||
},
|
||||
"Host": {
|
||||
"type": "string",
|
||||
"description": "Host for execution. Default is 'automatic'",
|
||||
"enum": [
|
||||
"AppVeyor",
|
||||
"AzurePipelines",
|
||||
"Bamboo",
|
||||
"Bitbucket",
|
||||
"Bitrise",
|
||||
"GitHubActions",
|
||||
"GitLab",
|
||||
"Jenkins",
|
||||
"Rider",
|
||||
"SpaceAutomation",
|
||||
"TeamCity",
|
||||
"Terminal",
|
||||
"TravisCI",
|
||||
"VisualStudio",
|
||||
"VSCode"
|
||||
]
|
||||
},
|
||||
"NoLogo": {
|
||||
"type": "boolean",
|
||||
"description": "Disables displaying the NUKE logo"
|
||||
},
|
||||
"Partition": {
|
||||
"type": "string",
|
||||
"description": "Partition to use on CI"
|
||||
},
|
||||
"Plan": {
|
||||
"type": "boolean",
|
||||
"description": "Shows the execution plan (HTML)"
|
||||
},
|
||||
"Profile": {
|
||||
"type": "array",
|
||||
"description": "Defines the profiles to load",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"Root": {
|
||||
"type": "string",
|
||||
"description": "Root directory during build execution"
|
||||
},
|
||||
"Skip": {
|
||||
"type": "array",
|
||||
"description": "List of targets to be skipped. Empty list skips all dependencies",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Default",
|
||||
"DevBuild",
|
||||
"DevBuildDefault",
|
||||
"DevBuildReleaseSimulation",
|
||||
"ReleaseMaa",
|
||||
"SetMaaChangeLog",
|
||||
"SetPackageBundled",
|
||||
"SetVersion",
|
||||
"UseClean",
|
||||
"UseCommitVersion",
|
||||
"UseMaaChangeLog",
|
||||
"UseMaaDevBundle",
|
||||
"UseMaaRelease",
|
||||
"UsePublishArtifact",
|
||||
"UsePublishRelease",
|
||||
"UseRsVersion",
|
||||
"UseTagVersion",
|
||||
"WithCompileCoreRelease",
|
||||
"WithCompileWpfRelease",
|
||||
"WithSyncRes"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Target": {
|
||||
"type": "array",
|
||||
"description": "List of targets to be invoked. Default is '{default_target}'",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Default",
|
||||
"DevBuild",
|
||||
"DevBuildDefault",
|
||||
"DevBuildReleaseSimulation",
|
||||
"ReleaseMaa",
|
||||
"SetMaaChangeLog",
|
||||
"SetPackageBundled",
|
||||
"SetVersion",
|
||||
"UseClean",
|
||||
"UseCommitVersion",
|
||||
"UseMaaChangeLog",
|
||||
"UseMaaDevBundle",
|
||||
"UseMaaRelease",
|
||||
"UsePublishArtifact",
|
||||
"UsePublishRelease",
|
||||
"UseRsVersion",
|
||||
"UseTagVersion",
|
||||
"WithCompileCoreRelease",
|
||||
"WithCompileWpfRelease",
|
||||
"WithSyncRes"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Verbosity": {
|
||||
"type": "string",
|
||||
"description": "Logging verbosity during build execution. Default is 'Normal'",
|
||||
"enum": ["Minimal", "Normal", "Quiet", "Verbose"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"$schema": "./build.schema.json",
|
||||
"Solution": "tools/MaaBuilder.sln"
|
||||
}
|
||||
@@ -4,26 +4,33 @@ ci:
|
||||
autofix_prs: true
|
||||
repos:
|
||||
- repo: https://github.com/shssoichiro/oxipng
|
||||
rev: v9.1.2
|
||||
rev: v9.1.4
|
||||
hooks:
|
||||
- id: oxipng
|
||||
args: ["-q", "-o", "2", "-s", "--ng"]
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: v17.0.1
|
||||
rev: v20.1.0
|
||||
hooks:
|
||||
- id: clang-format
|
||||
files: ^src/MaaCore/.*
|
||||
args: ["--assume-filename", ".clang-format"]
|
||||
- repo: https://github.com/rbubley/mirrors-prettier
|
||||
rev: v3.5.1
|
||||
rev: v3.5.3
|
||||
hooks:
|
||||
- id: prettier
|
||||
files: ^((\.github/ISSUE_TEMPLATE|docs|resource|src|tools|website)/.*|\.pre-commit-config\.yaml|package-definition\.json)
|
||||
name: prettier (config files)
|
||||
files: ^((\.github/ISSUE_TEMPLATE|resource|src|tools)/.*|\.pre-commit-config\.yaml|package-definition\.json)
|
||||
types_or:
|
||||
- yaml
|
||||
- json
|
||||
- repo: https://github.com/rbubley/mirrors-prettier
|
||||
rev: v3.5.3
|
||||
hooks:
|
||||
- id: prettier
|
||||
name: prettier (docs)
|
||||
files: ^docs/.*
|
||||
- repo: https://github.com/DavidAnson/markdownlint-cli2
|
||||
rev: v0.13.0
|
||||
rev: v0.17.2
|
||||
hooks:
|
||||
- id: markdownlint-cli2
|
||||
files: ^docs/.*|^README\.md$
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
**/node_modules/
|
||||
**/pnpm-lock.yaml
|
||||
docs/**/*.md
|
||||
|
||||
MaaDeps/
|
||||
3rdparty/
|
||||
src/maa-cli
|
||||
src/MaaMacGui
|
||||
|
||||
website/
|
||||
# website/
|
||||
# docs/
|
||||
|
||||
resource/Arknights-Tile-Pos/
|
||||
tools/OptimizeTemplates/optimize_templates.json
|
||||
|
||||
CITATION.cff
|
||||
CHANGELOG.md
|
||||
## FUCK FUCK
|
||||
@@ -12,6 +12,12 @@
|
||||
"parser": "yaml",
|
||||
"tabWidth": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["**/*.md"],
|
||||
"options": {
|
||||
"tabWidth": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
@@ -2,7 +2,8 @@
|
||||
"json.schemas": [
|
||||
{
|
||||
"fileMatch": [
|
||||
"resource/tasks.json"
|
||||
"resource/tasks/**/*.json",
|
||||
"resource/global/**/resource/tasks/**/*.json",
|
||||
],
|
||||
"url": "./docs/maa_tasks_schema.json"
|
||||
}
|
||||
@@ -11,5 +12,8 @@
|
||||
"MaaDeps/vcpkg/buildtrees": true,
|
||||
"MaaDeps/vcpkg/packages": true
|
||||
},
|
||||
"files.associations": {
|
||||
"**/resource/tasks/**/*.json": "jsonc"
|
||||
},
|
||||
"C_Cpp.exclusionPolicy": "checkFilesAndFolders"
|
||||
}
|
||||
|
||||
339
3rdparty/include/meojson/common/array.hpp
vendored
339
3rdparty/include/meojson/common/array.hpp
vendored
@@ -1,3 +1,5 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <initializer_list>
|
||||
@@ -5,6 +7,7 @@
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "exception.hpp"
|
||||
@@ -37,37 +40,109 @@ public:
|
||||
// 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))
|
||||
{}
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_to_json_in_templ_spec<jsonization_t, string_t>::value
|
||||
&& !_utils::has_to_json_array_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
basic_array(const jsonization_t& value)
|
||||
: basic_array(ext::jsonization<string_t, jsonization_t>().to_json(value))
|
||||
{
|
||||
}
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_to_json_array_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
basic_array(const jsonization_t& value)
|
||||
: basic_array(ext::jsonization<string_t, jsonization_t>().to_json_array(value))
|
||||
{
|
||||
}
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
std::is_rvalue_reference_v<jsonization_t&&>
|
||||
&& _utils::has_move_to_json_in_templ_spec<jsonization_t, string_t>::value
|
||||
&& !_utils::has_move_to_json_array_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
basic_array(jsonization_t&& value)
|
||||
: basic_array(ext::jsonization<string_t, jsonization_t>().move_to_json(std::move(value)))
|
||||
{
|
||||
}
|
||||
|
||||
//template <
|
||||
// typename jsonization_t,
|
||||
// std::enable_if_t<
|
||||
// std::is_rvalue_reference_v<jsonization_t&&>
|
||||
// && _utils::has_move_to_json_array_in_templ_spec<jsonization_t, string_t>::value,
|
||||
// bool> = true>
|
||||
//basic_array(jsonization_t&& value)
|
||||
// : basic_array(
|
||||
// ext::jsonization<string_t, jsonization_t>().move_to_json_array(std::move(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 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;
|
||||
template <
|
||||
typename value_t,
|
||||
size_t Size,
|
||||
template <typename, size_t> typename fixed_array_t = std::array>
|
||||
fixed_array_t<value_t, Size> as_fixed_array() const;
|
||||
template <typename... elem_ts>
|
||||
std::tuple<elem_ts...> as_tuple() const;
|
||||
template <typename first_t, typename second_t>
|
||||
std::pair<first_t, second_t> as_pair() const;
|
||||
|
||||
template <
|
||||
typename value_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_from_json_array_in_templ_spec<value_t, string_t>::value,
|
||||
bool> = true>
|
||||
value_t as() const&
|
||||
{
|
||||
value_t res;
|
||||
ext::jsonization<string_t, value_t>().from_json_array(*this, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
template <
|
||||
typename value_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_move_from_json_array_in_templ_spec<value_t, string_t>::value,
|
||||
bool> = true>
|
||||
value_t as() &&
|
||||
{
|
||||
value_t res;
|
||||
ext::jsonization<string_t, value_t>().move_from_json_array(std::move(*this), res);
|
||||
return res;
|
||||
}
|
||||
|
||||
// Usage: get(key_1, key_2, ..., default_value);
|
||||
template <typename... key_then_default_value_t>
|
||||
@@ -112,37 +187,93 @@ public:
|
||||
|
||||
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>
|
||||
|
||||
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>
|
||||
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
|
||||
|
||||
template <
|
||||
typename value_t,
|
||||
size_t Size,
|
||||
template <typename, size_t> typename fixed_array_t = std::array,
|
||||
std::enable_if_t<_utils::is_fixed_array<fixed_array_t<value_t, Size>>, bool> = true>
|
||||
explicit operator fixed_array_t<value_t, Size>() const
|
||||
{
|
||||
return as<fixed_array_t<value_t, Size>>();
|
||||
}
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_from_json_in_templ_spec<jsonization_t, string_t>::value
|
||||
&& !_utils::has_from_json_array_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
explicit operator jsonization_t() const&
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!dst.from_json(*this)) {
|
||||
if (!ext::jsonization<string_t, jsonization_t>().from_json(*this, dst)) {
|
||||
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
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_from_json_array_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)) {
|
||||
if (!ext::jsonization<string_t, jsonization_t>().from_json_array(*this, dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_move_from_json_in_templ_spec<jsonization_t, string_t>::value
|
||||
&& !_utils::has_move_from_json_array_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
explicit operator jsonization_t() &&
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!ext::jsonization<string_t, jsonization_t>().from_json(std::move(*this), dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_move_from_json_array_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
explicit operator jsonization_t() &&
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!ext::jsonization<string_t, jsonization_t>().move_from_json_array(
|
||||
std::move(*this),
|
||||
dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
@@ -150,8 +281,9 @@ public:
|
||||
|
||||
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;
|
||||
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>
|
||||
@@ -164,15 +296,20 @@ private:
|
||||
};
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_array<string_t>::basic_array(std::initializer_list<value_type> init_list) : _array_data(init_list)
|
||||
{}
|
||||
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)
|
||||
{}
|
||||
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())
|
||||
// inline basic_array<string_t>::basic_array(const basic_value<string_t>& val) :
|
||||
// basic_array<string_t>(val.as_array())
|
||||
//{}
|
||||
//
|
||||
// template <typename string_t>
|
||||
@@ -202,8 +339,9 @@ 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");
|
||||
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)...);
|
||||
}
|
||||
|
||||
@@ -264,65 +402,65 @@ inline bool basic_array<string_t>::all() const
|
||||
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;
|
||||
return as<collection_t<value_t>>();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t, size_t Size, template <typename, size_t> typename fixed_array_t>
|
||||
inline fixed_array_t<value_t, Size> basic_array<string_t>::as_fixed_array() const
|
||||
{
|
||||
return as<fixed_array_t<value_t, Size>>();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename... elem_ts>
|
||||
inline std::tuple<elem_ts...> basic_array<string_t>::as_tuple() const
|
||||
{
|
||||
return as<std::tuple<elem_ts...>>();
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename first_t, typename second_t>
|
||||
inline std::pair<first_t, second_t> basic_array<string_t>::as_pair() const
|
||||
{
|
||||
return as<std::pair<first_t, second_t>>();
|
||||
}
|
||||
|
||||
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> {});
|
||||
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
|
||||
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)...);
|
||||
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
|
||||
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_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)) {
|
||||
@@ -341,9 +479,9 @@ 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_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)) {
|
||||
@@ -382,7 +520,8 @@ inline std::optional<value_t> basic_array<string_t>::find(size_t pos) const
|
||||
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;
|
||||
return val.template is<value_t>() ? std::optional<value_t>(val.template as<value_t>())
|
||||
: std::nullopt;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
@@ -434,25 +573,29 @@ inline typename basic_array<string_t>::reverse_iterator basic_array<string_t>::r
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_array<string_t>::const_reverse_iterator basic_array<string_t>::rbegin() const noexcept
|
||||
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
|
||||
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
|
||||
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
|
||||
inline typename basic_array<string_t>::const_reverse_iterator
|
||||
basic_array<string_t>::crend() const noexcept
|
||||
{
|
||||
return _array_data.crend();
|
||||
}
|
||||
@@ -470,7 +613,8 @@ inline const basic_value<string_t>& basic_array<string_t>::operator[](size_t pos
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_array<string_t> basic_array<string_t>::operator+(const basic_array<string_t>& rhs) const&
|
||||
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());
|
||||
@@ -481,8 +625,10 @@ 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()));
|
||||
temp._array_data.insert(
|
||||
_array_data.end(),
|
||||
std::make_move_iterator(rhs.begin()),
|
||||
std::make_move_iterator(rhs.end()));
|
||||
return temp;
|
||||
}
|
||||
|
||||
@@ -496,7 +642,10 @@ inline basic_array<string_t> basic_array<string_t>::operator+(const basic_array<
|
||||
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()));
|
||||
_array_data.insert(
|
||||
_array_data.end(),
|
||||
std::make_move_iterator(rhs.begin()),
|
||||
std::make_move_iterator(rhs.end()));
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
@@ -510,7 +659,10 @@ inline basic_array<string_t>& basic_array<string_t>::operator+=(const basic_arra
|
||||
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()));
|
||||
_array_data.insert(
|
||||
_array_data.end(),
|
||||
std::make_move_iterator(rhs.begin()),
|
||||
std::make_move_iterator(rhs.end()));
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -520,11 +672,14 @@ inline bool basic_array<string_t>::operator==(const basic_array<string_t>& rhs)
|
||||
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>>>
|
||||
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();
|
||||
|
||||
13
3rdparty/include/meojson/common/exception.hpp
vendored
13
3rdparty/include/meojson/common/exception.hpp
vendored
@@ -1,3 +1,5 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <exception>
|
||||
@@ -9,7 +11,11 @@ class exception : public std::exception
|
||||
{
|
||||
public:
|
||||
exception() = default;
|
||||
exception(const std::string& msg) : _what(msg) {}
|
||||
|
||||
exception(const std::string& msg)
|
||||
: _what(msg)
|
||||
{
|
||||
}
|
||||
|
||||
exception(const exception&) = default;
|
||||
exception& operator=(const exception&) = default;
|
||||
@@ -18,7 +24,10 @@ public:
|
||||
|
||||
virtual ~exception() noexcept override = default;
|
||||
|
||||
virtual const char* what() const noexcept override { return _what.empty() ? "Unknown exception" : _what.c_str(); }
|
||||
virtual const char* what() const noexcept override
|
||||
{
|
||||
return _what.empty() ? "Unknown exception" : _what.c_str();
|
||||
}
|
||||
|
||||
protected:
|
||||
std::string _what;
|
||||
|
||||
263
3rdparty/include/meojson/common/object.hpp
vendored
263
3rdparty/include/meojson/common/object.hpp
vendored
@@ -1,3 +1,5 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <initializer_list>
|
||||
@@ -36,36 +38,101 @@ public:
|
||||
// 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))
|
||||
{}
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_to_json_in_templ_spec<jsonization_t, string_t>::value
|
||||
&& !_utils::has_to_json_object_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
basic_object(const jsonization_t& value)
|
||||
: basic_object(ext::jsonization<string_t, jsonization_t>().to_json(value))
|
||||
{
|
||||
}
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_to_json_object_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
basic_object(const jsonization_t& value)
|
||||
: basic_object(ext::jsonization<string_t, jsonization_t>().to_json_object(value))
|
||||
{
|
||||
}
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
std::is_rvalue_reference_v<jsonization_t&&>
|
||||
&& _utils::has_move_to_json_in_templ_spec<jsonization_t, string_t>::value
|
||||
&& !_utils::has_move_to_json_object_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
basic_object(jsonization_t&& value)
|
||||
: basic_object(ext::jsonization<string_t, jsonization_t>().move_to_json(std::move(value)))
|
||||
{
|
||||
}
|
||||
|
||||
//template <
|
||||
// typename jsonization_t,
|
||||
// std::enable_if_t<
|
||||
// std::is_rvalue_reference_v<jsonization_t&&>
|
||||
// && _utils::has_move_to_json_object_in_templ_spec<jsonization_t, string_t>::value,
|
||||
// bool> = true>
|
||||
//basic_object(jsonization_t&& value)
|
||||
// : basic_object(
|
||||
// ext::jsonization<string_t, jsonization_t>().move_to_json_object(std::move(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 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;
|
||||
|
||||
template <
|
||||
typename value_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_from_json_object_in_templ_spec<value_t, string_t>::value,
|
||||
bool> = true>
|
||||
value_t as() const&
|
||||
{
|
||||
value_t res;
|
||||
ext::jsonization<string_t, value_t>().from_json_object(*this, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
template <
|
||||
typename value_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_move_from_json_object_in_templ_spec<value_t, string_t>::value,
|
||||
bool> = true>
|
||||
value_t as() &&
|
||||
{
|
||||
value_t res;
|
||||
ext::jsonization<string_t, value_t>().move_from_json_object(std::move(*this), res);
|
||||
return res;
|
||||
}
|
||||
|
||||
// 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;
|
||||
@@ -102,37 +169,83 @@ public:
|
||||
|
||||
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>
|
||||
|
||||
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>
|
||||
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
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_from_json_in_templ_spec<jsonization_t, string_t>::value
|
||||
&& !_utils::has_from_json_object_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
explicit operator jsonization_t() const&
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!dst.from_json(*this)) {
|
||||
if (!ext::jsonization<string_t, jsonization_t>().from_json(*this, dst)) {
|
||||
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
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_from_json_object_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)) {
|
||||
if (!ext::jsonization<string_t, jsonization_t>().from_json_object(*this, dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_move_from_json_in_templ_spec<jsonization_t, string_t>::value
|
||||
&& !_utils::has_move_from_json_object_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
explicit operator jsonization_t() &&
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!ext::jsonization<string_t, jsonization_t>().from_json(std::move(*this), dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_move_from_json_object_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
explicit operator jsonization_t() &&
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!ext::jsonization<string_t, jsonization_t>().move_from_json_object(
|
||||
std::move(*this),
|
||||
dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
@@ -140,8 +253,9 @@ public:
|
||||
|
||||
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;
|
||||
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>
|
||||
@@ -155,8 +269,11 @@ private:
|
||||
|
||||
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()))
|
||||
{}
|
||||
: _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) :
|
||||
@@ -202,9 +319,10 @@ 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)...);
|
||||
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.insert_or_assign(std::forward<args_t>(args)...);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
@@ -220,7 +338,8 @@ 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();
|
||||
str +=
|
||||
char_t('"') + _utils::unescape_string(key) + string_t { '\"', ':' } + val.to_string();
|
||||
if (++iter != _object_data.cend()) {
|
||||
str += ',';
|
||||
}
|
||||
@@ -238,8 +357,8 @@ inline string_t basic_object<string_t>::format(size_t indent, size_t indent_time
|
||||
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);
|
||||
str += body_indent + char_t('"') + _utils::unescape_string(key)
|
||||
+ string_t { '\"', ':', ' ' } + val.format(indent, indent_times + 1);
|
||||
if (++iter != _object_data.cend()) {
|
||||
str += ',';
|
||||
}
|
||||
@@ -265,39 +384,40 @@ 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;
|
||||
return as<map_t<string_t, value_t>>();
|
||||
}
|
||||
|
||||
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> {});
|
||||
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
|
||||
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)...);
|
||||
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
|
||||
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_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)) {
|
||||
@@ -314,11 +434,12 @@ inline auto basic_object<string_t>::get_helper(const value_t& default_value, con
|
||||
|
||||
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
|
||||
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_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)) {
|
||||
@@ -358,7 +479,8 @@ inline std::optional<value_t> basic_object<string_t>::find(const string_t& key)
|
||||
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;
|
||||
return val.template is<value_t>() ? std::optional<value_t>(val.template as<value_t>())
|
||||
: std::nullopt;
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
@@ -374,7 +496,8 @@ inline typename basic_object<string_t>::iterator basic_object<string_t>::end() n
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_object<string_t>::const_iterator basic_object<string_t>::begin() const noexcept
|
||||
inline typename basic_object<string_t>::const_iterator
|
||||
basic_object<string_t>::begin() const noexcept
|
||||
{
|
||||
return _object_data.begin();
|
||||
}
|
||||
@@ -386,7 +509,8 @@ inline typename basic_object<string_t>::const_iterator basic_object<string_t>::e
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline typename basic_object<string_t>::const_iterator basic_object<string_t>::cbegin() const noexcept
|
||||
inline typename basic_object<string_t>::const_iterator
|
||||
basic_object<string_t>::cbegin() const noexcept
|
||||
{
|
||||
return _object_data.cbegin();
|
||||
}
|
||||
@@ -410,7 +534,8 @@ inline basic_value<string_t>& basic_object<string_t>::operator[](string_t&& key)
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_object<string_t> basic_object<string_t>::operator|(const basic_object<string_t>& rhs) const&
|
||||
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());
|
||||
@@ -422,12 +547,15 @@ inline basic_object<string_t> basic_object<string_t>::operator|(basic_object<str
|
||||
{
|
||||
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()));
|
||||
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) &&
|
||||
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);
|
||||
@@ -461,11 +589,14 @@ inline bool basic_object<string_t>::operator==(const basic_object<string_t>& rhs
|
||||
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>>>
|
||||
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();
|
||||
|
||||
179
3rdparty/include/meojson/common/serialization.hpp
vendored
179
3rdparty/include/meojson/common/serialization.hpp
vendored
@@ -1,3 +1,5 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
@@ -9,96 +11,101 @@ 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 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(...);
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
|
||||
public:
|
||||
static constexpr bool value = decltype(test<in_t>(0))::value;
|
||||
};
|
||||
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 ...; }
|
||||
};
|
||||
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. "
|
||||
template <typename T>
|
||||
void unable_to_serialize()
|
||||
{
|
||||
static_assert(
|
||||
!sizeof(T),
|
||||
"Unable to serialize T. "
|
||||
#ifdef _MSC_VER
|
||||
"See T below: " __FUNCSIG__
|
||||
"See T below: " __FUNCSIG__
|
||||
#else
|
||||
// "See T below: " __PRETTY_FUNCTION__
|
||||
// "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 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(...);
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
|
||||
public:
|
||||
static constexpr bool value = decltype(test<out_t>(0))::value;
|
||||
};
|
||||
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 ...; }
|
||||
};
|
||||
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. "
|
||||
template <typename T>
|
||||
void unable_to_deserialize()
|
||||
{
|
||||
static_assert(
|
||||
!sizeof(T),
|
||||
"Unable to deserialize T. "
|
||||
#ifdef _MSC_VER
|
||||
"See T below: " __FUNCSIG__
|
||||
"See T below: " __FUNCSIG__
|
||||
#else
|
||||
// "See T below: " __PRETTY_FUNCTION__
|
||||
// "See T below: " __PRETTY_FUNCTION__
|
||||
|
||||
#endif
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename in_t, typename serializer_t = _serialization_helper::empty_serializer,
|
||||
typename string_t = default_string_t>
|
||||
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>>) {
|
||||
else if constexpr (
|
||||
_utils::is_collection<std::decay_t<in_t>> || _utils::is_fixed_array<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);
|
||||
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;
|
||||
@@ -109,27 +116,32 @@ basic_value<string_t> serialize(in_t&& in, const serializer_t& serializer = {})
|
||||
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);
|
||||
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 if constexpr (std::is_constructible_v<basic_value<string_t>, in_t>) {
|
||||
return basic_value<string_t>(std::forward<in_t>(in));
|
||||
}
|
||||
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 = {})
|
||||
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;
|
||||
@@ -149,20 +161,45 @@ bool deserialize(const basic_value<string_t>& in, out_t& out, const deserializer
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if constexpr (_utils::is_map<std::decay_t<out_t>>) {
|
||||
if (!in.is_object()) {
|
||||
else if constexpr (_utils::is_fixed_array<std::decay_t<out_t>>) {
|
||||
if (!in.is_array()) {
|
||||
return false;
|
||||
}
|
||||
for (auto&& [key, j_elem] : in.as_object()) {
|
||||
auto&& in_as_arr = in.as_array();
|
||||
constexpr size_t out_size = _utils::fixed_array_size<out_t>;
|
||||
if (in_as_arr.size() != out_size) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < out_size; ++i) {
|
||||
auto&& j_elem = in_as_arr.at(i);
|
||||
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));
|
||||
out.at(i) = 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::mapped_type;
|
||||
elem_t elem {};
|
||||
if (!deserialize<elem_t, deserializer_t, string_t>(j_elem, elem, deserializer)) {
|
||||
return false;
|
||||
}
|
||||
out.emplace(std::forward<decltype(key)>(key), std::move(elem));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if constexpr (std::is_constructible_v<out_t, basic_value<string_t>>) {
|
||||
out = out_t(in);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
_serialization_helper::unable_to_deserialize<out_t>();
|
||||
}
|
||||
|
||||
4
3rdparty/include/meojson/common/types.hpp
vendored
4
3rdparty/include/meojson/common/types.hpp
vendored
@@ -1,5 +1,7 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "array.hpp"
|
||||
#include "object.hpp"
|
||||
#include "value.hpp"
|
||||
#include "value.hpp"
|
||||
|
||||
298
3rdparty/include/meojson/common/utils.hpp
vendored
298
3rdparty/include/meojson/common/utils.hpp
vendored
@@ -1,7 +1,14 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
|
||||
namespace json
|
||||
{
|
||||
@@ -25,7 +32,7 @@ using wobject = basic_object<std::wstring>;
|
||||
|
||||
namespace json::ext
|
||||
{
|
||||
template <typename T>
|
||||
template <typename string_t, typename T, typename = void>
|
||||
class jsonization
|
||||
{
|
||||
public:
|
||||
@@ -61,18 +68,52 @@ constexpr bool is_container<T, std::void_t<typename T::value_type, range_value_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>;
|
||||
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_fixed_array = false;
|
||||
template <template <typename, size_t> typename arr_t, typename value_t, size_t size>
|
||||
constexpr bool is_fixed_array<arr_t<value_t, size>> = true;
|
||||
|
||||
template <typename T, typename = std::enable_if_t<is_fixed_array<T>>>
|
||||
constexpr size_t fixed_array_size = 0;
|
||||
template <template <typename, size_t> typename arr_t, typename value_t, size_t size>
|
||||
constexpr size_t fixed_array_size<arr_t<value_t, size>> = size;
|
||||
|
||||
template <typename T, typename = void>
|
||||
constexpr bool is_collection = false;
|
||||
template <typename T>
|
||||
constexpr bool is_collection<T> = is_container<T> && !is_map<T>;
|
||||
constexpr bool is_collection<T> = is_container<T> && !is_map<T> && !is_fixed_array<T>;
|
||||
|
||||
template <typename T>
|
||||
class has_to_json_in_member
|
||||
constexpr bool is_variant = false;
|
||||
template <typename... args_t>
|
||||
constexpr bool is_variant<std::variant<args_t...>> = true;
|
||||
|
||||
template <typename T>
|
||||
constexpr bool is_tuple = false;
|
||||
template <typename... args_t>
|
||||
constexpr bool is_tuple<std::tuple<args_t...>> = true;
|
||||
|
||||
template <typename T>
|
||||
constexpr bool is_pair = false;
|
||||
template <typename... args_t>
|
||||
constexpr bool is_pair<std::pair<args_t...>> = true;
|
||||
|
||||
template <typename T, typename = void>
|
||||
constexpr bool is_tuple_like = false;
|
||||
template <template <typename...> typename tuple_t, typename... args_t>
|
||||
constexpr bool is_tuple_like<
|
||||
tuple_t<args_t...>,
|
||||
std::void_t<decltype(std::tuple_size<tuple_t<args_t...>>::value)>> =
|
||||
std::tuple_size<tuple_t<args_t...>>::value == sizeof...(args_t);
|
||||
|
||||
template <typename T>
|
||||
class has_emplace_back
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int) -> decltype(std::declval<U>().to_json(), std::true_type());
|
||||
static auto test(int) -> decltype(std::declval<U>().emplace_back(), std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
@@ -82,10 +123,10 @@ public:
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class has_to_json_in_templ_spec
|
||||
class has_to_json_in_member
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int) -> decltype(std::declval<ext::jsonization<U>>().to_json(std::declval<U>()), std::true_type());
|
||||
static auto test(int) -> decltype(std::declval<U>().to_json(), std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
@@ -108,21 +149,6 @@ 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
|
||||
{
|
||||
@@ -137,14 +163,208 @@ public:
|
||||
static constexpr bool value = decltype(test<T>(0))::value;
|
||||
};
|
||||
|
||||
template <typename T, typename string_t>
|
||||
class has_to_json_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, 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_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, 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_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());
|
||||
-> decltype(std::declval<ext::jsonization<string_t, 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 T, typename string_t>
|
||||
class has_move_to_json_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().move_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_move_from_json_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().move_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 T, typename string_t>
|
||||
class has_to_json_array_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().to_json_array(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_array_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().check_json_array(std::declval<json::basic_array<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_array_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().from_json_array(std::declval<json::basic_array<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 T, typename string_t>
|
||||
class has_move_to_json_array_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().move_to_json_array(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_move_from_json_array_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().move_from_json_array(std::declval<json::basic_array<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 T, typename string_t>
|
||||
class has_to_json_object_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().to_json_object(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_object_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().check_json_object(std::declval<json::basic_object<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_object_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().from_json_object(std::declval<json::basic_object<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 T, typename string_t>
|
||||
class has_move_to_json_object_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().move_to_json_object(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_move_from_json_object_in_templ_spec
|
||||
{
|
||||
template <typename U>
|
||||
static auto test(int)
|
||||
-> decltype(std::declval<ext::jsonization<string_t, U>>().move_from_json_object(std::declval<json::basic_object<string_t>>(), std::declval<U&>()), std::true_type());
|
||||
|
||||
template <typename U>
|
||||
static std::false_type test(...);
|
||||
@@ -154,7 +374,7 @@ public:
|
||||
};
|
||||
|
||||
template <typename string_t>
|
||||
static constexpr string_t unescape_string(const string_t& str)
|
||||
inline constexpr string_t unescape_string(const string_t& str)
|
||||
{
|
||||
using char_t = typename string_t::value_type;
|
||||
|
||||
@@ -202,26 +422,41 @@ static constexpr string_t unescape_string(const string_t& str)
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
static constexpr string_t true_string()
|
||||
inline constexpr string_t true_string()
|
||||
{
|
||||
return { 't', 'r', 'u', 'e' };
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
static constexpr string_t false_string()
|
||||
inline constexpr string_t false_string()
|
||||
{
|
||||
return { 'f', 'a', 'l', 's', 'e' };
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
static constexpr string_t null_string()
|
||||
inline 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)
|
||||
inline string_t to_basic_string(any_t&& arg)
|
||||
{
|
||||
#ifdef MEOJSON_KEEP_FLOATING_PRECISION
|
||||
using real_type = std::remove_reference_t<any_t>;
|
||||
if constexpr (std::is_floating_point_v<real_type>) {
|
||||
if constexpr (std::is_same_v<string_t, std::string>) {
|
||||
std::ostringstream oss;
|
||||
oss << std::setprecision(std::numeric_limits<real_type>::max_digits10) << arg;
|
||||
return oss.str();
|
||||
}
|
||||
else if constexpr (std::is_same_v<string_t, std::wstring>) {
|
||||
std::wostringstream oss;
|
||||
oss << std::setprecision(std::numeric_limits<real_type>::max_digits10) << arg;
|
||||
return oss.str();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if constexpr (std::is_same_v<string_t, std::string>) {
|
||||
return std::to_string(std::forward<any_t>(arg));
|
||||
}
|
||||
@@ -232,4 +467,7 @@ string_t to_basic_string(any_t&& arg)
|
||||
static_assert(!sizeof(any_t), "Unsupported type");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace json::_utils
|
||||
|
||||
#include "../reflection/extensions.hpp"
|
||||
|
||||
392
3rdparty/include/meojson/common/value.hpp
vendored
392
3rdparty/include/meojson/common/value.hpp
vendored
@@ -1,13 +1,19 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <initializer_list>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "exception.hpp"
|
||||
#include "utils.hpp"
|
||||
@@ -64,31 +70,31 @@ public:
|
||||
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 enum_t, std::enable_if_t<std::is_enum_v<enum_t>, bool> = true>
|
||||
basic_value(enum_t e)
|
||||
: basic_value(static_cast<std::underlying_type_t<enum_t>>(e))
|
||||
{
|
||||
}
|
||||
|
||||
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 jsonization_t,
|
||||
std::enable_if_t<_utils::has_to_json_in_templ_spec<jsonization_t, string_t>::value, bool> =
|
||||
true>
|
||||
basic_value(const jsonization_t& value)
|
||||
: basic_value(ext::jsonization<string_t, 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;
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
std::is_rvalue_reference_v<jsonization_t&&>
|
||||
&& _utils::has_move_to_json_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
basic_value(jsonization_t&& value)
|
||||
: basic_value(ext::jsonization<string_t, jsonization_t>().move_to_json(std::move(value)))
|
||||
{
|
||||
}
|
||||
|
||||
// I don't know if you want to convert char to string or number, so I delete these constructors.
|
||||
basic_value(char) = delete;
|
||||
@@ -99,13 +105,21 @@ public:
|
||||
~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;
|
||||
|
||||
@@ -114,9 +128,13 @@ public:
|
||||
|
||||
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;
|
||||
|
||||
@@ -148,11 +166,19 @@ public:
|
||||
|
||||
template <typename value_t, template <typename...> typename collection_t = std::vector>
|
||||
collection_t<value_t> as_collection() const;
|
||||
template <
|
||||
typename value_t,
|
||||
size_t Size,
|
||||
template <typename, size_t> typename fixed_array_t = std::array>
|
||||
fixed_array_t<value_t, Size> as_fixed_array() 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;
|
||||
value_t as() const&;
|
||||
|
||||
template <typename value_t>
|
||||
value_t as() &&;
|
||||
|
||||
basic_array<string_t>& as_array();
|
||||
basic_object<string_t>& as_object();
|
||||
@@ -162,20 +188,29 @@ public:
|
||||
|
||||
void clear() noexcept;
|
||||
|
||||
string_t dumps(std::optional<size_t> indent = std::nullopt) const { return indent ? format(*indent) : to_string(); }
|
||||
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));
|
||||
}
|
||||
|
||||
// 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;
|
||||
@@ -200,48 +235,78 @@ public:
|
||||
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>
|
||||
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>
|
||||
|
||||
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
|
||||
|
||||
template <typename enum_t, std::enable_if_t<std::is_enum_v<enum_t>, bool> = true>
|
||||
explicit operator enum_t() const
|
||||
{
|
||||
return static_cast<enum_t>(static_cast<std::underlying_type_t<enum_t>>(*this));
|
||||
}
|
||||
|
||||
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 (!dst.from_json(*this)) {
|
||||
if (!ext::jsonization<string_t, jsonization_t>().from_json(*this, dst)) {
|
||||
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
|
||||
|
||||
template <
|
||||
typename jsonization_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_move_from_json_in_templ_spec<jsonization_t, string_t>::value,
|
||||
bool> = true>
|
||||
explicit operator jsonization_t() &&
|
||||
{
|
||||
jsonization_t dst {};
|
||||
if (!ext::jsonization<jsonization_t>().from_json(*this, dst)) {
|
||||
if (!ext::jsonization<string_t, jsonization_t>().move_from_json(std::move(*this), dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
@@ -256,8 +321,9 @@ private:
|
||||
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;
|
||||
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;
|
||||
@@ -276,89 +342,125 @@ 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))
|
||||
{}
|
||||
: _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>()))
|
||||
{}
|
||||
: _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))
|
||||
{}
|
||||
: _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))
|
||||
{}
|
||||
: _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))
|
||||
{}
|
||||
: _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))
|
||||
{}
|
||||
: _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))
|
||||
{}
|
||||
: _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))
|
||||
{}
|
||||
: _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))
|
||||
{}
|
||||
: _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))
|
||||
{}
|
||||
: _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))
|
||||
{}
|
||||
: _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))
|
||||
{}
|
||||
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))
|
||||
{}
|
||||
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)
|
||||
{}
|
||||
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)))
|
||||
{}
|
||||
: _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)))
|
||||
{}
|
||||
: _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))
|
||||
{}
|
||||
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>
|
||||
@@ -371,16 +473,13 @@ 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);
|
||||
return ext::jsonization<string_t, 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>) {
|
||||
else if constexpr (std::is_arithmetic_v<value_t> || std::is_enum_v<value_t>) {
|
||||
return is_number();
|
||||
}
|
||||
else if constexpr (std::is_constructible_v<string_t, value_t>) {
|
||||
@@ -396,8 +495,8 @@ inline bool basic_value<string_t>::is() const noexcept
|
||||
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>();
|
||||
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");
|
||||
@@ -444,33 +543,42 @@ 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> {});
|
||||
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
|
||||
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)...);
|
||||
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
|
||||
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)...)
|
||||
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)...)
|
||||
return is_array() ? as_array().get_helper(
|
||||
default_value,
|
||||
std::forward<first_key_t>(first),
|
||||
std::forward<rest_keys_t>(rest)...)
|
||||
: default_value;
|
||||
}
|
||||
else {
|
||||
@@ -480,16 +588,22 @@ inline auto basic_value<string_t>::get_helper(const value_t& default_value, firs
|
||||
|
||||
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
|
||||
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;
|
||||
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;
|
||||
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");
|
||||
static_assert(
|
||||
!sizeof(unique_key_t),
|
||||
"Parameter must be integral or string_t constructible");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -682,21 +796,33 @@ inline basic_object<string_t>& basic_value<string_t>::as_object()
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline value_t basic_value<string_t>::as() const
|
||||
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) {
|
||||
else if constexpr (_utils::has_from_json_in_templ_spec<value_t, string_t>::value) {
|
||||
value_t dst {};
|
||||
if (!dst.from_json(*this)) {
|
||||
if (!ext::jsonization<string_t, value_t>().from_json(*this, dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
else if constexpr (_utils::has_from_json_in_templ_spec<value_t, string_t>::value) {
|
||||
else {
|
||||
return static_cast<value_t>(*this);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
template <typename value_t>
|
||||
inline value_t basic_value<string_t>::as() &&
|
||||
{
|
||||
if constexpr (std::is_same_v<basic_value<string_t>, value_t>) {
|
||||
return std::move(*this);
|
||||
}
|
||||
else if constexpr (_utils::has_move_from_json_in_templ_spec<value_t, string_t>::value) {
|
||||
value_t dst {};
|
||||
if (!ext::jsonization<value_t>().from_json(*this, dst)) {
|
||||
if (!ext::jsonization<string_t, value_t>().move_from_json(std::move(*this), dst)) {
|
||||
throw exception("Wrong JSON");
|
||||
}
|
||||
return dst;
|
||||
@@ -722,10 +848,14 @@ 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...>;
|
||||
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");
|
||||
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)...);
|
||||
@@ -801,6 +931,13 @@ 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, size_t Size, template <typename, size_t> typename fixed_array_t>
|
||||
inline fixed_array_t<value_t, Size> basic_value<string_t>::as_fixed_array() const
|
||||
{
|
||||
return as_array().template as_fixed_array<value_t, Size>();
|
||||
}
|
||||
|
||||
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
|
||||
@@ -818,12 +955,15 @@ inline basic_value<string_t>& basic_value<string_t>::operator=(const basic_value
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t>& basic_value<string_t>::operator=(basic_value<string_t>&& rhs) noexcept = default;
|
||||
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;
|
||||
if (_type != rhs._type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (_type) {
|
||||
case value_type::null:
|
||||
@@ -878,7 +1018,8 @@ inline basic_value<string_t>& basic_value<string_t>::operator[](string_t&& key)
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t> basic_value<string_t>::operator|(const basic_object<string_t>& rhs) const&
|
||||
inline basic_value<string_t>
|
||||
basic_value<string_t>::operator|(const basic_object<string_t>& rhs) const&
|
||||
{
|
||||
return as_object() | rhs;
|
||||
}
|
||||
@@ -916,7 +1057,8 @@ inline basic_value<string_t>& basic_value<string_t>::operator|=(basic_object<str
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline basic_value<string_t> basic_value<string_t>::operator+(const basic_array<string_t>& rhs) const&
|
||||
inline basic_value<string_t>
|
||||
basic_value<string_t>::operator+(const basic_array<string_t>& rhs) const&
|
||||
{
|
||||
return as_array() + rhs;
|
||||
}
|
||||
@@ -956,9 +1098,12 @@ inline basic_value<string_t>& basic_value<string_t>::operator+=(basic_array<stri
|
||||
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)...)
|
||||
: _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");
|
||||
static_assert(
|
||||
std::is_constructible_v<var_t, args_t...>,
|
||||
"Parameter can't be used to construct a var_t");
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
@@ -981,11 +1126,14 @@ inline typename basic_value<string_t>::var_t basic_value<string_t>::deep_copy(co
|
||||
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>>>
|
||||
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();
|
||||
|
||||
5
3rdparty/include/meojson/json.hpp
vendored
5
3rdparty/include/meojson/json.hpp
vendored
@@ -1,6 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/serialization.hpp"
|
||||
// IWYU pragma: begin_exports
|
||||
|
||||
#include "common/types.hpp"
|
||||
#include "parser/parser.hpp"
|
||||
#include "reflection/jsonization.hpp"
|
||||
|
||||
// IWYU pragma: end_exports
|
||||
|
||||
4
3rdparty/include/meojson/json5.hpp
vendored
4
3rdparty/include/meojson/json5.hpp
vendored
@@ -1,4 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/types.hpp"
|
||||
#include "parser5/parser5.hpp"
|
||||
37
3rdparty/include/meojson/parser/bitops.hpp
vendored
37
3rdparty/include/meojson/parser/bitops.hpp
vendored
@@ -1,13 +1,17 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#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;
|
||||
@@ -15,25 +19,37 @@ inline constexpr bool is_little_endian()
|
||||
}
|
||||
#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);
|
||||
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);
|
||||
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);
|
||||
@@ -45,14 +61,17 @@ 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);
|
||||
@@ -63,16 +82,19 @@ 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;
|
||||
@@ -86,14 +108,17 @@ 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);
|
||||
@@ -102,10 +127,12 @@ inline int countr_one(uint64_t x)
|
||||
// no constexpr endian awareness before C++20
|
||||
inline bool is_little_endian()
|
||||
{
|
||||
union {
|
||||
union
|
||||
{
|
||||
uint32_t u32;
|
||||
uint8_t u8;
|
||||
} u = { 0x01020304 };
|
||||
|
||||
return u.u8 == 4;
|
||||
}
|
||||
} // namespace json::_bitops
|
||||
|
||||
42
3rdparty/include/meojson/parser/packed_bytes.hpp
vendored
42
3rdparty/include/meojson/parser/packed_bytes.hpp
vendored
@@ -1,3 +1,5 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
@@ -28,11 +30,13 @@ struct packed_bytes
|
||||
};
|
||||
}
|
||||
|
||||
#ifndef MEOJSON_DISABLE_PACKED_BYTES
|
||||
#if defined(__SSE2__) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP)
|
||||
#include "packed_bytes_x86.hpp"
|
||||
#elif defined(__ARM_NEON) || defined(_M_ARM) || defined(_M_ARM64)
|
||||
#include "packed_bytes_arm.hpp"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace json::_packed_bytes
|
||||
{
|
||||
@@ -66,14 +70,19 @@ struct packed_bytes_trait_uint64
|
||||
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 (_bitops::is_little_endian())
|
||||
if (_bitops::is_little_endian()) {
|
||||
return _bitops::countr_zero(x) / 8;
|
||||
else
|
||||
}
|
||||
else {
|
||||
return _bitops::countl_zero(x) / 8;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -108,16 +117,22 @@ struct packed_bytes_trait_uint32
|
||||
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 (_bitops::is_little_endian())
|
||||
if (_bitops::is_little_endian()) {
|
||||
return _bitops::countr_zero(x) / 8;
|
||||
else
|
||||
}
|
||||
else {
|
||||
return _bitops::countl_zero(x) / 8;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct packed_bytes<8>
|
||||
{
|
||||
@@ -133,9 +148,14 @@ struct packed_bytes<4>
|
||||
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
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
// current NEON implementation doesn't outperform 64-bit scalar implementation
|
||||
@@ -17,7 +19,10 @@ struct packed_bytes_trait_neon
|
||||
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)
|
||||
{
|
||||
@@ -26,19 +31,31 @@ struct packed_bytes_trait_neon
|
||||
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)
|
||||
{
|
||||
#ifdef __packed_bytes_trait_arm64
|
||||
return vmaxvq_u8(x) == 0;
|
||||
#else
|
||||
auto fold64 = vorr_u64(vget_high_u64(vreinterpretq_u8_u64(x), 0), vget_low_u64(vreinterpretq_u8_u64(x), 1));
|
||||
auto fold32 = vget_lane_u32(vreinterpret_u64_u32(fold64), 0) | vget_lane_u32(vreinterpret_u64_u32(fold64), 1);
|
||||
auto fold64 = vorr_u64(
|
||||
vget_high_u64(vreinterpretq_u8_u64(x), 0),
|
||||
vget_low_u64(vreinterpretq_u8_u64(x), 1));
|
||||
auto fold32 = vget_lane_u32(vreinterpret_u64_u32(fold64), 0)
|
||||
| vget_lane_u32(vreinterpret_u64_u32(fold64), 1);
|
||||
return fold32 == 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "packed_bytes.hpp"
|
||||
|
||||
#include <emmintrin.h>
|
||||
@@ -35,9 +38,15 @@ struct packed_bytes_trait_sse
|
||||
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)
|
||||
{
|
||||
@@ -97,14 +106,20 @@ 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)
|
||||
{
|
||||
|
||||
425
3rdparty/include/meojson/parser/parser.hpp
vendored
425
3rdparty/include/meojson/parser/parser.hpp
vendored
@@ -1,5 +1,8 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cctype>
|
||||
#include <fstream>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
@@ -15,8 +18,11 @@ namespace json
|
||||
// * parser declare *
|
||||
// ****************************
|
||||
|
||||
template <typename string_t = default_string_t, typename parsing_t = void,
|
||||
typename accel_traits = _packed_bytes::packed_bytes_trait_max>
|
||||
template <
|
||||
bool accept_jsonc = false,
|
||||
typename string_t = default_string_t,
|
||||
typename parsing_t = void,
|
||||
typename accel_traits = _packed_bytes::packed_bytes_trait_max>
|
||||
class parser
|
||||
{
|
||||
public:
|
||||
@@ -28,7 +34,12 @@ public:
|
||||
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) { ; }
|
||||
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();
|
||||
@@ -46,7 +57,9 @@ private:
|
||||
|
||||
bool skip_string_literal_with_accel();
|
||||
bool skip_whitespace() noexcept;
|
||||
bool skip_comment() noexcept;
|
||||
bool skip_digit();
|
||||
bool skip_unicode_escape(uint16_t& pair_high, string_t& result);
|
||||
|
||||
private:
|
||||
parsing_iter_t _cur;
|
||||
@@ -63,26 +76,34 @@ 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 parsing_t>
|
||||
auto parsec(const parsing_t& content);
|
||||
|
||||
template <typename char_t>
|
||||
auto parsec(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 = false, bool with_commets = false);
|
||||
|
||||
template <typename ifstream_t = std::ifstream, typename path_t = void>
|
||||
auto open(const path_t& path, bool check_bom = false);
|
||||
auto open(const path_t& path, bool check_bom = false, bool with_commets = false);
|
||||
|
||||
namespace literals
|
||||
{
|
||||
value operator""_json(const char* str, size_t len);
|
||||
wvalue operator""_json(const wchar_t* str, size_t len);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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>
|
||||
@@ -92,14 +113,17 @@ 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)
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline std::optional<basic_value<string_t>>
|
||||
parser<accept_jsonc, string_t, parsing_t, accel_traits>::parse(const parsing_t& content)
|
||||
{
|
||||
return parser<string_t, parsing_t, accel_traits>(content.cbegin(), content.cend()).parse();
|
||||
return parser<accept_jsonc, 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()
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline std::optional<basic_value<string_t>>
|
||||
parser<accept_jsonc, string_t, parsing_t, accel_traits>::parse()
|
||||
{
|
||||
if (!skip_whitespace()) {
|
||||
return std::nullopt;
|
||||
@@ -121,8 +145,7 @@ inline std::optional<basic_value<string_t>> parser<string_t, parsing_t, accel_tr
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// After the parsing is complete, there should be no more content other than
|
||||
// spaces behind
|
||||
// After the parsing is complete, there should be no more content other than spaces behind
|
||||
if (skip_whitespace()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
@@ -130,8 +153,8 @@ inline std::optional<basic_value<string_t>> parser<string_t, parsing_t, accel_tr
|
||||
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()
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<accept_jsonc, string_t, parsing_t, accel_traits>::parse_value()
|
||||
{
|
||||
switch (*_cur) {
|
||||
case 'n':
|
||||
@@ -162,8 +185,8 @@ inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_va
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_null()
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<accept_jsonc, string_t, parsing_t, accel_traits>::parse_null()
|
||||
{
|
||||
for (const auto& ch : _utils::null_string<string_t>()) {
|
||||
if (_cur != _end && *_cur == ch) {
|
||||
@@ -177,8 +200,9 @@ inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_nu
|
||||
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()
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t>
|
||||
parser<accept_jsonc, string_t, parsing_t, accel_traits>::parse_boolean()
|
||||
{
|
||||
switch (*_cur) {
|
||||
case 't':
|
||||
@@ -206,8 +230,8 @@ inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_bo
|
||||
}
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_number()
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<accept_jsonc, string_t, parsing_t, accel_traits>::parse_number()
|
||||
{
|
||||
const auto first = _cur;
|
||||
if (*_cur == '-') {
|
||||
@@ -245,18 +269,20 @@ inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_nu
|
||||
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()
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<accept_jsonc, 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());
|
||||
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()
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<accept_jsonc, string_t, parsing_t, accel_traits>::parse_array()
|
||||
{
|
||||
if (*_cur == '[') {
|
||||
++_cur;
|
||||
@@ -280,6 +306,12 @@ inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_ar
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
if constexpr (accept_jsonc) {
|
||||
if (*_cur == ']') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
basic_value<string_t> val = parse_value();
|
||||
|
||||
if (!val.valid() || !skip_whitespace()) {
|
||||
@@ -306,8 +338,8 @@ inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_ar
|
||||
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()
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline basic_value<string_t> parser<accept_jsonc, string_t, parsing_t, accel_traits>::parse_object()
|
||||
{
|
||||
if (*_cur == '{') {
|
||||
++_cur;
|
||||
@@ -331,6 +363,12 @@ inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_ob
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
if constexpr (accept_jsonc) {
|
||||
if (*_cur == '}') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
auto key_opt = parse_stdstring();
|
||||
|
||||
if (key_opt && skip_whitespace() && *_cur == ':') {
|
||||
@@ -350,7 +388,10 @@ inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_ob
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
result.emplace(std::move(*key_opt), std::move(val));
|
||||
auto emplaced = result.emplace(std::move(*key_opt), std::move(val)).second;
|
||||
if (!emplaced) {
|
||||
return invalid_value<string_t>();
|
||||
}
|
||||
|
||||
if (*_cur == ',') {
|
||||
++_cur;
|
||||
@@ -370,8 +411,9 @@ inline basic_value<string_t> parser<string_t, parsing_t, accel_traits>::parse_ob
|
||||
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()
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline std::optional<string_t>
|
||||
parser<accept_jsonc, string_t, parsing_t, accel_traits>::parse_stdstring()
|
||||
{
|
||||
if (*_cur == '"') {
|
||||
++_cur;
|
||||
@@ -382,6 +424,7 @@ inline std::optional<string_t> parser<string_t, parsing_t, accel_traits>::parse_
|
||||
|
||||
string_t result;
|
||||
auto no_escape_beg = _cur;
|
||||
uint16_t pair_high = 0;
|
||||
|
||||
while (_cur != _end) {
|
||||
if constexpr (sizeof(*_cur) == 1 && accel_traits::available) {
|
||||
@@ -399,6 +442,9 @@ inline std::optional<string_t> parser<string_t, parsing_t, accel_traits>::parse_
|
||||
if (_cur == _end) {
|
||||
return std::nullopt;
|
||||
}
|
||||
if (pair_high && *_cur != 'u') {
|
||||
return std::nullopt;
|
||||
}
|
||||
switch (*_cur) {
|
||||
case '"':
|
||||
result.push_back('"');
|
||||
@@ -424,9 +470,11 @@ inline std::optional<string_t> parser<string_t, parsing_t, accel_traits>::parse_
|
||||
case 't':
|
||||
result.push_back('\t');
|
||||
break;
|
||||
// case 'u':
|
||||
// result.push_back('\u');
|
||||
// break;
|
||||
case 'u':
|
||||
if (!skip_unicode_escape(pair_high, result)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Illegal backslash escape
|
||||
return std::nullopt;
|
||||
@@ -435,10 +483,16 @@ inline std::optional<string_t> parser<string_t, parsing_t, accel_traits>::parse_
|
||||
break;
|
||||
}
|
||||
case '"': {
|
||||
if (pair_high) {
|
||||
return std::nullopt;
|
||||
}
|
||||
result += string_t(no_escape_beg, _cur++);
|
||||
return result;
|
||||
}
|
||||
default:
|
||||
if (pair_high) {
|
||||
return std::nullopt;
|
||||
}
|
||||
++_cur;
|
||||
break;
|
||||
}
|
||||
@@ -446,8 +500,106 @@ inline std::optional<string_t> parser<string_t, parsing_t, accel_traits>::parse_
|
||||
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()
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline bool parser<accept_jsonc, string_t, parsing_t, accel_traits>::skip_unicode_escape(
|
||||
uint16_t& pair_high,
|
||||
string_t& result)
|
||||
{
|
||||
uint16_t cp = 0;
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (++_cur == _end) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!std::isxdigit(static_cast<unsigned char>(*_cur))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
cp <<= 4;
|
||||
|
||||
if ('0' <= *_cur && *_cur <= '9') {
|
||||
cp |= *_cur - '0';
|
||||
}
|
||||
else if ('a' <= *_cur && *_cur <= 'f') {
|
||||
cp |= *_cur - 'a' + 10;
|
||||
}
|
||||
else if ('A' <= *_cur && *_cur <= 'F') {
|
||||
cp |= *_cur - 'A' + 10;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t ext_cp = cp;
|
||||
uint16_t hi_cp = 0, lo_cp = 0;
|
||||
|
||||
if (0xD800 <= cp && cp <= 0xDBFF) {
|
||||
if (pair_high) {
|
||||
return false;
|
||||
}
|
||||
pair_high = cp;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (0xDC00 <= cp && cp <= 0xDFFF) {
|
||||
if (!pair_high) {
|
||||
return false;
|
||||
}
|
||||
ext_cp = (((pair_high - 0xD800) << 10) | (cp - 0xDC00)) + 0x10000;
|
||||
hi_cp = pair_high;
|
||||
lo_cp = cp;
|
||||
pair_high = 0;
|
||||
}
|
||||
|
||||
if constexpr (std::is_same_v<typename string_t::value_type, char>) {
|
||||
// utf8
|
||||
if (ext_cp <= 0x7F) {
|
||||
result.push_back(static_cast<char>(ext_cp));
|
||||
}
|
||||
else if (ext_cp <= 0x7FF) {
|
||||
result.push_back(static_cast<char>(((ext_cp >> 6) & 0b00011111) | 0b11000000u));
|
||||
result.push_back(static_cast<char>((ext_cp & 0b00111111) | 0b10000000u));
|
||||
}
|
||||
else if (ext_cp <= 0xFFFF) {
|
||||
result.push_back(static_cast<char>(((ext_cp >> 12) & 0b00001111) | 0b11100000u));
|
||||
result.push_back(static_cast<char>(((ext_cp >> 6) & 0b00111111) | 0b10000000u));
|
||||
result.push_back(static_cast<char>((ext_cp & 0b00111111) | 0b10000000u));
|
||||
}
|
||||
else {
|
||||
result.push_back(static_cast<char>(((ext_cp >> 18) & 0b00000111) | 0b11110000u));
|
||||
result.push_back(static_cast<char>(((ext_cp >> 12) & 0b00111111) | 0b10000000u));
|
||||
result.push_back(static_cast<char>(((ext_cp >> 6) & 0b00111111) | 0b10000000u));
|
||||
result.push_back(static_cast<char>((ext_cp & 0b00111111) | 0b10000000u));
|
||||
}
|
||||
}
|
||||
else if constexpr (std::is_same_v<typename string_t::value_type, wchar_t>) {
|
||||
if constexpr (sizeof(wchar_t) == 4) {
|
||||
result.push_back(static_cast<wchar_t>(ext_cp));
|
||||
}
|
||||
else if constexpr (sizeof(wchar_t) == 2) {
|
||||
if (ext_cp <= 0xFFFF) {
|
||||
result.push_back(static_cast<wchar_t>(ext_cp));
|
||||
}
|
||||
else {
|
||||
result.push_back(static_cast<wchar_t>(hi_cp));
|
||||
result.push_back(static_cast<wchar_t>(lo_cp));
|
||||
}
|
||||
}
|
||||
else {
|
||||
static_assert(!sizeof(typename string_t::value_type), "Unsupported wchar");
|
||||
}
|
||||
}
|
||||
else {
|
||||
static_assert(!sizeof(typename string_t::value_type), "Unsupported type");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline bool
|
||||
parser<accept_jsonc, string_t, parsing_t, accel_traits>::skip_string_literal_with_accel()
|
||||
{
|
||||
if constexpr (sizeof(*_cur) != 1) {
|
||||
return false;
|
||||
@@ -456,8 +608,10 @@ inline bool parser<string_t, parsing_t, accel_traits>::skip_string_literal_with_
|
||||
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>('\\')));
|
||||
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;
|
||||
@@ -472,8 +626,8 @@ inline bool parser<string_t, parsing_t, accel_traits>::skip_string_literal_with_
|
||||
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
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline bool parser<accept_jsonc, string_t, parsing_t, accel_traits>::skip_whitespace() noexcept
|
||||
{
|
||||
while (_cur != _end) {
|
||||
switch (*_cur) {
|
||||
@@ -483,6 +637,17 @@ inline bool parser<string_t, parsing_t, accel_traits>::skip_whitespace() noexcep
|
||||
case '\n':
|
||||
++_cur;
|
||||
break;
|
||||
case '/':
|
||||
if constexpr (accept_jsonc) {
|
||||
if (!skip_comment()) {
|
||||
return false;
|
||||
}
|
||||
// else continue;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case '\0':
|
||||
return false;
|
||||
default:
|
||||
@@ -492,8 +657,59 @@ inline bool parser<string_t, parsing_t, accel_traits>::skip_whitespace() noexcep
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline bool parser<string_t, parsing_t, accel_traits>::skip_digit()
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
bool json::parser<accept_jsonc, string_t, parsing_t, accel_traits>::skip_comment() noexcept
|
||||
{
|
||||
if (_cur == _end || *_cur != '/') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (++_cur == _end) {
|
||||
return false;
|
||||
}
|
||||
|
||||
enum class comment_type
|
||||
{
|
||||
invalid,
|
||||
line,
|
||||
block,
|
||||
} t = comment_type::invalid;
|
||||
|
||||
switch (*_cur++) {
|
||||
case '/':
|
||||
t = comment_type::line;
|
||||
break;
|
||||
case '*':
|
||||
t = comment_type::block;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
while (_cur != _end) {
|
||||
switch (*_cur++) {
|
||||
case '\n':
|
||||
if (t == comment_type::line) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case '*':
|
||||
if (t == comment_type::block && _cur != _end && *_cur == '/') {
|
||||
++_cur;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// _cur == _end
|
||||
return t == comment_type::line;
|
||||
}
|
||||
|
||||
template <bool accept_jsonc, typename string_t, typename parsing_t, typename accel_traits>
|
||||
inline bool parser<accept_jsonc, string_t, parsing_t, accel_traits>::skip_digit()
|
||||
{
|
||||
// At least one digit
|
||||
if (_cur != _end && std::isdigit(*_cur)) {
|
||||
@@ -523,7 +739,7 @@ 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);
|
||||
return parser<false, string_t, parsing_t>::parse(content);
|
||||
}
|
||||
|
||||
template <typename char_t>
|
||||
@@ -533,7 +749,7 @@ auto parse(char_t* content)
|
||||
}
|
||||
|
||||
template <typename istream_t, typename _>
|
||||
auto parse(istream_t& ifs, bool check_bom)
|
||||
auto parse(istream_t& ifs, bool check_bom, bool with_commets)
|
||||
{
|
||||
using string_t = std::basic_string<typename istream_t::char_type>;
|
||||
|
||||
@@ -551,16 +767,16 @@ auto parse(istream_t& ifs, bool check_bom)
|
||||
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) {
|
||||
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);
|
||||
return with_commets ? parsec(str) : parse(str);
|
||||
}
|
||||
|
||||
template <typename ifstream_t, typename path_t>
|
||||
auto open(const path_t& filepath, bool check_bom)
|
||||
auto open(const path_t& filepath, bool check_bom, bool with_commets)
|
||||
{
|
||||
using char_t = typename ifstream_t::char_type;
|
||||
using string_t = std::basic_string<char_t>;
|
||||
@@ -571,57 +787,76 @@ auto open(const path_t& filepath, bool check_bom)
|
||||
if (!ifs.is_open()) {
|
||||
return return_t(std::nullopt);
|
||||
}
|
||||
auto opt = parse(ifs, check_bom);
|
||||
auto opt = parse(ifs, check_bom, with_commets);
|
||||
ifs.close();
|
||||
return opt;
|
||||
}
|
||||
|
||||
template <typename parsing_t>
|
||||
auto parsec(const parsing_t& content)
|
||||
{
|
||||
using string_t = std::basic_string<typename parsing_t::value_type>;
|
||||
return parser<true, string_t, parsing_t>::parse(content);
|
||||
}
|
||||
|
||||
template <typename char_t>
|
||||
auto parsec(char_t* content)
|
||||
{
|
||||
return parsec(std::basic_string_view<std::decay_t<char_t>> { content });
|
||||
}
|
||||
|
||||
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""_json(const char* 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 wvalue operator""_json(const wchar_t* str, size_t len)
|
||||
{
|
||||
return operator""_jvalue(str, len);
|
||||
}
|
||||
|
||||
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 value operator""_jvalue(const char* str, size_t len)
|
||||
{
|
||||
return parse(std::string_view(str, len)).value_or(value());
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
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());
|
||||
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
1502
3rdparty/include/meojson/parser5/parser5.hpp
vendored
File diff suppressed because it is too large
Load Diff
16
3rdparty/include/meojson/parser5/unicode.h
vendored
16
3rdparty/include/meojson/parser5/unicode.h
vendored
File diff suppressed because one or more lines are too long
656
3rdparty/include/meojson/reflection/extensions.hpp
vendored
Normal file
656
3rdparty/include/meojson/reflection/extensions.hpp
vendored
Normal file
@@ -0,0 +1,656 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <filesystem>
|
||||
#include <queue>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
|
||||
#include "../common/types.hpp"
|
||||
|
||||
namespace json::ext
|
||||
{
|
||||
|
||||
template <typename string_t, typename impl_t, typename var_t, size_t len> // (size_t)-1 for no
|
||||
// restriction
|
||||
class __jsonization_array
|
||||
{
|
||||
public:
|
||||
json::basic_value<string_t> to_json(const var_t& value) const
|
||||
{
|
||||
return static_cast<const impl_t*>(this)->to_json_array(value);
|
||||
}
|
||||
|
||||
bool check_json(const json::basic_value<string_t>& json) const
|
||||
{
|
||||
if (!json.is_array()) {
|
||||
return false;
|
||||
}
|
||||
const auto& arr = json.as_array();
|
||||
if constexpr (len != static_cast<size_t>(-1)) {
|
||||
if (len != arr.size()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return static_cast<const impl_t*>(this)->check_json_array(arr);
|
||||
}
|
||||
|
||||
bool from_json(const json::basic_value<string_t>& json, var_t& value) const
|
||||
{
|
||||
if (!json.is_array()) {
|
||||
return false;
|
||||
}
|
||||
const auto& arr = json.as_array();
|
||||
if constexpr (len != static_cast<size_t>(-1)) {
|
||||
if (len != arr.size()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return static_cast<const impl_t*>(this)->from_json_array(arr, value);
|
||||
}
|
||||
|
||||
json::basic_value<string_t> move_to_json(var_t value) const
|
||||
{
|
||||
return static_cast<const impl_t*>(this)->move_to_json_array(std::move(value));
|
||||
}
|
||||
|
||||
bool move_from_json(json::basic_value<string_t> json, var_t& value) const
|
||||
{
|
||||
if (!json.is_array()) {
|
||||
return false;
|
||||
}
|
||||
auto& arr = json.as_array();
|
||||
if constexpr (len != static_cast<size_t>(-1)) {
|
||||
if (len != arr.size()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return static_cast<const impl_t*>(this)->move_from_json_array(std::move(arr), value);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename string_t, typename impl_t, typename var_t>
|
||||
class __jsonization_object
|
||||
{
|
||||
public:
|
||||
json::basic_value<string_t> to_json(const var_t& value) const
|
||||
{
|
||||
return static_cast<const impl_t*>(this)->to_json_object(value);
|
||||
}
|
||||
|
||||
bool check_json(const json::basic_value<string_t>& json) const
|
||||
{
|
||||
if (!json.is_object()) {
|
||||
return false;
|
||||
}
|
||||
const auto& obj = json.as_object();
|
||||
return static_cast<const impl_t*>(this)->check_json_object(obj);
|
||||
}
|
||||
|
||||
bool from_json(const json::basic_value<string_t>& json, var_t& value) const
|
||||
{
|
||||
if (!json.is_object()) {
|
||||
return false;
|
||||
}
|
||||
const auto& obj = json.as_object();
|
||||
return static_cast<const impl_t*>(this)->from_json_object(obj, value);
|
||||
}
|
||||
|
||||
json::basic_value<string_t> move_to_json(var_t value) const
|
||||
{
|
||||
return static_cast<const impl_t*>(this)->move_to_json_object(std::move(value));
|
||||
}
|
||||
|
||||
bool move_from_json(json::basic_value<string_t> json, var_t& value) const
|
||||
{
|
||||
if (!json.is_object()) {
|
||||
return false;
|
||||
}
|
||||
auto& obj = json.as_object();
|
||||
return static_cast<const impl_t*>(this)->move_from_json_object(std::move(obj), value);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename string_t>
|
||||
class jsonization<string_t, std::nullptr_t>
|
||||
{
|
||||
public:
|
||||
json::basic_value<string_t> to_json(const std::nullptr_t&) const
|
||||
{
|
||||
return json::basic_value<string_t> {};
|
||||
}
|
||||
|
||||
bool check_json(const json::basic_value<string_t>& json) const { return json.is_null(); }
|
||||
|
||||
bool from_json(const json::basic_value<string_t>& json, std::nullptr_t&)
|
||||
{
|
||||
return check_json(json);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename string_t>
|
||||
class jsonization<
|
||||
string_t,
|
||||
std::filesystem::path,
|
||||
std::enable_if_t<
|
||||
std::is_same_v<string_t, std::filesystem::path::string_type>
|
||||
|| std::is_same_v<string_t, std::string>>>
|
||||
{
|
||||
public:
|
||||
json::basic_value<string_t> to_json(const std::filesystem::path& path) const
|
||||
{
|
||||
if constexpr (std::is_same_v<string_t, std::filesystem::path::string_type>) {
|
||||
return path.native();
|
||||
}
|
||||
else if constexpr (std::is_same_v<string_t, std::string>) {
|
||||
#if __cplusplus >= 202002L
|
||||
std::u8string u8str = path.u8string();
|
||||
return std::string { u8str.begin(), u8str.end() };
|
||||
#else
|
||||
return path.u8string();
|
||||
#endif
|
||||
}
|
||||
#if __cplusplus >= 202002L
|
||||
else if constexpr (std::is_same_v<string_t, std::u8string>) {
|
||||
return path.u8string();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool check_json(const json::basic_value<string_t>& json) const { return json.is_string(); }
|
||||
|
||||
bool from_json(const json::basic_value<string_t>& json, std::filesystem::path& path) const
|
||||
{
|
||||
path = json.as_string();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template <
|
||||
typename string_t,
|
||||
template <typename, size_t> typename arr_t,
|
||||
typename value_t,
|
||||
size_t size>
|
||||
class jsonization<string_t, arr_t<value_t, size>>
|
||||
: public __jsonization_array<
|
||||
string_t,
|
||||
jsonization<string_t, arr_t<value_t, size>>,
|
||||
arr_t<value_t, size>,
|
||||
size>
|
||||
{
|
||||
public:
|
||||
json::basic_array<string_t> to_json_array(const arr_t<value_t, size>& value) const
|
||||
{
|
||||
json::basic_array<string_t> result;
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
result.emplace_back(value.at(i));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool check_json_array(const json::basic_array<string_t>& arr) const
|
||||
{
|
||||
return arr.template all<value_t>();
|
||||
}
|
||||
|
||||
bool from_json_array(const json::basic_array<string_t>& arr, arr_t<value_t, size>& value) const
|
||||
{
|
||||
if (!check_json_array(arr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
value.at(i) = arr[i].template as<value_t>();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
json::basic_array<string_t> move_to_json_array(arr_t<value_t, size> value) const
|
||||
{
|
||||
json::basic_array<string_t> result;
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
result.emplace_back(std::move(value.at(i)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool move_from_json_array(json::basic_array<string_t> arr, arr_t<value_t, size>& value) const
|
||||
{
|
||||
if (!check_json_array(arr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
value.at(i) = std::move(arr[i]).template as<value_t>();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename string_t, typename collection_t>
|
||||
class jsonization<string_t, collection_t, std::enable_if_t<_utils::is_collection<collection_t>>>
|
||||
: public __jsonization_array<
|
||||
string_t,
|
||||
jsonization<string_t, collection_t>,
|
||||
collection_t,
|
||||
(size_t)-1>
|
||||
{
|
||||
public:
|
||||
json::basic_array<string_t> to_json_array(const collection_t& value) const
|
||||
{
|
||||
json::basic_array<string_t> result;
|
||||
for (const auto& val : value) {
|
||||
result.emplace_back(val);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool check_json_array(const json::basic_array<string_t>& arr) const
|
||||
{
|
||||
return arr.template all<typename collection_t::value_type>();
|
||||
}
|
||||
|
||||
bool from_json_array(const json::basic_array<string_t>& arr, collection_t& value) const
|
||||
{
|
||||
if (!check_json_array(arr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
value = {};
|
||||
for (const auto& val : arr) {
|
||||
if constexpr (_utils::has_emplace_back<collection_t>::value) {
|
||||
value.emplace_back(val.template as<typename collection_t::value_type>());
|
||||
}
|
||||
else {
|
||||
value.emplace(val.template as<typename collection_t::value_type>());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
json::basic_array<string_t> move_to_json_array(collection_t value) const
|
||||
{
|
||||
json::basic_array<string_t> result;
|
||||
for (auto& val : value) {
|
||||
result.emplace_back(std::move(val));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool move_from_json_array(json::basic_array<string_t> arr, collection_t& value) const
|
||||
{
|
||||
if (!check_json_array(arr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto& val : arr) {
|
||||
if constexpr (_utils::has_emplace_back<collection_t>::value) {
|
||||
value.emplace_back(std::move(val).template as<typename collection_t::value_type>());
|
||||
}
|
||||
else {
|
||||
value.emplace(std::move(val).template as<typename collection_t::value_type>());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename string_t, template <typename...> typename tuple_t, typename... args_t>
|
||||
class jsonization<
|
||||
string_t,
|
||||
tuple_t<args_t...>,
|
||||
std::enable_if_t<_utils::is_tuple_like<tuple_t<args_t...>>>>
|
||||
: public __jsonization_array<
|
||||
string_t,
|
||||
jsonization<string_t, tuple_t<args_t...>>,
|
||||
tuple_t<args_t...>,
|
||||
std::tuple_size_v<tuple_t<args_t...>>>
|
||||
{
|
||||
public:
|
||||
constexpr static size_t tuple_size = std::tuple_size_v<tuple_t<args_t...>>;
|
||||
|
||||
json::basic_array<string_t> to_json_array(const tuple_t<args_t...>& value) const
|
||||
{
|
||||
json::basic_array<string_t> result;
|
||||
to_json_impl(result, value, std::make_index_sequence<tuple_size>());
|
||||
return result;
|
||||
}
|
||||
|
||||
template <std::size_t... Is>
|
||||
void to_json_impl(
|
||||
json::basic_array<string_t>& arr,
|
||||
const tuple_t<args_t...>& t,
|
||||
std::index_sequence<Is...>) const
|
||||
{
|
||||
using std::get;
|
||||
(arr.emplace_back(get<Is>(t)), ...);
|
||||
}
|
||||
|
||||
bool check_json_array(const json::basic_array<string_t>& arr) const
|
||||
{
|
||||
return check_json_impl(arr, std::make_index_sequence<tuple_size>());
|
||||
}
|
||||
|
||||
template <std::size_t... Is>
|
||||
bool check_json_impl(const json::basic_array<string_t>& arr, std::index_sequence<Is...>) const
|
||||
{
|
||||
return (arr[Is].template is<std::tuple_element_t<Is, tuple_t<args_t...>>>() && ...);
|
||||
}
|
||||
|
||||
bool from_json_array(const json::basic_array<string_t>& arr, tuple_t<args_t...>& value) const
|
||||
{
|
||||
if (!check_json_array(arr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
from_json_impl(arr, value, std::make_index_sequence<tuple_size>());
|
||||
return true;
|
||||
}
|
||||
|
||||
template <std::size_t... Is>
|
||||
void from_json_impl(
|
||||
const json::basic_array<string_t>& arr,
|
||||
tuple_t<args_t...>& t,
|
||||
std::index_sequence<Is...>) const
|
||||
{
|
||||
using std::get;
|
||||
((get<Is>(t) = arr[Is].template as<std::tuple_element_t<Is, tuple_t<args_t...>>>()), ...);
|
||||
}
|
||||
|
||||
json::basic_array<string_t> move_to_json_array(tuple_t<args_t...> value) const
|
||||
{
|
||||
json::basic_array<string_t> result;
|
||||
move_to_json_impl(result, std::move(value), std::make_index_sequence<tuple_size>());
|
||||
return result;
|
||||
}
|
||||
|
||||
template <std::size_t... Is>
|
||||
void move_to_json_impl(
|
||||
json::basic_array<string_t>& arr,
|
||||
tuple_t<args_t...> t,
|
||||
std::index_sequence<Is...>) const
|
||||
{
|
||||
using std::get;
|
||||
(arr.emplace_back(std::move(get<Is>(t))), ...);
|
||||
}
|
||||
|
||||
bool move_from_json_array(json::basic_array<string_t> arr, tuple_t<args_t...>& value) const
|
||||
{
|
||||
if (!check_json_array(arr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
move_from_json_impl(arr, value, std::make_index_sequence<tuple_size>());
|
||||
return true;
|
||||
}
|
||||
|
||||
template <std::size_t... Is>
|
||||
void move_from_json_impl(
|
||||
json::basic_array<string_t> arr,
|
||||
tuple_t<args_t...>& t,
|
||||
std::index_sequence<Is...>) const
|
||||
{
|
||||
using std::get;
|
||||
((get<Is>(t) =
|
||||
std::move(arr[Is]).template as<std::tuple_element_t<Is, tuple_t<args_t...>>>()),
|
||||
...);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename string_t, typename map_t>
|
||||
class jsonization<
|
||||
string_t,
|
||||
map_t,
|
||||
std::enable_if_t<_utils::is_map<map_t> && std::is_same_v<typename map_t::key_type, string_t>>>
|
||||
: public __jsonization_object<string_t, jsonization<string_t, map_t>, map_t>
|
||||
{
|
||||
public:
|
||||
json::basic_object<string_t> to_json_object(const map_t& value) const
|
||||
{
|
||||
json::basic_object<string_t> result;
|
||||
for (const auto& [key, val] : value) {
|
||||
result.emplace(key, val);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool check_json_object(const json::basic_object<string_t>& arr) const
|
||||
{
|
||||
for (const auto& [key, val] : arr) {
|
||||
if (!val.template is<typename map_t::mapped_type>()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool from_json_object(const json::basic_object<string_t>& arr, map_t& value) const
|
||||
{
|
||||
// TODO: 是不是直接from不check了算了
|
||||
if (!check_json_object(arr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
value = {};
|
||||
for (const auto& [key, val] : arr) {
|
||||
value.emplace(key, val.template as<typename map_t::mapped_type>());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
json::basic_object<string_t> move_to_json_object(map_t value) const
|
||||
{
|
||||
json::basic_object<string_t> result;
|
||||
for (auto& [key, val] : value) {
|
||||
result.emplace(key, std::move(val));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool move_from_json_object(json::basic_object<string_t> arr, map_t& value) const
|
||||
{
|
||||
// TODO: 是不是直接from不check了算了
|
||||
if (!check_json_object(arr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
value = {};
|
||||
for (auto& [key, val] : arr) {
|
||||
value.emplace(key, std::move(val).template as<typename map_t::mapped_type>());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename string_t, typename... args_t>
|
||||
class jsonization<string_t, std::variant<args_t...>>
|
||||
{
|
||||
public:
|
||||
using variant_t = std::variant<args_t...>;
|
||||
constexpr static size_t variant_size = std::variant_size_v<variant_t>;
|
||||
|
||||
json::basic_value<string_t> to_json(const variant_t& value) const
|
||||
{
|
||||
json::basic_value<string_t> result;
|
||||
to_json_impl(result, value, std::make_index_sequence<variant_size>());
|
||||
return result;
|
||||
}
|
||||
|
||||
template <std::size_t... Is>
|
||||
void to_json_impl(
|
||||
json::basic_value<string_t>& val,
|
||||
const variant_t& t,
|
||||
std::index_sequence<Is...>) const
|
||||
{
|
||||
using std::get;
|
||||
std::ignore = ((t.index() == Is ? (val = get<Is>(t), true) : false) || ...);
|
||||
}
|
||||
|
||||
bool check_json(const json::basic_value<string_t>& json) const
|
||||
{
|
||||
return check_json_impl(json, std::make_index_sequence<variant_size>());
|
||||
}
|
||||
|
||||
template <std::size_t... Is>
|
||||
bool check_json_impl(const json::basic_value<string_t>& val, std::index_sequence<Is...>) const
|
||||
{
|
||||
return (val.template is<std::variant_alternative_t<Is, variant_t>>() || ...);
|
||||
}
|
||||
|
||||
bool from_json(const json::basic_value<string_t>& json, variant_t& value) const
|
||||
{
|
||||
if (!check_json_impl(json, std::make_index_sequence<variant_size>())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
from_json_impl(json, value, std::make_index_sequence<variant_size>());
|
||||
return true;
|
||||
}
|
||||
|
||||
template <std::size_t... Is>
|
||||
void from_json_impl(
|
||||
const json::basic_value<string_t>& json,
|
||||
variant_t& t,
|
||||
std::index_sequence<Is...>) const
|
||||
{
|
||||
std::ignore =
|
||||
((json.template is<std::variant_alternative_t<Is, variant_t>>()
|
||||
? (t = json.template as<std::variant_alternative_t<Is, variant_t>>(), true)
|
||||
: false)
|
||||
|| ...);
|
||||
}
|
||||
|
||||
json::basic_value<string_t> move_to_json(variant_t value) const
|
||||
{
|
||||
json::basic_value<string_t> result;
|
||||
move_to_json_impl(result, std::move(value), std::make_index_sequence<variant_size>());
|
||||
return result;
|
||||
}
|
||||
|
||||
template <std::size_t... Is>
|
||||
void
|
||||
move_to_json_impl(json::basic_value<string_t>& val, variant_t t, std::index_sequence<Is...>)
|
||||
const
|
||||
{
|
||||
using std::get;
|
||||
std::ignore = ((t.index() == Is ? (val = std::move(get<Is>(t)), true) : false) || ...);
|
||||
}
|
||||
|
||||
bool move_from_json(json::basic_value<string_t> json, variant_t& value) const
|
||||
{
|
||||
if (!check_json_impl(json, std::make_index_sequence<variant_size>())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
move_from_json_impl(std::move(json), value, std::make_index_sequence<variant_size>());
|
||||
return true;
|
||||
}
|
||||
|
||||
template <std::size_t... Is>
|
||||
void move_from_json_impl(
|
||||
json::basic_value<string_t> json,
|
||||
variant_t& t,
|
||||
std::index_sequence<Is...>) const
|
||||
{
|
||||
std::ignore =
|
||||
((json.template is<std::variant_alternative_t<Is, variant_t>>()
|
||||
? (t = std::move(json).template as<std::variant_alternative_t<Is, variant_t>>(),
|
||||
true)
|
||||
: false)
|
||||
|| ...);
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: check if has move_xxx in member
|
||||
template <typename string_t, typename var_t>
|
||||
class jsonization<
|
||||
string_t,
|
||||
var_t,
|
||||
std::enable_if_t<
|
||||
_utils::has_to_json_in_member<var_t>::value
|
||||
&& _utils::has_check_json_in_member<var_t, string_t>::value
|
||||
&& _utils::has_from_json_in_member<var_t, string_t>::value>>
|
||||
{
|
||||
public:
|
||||
json::basic_value<string_t> to_json(const var_t& value) const { return value.to_json(); }
|
||||
|
||||
bool check_json(const json::basic_value<string_t>& json) const
|
||||
{
|
||||
var_t value;
|
||||
return value.check_json(json);
|
||||
}
|
||||
|
||||
bool from_json(const json::basic_value<string_t>& json, var_t& value) const
|
||||
{
|
||||
return value.from_json(json);
|
||||
}
|
||||
|
||||
json::basic_value<string_t> move_to_json(var_t value) const { return to_json(value); }
|
||||
|
||||
bool move_from_json(json::basic_value<string_t> json, var_t& value) const
|
||||
{
|
||||
return from_json(json, value);
|
||||
}
|
||||
};
|
||||
|
||||
// really need this fucking queue?
|
||||
template <typename string_t, typename value_t>
|
||||
class jsonization<string_t, std::queue<value_t>>
|
||||
: public __jsonization_array<
|
||||
string_t,
|
||||
jsonization<string_t, std::queue<value_t>>,
|
||||
std::queue<value_t>,
|
||||
(size_t)-1>
|
||||
{
|
||||
public:
|
||||
json::basic_array<string_t> to_json_array(const std::queue<value_t>& value) const
|
||||
{
|
||||
return move_to_json_array(value);
|
||||
}
|
||||
|
||||
bool check_json_array(const json::basic_array<string_t>& arr) const
|
||||
{
|
||||
return arr.template all<value_t>();
|
||||
}
|
||||
|
||||
bool from_json_array(const json::basic_array<string_t>& arr, std::queue<value_t>& value) const
|
||||
{
|
||||
if (!check_json_array(arr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
value = {};
|
||||
for (const auto& val : arr) {
|
||||
value.emplace(val.template as<value_t>());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
json::basic_array<string_t> move_to_json_array(std::queue<value_t> value) const
|
||||
{
|
||||
json::basic_array<string_t> result;
|
||||
while (!value.empty()) {
|
||||
result.emplace_back(std::move(value.front()));
|
||||
value.pop();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool move_from_json_array(json::basic_array<string_t> arr, std::queue<value_t>& value) const
|
||||
{
|
||||
if (!check_json_array(arr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto& val : arr) {
|
||||
value.emplace(std::move(val).template as<value_t>());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
713
3rdparty/include/meojson/reflection/jsonization.hpp
vendored
713
3rdparty/include/meojson/reflection/jsonization.hpp
vendored
@@ -1,94 +1,298 @@
|
||||
// IWYU pragma: private, include <meojson/json.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../common/types.hpp"
|
||||
#include "extensions.hpp"
|
||||
|
||||
namespace json::_jsonization_helper
|
||||
{
|
||||
|
||||
template <typename value_t>
|
||||
struct is_optional_t : public std::false_type
|
||||
{
|
||||
};
|
||||
|
||||
template <typename value_t>
|
||||
struct is_optional_t<std::optional<value_t>> : public std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <typename value_t>
|
||||
inline constexpr bool is_optional_v = is_optional_t<value_t>::value;
|
||||
|
||||
struct next_is_optional_t
|
||||
{};
|
||||
{
|
||||
};
|
||||
|
||||
struct next_override_key_t
|
||||
{
|
||||
const char* key;
|
||||
};
|
||||
|
||||
struct next_state_t
|
||||
{
|
||||
bool is_optional = false;
|
||||
const char* override_key = nullptr;
|
||||
};
|
||||
|
||||
struct va_arg_end
|
||||
{};
|
||||
{
|
||||
};
|
||||
|
||||
template <typename tag_t>
|
||||
struct is_tag_t : public std::false_type
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_tag_t<next_is_optional_t> : public std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_tag_t<next_override_key_t> : public std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
void _to_json(json::object&, va_arg_end) const {}
|
||||
|
||||
template <typename... rest_t>
|
||||
json::value _to_json(const char*, next_is_optional_t, rest_t&&... rest) const
|
||||
void _to_json(json::object& result, const char* key, rest_t&&... rest) const
|
||||
{
|
||||
return _to_json(std::forward<rest_t>(rest)...);
|
||||
_to_json(result, next_state_t {}, key, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
|
||||
template <
|
||||
typename var_t,
|
||||
typename... rest_t,
|
||||
typename _ = std::enable_if_t<!is_tag_t<var_t>::value, void>>
|
||||
void _to_json(
|
||||
json::object& result,
|
||||
next_state_t state,
|
||||
const char* key,
|
||||
const var_t& var,
|
||||
rest_t&&... rest) const
|
||||
{
|
||||
if (state.override_key) {
|
||||
key = state.override_key;
|
||||
}
|
||||
if constexpr (is_optional_v<var_t>) {
|
||||
if (!state.is_optional) {
|
||||
throw exception("std::optional must be used with MEO_OPT");
|
||||
}
|
||||
|
||||
if (var.has_value()) {
|
||||
result.emplace(key, var.value());
|
||||
}
|
||||
}
|
||||
else {
|
||||
result.emplace(key, var);
|
||||
}
|
||||
_to_json(result, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
|
||||
template <typename... rest_t>
|
||||
void _to_json(
|
||||
json::object& result,
|
||||
next_state_t state,
|
||||
const char*,
|
||||
next_is_optional_t,
|
||||
rest_t&&... rest) const
|
||||
{
|
||||
state.is_optional = true;
|
||||
_to_json(result, state, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
|
||||
template <typename... rest_t>
|
||||
void _to_json(
|
||||
json::object& result,
|
||||
next_state_t state,
|
||||
const char*,
|
||||
next_override_key_t override_key,
|
||||
rest_t&&... rest) const
|
||||
{
|
||||
state.override_key = override_key.key;
|
||||
_to_json(result, state, 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
|
||||
bool _check_json(const json::value&, std::string&, va_arg_end) const { return true; }
|
||||
|
||||
template <typename... rest_t>
|
||||
bool _check_json(
|
||||
const json::value& in,
|
||||
std::string& error_key,
|
||||
const char* key,
|
||||
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)...);
|
||||
return _check_json(in, error_key, next_state_t {}, 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
|
||||
|
||||
template <
|
||||
typename var_t,
|
||||
typename... rest_t,
|
||||
typename _ = std::enable_if_t<!is_tag_t<var_t>::value, void>>
|
||||
bool _check_json(
|
||||
const json::value& in,
|
||||
std::string& error_key,
|
||||
next_state_t state,
|
||||
const char* key,
|
||||
const var_t&,
|
||||
rest_t&&... rest) const
|
||||
{
|
||||
if (state.override_key) {
|
||||
key = state.override_key;
|
||||
}
|
||||
auto opt = in.find(key);
|
||||
if (opt) {
|
||||
if (!opt->is<var_t>()) {
|
||||
if constexpr (is_optional_v<var_t>) {
|
||||
if (!state.is_optional) {
|
||||
throw exception("std::optional must be used with MEO_OPT");
|
||||
}
|
||||
|
||||
if (opt && !opt->is<typename var_t::value_type>()) {
|
||||
error_key = key;
|
||||
return false;
|
||||
}
|
||||
} // next_is_optional_t, ignore key not found
|
||||
|
||||
}
|
||||
else {
|
||||
if (state.is_optional) {
|
||||
if (opt && !opt->is<var_t>()) {
|
||||
error_key = key;
|
||||
return false;
|
||||
} // is_optional, ignore key not found
|
||||
}
|
||||
else if (!opt || !opt->is<var_t>()) {
|
||||
error_key = key;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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; }
|
||||
|
||||
template <typename... rest_t>
|
||||
bool _check_json(
|
||||
const json::value& in,
|
||||
std::string& error_key,
|
||||
next_state_t state,
|
||||
const char*,
|
||||
next_is_optional_t,
|
||||
rest_t&&... rest) const
|
||||
{
|
||||
state.is_optional = true;
|
||||
return _check_json(in, error_key, state, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
|
||||
template <typename... rest_t>
|
||||
bool _check_json(
|
||||
const json::value& in,
|
||||
std::string& error_key,
|
||||
next_state_t state,
|
||||
const char*,
|
||||
next_override_key_t override_key,
|
||||
rest_t&&... rest) const
|
||||
{
|
||||
state.override_key = override_key.key;
|
||||
return _check_json(in, error_key, state, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
};
|
||||
|
||||
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>();
|
||||
bool _from_json(const json::value&, std::string&, va_arg_end) const { return true; }
|
||||
|
||||
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
|
||||
template <typename... rest_t>
|
||||
bool
|
||||
_from_json(const json::value& in, std::string& error_key, const char* key, rest_t&&... rest)
|
||||
{
|
||||
return _from_json(in, error_key, next_state_t {}, key, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
|
||||
template <
|
||||
typename var_t,
|
||||
typename... rest_t,
|
||||
typename _ = std::enable_if_t<!is_tag_t<var_t>::value, void>>
|
||||
bool _from_json(
|
||||
const json::value& in,
|
||||
std::string& error_key,
|
||||
next_state_t state,
|
||||
const char* key,
|
||||
var_t& var,
|
||||
rest_t&&... rest)
|
||||
{
|
||||
if (state.override_key) {
|
||||
key = state.override_key;
|
||||
}
|
||||
auto opt = in.find(key);
|
||||
if (opt) {
|
||||
if (!opt->is<var_t>()) {
|
||||
if constexpr (is_optional_v<var_t>) {
|
||||
if (!state.is_optional) {
|
||||
throw exception("std::optional must be used with MEO_OPT");
|
||||
}
|
||||
|
||||
if (opt && !opt->is<typename var_t::value_type>()) {
|
||||
error_key = key;
|
||||
return false;
|
||||
}
|
||||
var = std::move(opt)->as<var_t>();
|
||||
} // next_is_optional_t, ignore key not found
|
||||
if (opt) {
|
||||
var = std::move(opt)->as<typename var_t::value_type>();
|
||||
}
|
||||
else {
|
||||
var = std::nullopt;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (state.is_optional) {
|
||||
if (opt && !opt->is<var_t>()) {
|
||||
error_key = key;
|
||||
return false;
|
||||
} // is_optional, ignore key not found
|
||||
}
|
||||
else if (!opt || !opt->is<var_t>()) {
|
||||
error_key = key;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (opt) {
|
||||
var = std::move(opt)->as<var_t>();
|
||||
}
|
||||
}
|
||||
|
||||
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; }
|
||||
|
||||
template <typename... rest_t>
|
||||
bool _from_json(
|
||||
const json::value& in,
|
||||
std::string& error_key,
|
||||
next_state_t state,
|
||||
const char*,
|
||||
next_is_optional_t,
|
||||
rest_t&&... rest)
|
||||
{
|
||||
state.is_optional = true;
|
||||
return _from_json(in, error_key, state, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
|
||||
template <typename... rest_t>
|
||||
bool _from_json(
|
||||
const json::value& in,
|
||||
std::string& error_key,
|
||||
next_state_t state,
|
||||
const char*,
|
||||
next_override_key_t override_key,
|
||||
rest_t&&... rest)
|
||||
{
|
||||
state.override_key = override_key.key;
|
||||
return _from_json(in, error_key, state, std::forward<rest_t>(rest)...);
|
||||
}
|
||||
};
|
||||
} // namespace json::_jsonization_helper
|
||||
|
||||
@@ -109,124 +313,326 @@ namespace json::_private_macro
|
||||
|
||||
#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_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, ...) \
|
||||
#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_(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__))
|
||||
_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_TOJSON(...) \
|
||||
json::value to_json() const \
|
||||
{ \
|
||||
json::object result; \
|
||||
json::_jsonization_helper::dumper()._to_json( \
|
||||
result, \
|
||||
_MEOJSON_EXPAND(_MEOJSON_FOR_EACH(_MEOJSON_KEY_VALUE, __VA_ARGS__)) \
|
||||
json::_jsonization_helper::va_arg_end {}); \
|
||||
return result; \
|
||||
}
|
||||
|
||||
#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_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_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(...) \
|
||||
@@ -235,6 +641,7 @@ namespace json::_private_macro
|
||||
_MEOJSON_EXPAND(MEO_FROMJSON(__VA_ARGS__))
|
||||
|
||||
#define MEO_OPT json::_jsonization_helper::next_is_optional_t {},
|
||||
#define MEO_KEY(key) json::_jsonization_helper::next_override_key_t { key },
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop // -Wgnu-zero-variadic-macro-arguments
|
||||
|
||||
84
CHANGELOG.md
84
CHANGELOG.md
@@ -1,59 +1,49 @@
|
||||
## v5.15.0-beta.1
|
||||
## v5.26.0-beta.1
|
||||
|
||||
### 新增 | New
|
||||
|
||||
* 添加控件半透明背景色,新增自定义背景 (#12204) @ABA2396 @status102
|
||||
* YoStarEN Sarkaz theme + JP and KR template optimization @Constrat
|
||||
* 新增 MirrorChyan ErrorCode 提示 (#12202) @ABA2396
|
||||
* Telegram Topic notification (#12188) @Constrat
|
||||
* 任务列表支持多个开始唤醒,以实现多账号 (#12144) @hguandl
|
||||
* SSS#6 for EN (#12168) @dragonheart107
|
||||
* check nightly version with mirrorchyan (#12173) @MistEO
|
||||
* 调整下载来源提示 (#12156) @MistEO
|
||||
|
||||
### 改进 | Improved
|
||||
|
||||
* 孤星搓玉关 @Daydreamer114
|
||||
* 资源更新换一个解压目录 (#12153) @MistEO
|
||||
* 自动战斗开始前仅移除相似的召唤物头像缓存 @status102
|
||||
* 次生预案十里坡剑神 @ABA2396
|
||||
* 设置指引添加更新设置 @ABA2396
|
||||
* 设置指引添加性能设置 @ABA2396
|
||||
|
||||
### 修复 | Fix
|
||||
|
||||
* CheckLevelMax ocr target "-" -> digits (#12223) @BxFS
|
||||
* handle leak @dantmnf
|
||||
* YostarKR lower StartToVisit templThreshold (#12193) @HX3N
|
||||
* 保全开始部署 点击过快导致点击无效 (#12185) @Daydreamer114
|
||||
* 自动战斗在开启战斗列表时导入作业后,关闭战斗列表开始任务时作业使用错误 @status102
|
||||
* SSS#6 directional EC and branches @Constrat
|
||||
* 控制中枢模板mask (#12177) @Daydreamer114
|
||||
* 繁中服_生息演算組裝道具後卡住 (#12182) @momomochi987 @Daydreamer114
|
||||
* xaml requires   @Constrat
|
||||
* 钼铅识别错误 @ABA2396
|
||||
* update version.json on Arknights-Tile-Pos changes fix 43c672df541bae77b484c2faeb23c4522230e3ca @Constrat
|
||||
* roguelike already left encounter check and return from map screen (#12088) @BxFS
|
||||
* 文档首页语言选择按钮的宽度定义方式 (#14199) @lucienshawls
|
||||
* 傀影肉鸽无法识别四结局 (#14193) @Saratoga-Official
|
||||
* GamePassSkip2 识别到错误的跳过 @Saratoga-Official
|
||||
* 萨米肉鸽不期而遇避战 @Saratoga-Official
|
||||
* Google Play Games Developer shutdown @Constrat
|
||||
* manual set resource version time @MistEO
|
||||
* prettier @Constrat
|
||||
|
||||
### 文档 | Docs
|
||||
|
||||
* add space @MistEO
|
||||
* 补充vsc插件繁中文档 @Rbqwow
|
||||
* 修复文档站 readme 盾换行 @Rbqwow
|
||||
* 调整文档站的标题和尾注文本显示 (#14213) @lucienshawls
|
||||
* 更新网页开发相关文档 (#14167) @Rbqwow @Manicsteiner
|
||||
* 完善任务流程协议文档 (#13232) @zzyyyl
|
||||
* 回调消息协议文档视觉更新 @SherkeyXD
|
||||
* 集成文档视觉更新 @SherkeyXD
|
||||
* 文档启用 b 站视频播放功能 @SherkeyXD
|
||||
* 文档添加字段容器功能 @SherkeyXD
|
||||
* 文档添加功能 @SherkeyXD
|
||||
* 更新文档编写指南 @SherkeyXD
|
||||
* 标题 MAA 统一采用缩写 @MistEO
|
||||
* 再次调整文档站标题( @MistEO
|
||||
* 调整文档站标题 @MistEO
|
||||
* Update JP(#14227) @wallsman
|
||||
* markdown pre-commit @zzyyyl
|
||||
* add extension's evaluating feature @neko-para
|
||||
* add telegram icon @SherkeyXD
|
||||
|
||||
### 其他 | Other
|
||||
|
||||
* 繁中服「生路」活動導航 (#12224) @momomochi987
|
||||
* YostarKR Sarkaz Theme (#12220) @HX3N
|
||||
* gpu 选项禁用滚轮切换 @ABA2396
|
||||
* YostarJP Sarkaz Theme (#12216) @Manicsteiner
|
||||
* YostarJP 琳琅诗怀雅 ocr fix (#12219) @Manicsteiner
|
||||
* update wording about mirrorchyan (#12208) @MistEO
|
||||
* add delay pre UnlockClues @Constrat
|
||||
* YostarKR SSS#6 BuffChoose (#12191) @HX3N
|
||||
* update issue_template to remove new lines for EN @Constrat
|
||||
* 移除过时的重连代码 @ABA2396
|
||||
* tweak SSS files for global @Constrat
|
||||
* tweaked SSS copilot operators output @Constrat
|
||||
* add space after `:` @Constrat
|
||||
* YostarJP EnterInfrastDelicious (#12176) @Manicsteiner
|
||||
* 繁中服_聲浪安保派駐_定向導能元件 (#12174) @momomochi987
|
||||
* set output to UTF_8 for ResourceUpdater @Constrat
|
||||
* manual update version @MistEO
|
||||
* Revert "fix: roguelike already left encounter check and return from map screen (#12088)" @status102
|
||||
* Wpf肉鸽任务序列化 (#12124) @status102
|
||||
* 统一显示效果 @ABA2396
|
||||
* 水月萨米肉鸽不期而遇避战 @Saratoga-Official
|
||||
* 重写完成后动作仅一次的 ui 字符串 (#14196) @Rbqwow
|
||||
* 贸易站没其他好用的人再用锏 @ABA2396
|
||||
* YostarJP Sarkaz roguelike StageEncounter (#14223) @Manicsteiner
|
||||
* YostarJP sami roguelike 720p (#14210) @Manicsteiner
|
||||
* YostarJP Mizuki StageEncounter (#14206) @Manicsteiner
|
||||
* devcontainer.json (#14169) @Rbqwow @lucienshawls
|
||||
|
||||
205
CMakeLists.txt
205
CMakeLists.txt
@@ -1,194 +1,61 @@
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
project(MaaAssistantArknights)
|
||||
cmake_minimum_required(VERSION 3.28)
|
||||
project(MAA)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
|
||||
|
||||
option(BUILD_TEST "build a demo" OFF)
|
||||
option(BUILD_WPF_GUI "build MaaWpfGui" ${WIN32})
|
||||
option(BUILD_DEBUG_DEMO "build debug demo" OFF)
|
||||
option(BUILD_XCFRAMEWORK "build xcframework for macOS app" OFF)
|
||||
option(BUILD_UNIVERSAL "build both arm64 and x86_64 on macOS" OFF)
|
||||
option(BUILD_SMOKE_TEST "build smoke_test" 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)
|
||||
option(WITH_HASH_VERSION "generate version from git hash" OFF)
|
||||
|
||||
include(${PROJECT_SOURCE_DIR}/MaaDeps/maadeps.cmake)
|
||||
|
||||
include(${PROJECT_SOURCE_DIR}/cmake/config.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/cmake/utils.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/cmake/thrift-gen.cmake)
|
||||
|
||||
if(USE_MAADEPS)
|
||||
include(${PROJECT_SOURCE_DIR}/MaaDeps/maadeps.cmake)
|
||||
endif()
|
||||
|
||||
add_library(header_only_libraries INTERFACE)
|
||||
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;-Wextra;-Wpedantic")
|
||||
# LLVM clang 16 will failed with `error: no member named 'join' in namespace 'std::ranges::views'`, but Apple clang 16 won't
|
||||
# value defined in https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html
|
||||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
|
||||
OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17))
|
||||
target_compile_options(MaaCore PRIVATE "-fexperimental-library")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
#注意:相比VS版本缺少了 -D_CONSOLE -D_WINDLL 两项
|
||||
target_compile_definitions(MaaCore PRIVATE ASST_DLL_EXPORTS _UNICODE UNICODE)
|
||||
endif ()
|
||||
target_include_directories(MaaCore PUBLIC include PRIVATE src/MaaCore)
|
||||
set(MaaCore_PUBLIC_HEADERS include/AsstCaller.h include/AsstPort.h)
|
||||
target_sources(MaaCore PUBLIC ${MaaCore_PUBLIC_HEADERS})
|
||||
set_target_properties(MaaCore PROPERTIES
|
||||
CXX_STANDARD 20
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
PUBLIC_HEADER "${MaaCore_PUBLIC_HEADERS}"
|
||||
)
|
||||
include(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(MaaCore PROPERTIES INSTALL_RPATH "@loader_path/")
|
||||
elseif(UNIX)
|
||||
set_target_properties(MaaCore PROPERTIES INSTALL_RPATH "$ORIGIN/")
|
||||
endif()
|
||||
|
||||
if (BUILD_TEST)
|
||||
add_executable(test src/Cpp/main.cpp)
|
||||
set_target_properties(test PROPERTIES
|
||||
CXX_STANDARD 20
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
)
|
||||
target_link_libraries(test MaaCore)
|
||||
endif (BUILD_TEST)
|
||||
|
||||
find_package(OpenCV REQUIRED COMPONENTS core imgproc imgcodecs videoio)
|
||||
find_package(ZLIB REQUIRED)
|
||||
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)
|
||||
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 (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 ()
|
||||
|
||||
if(INSTALL_DEVEL)
|
||||
set(MaaCore_install_extra_args PUBLIC_HEADER DESTINATION devel/include ARCHIVE DESTINATION devel/lib)
|
||||
include(${PROJECT_SOURCE_DIR}/cmake/macos.cmake)
|
||||
endif()
|
||||
|
||||
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})
|
||||
add_library(HeaderOnlyLibraries INTERFACE)
|
||||
target_include_directories(HeaderOnlyLibraries INTERFACE 3rdparty/include)
|
||||
|
||||
if(INSTALL_THIRD_LIBS AND USE_MAADEPS)
|
||||
maadeps_install()
|
||||
find_package(OpenCV REQUIRED COMPONENTS core imgproc imgcodecs)
|
||||
find_package(Boost REQUIRED CONFIG COMPONENTS system)
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(fastdeploy_ppocr REQUIRED)
|
||||
find_package(ONNXRuntime REQUIRED)
|
||||
|
||||
add_subdirectory(src/MaaCore)
|
||||
|
||||
if(BUILD_WPF_GUI)
|
||||
include_external_msproject(MaaWpfGui ${PROJECT_SOURCE_DIR}/src/MaaWpfGui/MaaWpfGui.csproj)
|
||||
|
||||
add_dependencies(MaaWpfGui MaaCore)
|
||||
endif()
|
||||
|
||||
if (INSTALL_PYTHON)
|
||||
if(INSTALL_PYTHON)
|
||||
install(DIRECTORY src/Python DESTINATION .)
|
||||
endif (INSTALL_PYTHON)
|
||||
if (INSTALL_RESOURCE)
|
||||
endif()
|
||||
|
||||
if(INSTALL_RESOURCE)
|
||||
install(DIRECTORY resource DESTINATION .)
|
||||
endif (INSTALL_RESOURCE)
|
||||
endif()
|
||||
|
||||
|
||||
if (APPLE)
|
||||
include(${PROJECT_SOURCE_DIR}/cmake/macos.cmake)
|
||||
endif (APPLE)
|
||||
|
||||
# define MAA_VERSION from git
|
||||
if (NOT DEFINED MAA_VERSION)
|
||||
find_package(Git)
|
||||
endif ()
|
||||
if (NOT DEFINED MAA_VERSION AND GIT_FOUND)
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE output
|
||||
ERROR_VARIABLE err
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if (result EQUAL 0)
|
||||
set(MAA_VERSION "${output}")
|
||||
else ()
|
||||
message(WARNING "git rev-parse returning ${result}, output:\n${err}")
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT MAA_VERSION)
|
||||
set(MAA_VERSION "DEBUG VERSION")
|
||||
endif ()
|
||||
message(STATUS "MAA_VERSION=${MAA_VERSION}")
|
||||
add_compile_definitions(MAA_VERSION="${MAA_VERSION}")
|
||||
if(BUILD_DEBUG_DEMO OR BUILD_SMOKE_TEST)
|
||||
add_subdirectory(src/Cpp)
|
||||
endif()
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
@echo off
|
||||
chcp 65001
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
openfiles >nul 2>&1
|
||||
if %errorlevel% neq 0 (
|
||||
echo 正在获取管理员权限...
|
||||
echo Obtaining administrator privileges...
|
||||
powershell -Command "Start-Process cmd.exe -ArgumentList '/c %~dpnx0' -Verb RunAs"
|
||||
exit /b
|
||||
)
|
||||
|
||||
winget install "Microsoft.VCRedist.2015+.x64" --override "/repair /passive /norestart" --uninstall-previous --accept-package-agreements --force
|
||||
winget install "Microsoft.DotNet.DesktopRuntime.8" --override "/repair /passive /norestart" --uninstall-previous --accept-package-agreements --force
|
||||
|
||||
echo 运行库修复完成,请重启电脑后再次尝试运行 MAA。
|
||||
echo The runtime library repair is complete. Please restart your computer and try running MAA again.
|
||||
pause
|
||||
@@ -1,15 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Arknights/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Bilibili/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Infrast/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=oper/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=opers/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pallas/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pormpt/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Rougelike/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=templ/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=thres/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Todays/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=txwy/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=vuvm/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=XYAZ/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
106
MAA.sln
106
MAA.sln
@@ -1,106 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.2.32616.157
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MaaWpfGui", "src\MaaWpfGui\MaaWpfGui.csproj", "{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300} = {362D1E30-F5AE-4279-9985-65C27B3BA300}
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC} = {F860C043-4D86-41B6-A97E-4A75C9A6C4EC}
|
||||
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}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SyncRes", "src\SyncRes\SyncRes.csproj", "{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sample", "src\Cpp\MaaSample.vcxproj", "{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300} = {362D1E30-F5AE-4279-9985-65C27B3BA300}
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC} = {F860C043-4D86-41B6-A97E-4A75C9A6C4EC}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM64 = Debug|ARM64
|
||||
Debug|x64 = Debug|x64
|
||||
Release|ARM64 = Release|ARM64
|
||||
Release|x64 = Release|x64
|
||||
RelWithDebInfo|ARM64 = RelWithDebInfo|ARM64
|
||||
RelWithDebInfo|x64 = RelWithDebInfo|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Debug|x64.Build.0 = Debug|x64
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.ActiveCfg = Release|x64
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.Build.0 = Release|x64
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|ARM64.ActiveCfg = RelWithDebInfo|ARM64
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|ARM64.Build.0 = RelWithDebInfo|ARM64
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
|
||||
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.Debug|x64.Build.0 = Debug|x64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x64.ActiveCfg = Release|x64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x64.Build.0 = Release|x64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|ARM64.ActiveCfg = RelWithDebInfo|ARM64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|ARM64.Build.0 = RelWithDebInfo|ARM64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
|
||||
{362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.Debug|x64.Build.0 = Debug|x64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.Release|x64.ActiveCfg = Release|x64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.Release|x64.Build.0 = Release|x64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.RelWithDebInfo|ARM64.ActiveCfg = RelWithDebInfo|ARM64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.RelWithDebInfo|ARM64.Build.0 = RelWithDebInfo|ARM64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
|
||||
{8238EDB1-19BF-4E3B-AF5B-016120D59D7B}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.Debug|x64.Build.0 = Debug|x64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.Release|x64.ActiveCfg = Release|x64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.Release|x64.Build.0 = Release|x64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.RelWithDebInfo|ARM64.ActiveCfg = RelWithDebInfo|ARM64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.RelWithDebInfo|ARM64.Build.0 = RelWithDebInfo|ARM64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
|
||||
{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Debug|x64.Build.0 = Debug|x64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x64.ActiveCfg = Release|x64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x64.Build.0 = Release|x64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|ARM64.ActiveCfg = RelWithDebInfo|ARM64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|ARM64.Build.0 = RelWithDebInfo|ARM64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
|
||||
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4F2C0E4B-4FE9-47C6-A878-6BD2FAD8B9B2}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,161 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EN/@EntryIndexedValue">EN</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KR/@EntryIndexedValue">KR</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JP/@EntryIndexedValue">JP</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GUI/@EntryIndexedValue">GUI</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SWMINIMIZE/@EntryIndexedValue">SWMINIMIZE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=AP/@EntryIndexedValue">AP</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=AP_002D/@EntryIndexedValue">AP-</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=CA/@EntryIndexedValue">CA</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=CA_002D/@EntryIndexedValue">CA-</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=CE/@EntryIndexedValue">CE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=CE_002D/@EntryIndexedValue">CE-</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=EN/@EntryIndexedValue">EN</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=IS/@EntryIndexedValue">IS</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=JP/@EntryIndexedValue">JP</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=KR/@EntryIndexedValue">KR</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=LD/@EntryIndexedValue">LD</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=LS/@EntryIndexedValue">LS</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=LS_002D/@EntryIndexedValue">LS-</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=PR_002DA/@EntryIndexedValue">PR-A</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=PR_002DA_002D/@EntryIndexedValue">PR-A-</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=PR_002DB/@EntryIndexedValue">PR-B</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=PR_002DB_002D/@EntryIndexedValue">PR-B-</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=PR_002DC/@EntryIndexedValue">PR-C</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=PR_002DC_002D/@EntryIndexedValue">PR-C-</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=PR_002DD/@EntryIndexedValue">PR-D</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=PR_002DD_002D/@EntryIndexedValue">PR-D-</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=SK/@EntryIndexedValue">SK</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=SK_002D/@EntryIndexedValue">SK-</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=SSS/@EntryIndexedValue">SSS</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=WSA/@EntryIndexedValue">WSA</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=XYAZ/@EntryIndexedValue">XYAZ</s:String>
|
||||
<s:Boolean x:Key="/Default/GrammarAndSpelling/GrammarChecking/Exceptions/=Github/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=acast/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=acfend/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=acguad/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=acpion/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=acspec/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=acsupo/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=advapi/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Aero/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Affero/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=aguard/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=amedic/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=amiya/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=apionr/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=arget/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Arknights/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=arkplanner/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=asnipe/@EntryIndexedValue">True</s:Boolean>
|
||||
<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/=ccast/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=cdfend/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=cguard/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Chyan/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=cmedic/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Collapsal/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=cpione/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=csnipe/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=cspec/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=csuppo/@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>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=esource/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Favourite/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=filetime/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=findstr/@EntryIndexedValue">True</s:Boolean>
|
||||
<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/=iter/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=jsend/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ldconsole/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ldplayer/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=LD_0027s/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=leidian/@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/=mirrorc/@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>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=notstationed/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=objstr/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=oper/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=opers/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Originite/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Originium/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=originiums/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Orundum/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Orundums/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=o_FF9Fv_FF9F/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pallas/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=pidl/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pormpt/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=powrprof/@EntryIndexedValue">True</s:Boolean>
|
||||
<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/=qmsg/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Raidian/@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/=removelist/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=rguard/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=rmean/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=rmedic/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Roguelike/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=rsnipe/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Sami/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Sarkaz/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Screencap/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=sctp/@EntryIndexedValue">True</s:Boolean>
|
||||
<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/=Skland/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=specialaccess/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=spid/@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/=Stormeye/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=strlen/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Stylet/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=subtask/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Suppressions/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=SWMINIMIZE/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=taskchain/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Todays/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=txwy/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ucrtbase/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=XYAZ/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Yahei/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=yituliu/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Yostar/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0020_0020_0020wp_002ELength_0020/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0020_003D_0020stri/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
50
README.md
50
README.md
@@ -4,7 +4,7 @@
|
||||
|
||||
<img alt="LOGO" src="./docs/.vuepress/public/images/maa-logo_512x512.png" width="256" height="256" />
|
||||
|
||||
# MaaAssistantArknights
|
||||
# MAA
|
||||
|
||||
<br>
|
||||
<div>
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<!-- 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/)
|
||||
[简体中文](https://docs.maa.plus/zh-cn/) | [繁體中文](https://docs.maa.plus/zh-tw/) | [English](https://docs.maa.plus/en-us/) | [日本語](https://docs.maa.plus/ja-jp/) | [한국어](https://docs.maa.plus/ko-kr/)
|
||||
|
||||
MAA 的意思是 MAA Assistant Arknights
|
||||
|
||||
@@ -33,20 +33,20 @@ MAA 的意思是 MAA Assistant Arknights
|
||||
|
||||
基于图像识别技术,一键完成全部日常任务!
|
||||
|
||||
绝赞更新中 ✿✿ヽ(°▽°)ノ✿
|
||||
绝赞更新中 ✿✿ヽ(°▽°)ノ✿
|
||||
|
||||
</div>
|
||||
|
||||
## 下载与安装
|
||||
|
||||
请阅读 [文档](https://maa.plus/docs/zh-cn/manual/newbie.html) 后前往 [官网](https://maa.plus) 或 [Releases](https://github.com/MaaAssistantArknights/MaaAssistantArknights/releases) 下载,并参考 [新手上路](https://maa.plus/docs/zh-cn/manual/newbie.html) 进行安装。
|
||||
请阅读 [文档](https://docs.maa.plus/zh-cn/manual/newbie.html) 后前往 [官网](https://maa.plus) 或 [Releases](https://github.com/MaaAssistantArknights/MaaAssistantArknights/releases) 下载,并参考 [新手上路](https://docs.maa.plus/zh-cn/manual/newbie.html) 进行安装。
|
||||
|
||||
## 亮点功能
|
||||
|
||||
- 刷理智,掉落识别及上传 [企鹅物流](https://penguin-stats.cn/),[一图流](https://ark.yituliu.cn/)
|
||||
- 智能基建换班,自动计算干员效率,单设施内最优解;同时也支持 [自定义排班](https://maa.plus/docs/zh-cn/protocol/base-scheduling-schema.html)
|
||||
- 智能基建换班,自动计算干员效率,单设施内最优解;同时也支持 [自定义排班](https://docs.maa.plus/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)
|
||||
- 访问好友、收取信用及购物、领取日常奖励等,一键全日常自动长草
|
||||
@@ -83,16 +83,16 @@ MAA 的意思是 MAA Assistant Arknights
|
||||
|
||||
### 功能介绍
|
||||
|
||||
请参阅 [用户手册](https://maa.plus/docs/zh-cn/manual/)。
|
||||
请参阅 [用户手册](https://docs.maa.plus/zh-cn/manual/)。
|
||||
|
||||
### 外服支持
|
||||
|
||||
目前国际服(美服)、日服、韩服、繁中服的绝大部分功能均已支持。但由于外服用户较少及项目人手不足,很多功能并没有进行全面的测试,所以请自行体验。
|
||||
若您遇到了 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)
|
||||
若您遇到了 Bug,或对某个功能有强需求,欢迎在 [Issues](https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues) 和 [讨论区](https://github.com/MaaAssistantArknights/MaaAssistantArknights/discussions) 催更;或加入我们一起建设 MAA!请参阅 [外服适配教程](https://docs.maa.plus/zh-cn/develop/overseas-client-adaptation.html)
|
||||
|
||||
### CLI 支持
|
||||
|
||||
MAA 支持命令行界面(CLI)操作,支持 Linux,macOS 和 Windows,可用于自动化脚本或在无图形界面的服务器上使用。请参阅 [CLI 使用指南](https://maa.plus/docs/zh-cn/manual/cli/)
|
||||
MAA 支持命令行界面(CLI)操作,支持 Linux,macOS 和 Windows,可用于自动化脚本或在无图形界面的服务器上使用。请参阅 [CLI 使用指南](https://docs.maa.plus/zh-cn/manual/cli/)
|
||||
|
||||
## 加入我们
|
||||
|
||||
@@ -103,26 +103,22 @@ MAA 支持命令行界面(CLI)操作,支持 Linux,macOS 和 Windows,
|
||||
- 全新框架:[MaaFramework](https://github.com/MaaXYZ/MaaFramework)
|
||||
- [作业站](https://prts.plus) 前端:[maa-copilot-frontend](https://github.com/MaaAssistantArknights/maa-copilot-frontend)
|
||||
- [作业站](https://prts.plus) 后端:[MaaBackendCenter](https://github.com/MaaAssistantArknights/MaaBackendCenter)
|
||||
- [官网](https://maa.plus):[前端](website)
|
||||
- [官网](https://maa.plus):[前端](https://github.com/MaaAssistantArknights/maa-website)
|
||||
- 深度学习:[MaaAI](https://github.com/MaaAssistantArknights/MaaAI)
|
||||
|
||||
### 多语言 (i18n)
|
||||
|
||||
MAA 支持多国语言,并使用 Weblate 进行本地化管理。如果您通晓多门语言,欢迎前往 [MAA Weblate](https://weblate.maa-org.net) 帮助我们进行翻译。
|
||||
|
||||
MAA 以中文(简体)为第一语言,翻译词条均以中文(简体)为准。
|
||||
|
||||
[](https://weblate.maa-org.net/engage/maa/)
|
||||
|
||||
### 参与开发
|
||||
|
||||
#### Windows
|
||||
|
||||
请参阅 [开始开发](https://maa.plus/docs/zh-cn/develop/development.html)。
|
||||
请参阅 [开始开发](https://docs.maa.plus/zh-cn/develop/development.html)。
|
||||
|
||||
#### Linux | macOS
|
||||
|
||||
请参阅 [Linux 编译教程](https://maa.plus/docs/zh-cn/develop/linux-tutorial.html)。
|
||||
请参阅 [Linux 编译教程](https://docs.maa.plus/zh-cn/develop/linux-tutorial.html)。
|
||||
|
||||
#### API
|
||||
|
||||
@@ -135,22 +131,22 @@ MAA 以中文(简体)为第一语言,翻译词条均以中文(简体)
|
||||
- [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://docs.maa.plus/zh-cn/protocol/integration.html)
|
||||
- [回调消息协议](https://docs.maa.plus/zh-cn/protocol/callback-schema.html)
|
||||
- [任务流程协议](https://docs.maa.plus/zh-cn/protocol/task-schema.html)
|
||||
- [自动抄作业协议](https://docs.maa.plus/zh-cn/protocol/copilot-schema.html)
|
||||
|
||||
#### 外服适配
|
||||
|
||||
请参阅 [外服适配教程](https://maa.plus/docs/zh-cn/develop/overseas-client-adaptation.html),对于国服已支持的功能,绝大部分的外服适配工作仅需要截图 + 简单的 JSON 修改即可。
|
||||
请参阅 [外服适配教程](https://docs.maa.plus/zh-cn/develop/overseas-client-adaptation.html),对于国服已支持的功能,绝大部分的外服适配工作仅需要截图 + 简单的 JSON 修改即可。
|
||||
|
||||
#### 想参与开发,但不太会用 GitHub?
|
||||
|
||||
[GitHub Pull Request 流程简述](https://maa.plus/docs/zh-cn/develop/development.html#github-pull-request-流程简述)
|
||||
[GitHub Pull Request 流程简述](https://docs.maa.plus/zh-cn/develop/development.html#github-pull-request-流程简述)
|
||||
|
||||
#### Issue bot
|
||||
|
||||
请参阅 [Issue Bot 使用方法](https://maa.plus/docs/zh-cn/develop/issue-bot-usage.html)
|
||||
请参阅 [Issue Bot 使用方法](https://docs.maa.plus/zh-cn/develop/issue-bot-usage.html)
|
||||
|
||||
## 致谢
|
||||
|
||||
@@ -192,7 +188,7 @@ MAA 以中文(简体)为第一语言,翻译词条均以中文(简体)
|
||||
|
||||
## 声明
|
||||
|
||||
- 本软件使用 [GNU Affero General Public License v3.0 only](https://spdx.org/licenses/AGPL-3.0-only.html) 开源。
|
||||
- 本软件使用 [GNU Affero General Public License v3.0 only](https://spdx.org/licenses/AGPL-3.0-only.html) 开源,并附带额外 [用户协议](https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/dev/terms-of-service.md)。
|
||||
- 本软件 logo 并非使用 AGPL 3.0 协议开源,[耗毛](https://weibo.com/u/3251357314)、vie 两位画师及软件全体开发者保留所有权利。不得以 AGPL 3.0 协议已授权为由在未经授权的情况下使用本软件 logo,不得在未经授权的情况下将本软件 logo 用于任何商业用途。
|
||||
- 本软件开源、免费,仅供学习交流使用。若您遇到商家使用本软件进行代练并收费,可能是设备与时间等费用,产生的问题及后果与本软件无关。
|
||||
|
||||
@@ -202,13 +198,13 @@ MAA 以中文(简体)为第一语言,翻译词条均以中文(简体)
|
||||
|
||||
## 广告
|
||||
|
||||
用户交流 QQ 群:[MAA 使用 & 粥游交流 QQ 群](https://ota.maa.plus/MaaAssistantArknights/api/qqgroup/index.html)
|
||||
用户交流 QQ 群:[MAA 使用 & 粥游交流 QQ 群](https://api.maa.plus/MaaAssistantArknights/api/qqgroup/index.html)
|
||||
Discord 服务器: [邀请链接](https://discord.gg/23DfZ9uA4V)
|
||||
用户交流 TG 群:[Telegram 群](https://t.me/+Mgc2Zngr-hs3ZjU1)
|
||||
自动战斗 JSON 作业分享:[prts.plus](https://prts.plus)
|
||||
Bilibili 直播间:[MrEO 直播间](https://live.bilibili.com/2808861) 直播敲代码 & [MAA-Official 直播间](https://live.bilibili.com/27548877) 游戏/杂谈
|
||||
Bilibili 直播间:[MrEO 直播间](https://live.bilibili.com/2808861) 直播敲代码 & [MAA-Official 直播间](https://live.bilibili.com/27548877) 游戏/杂谈
|
||||
|
||||
技术群(舟无关、禁水):[内卷地狱!(QQ 群)](https://jq.qq.com/?_wv=1027&k=ypbzXcA2)
|
||||
开发者群:[QQ 群](https://jq.qq.com/?_wv=1027&k=JM9oCk3C)
|
||||
开发者群:[QQ 群](https://jq.qq.com/?_wv=1027&k=JM9oCk3C)
|
||||
|
||||
如果觉得软件对你有帮助,帮忙点个 Star 吧!~(网页最上方右上角的小星星),这就是对我们最大的支持了!
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
:; set -eo pipefail
|
||||
:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
|
||||
:; ${SCRIPT_DIR}/build.sh "$@"
|
||||
:; exit $?
|
||||
|
||||
@ECHO OFF
|
||||
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*
|
||||
69
build.ps1
69
build.ps1
@@ -1,69 +0,0 @@
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
|
||||
[string[]]$BuildArguments
|
||||
)
|
||||
|
||||
Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)"
|
||||
|
||||
Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 }
|
||||
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
|
||||
|
||||
###########################################################################
|
||||
# CONFIGURATION
|
||||
###########################################################################
|
||||
|
||||
$BuildProjectFile = "$PSScriptRoot\tools\MaaBuilder\MaaBuilder.csproj"
|
||||
$TempDirectory = "$PSScriptRoot\\.nuke\temp"
|
||||
|
||||
$DotNetGlobalFile = "$PSScriptRoot\\global.json"
|
||||
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
|
||||
$DotNetChannel = "Current"
|
||||
|
||||
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
|
||||
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
|
||||
$env:DOTNET_MULTILEVEL_LOOKUP = 0
|
||||
|
||||
###########################################################################
|
||||
# EXECUTION
|
||||
###########################################################################
|
||||
|
||||
function ExecSafe([scriptblock] $cmd) {
|
||||
& $cmd
|
||||
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
||||
}
|
||||
|
||||
# If dotnet CLI is installed globally and it matches requested version, use for execution
|
||||
if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and `
|
||||
$(dotnet --version) -and $LASTEXITCODE -eq 0) {
|
||||
$env:DOTNET_EXE = (Get-Command "dotnet").Path
|
||||
}
|
||||
else {
|
||||
# Download install script
|
||||
$DotNetInstallFile = "$TempDirectory\dotnet-install.ps1"
|
||||
New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile)
|
||||
|
||||
# If global.json exists, load expected version
|
||||
if (Test-Path $DotNetGlobalFile) {
|
||||
$DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json)
|
||||
if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) {
|
||||
$DotNetVersion = $DotNetGlobal.sdk.version
|
||||
}
|
||||
}
|
||||
|
||||
# Install by channel or version
|
||||
$DotNetDirectory = "$TempDirectory\dotnet-win"
|
||||
if (!(Test-Path variable:DotNetVersion)) {
|
||||
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
|
||||
} else {
|
||||
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
|
||||
}
|
||||
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
|
||||
}
|
||||
|
||||
Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"
|
||||
|
||||
ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
|
||||
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }
|
||||
62
build.sh
62
build.sh
@@ -1,62 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
bash --version 2>&1 | head -n 1
|
||||
|
||||
set -eo pipefail
|
||||
SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
|
||||
|
||||
###########################################################################
|
||||
# CONFIGURATION
|
||||
###########################################################################
|
||||
|
||||
BUILD_PROJECT_FILE="$SCRIPT_DIR/tools/MaaBuilder/MaaBuilder.csproj"
|
||||
TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"
|
||||
|
||||
DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
|
||||
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
|
||||
DOTNET_CHANNEL="Current"
|
||||
|
||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
export DOTNET_MULTILEVEL_LOOKUP=0
|
||||
|
||||
###########################################################################
|
||||
# EXECUTION
|
||||
###########################################################################
|
||||
|
||||
function FirstJsonValue {
|
||||
perl -nle 'print $1 if m{"'"$1"'": "([^"]+)",?}' <<< "${@:2}"
|
||||
}
|
||||
|
||||
# If dotnet CLI is installed globally and it matches requested version, use for execution
|
||||
if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then
|
||||
export DOTNET_EXE="$(command -v dotnet)"
|
||||
else
|
||||
# Download install script
|
||||
DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh"
|
||||
mkdir -p "$TEMP_DIRECTORY"
|
||||
curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL"
|
||||
chmod +x "$DOTNET_INSTALL_FILE"
|
||||
|
||||
# If global.json exists, load expected version
|
||||
if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then
|
||||
DOTNET_VERSION=$(FirstJsonValue "version" "$(cat "$DOTNET_GLOBAL_FILE")")
|
||||
if [[ "$DOTNET_VERSION" == "" ]]; then
|
||||
unset DOTNET_VERSION
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install by channel or version
|
||||
DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix"
|
||||
if [[ -z ${DOTNET_VERSION+x} ]]; then
|
||||
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path
|
||||
else
|
||||
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
|
||||
fi
|
||||
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
|
||||
fi
|
||||
|
||||
echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"
|
||||
|
||||
"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
|
||||
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"
|
||||
83
cmake/config.cmake
Normal file
83
cmake/config.cmake
Normal file
@@ -0,0 +1,83 @@
|
||||
set(debug_comp_defs "_DEBUG;ASST_DEBUG")
|
||||
add_compile_definitions("$<$<CONFIG:Debug>:${debug_comp_defs}>")
|
||||
|
||||
if(APPLE)
|
||||
set(CMAKE_INSTALL_RPATH "@loader_path;@executable_path")
|
||||
set(CMAKE_BUILD_RPATH "@loader_path;@executable_path")
|
||||
elseif(UNIX)
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN")
|
||||
set(CMAKE_BUILD_RPATH "$ORIGIN")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options("/utf-8")
|
||||
add_compile_options("/MP")
|
||||
add_compile_options("/W4;/WX;/Gy;/permissive-;/sdl")
|
||||
add_compile_options("/wd4127") # conditional expression is constant
|
||||
add_compile_options("/wd4251") # export dll with templates
|
||||
|
||||
add_compile_options("/DWINVER=0x0A00")
|
||||
add_compile_options("/D_WIN32_WINNT=0x0A00")
|
||||
|
||||
# https://github.com/actions/runner-images/issues/10004 https://github.com/microsoft/STL/releases/tag/vs-2022-17.10
|
||||
add_compile_definitions("_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
|
||||
|
||||
set(release_link_options "/OPT:REF;/OPT:ICF")
|
||||
add_link_options("$<$<CONFIG:Release>:${release_link_options}>")
|
||||
SET(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO "RelWithDebInfo;Release;")
|
||||
SET(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL "MinSizeRel;Release;")
|
||||
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()
|
||||
|
||||
if(LINUX)
|
||||
function(copy_and_add_rpath_library LIBNAME)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=${LIBNAME}.so.1 -target ${CMAKE_CXX_COMPILER_TARGET} --sysroot=${CMAKE_SYSROOT}
|
||||
OUTPUT_VARIABLE LIB_PATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if("${LIB_PATH}" STREQUAL "${LIBNAME}.so.1")
|
||||
message(FATAL_ERROR "Could not locate ${LIBNAME}.so.1 using compiler")
|
||||
endif()
|
||||
|
||||
file(READ_SYMLINK "${LIB_PATH}" LINK_TARGET)
|
||||
if(NOT LINK_TARGET)
|
||||
set(LIB_PATH_REAL "${LIB_PATH}")
|
||||
elseif(NOT IS_ABSOLUTE "${LINK_TARGET}")
|
||||
get_filename_component(LIB_PATH_DIR "${LIB_PATH}" DIRECTORY)
|
||||
file(REAL_PATH "${LIB_PATH_DIR}/${LINK_TARGET}" LIB_PATH_REAL)
|
||||
else()
|
||||
set(LIB_PATH_REAL "${LINK_TARGET}")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${LIB_PATH_REAL}")
|
||||
message(FATAL_ERROR "File not found: ${LIB_PATH_REAL}")
|
||||
endif()
|
||||
|
||||
message(STATUS "${LIBNAME}.so.1 path: ${LIB_PATH_REAL}")
|
||||
|
||||
install(FILES "${LIB_PATH_REAL}" DESTINATION . RENAME "${LIBNAME}.so.1" COMPONENT libcxx)
|
||||
|
||||
get_filename_component(LIB_PATH_DIR "${LIB_PATH_REAL}" DIRECTORY)
|
||||
list(APPEND CMAKE_BUILD_RPATH "${LIB_PATH_DIR}")
|
||||
set(CMAKE_BUILD_RPATH "${CMAKE_BUILD_RPATH}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
copy_and_add_rpath_library(libc++)
|
||||
copy_and_add_rpath_library(libc++abi)
|
||||
copy_and_add_rpath_library(libunwind)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
@@ -25,6 +25,3 @@ if (BUILD_XCFRAMEWORK)
|
||||
)
|
||||
endif (BUILD_XCFRAMEWORK)
|
||||
|
||||
target_compile_options(MaaCore PRIVATE
|
||||
-Wno-deprecated-declarations
|
||||
-Wno-gnu-zero-variadic-macro-arguments)
|
||||
|
||||
41
cmake/modules/FindONNXRuntime.cmake
Normal file
41
cmake/modules/FindONNXRuntime.cmake
Normal file
@@ -0,0 +1,41 @@
|
||||
find_path(ONNXRuntime_INCLUDE_DIR NAMES onnxruntime/onnxruntime_c_api.h)
|
||||
|
||||
find_library(ONNXRuntime_LIBRARY_IMP NAMES onnxruntime)
|
||||
|
||||
if (WIN32)
|
||||
get_filename_component(ONNXRuntime_PATH_LIB ${ONNXRuntime_LIBRARY_IMP} DIRECTORY)
|
||||
find_file(ONNXRuntime_LIBRARY NAMES onnxruntime_maa.dll PATHS "${ONNXRuntime_PATH_LIB}/../bin")
|
||||
|
||||
find_file(ONNXRuntime_LIBRARY_IMP_DEBUG NAMES onnxruntime.lib PATHS "${ONNXRuntime_PATH_LIB}/../debug/lib")
|
||||
find_file(ONNXRuntime_LIBRARY_DEBUG NAMES onnxruntime_maa.dll PATHS "${ONNXRuntime_PATH_LIB}/../debug/bin")
|
||||
else ()
|
||||
set(ONNXRuntime_LIBRARY ${ONNXRuntime_LIBRARY_IMP})
|
||||
endif (WIN32)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
ONNXRuntime
|
||||
REQUIRED_VARS ONNXRuntime_LIBRARY_IMP ONNXRuntime_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if(ONNXRuntime_FOUND)
|
||||
set(ONNXRuntime_INCLUDE_DIRS ${ONNXRuntime_INCLUDE_DIR})
|
||||
if(NOT TARGET ONNXRuntime::ONNXRuntime)
|
||||
add_library(ONNXRuntime::ONNXRuntime SHARED IMPORTED)
|
||||
set_property(TARGET ONNXRuntime::ONNXRuntime APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
if (WIN32)
|
||||
set_property(TARGET ONNXRuntime::ONNXRuntime APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(ONNXRuntime::ONNXRuntime PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${ONNXRuntime_LIBRARY_IMP}"
|
||||
)
|
||||
set_target_properties(ONNXRuntime::ONNXRuntime PROPERTIES
|
||||
IMPORTED_IMPLIB_DEBUG "${ONNXRuntime_LIBRARY_IMP_DEBUG}"
|
||||
IMPORTED_LOCATION_DEBUG "${ONNXRuntime_LIBRARY_DEBUG}"
|
||||
)
|
||||
endif (WIN32)
|
||||
set_target_properties(ONNXRuntime::ONNXRuntime PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${ONNXRuntime_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${ONNXRuntime_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,54 +0,0 @@
|
||||
|
||||
|
||||
set(OPENCV_URL_PREFIX "https://github.com/MaaAssistantArknights/build-opencv/releases/download")
|
||||
|
||||
set(OPENCV_TAG "4.5.3")
|
||||
|
||||
set(COMPRESSED_SUFFIX ".tar.gz")
|
||||
|
||||
if(WIN32)
|
||||
set(OPENCV_FILENAME "OpenCV-Windows")
|
||||
set(OPENCV_CHECKSUM "bf736b243bbdaa020f139e4dfa1e4f15633f4ce7a8ad885524645e660de47a8b")
|
||||
elseif(APPLE)
|
||||
if (CURRENT_OSX_ARCH STREQUAL "arm64")
|
||||
set(OPENCV_FILENAME "OpenCV-macOS-arm64")
|
||||
set(OPENCV_CHECKSUM "31beb633c033dd4ee789ffa50911c29c9580860f9a91f334f03d8aa9c85e9700")
|
||||
else()
|
||||
set(OPENCV_FILENAME "OpenCV-macOS-x86_64")
|
||||
set(OPENCV_CHECKSUM "249c5c97cc52257b68d35acf499b1cf1037f5e6f3b40752f82ad5abe7884bea9")
|
||||
endif()
|
||||
else(UNIX)
|
||||
set(OPENCV_FILENAME "OpenCV-Linux")
|
||||
set(OPENCV_CHECKSUM "edc4138456189c9e8bdf29114ad2be8ec152e8e31087d98e633f6cda59b141ea")
|
||||
endif(WIN32)
|
||||
|
||||
set(OPENCV_URL ${OPENCV_URL_PREFIX}/${OPENCV_TAG}/${OPENCV_FILENAME}${COMPRESSED_SUFFIX})
|
||||
|
||||
if(OPENCV_DIRECTORY)
|
||||
set(OpenCV_DIR ${OPENCV_DIRECTORY})
|
||||
find_package(OpenCV REQUIRED PATHS ${OpenCV_DIR})
|
||||
include_directories(${OpenCV_INCLUDE_DIRS})
|
||||
list(APPEND DEPEND_LIBS ${OpenCV_LIBS})
|
||||
else()
|
||||
download_and_decompress(${OPENCV_URL}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${OPENCV_FILENAME}${COMPRESSED_SUFFIX}
|
||||
${OPENCV_CHECKSUM}
|
||||
${THIRD_PARTY_PATH}/install/)
|
||||
set(OPENCV_FILENAME opencv)
|
||||
set(OpenCV_DIR ${THIRD_PARTY_PATH}/install/${OPENCV_FILENAME})
|
||||
set(OPENCV_DIRECTORY ${OpenCV_DIR})
|
||||
if (WIN32)
|
||||
set(OpenCV_DIR ${OpenCV_DIR}/lib)
|
||||
endif()
|
||||
find_package(OpenCV REQUIRED PATHS ${OpenCV_DIR} NO_DEFAULT_PATH)
|
||||
include_directories(${OpenCV_INCLUDE_DIRS})
|
||||
list(APPEND DEPEND_LIBS ${OpenCV_LIBS})
|
||||
endif(OPENCV_DIRECTORY)
|
||||
|
||||
if (INSTALL_THIRD_LIBS)
|
||||
if (OpenCV_SHARED)
|
||||
install(DIRECTORY ${OpenCV_INSTALL_PATH}/lib/
|
||||
DESTINATION .
|
||||
USE_SOURCE_PERMISSIONS PATTERN "cmake" EXCLUDE)
|
||||
endif (OpenCV_SHARED)
|
||||
endif (INSTALL_THIRD_LIBS)
|
||||
@@ -1,44 +0,0 @@
|
||||
macro(GENERATE_THRIFT_LIB LIB_NAME FILENAME OUTPUTDIR SOURCES)
|
||||
file(MAKE_DIRECTORY ${OUTPUTDIR})
|
||||
detect_host_triplet(HOST_TRIPLET)
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
if (CMAKE_HOST_WIN32)
|
||||
set(_host_executable_suffix ".exe")
|
||||
else()
|
||||
set(_host_executable_suffix "")
|
||||
endif()
|
||||
else()
|
||||
set(_host_executable_suffix ${CMAKE_EXECUTABLE_SUFFIX})
|
||||
endif()
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/MaaDeps/vcpkg/installed/maa-${HOST_TRIPLET}/tools/thrift/thrift${_host_executable_suffix})
|
||||
set(THRIFT_COMPILER ${PROJECT_SOURCE_DIR}/MaaDeps/vcpkg/installed/maa-${HOST_TRIPLET}/tools/thrift/thrift${_host_executable_suffix})
|
||||
else()
|
||||
find_program(THRIFT_COMPILER thrift)
|
||||
endif()
|
||||
if(NOT THRIFT_COMPILER)
|
||||
message(FATAL_ERROR "Thrift compiler not found")
|
||||
endif()
|
||||
get_filename_component(THRIFT_IDL_NAME ${FILENAME} NAME_WE)
|
||||
set(THRIFT_IDL_TARGET "${LIB_NAME}_${THRIFT_IDL_NAME}_idl")
|
||||
set("${THRIFT_IDL_NAME}-gen-cpp"
|
||||
${OUTPUTDIR}/${THRIFT_IDL_NAME}.cpp
|
||||
${OUTPUTDIR}/${THRIFT_IDL_NAME}.h
|
||||
${OUTPUTDIR}/${THRIFT_IDL_NAME}_types.cpp
|
||||
${OUTPUTDIR}/${THRIFT_IDL_NAME}_types.h)
|
||||
|
||||
add_custom_command(OUTPUT ${${THRIFT_IDL_NAME}-gen-cpp}
|
||||
DEPENDS ${FILENAME}
|
||||
COMMAND ${THRIFT_COMPILER} --gen cpp:no_skeleton -out ${OUTPUTDIR} ${FILENAME}
|
||||
VERBATIM)
|
||||
add_custom_target(${THRIFT_IDL_TARGET} DEPENDS ${${THRIFT_IDL_NAME}-gen-cpp})
|
||||
add_library(${LIB_NAME} STATIC ${${THRIFT_IDL_NAME}-gen-cpp})
|
||||
add_dependencies(${LIB_NAME} ${THRIFT_IDL_TARGET})
|
||||
set_target_properties(${LIB_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
target_link_libraries(${LIB_NAME} PUBLIC thrift::thrift)
|
||||
target_include_directories(${LIB_NAME} PUBLIC ${OUTPUTDIR})
|
||||
set(${SOURCES} ${${SOURCES}} ${GENERATED_SOURCES} PARENT_SCOPE)
|
||||
endmacro(GENERATE_THRIFT_LIB)
|
||||
|
||||
if (WITH_THRIFT)
|
||||
add_compile_definitions(WITH_THRIFT)
|
||||
endif (WITH_THRIFT)
|
||||
@@ -1,50 +1,73 @@
|
||||
function(download_and_decompress url filename sha256_checksum decompress_dir)
|
||||
if(EXISTS ${filename})
|
||||
file(SHA256 ${filename} CHECKSUM_VARIABLE)
|
||||
endif()
|
||||
if(NOT EXISTS ${filename} OR NOT CHECKSUM_VARIABLE STREQUAL sha256_checksum)
|
||||
message("Downloading file from ${url} to ${filename} ...")
|
||||
file(DOWNLOAD ${url} "${filename}.tmp" SHOW_PROGRESS EXPECTED_HASH SHA256=${sha256_checksum})
|
||||
file(RENAME "${filename}.tmp" ${filename})
|
||||
endif()
|
||||
if(NOT EXISTS ${decompress_dir})
|
||||
file(MAKE_DIRECTORY ${decompress_dir})
|
||||
endif()
|
||||
message("Decompress file ${filename} ...")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar -xf ${filename} WORKING_DIRECTORY ${decompress_dir})
|
||||
if(EXISTS ${filename})
|
||||
file(SHA256 ${filename} CHECKSUM_VARIABLE)
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS ${filename} OR NOT CHECKSUM_VARIABLE STREQUAL sha256_checksum)
|
||||
message("Downloading file from ${url} to ${filename} ...")
|
||||
file(
|
||||
DOWNLOAD ${url} "${filename}.tmp"
|
||||
SHOW_PROGRESS
|
||||
EXPECTED_HASH SHA256=${sha256_checksum})
|
||||
file(RENAME "${filename}.tmp" ${filename})
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS ${decompress_dir})
|
||||
file(MAKE_DIRECTORY ${decompress_dir})
|
||||
endif()
|
||||
|
||||
message("Decompress file ${filename} ...")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar -xf ${filename} WORKING_DIRECTORY ${decompress_dir})
|
||||
endfunction()
|
||||
|
||||
function(get_osx_architecture)
|
||||
if (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
|
||||
set(CURRENT_OSX_ARCH "arm64" PARENT_SCOPE)
|
||||
elseif(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
|
||||
set(CURRENT_OSX_ARCH "x86_64" PARENT_SCOPE)
|
||||
else()
|
||||
set(CURRENT_OSX_ARCH ${CMAKE_HOST_SYSTEM_PROCESSOR} PARENT_SCOPE)
|
||||
endif()
|
||||
if(CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
|
||||
set(CURRENT_OSX_ARCH
|
||||
"arm64"
|
||||
PARENT_SCOPE)
|
||||
elseif(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
|
||||
set(CURRENT_OSX_ARCH
|
||||
"x86_64"
|
||||
PARENT_SCOPE)
|
||||
else()
|
||||
set(CURRENT_OSX_ARCH
|
||||
${CMAKE_HOST_SYSTEM_PROCESSOR}
|
||||
PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(detect_host_triplet outvar)
|
||||
string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" host_triplet_system)
|
||||
string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" host_triplet_arch)
|
||||
if(host_triplet_system STREQUAL "darwin")
|
||||
set(host_triplet_system "osx")
|
||||
endif()
|
||||
message("host_triplet_system: ${host_triplet_system}")
|
||||
message("host_triplet_arch: ${host_triplet_arch}")
|
||||
if(host_triplet_arch MATCHES "(amd64|x86_64)")
|
||||
set(host_triplet_arch "x64")
|
||||
elseif(host_triplet_arch MATCHES "i[3456]86")
|
||||
set(host_triplet_arch "x86")
|
||||
elseif(host_triplet_arch MATCHES "(aarch64|armv8l|arm64)")
|
||||
set(host_triplet_arch "arm64")
|
||||
else()
|
||||
message(FATAL_ERROR "Unrecognized CMAKE_HOST_SYSTEM_PROCESSOR: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||
endif()
|
||||
set(${outvar} "${host_triplet_arch}-${host_triplet_system}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
if(APPLE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 13.3) # for to_chars
|
||||
get_osx_architecture()
|
||||
endif(APPLE)
|
||||
|
||||
if (APPLE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 12.0)
|
||||
get_osx_architecture()
|
||||
endif (APPLE)
|
||||
if(NOT DEFINED MAADEPS_TRIPLET)
|
||||
detect_maadeps_triplet(MAADEPS_TRIPLET)
|
||||
endif()
|
||||
|
||||
# 创建资源目录链接的函数
|
||||
function(create_resource_link TARGET_NAME OUTPUT_DIR)
|
||||
if(WIN32)
|
||||
# Windows 使用 mklink /J 创建目录链接(不需要管理员权限)
|
||||
add_custom_command(
|
||||
TARGET ${TARGET_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Creating resource directory link for ${TARGET_NAME}..."
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory "${OUTPUT_DIR}/resource"
|
||||
COMMAND cmd /c "mklink /J \"${OUTPUT_DIR}/resource\" \"${PROJECT_SOURCE_DIR}/resource\""
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Resource directory link created successfully"
|
||||
COMMENT "Creating junction for resource directory for ${TARGET_NAME}"
|
||||
)
|
||||
else()
|
||||
# Unix/Linux/macOS 使用符号链接
|
||||
add_custom_command(
|
||||
TARGET ${TARGET_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Creating resource directory link for ${TARGET_NAME}..."
|
||||
COMMAND ${CMAKE_COMMAND} -E remove "${OUTPUT_DIR}/resource"
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink "${PROJECT_SOURCE_DIR}/resource" "${OUTPUT_DIR}/resource"
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Resource directory link created successfully"
|
||||
COMMENT "Creating symlink for resource directory for ${TARGET_NAME}"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
27
cmake/version.cmake
Normal file
27
cmake/version.cmake
Normal file
@@ -0,0 +1,27 @@
|
||||
# define MAA_HASH_VERSION from git
|
||||
set(MAA_HASH_VERSION
|
||||
"DEBUG_VERSION"
|
||||
CACHE STRING "maa version")
|
||||
|
||||
if(WITH_HASH_VERSION AND MAA_HASH_VERSION STREQUAL "DEBUG_VERSION")
|
||||
find_package(Git)
|
||||
|
||||
if(GIT_FOUND)
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE output
|
||||
ERROR_VARIABLE err
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(result EQUAL 0)
|
||||
set(MAA_HASH_VERSION "${output}")
|
||||
else()
|
||||
message(WARNING "git rev-parse returning ${result}, output:\n${err}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "MAA_HASH_VERSION=${MAA_HASH_VERSION}")
|
||||
add_compile_definitions(MAA_VERSION="${MAA_HASH_VERSION}")
|
||||
@@ -224,3 +224,38 @@ MD052: true
|
||||
MD053:
|
||||
# Ignored definitions
|
||||
ignored_definitions: ["//"]
|
||||
|
||||
# MD054/link-image-style - Link and image style
|
||||
MD054:
|
||||
# Allow autolinks
|
||||
autolink: true
|
||||
# Allow collapsed reference links and images
|
||||
collapsed: true
|
||||
# Allow full reference links and images
|
||||
full: true
|
||||
# Allow inline links and images
|
||||
inline: true
|
||||
# Allow shortcut reference links and images
|
||||
shortcut: true
|
||||
# Allow URLs as inline links
|
||||
url_inline: true
|
||||
|
||||
# MD055/table-pipe-style - Table pipe style
|
||||
MD055:
|
||||
# Table pipe style
|
||||
style: "consistent"
|
||||
|
||||
# MD056/table-column-count - Table column count
|
||||
MD056: true
|
||||
|
||||
# MD057 - Table column count inconsistencies with table header column count
|
||||
# (Not documented in official rules list - MD057 appears to be missing or deprecated)
|
||||
|
||||
# MD058/blanks-around-tables - Tables should be surrounded by blank lines
|
||||
MD058: true
|
||||
|
||||
# MD059/descriptive-link-text - Link text should be descriptive
|
||||
MD059:
|
||||
false
|
||||
# Prohibited link texts
|
||||
#prohibited_texts: ["click here", "here", "link", "more"]
|
||||
|
||||
2
docs/.prettierignore
Normal file
2
docs/.prettierignore
Normal file
@@ -0,0 +1,2 @@
|
||||
**/pnpm-lock.yaml
|
||||
**/*.md
|
||||
40
docs/.prettierrc.js
Normal file
40
docs/.prettierrc.js
Normal file
@@ -0,0 +1,40 @@
|
||||
module.exports = {
|
||||
printWidth: 120,
|
||||
tabWidth: 2,
|
||||
useTabs: false,
|
||||
bracketSpacing: true,
|
||||
bracketSameLine: false,
|
||||
endOfLine: 'auto',
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
trailingComma: 'all',
|
||||
arrowParens: 'always',
|
||||
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/*.ts'],
|
||||
options: {
|
||||
semi: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.*css'],
|
||||
options: {
|
||||
singleQuote: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.yml', '**/*.yaml'],
|
||||
options: {
|
||||
parser: 'yaml',
|
||||
singleQuote: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.json'],
|
||||
options: {
|
||||
tabWidth: 4,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
import { defineClientConfig } from "vuepress/client";
|
||||
import Image1 from "../components/Image1.vue";
|
||||
import Image2 from "../components/Image2.vue";
|
||||
import Image4 from "../components/Image4.vue";
|
||||
import { defineClientConfig } from 'vuepress/client';
|
||||
|
||||
import ImageGrid from './components/ImageGrid.vue';
|
||||
|
||||
import './styles/index.scss';
|
||||
|
||||
export default defineClientConfig({
|
||||
enhance: ({ app }) => {
|
||||
app.component("Image1", Image1);
|
||||
app.component("Image2", Image2);
|
||||
app.component("Image4", Image4);
|
||||
app.component('ImageGrid', ImageGrid);
|
||||
},
|
||||
});
|
||||
|
||||
72
docs/.vuepress/components/ImageGrid.vue
Normal file
72
docs/.vuepress/components/ImageGrid.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<CardGrid>
|
||||
<ImageCard v-for="(item, index) of displayImageList" :key="index" :image="item" />
|
||||
</CardGrid>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { PropType, defineComponent, computed, ref, onMounted, onUnmounted } from 'vue'
|
||||
import { withBase } from 'vuepress/client'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ImageCardGrid',
|
||||
props: {
|
||||
imageList: {
|
||||
type: Array as PropType<Array<{ light: string; dark: string } | string>>,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const isDarkMode = ref(false)
|
||||
let observer: MutationObserver | null = null
|
||||
let mediaQuery: MediaQueryList | null = null
|
||||
|
||||
const updateDarkMode = () => {
|
||||
if (typeof window !== 'undefined') {
|
||||
const html = document.documentElement
|
||||
isDarkMode.value =
|
||||
html.classList.contains('dark') ||
|
||||
html.getAttribute('data-theme') === 'dark' ||
|
||||
window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
updateDarkMode()
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
// 监听DOM变化(主题切换通常会改变class或data-theme属性)
|
||||
observer = new MutationObserver(updateDarkMode)
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['class', 'data-theme'],
|
||||
})
|
||||
|
||||
// 监听系统主题变化
|
||||
mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
|
||||
mediaQuery.addEventListener('change', updateDarkMode)
|
||||
}
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (observer) {
|
||||
observer.disconnect()
|
||||
}
|
||||
if (mediaQuery) {
|
||||
mediaQuery.removeEventListener('change', updateDarkMode)
|
||||
}
|
||||
})
|
||||
|
||||
const displayImageList = computed(() => {
|
||||
return props.imageList.map((item) => {
|
||||
const src = typeof item === 'string' ? item : isDarkMode.value ? item.dark : item.light
|
||||
return withBase(src)
|
||||
})
|
||||
})
|
||||
|
||||
return {
|
||||
displayImageList,
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
@@ -1,77 +1,70 @@
|
||||
import { defineUserConfig } from "vuepress";
|
||||
import { viteBundler } from "@vuepress/bundler-vite";
|
||||
import { googleAnalyticsPlugin } from "@vuepress/plugin-google-analytics";
|
||||
import Theme from "./theme";
|
||||
import { viteBundler } from '@vuepress/bundler-vite';
|
||||
import { defineUserConfig } from 'vuepress';
|
||||
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics';
|
||||
import { plumeTheme } from 'vuepress-theme-plume';
|
||||
|
||||
import DocSearchConfig from './plugins/search';
|
||||
|
||||
const isProd = process.env.NODE_ENV === 'production';
|
||||
|
||||
export default defineUserConfig({
|
||||
base: "/docs/",
|
||||
lang: "zh-CN",
|
||||
title: "MaaAssistantArknights",
|
||||
description: "MAA",
|
||||
base: '/',
|
||||
lang: 'zh-CN',
|
||||
title: 'MAA 文档站',
|
||||
description: 'MAA —「明日方舟」小助手',
|
||||
host: '0.0.0.0',
|
||||
port: 3001,
|
||||
|
||||
locales: {
|
||||
"/zh-cn/": {
|
||||
lang: "zh-CN",
|
||||
description: "文档",
|
||||
'/zh-cn/': {
|
||||
lang: 'zh-CN',
|
||||
title: 'MAA 文档站',
|
||||
description: '文档',
|
||||
},
|
||||
"/zh-tw/": {
|
||||
lang: "zh-TW",
|
||||
description: "文件",
|
||||
'/zh-tw/': {
|
||||
lang: 'zh-TW',
|
||||
title: 'MAA 文件站',
|
||||
description: '文件',
|
||||
},
|
||||
"/en-us/": {
|
||||
lang: "en-US",
|
||||
description: "Documentation",
|
||||
'/en-us/': {
|
||||
lang: 'en-US',
|
||||
title: 'MAA Documentation Site',
|
||||
description: 'Documentation',
|
||||
},
|
||||
"/ja-jp/": {
|
||||
lang: "ja-JP",
|
||||
description: "ドキュメンテーション",
|
||||
'/ja-jp/': {
|
||||
lang: 'ja-JP',
|
||||
title: 'MAA ドキュメントサイト',
|
||||
description: 'ドキュメント',
|
||||
},
|
||||
"/ko-kr/": {
|
||||
lang: "ko-KR",
|
||||
description: "선적 서류 비치",
|
||||
'/ko-kr/': {
|
||||
lang: 'ko-KR',
|
||||
title: 'MAA 문서 사이트',
|
||||
description: '문서',
|
||||
},
|
||||
},
|
||||
|
||||
markdown: {
|
||||
headers: {
|
||||
level: [2, 3, 4, 5],
|
||||
},
|
||||
},
|
||||
|
||||
theme: Theme,
|
||||
|
||||
plugins: [
|
||||
googleAnalyticsPlugin({
|
||||
id: "G-FJQDKG394Z",
|
||||
}),
|
||||
],
|
||||
|
||||
head: [
|
||||
["link", { rel: "preconnect", href: "https://fonts.googleapis.com" }],
|
||||
['link', { rel: 'preconnect', href: 'https://fonts.googleapis.com' }],
|
||||
['link', { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }],
|
||||
[
|
||||
"link",
|
||||
{ rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: "" },
|
||||
],
|
||||
[
|
||||
"link",
|
||||
'link',
|
||||
{
|
||||
href: "https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@100..900&display=swap",
|
||||
rel: "stylesheet",
|
||||
href: 'https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@100..900&display=swap',
|
||||
rel: 'stylesheet',
|
||||
},
|
||||
],
|
||||
[
|
||||
"link",
|
||||
'link',
|
||||
{
|
||||
href: "https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@200..900&display=swap",
|
||||
rel: "stylesheet",
|
||||
href: 'https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@200..900&display=swap',
|
||||
rel: 'stylesheet',
|
||||
},
|
||||
],
|
||||
[
|
||||
"link",
|
||||
'link',
|
||||
{
|
||||
href: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap",
|
||||
rel: "stylesheet",
|
||||
href: 'https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap',
|
||||
rel: 'stylesheet',
|
||||
},
|
||||
],
|
||||
],
|
||||
@@ -80,4 +73,63 @@ export default defineUserConfig({
|
||||
viteOptions: {},
|
||||
vuePluginOptions: {},
|
||||
}),
|
||||
|
||||
shouldPrefetch: false,
|
||||
|
||||
theme: plumeTheme({
|
||||
hostname: 'https://docs.maa.plus',
|
||||
|
||||
docsRepo: 'MaaAssistantArknights/MaaAssistantArknights',
|
||||
docsDir: '/docs',
|
||||
docsBranch: 'dev',
|
||||
|
||||
editLink: true,
|
||||
lastUpdated: false,
|
||||
contributors: false,
|
||||
changelog: false,
|
||||
|
||||
blog: false,
|
||||
|
||||
cache: 'filesystem',
|
||||
|
||||
search: DocSearchConfig,
|
||||
|
||||
codeHighlighter: {
|
||||
themes: { light: 'one-light', dark: 'one-dark-pro' },
|
||||
},
|
||||
|
||||
markdown: {
|
||||
image: {
|
||||
lazyload: true,
|
||||
mark: true,
|
||||
size: true,
|
||||
},
|
||||
|
||||
icon: { provider: 'iconify' },
|
||||
plot: true,
|
||||
field: true,
|
||||
bilibili: true,
|
||||
},
|
||||
|
||||
watermark: false,
|
||||
|
||||
comment: {
|
||||
provider: 'Giscus',
|
||||
repo: 'MaaAssistantArknights/maa-website',
|
||||
repoId: 'R_kgDOHY7Gyg',
|
||||
category: 'Comments',
|
||||
categoryId: 'DIC_kwDOHY7Gys4CgoVH',
|
||||
mapping: 'pathname',
|
||||
strict: false,
|
||||
lazyLoading: true,
|
||||
},
|
||||
|
||||
//replaceAssets: isProd ? "https://cdn.maa.plus" : false,
|
||||
}),
|
||||
|
||||
plugins: [
|
||||
googleAnalyticsPlugin({
|
||||
id: 'G-FJQDKG394Z',
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
5
docs/.vuepress/env.d.ts
vendored
Normal file
5
docs/.vuepress/env.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
declare module '*.vue' {
|
||||
import { DefineComponent } from 'vue';
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
}
|
||||
@@ -1,29 +1,19 @@
|
||||
import { navbar } from "vuepress-theme-hope";
|
||||
import { defineNavbarConfig } from 'vuepress-theme-plume';
|
||||
|
||||
export const enusNavbar = navbar([
|
||||
export const enusNavbar = defineNavbarConfig([
|
||||
{
|
||||
text: "Home",
|
||||
icon: "ic:round-home",
|
||||
link: "/en-us/",
|
||||
text: 'User Manual',
|
||||
icon: 'mdi:user',
|
||||
link: '/en-us/manual/newbie.html',
|
||||
},
|
||||
{
|
||||
text: "User Manual",
|
||||
icon: "mdi:user",
|
||||
link: "/en-us/manual/",
|
||||
text: 'Development Docs',
|
||||
icon: 'ph:code-bold',
|
||||
link: '/en-us/develop/development.html',
|
||||
},
|
||||
{
|
||||
text: "Development Docs",
|
||||
icon: "ph:code-bold",
|
||||
link: "/en-us/develop/",
|
||||
},
|
||||
{
|
||||
text: "Protocol Docs",
|
||||
icon: "basil:document-solid",
|
||||
link: "/en-us/protocol/",
|
||||
},
|
||||
{
|
||||
text: "MAA Website",
|
||||
icon: "mdi:cow",
|
||||
link: "https://maa.plus",
|
||||
text: 'Protocol Docs',
|
||||
icon: 'basil:document-solid',
|
||||
link: '/en-us/protocol/integration.html',
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export * from "./zh-cn";
|
||||
export * from "./zh-tw";
|
||||
export * from "./en-us";
|
||||
export * from "./ja-jp";
|
||||
export * from "./ko-kr";
|
||||
export * from './zh-cn';
|
||||
export * from './zh-tw';
|
||||
export * from './en-us';
|
||||
export * from './ja-jp';
|
||||
export * from './ko-kr';
|
||||
|
||||
@@ -1,29 +1,19 @@
|
||||
import { navbar } from "vuepress-theme-hope";
|
||||
import { defineNavbarConfig } from 'vuepress-theme-plume';
|
||||
|
||||
export const jajpNavbar = navbar([
|
||||
export const jajpNavbar = defineNavbarConfig([
|
||||
{
|
||||
text: "ホームページ",
|
||||
icon: "ic:round-home",
|
||||
link: "/ja-jp/",
|
||||
text: '使用説明',
|
||||
icon: 'mdi:user',
|
||||
link: '/ja-jp/manual/newbie.html',
|
||||
},
|
||||
{
|
||||
text: "使用説明",
|
||||
icon: "mdi:user",
|
||||
link: "/ja-jp/manual/",
|
||||
text: '開発関連',
|
||||
icon: 'ph:code-bold',
|
||||
link: '/ja-jp/develop/development.html',
|
||||
},
|
||||
{
|
||||
text: "開発関連",
|
||||
icon: "ph:code-bold",
|
||||
link: "/ja-jp/develop/",
|
||||
},
|
||||
{
|
||||
text: "プロトコルドキュメント",
|
||||
icon: "basil:document-solid",
|
||||
link: "/ja-jp/protocol/",
|
||||
},
|
||||
{
|
||||
text: "MAA 公式サイト",
|
||||
icon: "mdi:cow",
|
||||
link: "https://maa.plus",
|
||||
text: 'プロトコルドキュメント',
|
||||
icon: 'basil:document-solid',
|
||||
link: '/ja-jp/protocol/integration.html',
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -1,29 +1,19 @@
|
||||
import { navbar } from "vuepress-theme-hope";
|
||||
import { defineNavbarConfig } from 'vuepress-theme-plume';
|
||||
|
||||
export const kokrNavbar = navbar([
|
||||
export const kokrNavbar = defineNavbarConfig([
|
||||
{
|
||||
text: "홈페이지",
|
||||
icon: "ic:round-home",
|
||||
link: "/ko-kr/",
|
||||
text: '사용자 설명서',
|
||||
icon: 'mdi:user',
|
||||
link: '/ko-kr/manual/newbie.html',
|
||||
},
|
||||
{
|
||||
text: "사용자 설명서",
|
||||
icon: "mdi:user",
|
||||
link: "/ko-kr/manual/",
|
||||
text: '개발 문서',
|
||||
icon: 'ph:code-bold',
|
||||
link: '/ko-kr/develop/development.html',
|
||||
},
|
||||
{
|
||||
text: "개발 문서",
|
||||
icon: "ph:code-bold",
|
||||
link: "/ko-kr/develop/",
|
||||
},
|
||||
{
|
||||
text: "프로토콜 문서",
|
||||
icon: "basil:document-solid",
|
||||
link: "/ko-kr/protocol/",
|
||||
},
|
||||
{
|
||||
text: "MAA 공식 홈페이지",
|
||||
icon: "mdi:cow",
|
||||
link: "https://maa.plus",
|
||||
text: '프로토콜 문서',
|
||||
icon: 'basil:document-solid',
|
||||
link: '/ko-kr/protocol/integration.html',
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -1,29 +1,19 @@
|
||||
import { navbar } from "vuepress-theme-hope";
|
||||
import { defineNavbarConfig } from 'vuepress-theme-plume';
|
||||
|
||||
export const zhcnNavbar = navbar([
|
||||
export const zhcnNavbar = defineNavbarConfig([
|
||||
{
|
||||
text: "主页",
|
||||
icon: "ic:round-home",
|
||||
link: "/zh-cn/",
|
||||
text: '用户手册',
|
||||
icon: 'mdi:user',
|
||||
link: '/zh-cn/manual/newbie.html',
|
||||
},
|
||||
{
|
||||
text: "用户手册",
|
||||
icon: "mdi:user",
|
||||
link: "/zh-cn/manual/",
|
||||
text: '开发文档',
|
||||
icon: 'ph:code-bold',
|
||||
link: '/zh-cn/develop/development.html',
|
||||
},
|
||||
{
|
||||
text: "开发文档",
|
||||
icon: "ph:code-bold",
|
||||
link: "/zh-cn/develop/",
|
||||
},
|
||||
{
|
||||
text: "协议文档",
|
||||
icon: "basil:document-solid",
|
||||
link: "/zh-cn/protocol/",
|
||||
},
|
||||
{
|
||||
text: "MAA 官网",
|
||||
icon: "mdi:cow",
|
||||
link: "https://maa.plus",
|
||||
text: '协议文档',
|
||||
icon: 'basil:document-solid',
|
||||
link: '/zh-cn/protocol/integration.html',
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -1,29 +1,19 @@
|
||||
import { navbar } from "vuepress-theme-hope";
|
||||
import { defineNavbarConfig } from 'vuepress-theme-plume';
|
||||
|
||||
export const zhtwNavbar = navbar([
|
||||
export const zhtwNavbar = defineNavbarConfig([
|
||||
{
|
||||
text: "首頁",
|
||||
icon: "ic:round-home",
|
||||
link: "/zh-tw/",
|
||||
text: '用戶說明書',
|
||||
icon: 'mdi:user',
|
||||
link: '/zh-tw/manual/newbie.html',
|
||||
},
|
||||
{
|
||||
text: "用戶說明書",
|
||||
icon: "mdi:user",
|
||||
link: "/zh-tw/manual/",
|
||||
text: '開發文件',
|
||||
icon: 'ph:code-bold',
|
||||
link: '/zh-tw/develop/development.html',
|
||||
},
|
||||
{
|
||||
text: "開發文件",
|
||||
icon: "ph:code-bold",
|
||||
link: "/zh-tw/develop/",
|
||||
},
|
||||
{
|
||||
text: "協議文件",
|
||||
icon: "basil:document-solid",
|
||||
link: "/zh-tw/protocol/",
|
||||
},
|
||||
{
|
||||
text: "MAA 官網",
|
||||
icon: "mdi:cow",
|
||||
link: "https://maa.plus",
|
||||
text: '協議文件',
|
||||
icon: 'basil:document-solid',
|
||||
link: '/zh-tw/protocol/integration.html',
|
||||
},
|
||||
]);
|
||||
|
||||
8
docs/.vuepress/notes/en-us.ts
Normal file
8
docs/.vuepress/notes/en-us.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { defineNotesConfig } from 'vuepress-theme-plume';
|
||||
import { genNotes } from './genSidebar';
|
||||
|
||||
export const enusNotes = defineNotesConfig({
|
||||
dir: 'en-us',
|
||||
link: '/en-us/',
|
||||
notes: genNotes('en-us'),
|
||||
});
|
||||
119
docs/.vuepress/notes/genSidebar.ts
Normal file
119
docs/.vuepress/notes/genSidebar.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as matterModule from 'gray-matter';
|
||||
import { defineNoteConfig, ThemeNote, ThemeSidebarItem } from 'vuepress-theme-plume';
|
||||
|
||||
const matter = (matterModule as any).default;
|
||||
|
||||
interface MetaData {
|
||||
baseName: string;
|
||||
order: number;
|
||||
title: string;
|
||||
icon: string;
|
||||
index: boolean;
|
||||
}
|
||||
|
||||
function getMetaData(dir: string, entry: fs.Dirent): MetaData | null {
|
||||
const currentPath = path.join(dir, entry.name);
|
||||
if (!fs.existsSync(currentPath)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let mdFilePath = '';
|
||||
if (entry.isDirectory()) {
|
||||
mdFilePath = path.join(currentPath, 'README.md');
|
||||
} else if (entry.isFile() && entry.name.endsWith('.md') && entry.name.toLowerCase() !== 'readme.md') {
|
||||
mdFilePath = currentPath;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!fs.existsSync(mdFilePath)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const fileContent = fs.readFileSync(mdFilePath, 'utf-8');
|
||||
const meta = matter(fileContent).data ?? {};
|
||||
|
||||
const baseName = path.parse(entry.name).name;
|
||||
// 获取顺序,目录的order在meta.dir.order里,文件的order在meta.order里,默认值为一个大数
|
||||
const order = Number((entry.isDirectory() ? meta?.dir?.order : meta?.order) ?? Number.MAX_SAFE_INTEGER);
|
||||
// 获取标题,先从matter里找title,再用正则获取一级标题,最后fallback到文件名(不含扩展名)
|
||||
const title = String(meta?.title ?? RegExp('# (.+)').exec(fileContent)?.[1] ?? baseName);
|
||||
// 获取图标
|
||||
const icon = String(meta?.icon ?? '');
|
||||
// 是否作为索引页,文件永远为true,目录则看meta.index,默认true
|
||||
const index = entry.isDirectory() ? (Boolean(meta?.index) ?? true) : true;
|
||||
|
||||
return {
|
||||
baseName: baseName,
|
||||
order: order,
|
||||
title: title,
|
||||
icon: icon,
|
||||
index: index,
|
||||
};
|
||||
}
|
||||
|
||||
export function genNotes(lang: string, baseDir = path.resolve(__dirname, '../../')): ThemeNote[] {
|
||||
// 进入指定语言目录,即docs/<i18n>/
|
||||
const langDir = path.join(baseDir, lang);
|
||||
|
||||
// 递归获取目录和文件
|
||||
function getItems(dir: string, isRoot: boolean): any[] {
|
||||
// 将内容与对应顺序进行包装
|
||||
interface Wrapped {
|
||||
content: ThemeNote | ThemeSidebarItem | string;
|
||||
order: number;
|
||||
}
|
||||
let itemsWithOrder: Wrapped[] = [];
|
||||
|
||||
// 获取所有非隐藏文件和目录
|
||||
const entries = fs.readdirSync(dir, { withFileTypes: true }).filter((e) => !e.name.startsWith('.'));
|
||||
|
||||
for (const entry of entries) {
|
||||
const metaData = getMetaData(dir, entry);
|
||||
if (!metaData) {
|
||||
continue;
|
||||
}
|
||||
if (entry.isDirectory()) {
|
||||
// 递归获取子目录内容
|
||||
const children = getItems(path.join(dir, entry.name), false);
|
||||
|
||||
if (isRoot) {
|
||||
// 一级目录,作为“专题”
|
||||
const item = defineNoteConfig({
|
||||
dir: metaData.baseName,
|
||||
link: `/${metaData.baseName}/`,
|
||||
text: metaData.title,
|
||||
sidebar: children,
|
||||
});
|
||||
itemsWithOrder.push({ content: item, order: metaData.order });
|
||||
} else {
|
||||
// 非一级目录,作为可折叠的子目录
|
||||
const item: ThemeSidebarItem = {
|
||||
text: metaData.title,
|
||||
// 只有当目录设置了index: true时,才生成链接,否则点击时不跳转、只切换折叠状态
|
||||
link: metaData.index ? `${metaData.baseName}/` : undefined,
|
||||
icon: metaData.icon,
|
||||
// 目前没有文档使用了这个特性,故不处理
|
||||
// badge: undefined,
|
||||
collapsed: true,
|
||||
// 前面不能加斜杠,必须用相对路径
|
||||
prefix: `${metaData.baseName}/`,
|
||||
items: children,
|
||||
};
|
||||
itemsWithOrder.push({ content: item, order: metaData.order });
|
||||
}
|
||||
} else if (entry.isFile() && entry.name.endsWith('.md') && entry.name.toLowerCase() !== 'readme.md') {
|
||||
// 普通文件,取完整文件名作为链接
|
||||
const item = entry.name;
|
||||
itemsWithOrder.push({ content: item, order: metaData.order });
|
||||
}
|
||||
}
|
||||
// 当前dir的内容读取完毕,进行排序并返回,返回时丢弃order
|
||||
itemsWithOrder.sort((a, b) => a.order - b.order);
|
||||
return itemsWithOrder.map((i) => i.content);
|
||||
}
|
||||
// 递归起点,只有这里是一级目录,isRoot传true
|
||||
return getItems(langDir, true);
|
||||
}
|
||||
5
docs/.vuepress/notes/index.ts
Normal file
5
docs/.vuepress/notes/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from './zh-cn';
|
||||
export * from './zh-tw';
|
||||
export * from './en-us';
|
||||
export * from './ja-jp';
|
||||
export * from './ko-kr';
|
||||
8
docs/.vuepress/notes/ja-jp.ts
Normal file
8
docs/.vuepress/notes/ja-jp.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { defineNotesConfig } from 'vuepress-theme-plume';
|
||||
import { genNotes } from './genSidebar';
|
||||
|
||||
export const jajpNotes = defineNotesConfig({
|
||||
dir: 'ja-jp',
|
||||
link: '/ja-jp/',
|
||||
notes: genNotes('ja-jp'),
|
||||
});
|
||||
8
docs/.vuepress/notes/ko-kr.ts
Normal file
8
docs/.vuepress/notes/ko-kr.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { defineNotesConfig } from 'vuepress-theme-plume';
|
||||
import { genNotes } from './genSidebar';
|
||||
|
||||
export const kokrNotes = defineNotesConfig({
|
||||
dir: 'ko-kr',
|
||||
link: '/ko-kr/',
|
||||
notes: genNotes('ko-kr'),
|
||||
});
|
||||
8
docs/.vuepress/notes/zh-cn.ts
Normal file
8
docs/.vuepress/notes/zh-cn.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { defineNotesConfig } from 'vuepress-theme-plume';
|
||||
import { genNotes } from './genSidebar';
|
||||
|
||||
export const zhcnNotes = defineNotesConfig({
|
||||
dir: 'zh-cn',
|
||||
link: '/zh-cn/',
|
||||
notes: genNotes('zh-cn'),
|
||||
});
|
||||
8
docs/.vuepress/notes/zh-tw.ts
Normal file
8
docs/.vuepress/notes/zh-tw.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { defineNotesConfig } from 'vuepress-theme-plume';
|
||||
import { genNotes } from './genSidebar';
|
||||
|
||||
export const zhtwNotes = defineNotesConfig({
|
||||
dir: 'zh-tw',
|
||||
link: '/zh-tw/',
|
||||
notes: genNotes('zh-tw'),
|
||||
});
|
||||
@@ -1,88 +1,84 @@
|
||||
export default {
|
||||
appId: "99JM20SIFG",
|
||||
apiKey: "7596a5a8c95cd64d4cf3050c9a4f878e",
|
||||
indexName: "maa",
|
||||
// 这里应该把所有本地化配置都放入 locales 中
|
||||
locales: {
|
||||
"/zh-cn/": {
|
||||
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: "点击反馈",
|
||||
},
|
||||
},
|
||||
},
|
||||
provider: 'algolia' as const,
|
||||
appId: '99JM20SIFG',
|
||||
apiKey: '7596a5a8c95cd64d4cf3050c9a4f878e',
|
||||
indexName: 'maa',
|
||||
locales: {
|
||||
'/zh-cn/': {
|
||||
placeholder: '搜索',
|
||||
translations: {
|
||||
button: {
|
||||
buttonText: '搜索',
|
||||
},
|
||||
"/en-us/": {
|
||||
placeholder: "Search",
|
||||
translations: {
|
||||
button: {
|
||||
buttonText: "Search",
|
||||
},
|
||||
modal: {
|
||||
searchBox: {
|
||||
resetButtonTitle: "Clear the query",
|
||||
cancelButtonText: "Cancel",
|
||||
},
|
||||
startScreen: {
|
||||
recentSearchesTitle: "Recent",
|
||||
noRecentSearchesText: "No recent searches",
|
||||
saveRecentSearchButtonTitle: "Save this search",
|
||||
removeRecentSearchButtonTitle:
|
||||
"Remove this search from history",
|
||||
favoriteSearchesTitle: "Favorite",
|
||||
removeFavoriteSearchButtonTitle:
|
||||
"Remove this search from favorites",
|
||||
},
|
||||
errorScreen: {
|
||||
titleText: "Unable to fetch results",
|
||||
helpText:
|
||||
"You might want to check your network connection.",
|
||||
},
|
||||
footer: {
|
||||
selectText: "to select",
|
||||
navigateText: "to navigate",
|
||||
closeText: "to close",
|
||||
searchByText: "Search by",
|
||||
},
|
||||
noResultsScreen: {
|
||||
noResultsText: "No results for",
|
||||
suggestedQueryText: "Try searching for",
|
||||
reportMissingResultsText:
|
||||
"Believe this query should return results?",
|
||||
reportMissingResultsLinkText: "Let us know.",
|
||||
},
|
||||
},
|
||||
},
|
||||
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',
|
||||
translations: {
|
||||
button: {
|
||||
buttonText: 'Search',
|
||||
},
|
||||
modal: {
|
||||
searchBox: {
|
||||
resetButtonTitle: 'Clear the query',
|
||||
cancelButtonText: 'Cancel',
|
||||
},
|
||||
startScreen: {
|
||||
recentSearchesTitle: 'Recent',
|
||||
noRecentSearchesText: 'No recent searches',
|
||||
saveRecentSearchButtonTitle: 'Save this search',
|
||||
removeRecentSearchButtonTitle: 'Remove this search from history',
|
||||
favoriteSearchesTitle: 'Favorite',
|
||||
removeFavoriteSearchButtonTitle: 'Remove this search from favorites',
|
||||
},
|
||||
errorScreen: {
|
||||
titleText: 'Unable to fetch results',
|
||||
helpText: 'You might want to check your network connection.',
|
||||
},
|
||||
footer: {
|
||||
selectText: 'to select',
|
||||
navigateText: 'to navigate',
|
||||
closeText: 'to close',
|
||||
searchByText: 'Search by',
|
||||
},
|
||||
noResultsScreen: {
|
||||
noResultsText: 'No results for',
|
||||
suggestedQueryText: 'Try searching for',
|
||||
reportMissingResultsText: 'Believe this query should return results?',
|
||||
reportMissingResultsLinkText: 'Let us know.',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
129
docs/.vuepress/plume.config.ts
Normal file
129
docs/.vuepress/plume.config.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
import { defineThemeConfig } from 'vuepress-theme-plume';
|
||||
import { zhcnNavbar, zhtwNavbar, enusNavbar, jajpNavbar, kokrNavbar } from './navbar';
|
||||
import { zhcnNotes, zhtwNotes, enusNotes, jajpNotes, kokrNotes } from './notes';
|
||||
|
||||
export default defineThemeConfig({
|
||||
logo: '/images/maa-logo_512x512.png',
|
||||
|
||||
appearance: true,
|
||||
|
||||
social: [
|
||||
{ icon: 'qq', link: 'https://api.maa.plus/MaaAssistantArknights/api/qqgroup' },
|
||||
{ icon: 'discord', link: 'https://discord.gg/23DfZ9uA4V' },
|
||||
{ icon: 'telegram', link: 'https://t.me/+Mgc2Zngr-hs3ZjU1' },
|
||||
{ icon: 'bilibili', link: 'https://space.bilibili.com/3493274731940507/' },
|
||||
{ icon: 'github', link: 'https://github.com/MaaAssistantArknights/MaaAssistantArknights/' },
|
||||
],
|
||||
navbarSocialInclude: ['qq', 'discord', 'telegram', 'bilibili', 'github'],
|
||||
|
||||
aside: true,
|
||||
// outline: [2, 3, 4, 5],
|
||||
copyright: false,
|
||||
prevPage: false,
|
||||
nextPage: false,
|
||||
createTime: false,
|
||||
|
||||
footer: false,
|
||||
|
||||
locales: {
|
||||
'/zh-cn/': {
|
||||
navbar: zhcnNavbar,
|
||||
notes: zhcnNotes,
|
||||
},
|
||||
'/zh-tw/': {
|
||||
navbar: zhtwNavbar,
|
||||
notes: zhtwNotes,
|
||||
},
|
||||
'/en-us/': {
|
||||
navbar: enusNavbar,
|
||||
notes: enusNotes,
|
||||
},
|
||||
'/ja-jp/': {
|
||||
navbar: jajpNavbar,
|
||||
notes: jajpNotes,
|
||||
},
|
||||
'/ko-kr/': {
|
||||
navbar: kokrNavbar,
|
||||
notes: kokrNotes,
|
||||
},
|
||||
},
|
||||
|
||||
autoFrontmatter: false,
|
||||
|
||||
//plugins: {
|
||||
// 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/",
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
//},
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user