Compare commits
467 Commits
f689e59b58
...
bmain
Author | SHA1 | Date | |
---|---|---|---|
/* User with id == 0 is a fake user from git author */
|
72cf94128d | ||
/* User with id == 0 is a fake user from git author */
|
437b8a2e16 | ||
/* User with id == 0 is a fake user from git author */
|
dbc483330b | ||
/* User with id == 0 is a fake user from git author */
|
835f80f179 | ||
/* User with id == 0 is a fake user from git author */
|
5cd24d6e94 | ||
/* User with id == 0 is a fake user from git author */
|
3f4e40147b | ||
/* User with id == 0 is a fake user from git author */
|
f45137e8f3 | ||
/* User with id == 0 is a fake user from git author */
|
882e4f6278 | ||
/* User with id == 0 is a fake user from git author */
|
c30a14c0c9 | ||
/* User with id == 0 is a fake user from git author */
|
cd4ab32709 | ||
/* User with id == 0 is a fake user from git author */
|
1ffbb95e80 | ||
/* User with id == 0 is a fake user from git author */
|
56960ed38f | ||
/* User with id == 0 is a fake user from git author */
|
5e34c2f5cc | ||
/* User with id == 0 is a fake user from git author */
|
f451a6a1e1 | ||
/* User with id == 0 is a fake user from git author */
|
7ff1933fb0 | ||
/* User with id == 0 is a fake user from git author */
|
d360408365 | ||
/* User with id == 0 is a fake user from git author */
|
2f8fae30a4 | ||
/* User with id == 0 is a fake user from git author */
|
6d4556236e | ||
/* User with id == 0 is a fake user from git author */
|
d4614dcb09 | ||
/* User with id == 0 is a fake user from git author */
|
ad8e294902 | ||
/* User with id == 0 is a fake user from git author */
|
3e97046031 | ||
/* User with id == 0 is a fake user from git author */
|
f8b9887734 | ||
/* User with id == 0 is a fake user from git author */
|
de6056ab27 | ||
/* User with id == 0 is a fake user from git author */
|
8266f0a6a3 | ||
/* User with id == 0 is a fake user from git author */
|
af8fec15eb | ||
/* User with id == 0 is a fake user from git author */
|
756b48ae36 | ||
/* User with id == 0 is a fake user from git author */
|
b5f71d95d2 | ||
/* User with id == 0 is a fake user from git author */
|
ea178aa11a | ||
/* User with id == 0 is a fake user from git author */
|
64630b4abd | ||
/* User with id == 0 is a fake user from git author */
|
8eeafdd0d8 | ||
/* User with id == 0 is a fake user from git author */
|
9277c95336 | ||
/* User with id == 0 is a fake user from git author */
|
ec687cc4e9 | ||
/* User with id == 0 is a fake user from git author */
|
d21d5b0263 | ||
/* User with id == 0 is a fake user from git author */
|
e1b7aeed21 | ||
/* User with id == 0 is a fake user from git author */
|
0bae715de7 | ||
/* User with id == 0 is a fake user from git author */
|
849cab2dbb | ||
/* User with id == 0 is a fake user from git author */
|
4113a0a6f1 | ||
/* User with id == 0 is a fake user from git author */
|
e57cce5a28 | ||
/* User with id == 0 is a fake user from git author */
|
342dc34096 | ||
/* User with id == 0 is a fake user from git author */
|
1d3ee05571 | ||
/* User with id == 0 is a fake user from git author */
|
29aa6225b4 | ||
/* User with id == 0 is a fake user from git author */
|
31a6d46726 | ||
/* User with id == 0 is a fake user from git author */
|
bea5561dc4 | ||
/* User with id == 0 is a fake user from git author */
|
b92b3e2107 | ||
/* User with id == 0 is a fake user from git author */
|
c52ddbed83 | ||
/* User with id == 0 is a fake user from git author */
|
58a38e75ab | ||
/* User with id == 0 is a fake user from git author */
|
e7692ddfd1 | ||
/* User with id == 0 is a fake user from git author */
|
0e4ae40622 | ||
/* User with id == 0 is a fake user from git author */
|
9c746559f4 | ||
/* User with id == 0 is a fake user from git author */
|
536fec9db0 | ||
/* User with id == 0 is a fake user from git author */
|
16bfabc6fe | ||
/* User with id == 0 is a fake user from git author */
|
5e550363ee | ||
/* User with id == 0 is a fake user from git author */
|
fcb513d4ac | ||
/* User with id == 0 is a fake user from git author */
|
b4871d1b07 | ||
/* User with id == 0 is a fake user from git author */
|
5d337e3356 | ||
/* User with id == 0 is a fake user from git author */
|
40debb62a6 | ||
/* User with id == 0 is a fake user from git author */
|
70b7d85fac | ||
/* User with id == 0 is a fake user from git author */
|
c96244dd29 | ||
/* User with id == 0 is a fake user from git author */
|
6fe3bbff18 | ||
/* User with id == 0 is a fake user from git author */
|
a0438aebc6 | ||
/* User with id == 0 is a fake user from git author */
|
eb35ccb059 | ||
/* User with id == 0 is a fake user from git author */
|
84299e59a5 | ||
/* User with id == 0 is a fake user from git author */
|
8cc267707f | ||
/* User with id == 0 is a fake user from git author */
|
4838bb74ef | ||
/* User with id == 0 is a fake user from git author */
|
023e1d8a0a | ||
/* User with id == 0 is a fake user from git author */
|
1e88508936 | ||
/* User with id == 0 is a fake user from git author */
|
bf3aa88ec1 | ||
/* User with id == 0 is a fake user from git author */
|
908303d235 | ||
/* User with id == 0 is a fake user from git author */
|
82a2c15364 | ||
/* User with id == 0 is a fake user from git author */
|
2ce107ed19 | ||
/* User with id == 0 is a fake user from git author */
|
1f05458724 | ||
/* User with id == 0 is a fake user from git author */
|
d85191b2d0 | ||
/* User with id == 0 is a fake user from git author */
|
11acb59e39 | ||
/* User with id == 0 is a fake user from git author */
|
3c12d055a2 | ||
/* User with id == 0 is a fake user from git author */
|
3e8cbd319e | ||
/* User with id == 0 is a fake user from git author */
|
721d26ca5e | ||
/* User with id == 0 is a fake user from git author */
|
2b4596b065 | ||
/* User with id == 0 is a fake user from git author */
|
0fb0270a53 | ||
/* User with id == 0 is a fake user from git author */
|
4147ea51d6 | ||
/* User with id == 0 is a fake user from git author */
|
a1b89271b7 | ||
/* User with id == 0 is a fake user from git author */
|
4c6cde5d59 | ||
/* User with id == 0 is a fake user from git author */
|
2f364e66a3 | ||
/* User with id == 0 is a fake user from git author */
|
600ac6ef1e | ||
/* User with id == 0 is a fake user from git author */
|
aa59e460c5 | ||
/* User with id == 0 is a fake user from git author */
|
4a0a74936b | ||
/* User with id == 0 is a fake user from git author */
|
d47a651fd4 | ||
/* User with id == 0 is a fake user from git author */
|
40157d7df2 | ||
/* User with id == 0 is a fake user from git author */
|
dabd772aec | ||
/* User with id == 0 is a fake user from git author */
|
92a8cb501d | ||
/* User with id == 0 is a fake user from git author */
|
e9944b6e0c | ||
/* User with id == 0 is a fake user from git author */
|
5762ec1cdf | ||
/* User with id == 0 is a fake user from git author */
|
5c9c870654 | ||
/* User with id == 0 is a fake user from git author */
|
6a873ea2c9 | ||
/* User with id == 0 is a fake user from git author */
|
ef441cca37 | ||
/* User with id == 0 is a fake user from git author */
|
03556b203c | ||
/* User with id == 0 is a fake user from git author */
|
2aab937785 | ||
/* User with id == 0 is a fake user from git author */
|
3e37580b98 | ||
/* User with id == 0 is a fake user from git author */
|
b8d5ddb47f | ||
/* User with id == 0 is a fake user from git author */
|
a0d9d31a21 | ||
/* User with id == 0 is a fake user from git author */
|
1774cfda3a | ||
/* User with id == 0 is a fake user from git author */
|
b325c152fd | ||
/* User with id == 0 is a fake user from git author */
|
696b5744b1 | ||
/* User with id == 0 is a fake user from git author */
|
7cca0d4d92 | ||
/* User with id == 0 is a fake user from git author */
|
391adbaf11 | ||
/* User with id == 0 is a fake user from git author */
|
69fb7a8c5c | ||
/* User with id == 0 is a fake user from git author */
|
d66bdb4cea | ||
/* User with id == 0 is a fake user from git author */
|
a578e3b244 | ||
/* User with id == 0 is a fake user from git author */
|
2e0356fe09 | ||
/* User with id == 0 is a fake user from git author */
|
342446fdce | ||
/* User with id == 0 is a fake user from git author */
|
15d8ee63ad | ||
/* User with id == 0 is a fake user from git author */
|
d73d9e4227 | ||
/* User with id == 0 is a fake user from git author */
|
3b987e2a6e | ||
/* User with id == 0 is a fake user from git author */
|
131e638f8b | ||
/* User with id == 0 is a fake user from git author */
|
659b0a19cb | ||
/* User with id == 0 is a fake user from git author */
|
c8523687fc | ||
/* User with id == 0 is a fake user from git author */
|
65a115ff6f | ||
/* User with id == 0 is a fake user from git author */
|
4fc794e834 | ||
/* User with id == 0 is a fake user from git author */
|
15f24be62d | ||
/* User with id == 0 is a fake user from git author */
|
5166bbe7cf | ||
/* User with id == 0 is a fake user from git author */
|
7ba366e151 | ||
/* User with id == 0 is a fake user from git author */
|
5b692812db | ||
/* User with id == 0 is a fake user from git author */
|
b1958e065a | ||
/* User with id == 0 is a fake user from git author */
|
6cc8cff669 | ||
/* User with id == 0 is a fake user from git author */
|
0e25b260de | ||
/* User with id == 0 is a fake user from git author */
|
7a3b57f135 | ||
/* User with id == 0 is a fake user from git author */
|
388b87377a | ||
/* User with id == 0 is a fake user from git author */
|
093eb009d0 | ||
/* User with id == 0 is a fake user from git author */
|
18e0b5d9d4 | ||
/* User with id == 0 is a fake user from git author */
|
1bdcf7597b | ||
/* User with id == 0 is a fake user from git author */
|
bfe282e141 | ||
/* User with id == 0 is a fake user from git author */
|
bdc450d1b3 | ||
/* User with id == 0 is a fake user from git author */
|
bb547bd4f7 | ||
/* User with id == 0 is a fake user from git author */
|
e34ad6cfb1 | ||
/* User with id == 0 is a fake user from git author */
|
df8ffa6024 | ||
/* User with id == 0 is a fake user from git author */
|
bf32afc1cd | ||
/* User with id == 0 is a fake user from git author */
|
3deb3d3106 | ||
/* User with id == 0 is a fake user from git author */
|
50019e94cd | ||
/* User with id == 0 is a fake user from git author */
|
3629380b37 | ||
/* User with id == 0 is a fake user from git author */
|
870b50066d | ||
/* User with id == 0 is a fake user from git author */
|
17e25f8f5d | ||
/* User with id == 0 is a fake user from git author */
|
033dd35cfc | ||
/* User with id == 0 is a fake user from git author */
|
e0b357be37 | ||
/* User with id == 0 is a fake user from git author */
|
0c52cb85af | ||
/* User with id == 0 is a fake user from git author */
|
7b3605a929 | ||
/* User with id == 0 is a fake user from git author */
|
fa52fe1027 | ||
/* User with id == 0 is a fake user from git author */
|
cdca176fa9 | ||
/* User with id == 0 is a fake user from git author */
|
a112a17f0d | ||
/* User with id == 0 is a fake user from git author */
|
3c1aba34e9 | ||
/* User with id == 0 is a fake user from git author */
|
29156b0dd0 | ||
/* User with id == 0 is a fake user from git author */
|
ae76c4626c | ||
/* User with id == 0 is a fake user from git author */
|
66bec91d83 | ||
/* User with id == 0 is a fake user from git author */
|
f8e1e7f062 | ||
/* User with id == 0 is a fake user from git author */
|
2c2b664d15 | ||
/* User with id == 0 is a fake user from git author */
|
3259618f1e | ||
/* User with id == 0 is a fake user from git author */
|
73d4d3daaf | ||
/* User with id == 0 is a fake user from git author */
|
8f8ddb9460 | ||
/* User with id == 0 is a fake user from git author */
|
a46afc5865 | ||
/* User with id == 0 is a fake user from git author */
|
32ae22cc92 | ||
/* User with id == 0 is a fake user from git author */
|
13b39d7b1b | ||
/* User with id == 0 is a fake user from git author */
|
10eefea106 | ||
/* User with id == 0 is a fake user from git author */
|
eb050b2c6c | ||
/* User with id == 0 is a fake user from git author */
|
3fbaa2f2a6 | ||
/* User with id == 0 is a fake user from git author */
|
ce958a5d74 | ||
/* User with id == 0 is a fake user from git author */
|
3c13880b49 | ||
/* User with id == 0 is a fake user from git author */
|
aa5d67daf4 | ||
/* User with id == 0 is a fake user from git author */
|
a64b43b1e9 | ||
/* User with id == 0 is a fake user from git author */
|
8b226414b5 | ||
/* User with id == 0 is a fake user from git author */
|
e2ceca2cd8 | ||
/* User with id == 0 is a fake user from git author */
|
f10ea286c0 | ||
/* User with id == 0 is a fake user from git author */
|
15edbd80d8 | ||
/* User with id == 0 is a fake user from git author */
|
22f85f03a4 | ||
/* User with id == 0 is a fake user from git author */
|
89e67d93e3 | ||
/* User with id == 0 is a fake user from git author */
|
e69cc7577f | ||
/* User with id == 0 is a fake user from git author */
|
016a45f648 | ||
/* User with id == 0 is a fake user from git author */
|
467c46a5c3 | ||
/* User with id == 0 is a fake user from git author */
|
ed5f8509cd | ||
/* User with id == 0 is a fake user from git author */
|
9052a06bd5 | ||
/* User with id == 0 is a fake user from git author */
|
8924a85c85 | ||
/* User with id == 0 is a fake user from git author */
|
93080593d1 | ||
/* User with id == 0 is a fake user from git author */
|
5a23263a92 | ||
/* User with id == 0 is a fake user from git author */
|
d220831b19 | ||
/* User with id == 0 is a fake user from git author */
|
787a410814 | ||
/* User with id == 0 is a fake user from git author */
|
ca72233581 | ||
/* User with id == 0 is a fake user from git author */
|
561be0b68e | ||
/* User with id == 0 is a fake user from git author */
|
6f6fc16383 | ||
/* User with id == 0 is a fake user from git author */
|
0e3b50de91 | ||
/* User with id == 0 is a fake user from git author */
|
1cb53c967e | ||
/* User with id == 0 is a fake user from git author */
|
d988636881 | ||
/* User with id == 0 is a fake user from git author */
|
278eeaefcf | ||
/* User with id == 0 is a fake user from git author */
|
7af3c774e4 | ||
/* User with id == 0 is a fake user from git author */
|
4d81b7168d | ||
/* User with id == 0 is a fake user from git author */
|
60f2a25103 | ||
/* User with id == 0 is a fake user from git author */
|
24fd8fea92 | ||
/* User with id == 0 is a fake user from git author */
|
7c5b93fa34 | ||
/* User with id == 0 is a fake user from git author */
|
30a1dc7ce5 | ||
/* User with id == 0 is a fake user from git author */
|
860d383da6 | ||
/* User with id == 0 is a fake user from git author */
|
f5957100ea | ||
/* User with id == 0 is a fake user from git author */
|
641ef996f9 | ||
/* User with id == 0 is a fake user from git author */
|
9545f7cf86 | ||
/* User with id == 0 is a fake user from git author */
|
784f42dd40 | ||
/* User with id == 0 is a fake user from git author */
|
a38ad468e3 | ||
/* User with id == 0 is a fake user from git author */
|
074ddf0c31 | ||
/* User with id == 0 is a fake user from git author */
|
665b119c61 | ||
/* User with id == 0 is a fake user from git author */
|
26b7770b61 | ||
/* User with id == 0 is a fake user from git author */
|
ab07905f68 | ||
/* User with id == 0 is a fake user from git author */
|
299bbe8c51 | ||
/* User with id == 0 is a fake user from git author */
|
22ce305df6 | ||
/* User with id == 0 is a fake user from git author */
|
c31fd0b671 | ||
/* User with id == 0 is a fake user from git author */
|
0c0c7a8a0e | ||
/* User with id == 0 is a fake user from git author */
|
eb890e4409 | ||
/* User with id == 0 is a fake user from git author */
|
dd753905c8 | ||
/* User with id == 0 is a fake user from git author */
|
22acd30baa | ||
/* User with id == 0 is a fake user from git author */
|
b58796277d | ||
/* User with id == 0 is a fake user from git author */
|
53125f9556 | ||
/* User with id == 0 is a fake user from git author */
|
51ea4859d8 | ||
/* User with id == 0 is a fake user from git author */
|
acfcd70fd7 | ||
/* User with id == 0 is a fake user from git author */
|
7331afaa8a | ||
/* User with id == 0 is a fake user from git author */
|
143cda31c1 | ||
/* User with id == 0 is a fake user from git author */
|
25abd43d79 | ||
/* User with id == 0 is a fake user from git author */
|
f32ab7e51b | ||
/* User with id == 0 is a fake user from git author */
|
f3e62b89ae | ||
/* User with id == 0 is a fake user from git author */
|
9d5af62781 | ||
/* User with id == 0 is a fake user from git author */
|
ce0d364102 | ||
/* User with id == 0 is a fake user from git author */
|
f2a67017c8 | ||
/* User with id == 0 is a fake user from git author */
|
5a1dba2a38 | ||
/* User with id == 0 is a fake user from git author */
|
0100406f3f | ||
/* User with id == 0 is a fake user from git author */
|
554455133d | ||
/* User with id == 0 is a fake user from git author */
|
0d5e74665b | ||
/* User with id == 0 is a fake user from git author */
|
83e5de35bb | ||
/* User with id == 0 is a fake user from git author */
|
f85f685cdf | ||
/* User with id == 0 is a fake user from git author */
|
76d4a4dbe1 | ||
/* User with id == 0 is a fake user from git author */
|
e2f3a662f3 | ||
/* User with id == 0 is a fake user from git author */
|
6974c13d16 | ||
/* User with id == 0 is a fake user from git author */
|
443ebf4fd1 | ||
/* User with id == 0 is a fake user from git author */
|
1b7c4543c8 | ||
/* User with id == 0 is a fake user from git author */
|
174320c264 | ||
/* User with id == 0 is a fake user from git author */
|
ff8b9667d9 | ||
/* User with id == 0 is a fake user from git author */
|
6a5b24e62c | ||
/* User with id == 0 is a fake user from git author */
|
c2e77c293d | ||
/* User with id == 0 is a fake user from git author */
|
aca56895ac | ||
/* User with id == 0 is a fake user from git author */
|
defcee30a4 | ||
/* User with id == 0 is a fake user from git author */
|
71f2c6fd54 | ||
/* User with id == 0 is a fake user from git author */
|
8d7745ac90 | ||
/* User with id == 0 is a fake user from git author */
|
9459bfa707 | ||
/* User with id == 0 is a fake user from git author */
|
12a482c098 | ||
/* User with id == 0 is a fake user from git author */
|
d738a5fc2c | ||
/* User with id == 0 is a fake user from git author */
|
f35984ba84 | ||
/* User with id == 0 is a fake user from git author */
|
dc84354861 | ||
/* User with id == 0 is a fake user from git author */
|
855dc37af1 | ||
/* User with id == 0 is a fake user from git author */
|
3eec5443ab | ||
/* User with id == 0 is a fake user from git author */
|
34b5db2822 | ||
/* User with id == 0 is a fake user from git author */
|
ec4928d67b | ||
/* User with id == 0 is a fake user from git author */
|
5f707743a4 | ||
/* User with id == 0 is a fake user from git author */
|
3db771e9d9 | ||
/* User with id == 0 is a fake user from git author */
|
cf870b5c9c | ||
/* User with id == 0 is a fake user from git author */
|
0aca9256c3 | ||
/* User with id == 0 is a fake user from git author */
|
59a8cb3708 | ||
/* User with id == 0 is a fake user from git author */
|
27eb6b19a6 | ||
/* User with id == 0 is a fake user from git author */
|
d2e3ed17e6 | ||
/* User with id == 0 is a fake user from git author */
|
ec5b42a3b2 | ||
/* User with id == 0 is a fake user from git author */
|
e37523f671 | ||
/* User with id == 0 is a fake user from git author */
|
19477b3c51 | ||
/* User with id == 0 is a fake user from git author */
|
1d4de6d8a7 | ||
/* User with id == 0 is a fake user from git author */
|
027e8a9191 | ||
/* User with id == 0 is a fake user from git author */
|
7ee84c97aa | ||
/* User with id == 0 is a fake user from git author */
|
83ad9c6bbf | ||
/* User with id == 0 is a fake user from git author */
|
abf5c28c43 | ||
/* User with id == 0 is a fake user from git author */
|
ca5d86f1c6 | ||
/* User with id == 0 is a fake user from git author */
|
4eb0f8b724 | ||
/* User with id == 0 is a fake user from git author */
|
557c18cb3f | ||
/* User with id == 0 is a fake user from git author */
|
138dc8f5ac | ||
/* User with id == 0 is a fake user from git author */
|
38b7b5d085 | ||
/* User with id == 0 is a fake user from git author */
|
e13d8589f6 | ||
/* User with id == 0 is a fake user from git author */
|
586c7aee43 | ||
/* User with id == 0 is a fake user from git author */
|
cd4e81a89a | ||
/* User with id == 0 is a fake user from git author */
|
998dee68b7 | ||
/* User with id == 0 is a fake user from git author */
|
f5cc30d65e | ||
/* User with id == 0 is a fake user from git author */
|
80c7b85ec2 | ||
/* User with id == 0 is a fake user from git author */
|
b5cf36be19 | ||
/* User with id == 0 is a fake user from git author */
|
2272742d8f | ||
/* User with id == 0 is a fake user from git author */
|
afe609c463 | ||
/* User with id == 0 is a fake user from git author */
|
b714f5579c | ||
/* User with id == 0 is a fake user from git author */
|
d7ed80d1b0 | ||
/* User with id == 0 is a fake user from git author */
|
fdd6cdc718 | ||
/* User with id == 0 is a fake user from git author */
|
c1d788a611 | ||
/* User with id == 0 is a fake user from git author */
|
e1519765ba | ||
/* User with id == 0 is a fake user from git author */
|
cd42f26bfd | ||
/* User with id == 0 is a fake user from git author */
|
8890462b1b | ||
/* User with id == 0 is a fake user from git author */
|
1cb7045ad8 | ||
/* User with id == 0 is a fake user from git author */
|
8bfa731e4a | ||
/* User with id == 0 is a fake user from git author */
|
cb73c93360 | ||
/* User with id == 0 is a fake user from git author */
|
bc20d259f5 | ||
/* User with id == 0 is a fake user from git author */
|
4c4ca8645e | ||
/* User with id == 0 is a fake user from git author */
|
62e33805f0 | ||
/* User with id == 0 is a fake user from git author */
|
8b6ea4118f | ||
/* User with id == 0 is a fake user from git author */
|
939d1cc007 | ||
/* User with id == 0 is a fake user from git author */
|
72f23aa514 | ||
/* User with id == 0 is a fake user from git author */
|
8fc49ae8d9 | ||
/* User with id == 0 is a fake user from git author */
|
6bb20fe2e2 | ||
/* User with id == 0 is a fake user from git author */
|
c7d6ecd0c5 | ||
/* User with id == 0 is a fake user from git author */
|
75fa0f9e45 | ||
/* User with id == 0 is a fake user from git author */
|
989273ee18 | ||
/* User with id == 0 is a fake user from git author */
|
a721d4465a | ||
/* User with id == 0 is a fake user from git author */
|
fe956958d2 | ||
/* User with id == 0 is a fake user from git author */
|
0fbd22b7b1 | ||
/* User with id == 0 is a fake user from git author */
|
3bfc5f8355 | ||
/* User with id == 0 is a fake user from git author */
|
4543f13d9f | ||
/* User with id == 0 is a fake user from git author */
|
f24913673b | ||
/* User with id == 0 is a fake user from git author */
|
90bfd26996 | ||
/* User with id == 0 is a fake user from git author */
|
933bed0404 | ||
/* User with id == 0 is a fake user from git author */
|
e4b9bfffee | ||
/* User with id == 0 is a fake user from git author */
|
8bf6f3447f | ||
/* User with id == 0 is a fake user from git author */
|
d04d601a7c | ||
/* User with id == 0 is a fake user from git author */
|
96c89eb68c | ||
/* User with id == 0 is a fake user from git author */
|
66660bfb3c | ||
/* User with id == 0 is a fake user from git author */
|
0b9828c06a | ||
/* User with id == 0 is a fake user from git author */
|
6d623437ff | ||
/* User with id == 0 is a fake user from git author */
|
4273cea392 | ||
/* User with id == 0 is a fake user from git author */
|
3c60af8369 | ||
/* User with id == 0 is a fake user from git author */
|
49dfa7570d | ||
/* User with id == 0 is a fake user from git author */
|
2c713b6ccb | ||
/* User with id == 0 is a fake user from git author */
|
11f79dec3a | ||
/* User with id == 0 is a fake user from git author */
|
fee4f8aee1 | ||
/* User with id == 0 is a fake user from git author */
|
97b1280b15 | ||
/* User with id == 0 is a fake user from git author */
|
c0cc5540b5 | ||
/* User with id == 0 is a fake user from git author */
|
b8ae34461b | ||
/* User with id == 0 is a fake user from git author */
|
e075c1c67c | ||
/* User with id == 0 is a fake user from git author */
|
6e9dffc1f4 | ||
/* User with id == 0 is a fake user from git author */
|
92d2763d40 | ||
/* User with id == 0 is a fake user from git author */
|
091f19d93a | ||
/* User with id == 0 is a fake user from git author */
|
c860938de3 | ||
/* User with id == 0 is a fake user from git author */
|
f8a8c6ce28 | ||
/* User with id == 0 is a fake user from git author */
|
e5ae0cf091 | ||
/* User with id == 0 is a fake user from git author */
|
1f10da8473 | ||
/* User with id == 0 is a fake user from git author */
|
4afd99fce1 | ||
/* User with id == 0 is a fake user from git author */
|
286259df9d | ||
/* User with id == 0 is a fake user from git author */
|
c617e6ea8a | ||
/* User with id == 0 is a fake user from git author */
|
290b72d362 | ||
/* User with id == 0 is a fake user from git author */
|
ed0ab398db | ||
/* User with id == 0 is a fake user from git author */
|
cf415becc0 | ||
/* User with id == 0 is a fake user from git author */
|
6c4c4a86e1 | ||
/* User with id == 0 is a fake user from git author */
|
a8e6127a0f | ||
/* User with id == 0 is a fake user from git author */
|
71cefa21c4 | ||
/* User with id == 0 is a fake user from git author */
|
6e6c59b0cc | ||
/* User with id == 0 is a fake user from git author */
|
a542e66922 | ||
/* User with id == 0 is a fake user from git author */
|
a12c86d471 | ||
/* User with id == 0 is a fake user from git author */
|
2071e21542 | ||
/* User with id == 0 is a fake user from git author */
|
4485241a49 | ||
/* User with id == 0 is a fake user from git author */
|
c613f0df8a | ||
/* User with id == 0 is a fake user from git author */
|
a407d97d70 | ||
/* User with id == 0 is a fake user from git author */
|
2c553a20e0 | ||
/* User with id == 0 is a fake user from git author */
|
9ca7dd3a90 | ||
/* User with id == 0 is a fake user from git author */
|
3cbcc8df6c | ||
/* User with id == 0 is a fake user from git author */
|
59fc4ff1e1 | ||
/* User with id == 0 is a fake user from git author */
|
388e62b7c3 | ||
/* User with id == 0 is a fake user from git author */
|
5e39246c60 | ||
/* User with id == 0 is a fake user from git author */
|
f3b886c8c2 | ||
/* User with id == 0 is a fake user from git author */
|
f58ad91530 | ||
/* User with id == 0 is a fake user from git author */
|
16e11d9cb7 | ||
/* User with id == 0 is a fake user from git author */
|
04e2329262 | ||
/* User with id == 0 is a fake user from git author */
|
6238184f8d | ||
/* User with id == 0 is a fake user from git author */
|
b893f0884e | ||
/* User with id == 0 is a fake user from git author */
|
936581e12d | ||
/* User with id == 0 is a fake user from git author */
|
d812f6c40e | ||
/* User with id == 0 is a fake user from git author */
|
a821ee6cc5 | ||
/* User with id == 0 is a fake user from git author */
|
500c806dbd | ||
/* User with id == 0 is a fake user from git author */
|
0ca2981290 | ||
/* User with id == 0 is a fake user from git author */
|
fb77b5ef89 | ||
/* User with id == 0 is a fake user from git author */
|
c676b9d4f2 | ||
/* User with id == 0 is a fake user from git author */
|
4ca3c9a955 | ||
/* User with id == 0 is a fake user from git author */
|
b213c85b78 | ||
/* User with id == 0 is a fake user from git author */
|
c5a1b1ae94 | ||
/* User with id == 0 is a fake user from git author */
|
8059bfd3a0 | ||
/* User with id == 0 is a fake user from git author */
|
c87ecc13cd | ||
/* User with id == 0 is a fake user from git author */
|
a16a71084b | ||
/* User with id == 0 is a fake user from git author */
|
0bf7d2c290 | ||
/* User with id == 0 is a fake user from git author */
|
63edcfd88e | ||
/* User with id == 0 is a fake user from git author */
|
7b9ce2c1fb | ||
/* User with id == 0 is a fake user from git author */
|
1876bdc2ce | ||
/* User with id == 0 is a fake user from git author */
|
82761030c8 | ||
/* User with id == 0 is a fake user from git author */
|
86e1668591 | ||
/* User with id == 0 is a fake user from git author */
|
f05b82847e | ||
/* User with id == 0 is a fake user from git author */
|
ca20ff4850 | ||
/* User with id == 0 is a fake user from git author */
|
602f35faba | ||
/* User with id == 0 is a fake user from git author */
|
1ae5806738 | ||
/* User with id == 0 is a fake user from git author */
|
ea970195fb | ||
/* User with id == 0 is a fake user from git author */
|
2513842f7f | ||
/* User with id == 0 is a fake user from git author */
|
8a770d21ab | ||
/* User with id == 0 is a fake user from git author */
|
74dbcd6482 | ||
/* User with id == 0 is a fake user from git author */
|
3a41be365a | ||
/* User with id == 0 is a fake user from git author */
|
968063376b | ||
/* User with id == 0 is a fake user from git author */
|
562381e4c2 | ||
/* User with id == 0 is a fake user from git author */
|
4c40e76abd | ||
/* User with id == 0 is a fake user from git author */
|
0c07b0e497 | ||
/* User with id == 0 is a fake user from git author */
|
5ced8624e6 | ||
/* User with id == 0 is a fake user from git author */
|
a9fbdef1d7 | ||
/* User with id == 0 is a fake user from git author */
|
e54bc15c4a | ||
/* User with id == 0 is a fake user from git author */
|
b2956aad58 | ||
/* User with id == 0 is a fake user from git author */
|
707711607d | ||
/* User with id == 0 is a fake user from git author */
|
d4c5014bd8 | ||
/* User with id == 0 is a fake user from git author */
|
5440691151 | ||
/* User with id == 0 is a fake user from git author */
|
bf89d8c83e | ||
/* User with id == 0 is a fake user from git author */
|
004c9a9135 | ||
/* User with id == 0 is a fake user from git author */
|
b994f15dbb | ||
/* User with id == 0 is a fake user from git author */
|
3537c0a37d | ||
/* User with id == 0 is a fake user from git author */
|
9c39536b4f | ||
/* User with id == 0 is a fake user from git author */
|
39996ce5fa | ||
/* User with id == 0 is a fake user from git author */
|
b7ebc664cc | ||
/* User with id == 0 is a fake user from git author */
|
e57424e4e8 | ||
/* User with id == 0 is a fake user from git author */
|
f5f73b0344 | ||
/* User with id == 0 is a fake user from git author */
|
642385f95f | ||
/* User with id == 0 is a fake user from git author */
|
f050af4718 | ||
/* User with id == 0 is a fake user from git author */
|
2e5c90155f | ||
/* User with id == 0 is a fake user from git author */
|
1bb328a4bb | ||
/* User with id == 0 is a fake user from git author */
|
154890d939 | ||
/* User with id == 0 is a fake user from git author */
|
28b6010c51 | ||
/* User with id == 0 is a fake user from git author */
|
68c00e0569 | ||
/* User with id == 0 is a fake user from git author */
|
ba43de8a27 | ||
/* User with id == 0 is a fake user from git author */
|
049521c7c7 | ||
/* User with id == 0 is a fake user from git author */
|
8477d1c3b9 | ||
/* User with id == 0 is a fake user from git author */
|
de92c3295b | ||
/* User with id == 0 is a fake user from git author */
|
8533bb0508 | ||
/* User with id == 0 is a fake user from git author */
|
bf1d0f2222 | ||
/* User with id == 0 is a fake user from git author */
|
41e78aabc1 | ||
/* User with id == 0 is a fake user from git author */
|
b460e66975 | ||
/* User with id == 0 is a fake user from git author */
|
cc25902d85 | ||
/* User with id == 0 is a fake user from git author */
|
c6c879dc45 | ||
/* User with id == 0 is a fake user from git author */
|
108a86df10 | ||
/* User with id == 0 is a fake user from git author */
|
59a9e5fd9c | ||
/* User with id == 0 is a fake user from git author */
|
4cfe8e9d0e | ||
/* User with id == 0 is a fake user from git author */
|
9f792d27c1 | ||
/* User with id == 0 is a fake user from git author */
|
eb09153a87 | ||
/* User with id == 0 is a fake user from git author */
|
c98d863715 | ||
/* User with id == 0 is a fake user from git author */
|
103ea42de7 | ||
/* User with id == 0 is a fake user from git author */
|
7dff03d2bc | ||
/* User with id == 0 is a fake user from git author */
|
37628f49a4 | ||
/* User with id == 0 is a fake user from git author */
|
c9ae7e236f | ||
/* User with id == 0 is a fake user from git author */
|
3e11a125df | ||
/* User with id == 0 is a fake user from git author */
|
7848f3c8bb | ||
/* User with id == 0 is a fake user from git author */
|
dfaf5a587f | ||
/* User with id == 0 is a fake user from git author */
|
d1fa601bb5 | ||
/* User with id == 0 is a fake user from git author */
|
37df093b7a | ||
/* User with id == 0 is a fake user from git author */
|
6a3b673a19 | ||
/* User with id == 0 is a fake user from git author */
|
6aa460f380 | ||
/* User with id == 0 is a fake user from git author */
|
fd611217e3 | ||
/* User with id == 0 is a fake user from git author */
|
3392905ff0 | ||
/* User with id == 0 is a fake user from git author */
|
6a0fa2fa3b | ||
/* User with id == 0 is a fake user from git author */
|
ffbc7b1777 | ||
/* User with id == 0 is a fake user from git author */
|
c9b5fc5cb6 | ||
/* User with id == 0 is a fake user from git author */
|
d42932deb4 | ||
/* User with id == 0 is a fake user from git author */
|
ab68f32074 | ||
/* User with id == 0 is a fake user from git author */
|
7134f0eb67 | ||
/* User with id == 0 is a fake user from git author */
|
2c02d1a70a | ||
/* User with id == 0 is a fake user from git author */
|
08f059d553 | ||
/* User with id == 0 is a fake user from git author */
|
50ec9d656c | ||
/* User with id == 0 is a fake user from git author */
|
f52ff234d7 | ||
/* User with id == 0 is a fake user from git author */
|
832cd98558 | ||
/* User with id == 0 is a fake user from git author */
|
af3cf17663 | ||
/* User with id == 0 is a fake user from git author */
|
660a66c58b | ||
/* User with id == 0 is a fake user from git author */
|
7f32a3298a | ||
/* User with id == 0 is a fake user from git author */
|
5d24118766 | ||
/* User with id == 0 is a fake user from git author */
|
a2e2f8ce7b | ||
/* User with id == 0 is a fake user from git author */
|
50d2fac736 | ||
/* User with id == 0 is a fake user from git author */
|
fa658801cf | ||
/* User with id == 0 is a fake user from git author */
|
6142ecd2e9 | ||
/* User with id == 0 is a fake user from git author */
|
94edff9996 | ||
/* User with id == 0 is a fake user from git author */
|
febe6aafd0 |
1774
ZCppMain/ZCProcess.H
Normal file
1774
ZCppMain/ZCProcess.H
Normal file
File diff suppressed because it is too large
Load Diff
4695
ZCppMain/ZCProcess_Linux.H
Normal file
4695
ZCppMain/ZCProcess_Linux.H
Normal file
File diff suppressed because it is too large
Load Diff
3160
ZCppMain/ZCProcess_Win.H
Normal file
3160
ZCppMain/ZCProcess_Win.H
Normal file
File diff suppressed because it is too large
Load Diff
@ -348,7 +348,7 @@ namespace ZNsMain
|
||||
typename TEnvVar , //= ZNsMain::ZNsCGI::ZNsBase::ZtCEnvVar<TStringData>,
|
||||
typename TEnvVarSet //= NsCPP::ZtCObjAVL<TEnvVar>
|
||||
>
|
||||
class ZtCTypeEnvVarSet /*############################################################*/
|
||||
class ZtCTypeEnvVarSet ##############################################################*/
|
||||
|
||||
}/*
|
||||
namespace NsType*/
|
||||
|
@ -1040,7 +1040,7 @@ namespace ZNsMain
|
||||
int AI_Offset= 0 ,
|
||||
const char* APC_Padd = ""
|
||||
)
|
||||
/*################################################################*/
|
||||
##################################################################*/
|
||||
|
||||
|
||||
template<typename TString> void ZftGetBinHexFormat /*#############*/
|
||||
@ -1258,7 +1258,7 @@ namespace ZNsMain
|
||||
int AI_Offset=0 ,
|
||||
const char* APC_Padd =""
|
||||
)
|
||||
/*################################################################*/
|
||||
##################################################################*/
|
||||
|
||||
|
||||
template<typename TString> void ZftGetBinHexFormatEx( /*##########*/
|
||||
|
8646
ZCppMain/ZMainHead.H
8646
ZCppMain/ZMainHead.H
File diff suppressed because it is too large
Load Diff
@ -4,6 +4,16 @@
|
||||
#define __ZCPPMAIIN__MAINHEAD_EX_H__
|
||||
|
||||
|
||||
#ifndef _NO_USE_REEDDIR_R_
|
||||
|
||||
/* readdir_r() 함수가 실은 thread-safe 하지 않다고
|
||||
해서 폐기되었다. -- 2025-09-07 14:55
|
||||
*/
|
||||
#define _NO_USE_REEDDIR_R_
|
||||
|
||||
#endif // !_NO_USE_REEDDIR_R_
|
||||
|
||||
|
||||
#include<ctime>
|
||||
#include<fstream>
|
||||
#include<cstdio>
|
||||
@ -226,7 +236,7 @@ namespace ZNsMain
|
||||
|
||||
return ::_putenv_s(APC_EnvName, APC_Value)==0;
|
||||
|
||||
#else //__VISUAL_CPP_VER__<200500
|
||||
#else //__VISUAL_CPP_VER__<=200500
|
||||
|
||||
std::string VO_CStringEnv;
|
||||
|
||||
@ -252,7 +262,7 @@ namespace ZNsMain
|
||||
|
||||
DWORD VDW_WrittenSize= 0 ;
|
||||
|
||||
const bool CB_IsOK = //////////////////////////////////////////
|
||||
const bool CB_IsOK = ////////////////////////////////////////
|
||||
(
|
||||
::WriteFile
|
||||
(
|
||||
@ -299,7 +309,7 @@ namespace ZNsMain
|
||||
template<typename TString> long ZfReadStdIn(
|
||||
TString& ARR_CStringRead, LPOVERLAPPED AP_Overlapped=NULL)
|
||||
{
|
||||
const int CI_StdBuffSize=512;
|
||||
ZTycInt CI_StdBuffSize = 512 ;
|
||||
|
||||
if(ARR_CStringRead.size()<1)
|
||||
ARR_CStringRead.resize(CI_StdBuffSize, ' ');
|
||||
@ -444,7 +454,7 @@ namespace ZNsMain
|
||||
|
||||
template<typename TString> ssize_t ZfReadStdIn(TString& ARR_CStringRead)
|
||||
{
|
||||
const int CI_StdBuffSize=512;
|
||||
ZTycInt CI_StdBuffSize=512;
|
||||
|
||||
if(ARR_CStringRead.size()<1)
|
||||
ARR_CStringRead.resize(CI_StdBuffSize,' ');
|
||||
@ -1075,8 +1085,8 @@ namespace ZNsMain
|
||||
|
||||
if(mo_TimeObj.tm_yday<=mo_TimeObj.tm_wday) return 1;
|
||||
|
||||
const int CI_DayCntOfWeek=7;
|
||||
const int CI_DayCntAdded =2;
|
||||
ZTycInt CI_DayCntOfWeek= 7;
|
||||
ZTycInt CI_DayCntAdded = 2;
|
||||
|
||||
return (mo_TimeObj.tm_yday - mo_TimeObj.tm_wday-1)/CI_DayCntOfWeek + CI_DayCntAdded ;
|
||||
}/*
|
||||
@ -1147,7 +1157,7 @@ namespace ZNsMain
|
||||
{
|
||||
time_t VI_TimeSec=ZNsMain::ZCTime::MakeTimeInt(AI_Year, AI_Month, AI_Day, AI_Hour, AI_Min, AI_Sec);
|
||||
|
||||
if(VI_TimeSec<1) return false; *this+=VI_TimeSec; return true ;
|
||||
if(VI_TimeSec<1){return false;} *this+=VI_TimeSec; return true ;
|
||||
}/*
|
||||
bool GetDiffSec(time_t& ARRI_TimeGap, int AI_Year,int AI_Month,int AI_Day,int AI_Hour,int AI_Min,int AI_Sec)*/
|
||||
|
||||
@ -1248,7 +1258,7 @@ namespace ZNsMain
|
||||
if(SetTimeObj(VL_Time, RR(VO_StTime), AB_IsLoaclTime)==false) return 0;
|
||||
|
||||
|
||||
const int CI_TimeBuffSize=30; static char VCA_TimeBuff[CI_TimeBuffSize];
|
||||
ZTycInt CI_TimeBuffSize=30; static char VCA_TimeBuff[CI_TimeBuffSize];
|
||||
|
||||
(void)sprintf ////////////////////////////////////////////////////////
|
||||
(
|
||||
@ -1378,15 +1388,15 @@ namespace ZNsMain
|
||||
static string& GetUniqueID(string& ARR_CString)
|
||||
{
|
||||
const int CI_BuffSize=100 ;
|
||||
static int SI_Count =0 ;
|
||||
static long SI_Count =0 ;
|
||||
const char* CPC_Gap ="_" ;
|
||||
char VCA_Buff[CI_BuffSize] ;
|
||||
|
||||
::sprintf( VCA_Buff,
|
||||
"%d%s%d%s%d" ,
|
||||
"%ld%s%ld%s%ld" ,
|
||||
(long)GetNowSec(), // (long) 가 없으면 메모리 오류가 난다.
|
||||
CPC_Gap , GetTickCount() ,
|
||||
CPC_Gap , (++SI_Count)+ ::GetCurrentProcessId()
|
||||
CPC_Gap , (long)GetTickCount() ,
|
||||
CPC_Gap , (++SI_Count)+long(::GetCurrentProcessId())
|
||||
/*////*/ );
|
||||
|
||||
return ARR_CString = VCA_Buff ;
|
||||
@ -1713,7 +1723,10 @@ namespace ZNsMain
|
||||
|
||||
ZCStdTime(const ZCStdTime& rhs)
|
||||
{
|
||||
if(this==&rhs) return;
|
||||
if(this==&rhs)
|
||||
{
|
||||
mb_IsLocal = true; return;
|
||||
}
|
||||
|
||||
mb_IsLocal =rhs.mb_IsLocal ;
|
||||
mo_FILETIME =rhs.mo_FILETIME ;
|
||||
@ -2284,8 +2297,8 @@ namespace ZNsMain
|
||||
|
||||
if(mo_TimeObj.tm_yday<=mo_TimeObj.tm_wday) return 1;
|
||||
|
||||
const int CI_DayCntOfWeek=7;
|
||||
const int CI_DayCntAdded =2;
|
||||
ZTycInt CI_DayCntOfWeek=7;
|
||||
ZTycInt CI_DayCntAdded =2;
|
||||
|
||||
return (mo_TimeObj.tm_yday - mo_TimeObj.tm_wday-1)/CI_DayCntOfWeek + CI_DayCntAdded ;
|
||||
}/*
|
||||
@ -3974,8 +3987,8 @@ namespace ZNsMain
|
||||
|
||||
if(VI_Index<0) return ARR_CStringExt;
|
||||
|
||||
return ARR_CStringExt(
|
||||
APC_FileName+VI_Index+1, AI_Length-(VI_Index+1));
|
||||
return ARR_CStringExt
|
||||
( APC_FileName+VI_Index+1, AI_Length-(VI_Index+1) );
|
||||
}/*
|
||||
template<typename TString, typename TTypChar> ///////////////
|
||||
static TString& GetExtName
|
||||
@ -3987,19 +4000,23 @@ namespace ZNsMain
|
||||
///////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
template<typename TString, typename TTypChar> static bool SetExtName(
|
||||
template<typename TString, typename TTypChar> static bool SetExtName
|
||||
(
|
||||
const TTypChar* APC_FileName, ZTypLength AI_FileLen ,
|
||||
const TTypChar* APC_FileExt , ZTypLength AI_ExtLength,
|
||||
TString& ARR_CStringFileNew
|
||||
/*#########*/ ) /*#################################################*/
|
||||
)
|
||||
/*################################################################*/
|
||||
{
|
||||
// APC_FileName 의 확장자를 APC_FileExt 으로 바꾼
|
||||
// 새로운 파일명을 ARR_CStringFileNew 에 전달한다.
|
||||
|
||||
ZTypLength VL_ExtPos=ZCMainChars::FindPosFromEnd(
|
||||
APC_FileName, ".",
|
||||
ZTypLength VL_ExtPos=ZCMainChars::FindPosFromEnd
|
||||
(
|
||||
APC_FileName, TTypChar(".") ,
|
||||
AI_FileLen , (ZTypLength)1
|
||||
/*/////////*/ ); ////////////////////////////////
|
||||
);
|
||||
/**********************************************/
|
||||
|
||||
if(VL_ExtPos<0 || VL_ExtPos==AI_FileLen-1)
|
||||
{
|
||||
@ -4015,33 +4032,53 @@ namespace ZNsMain
|
||||
else if(VL_ExtPos==0)*/
|
||||
|
||||
ARR_CStringFileNew.append(APC_FileName , VL_ExtPos );
|
||||
ARR_CStringFileNew+=".";
|
||||
ARR_CStringFileNew.append(TTypChar('.') );
|
||||
ARR_CStringFileNew.append(APC_FileExt , AI_ExtLength );
|
||||
|
||||
return true;
|
||||
}/*
|
||||
template<typename TString, typename TTypChar> static bool SetExtName(
|
||||
template<typename TString, typename TTypChar> static bool SetExtName
|
||||
(
|
||||
const TTypChar* APC_FileName, ZTypLength AI_FileLen ,
|
||||
const TTypChar* APC_FileExt , ZTypLength AI_ExtLength,
|
||||
TString& ARR_CStringFileNew
|
||||
############# ) ###################################################*/
|
||||
)
|
||||
##################################################################*/
|
||||
|
||||
|
||||
template<typename TString> static bool SetExtName(
|
||||
const TString& AR_CStringFileNow, const TString& AR_CStringNewExt, TString& ARR_CStringFileNew)
|
||||
{
|
||||
return SetExtName( /////////////////////////////
|
||||
AR_CStringFileNow.c_str(),
|
||||
return SetExtName /**************/
|
||||
(
|
||||
AR_CStringFileNow.data() ,
|
||||
AR_CStringFileNow.size() ,
|
||||
AR_CStringNewExt.c_str() ,
|
||||
AR_CStringNewExt .data() ,
|
||||
AR_CStringNewExt .size() ,
|
||||
RR(ARR_CStringFileNew)
|
||||
/*//////////*/ ); //////////////////////////////
|
||||
);
|
||||
/********************************/
|
||||
}/*
|
||||
template<typename TString> static bool SetExtName(
|
||||
const TString& AR_CStringFileNow, const TString& AR_CStringNewExt, TString& ARR_CStringFileNew) */
|
||||
|
||||
|
||||
template<typename TString, typename TCharView> static bool SetExtName
|
||||
(
|
||||
const TCharView& AR_FileName, const TCharView& AR_FileExt, TString& ARR_CStringFileNew
|
||||
)
|
||||
/*#################################################################*/
|
||||
{
|
||||
return SetExtName /***************************/
|
||||
(
|
||||
AR_FileName.data(), AR_FileName.size(),
|
||||
AR_FileExt .data(), AR_FileExt .size()
|
||||
);
|
||||
/*********************************************/
|
||||
}
|
||||
/*#################################################################*/
|
||||
|
||||
|
||||
template<typename TString, typename TTypChar> static bool SetFileName
|
||||
(
|
||||
const TTypChar* APC_FileNow, ZTypLength AI_FileNowLen,
|
||||
@ -4053,10 +4090,11 @@ namespace ZNsMain
|
||||
/* 파일 APC_FileNow 의 확장자를 뺀 부분을 APC_FileNew 으로 바꾼,
|
||||
새로운 파일명을 ARR_CStringFileNew 에 전달한다. */
|
||||
|
||||
ZTypLength VL_ExtPos=ZCMainChars::FindPos( /////////
|
||||
APC_FileNow , ".",
|
||||
AI_FileNowLen, 1
|
||||
/*/////////*/ ); //////////////////////////////////
|
||||
ZTypLength VL_ExtPos=ZCMainChars::FindPos
|
||||
(
|
||||
APC_FileNow , ".", AI_FileNowLen, 1
|
||||
);
|
||||
/***************************************/
|
||||
|
||||
if(VL_ExtPos<0)
|
||||
{ ARR_CStringFileNew.append(APC_FileNew, AI_FileNewLen); return false; }
|
||||
@ -4065,7 +4103,7 @@ namespace ZNsMain
|
||||
/*else if(VL_ExtPos==0)*/
|
||||
|
||||
ARR_CStringFileNew.append(APC_FileNew, AI_FileNewLen);
|
||||
ARR_CStringFileNew+=".";
|
||||
ARR_CStringFileNew.append('.');
|
||||
|
||||
if(VL_ExtPos<AI_FileNowLen-1)
|
||||
{
|
||||
@ -4074,9 +4112,7 @@ namespace ZNsMain
|
||||
APC_FileNow+VL_ExtPos+1, AI_FileNowLen-VL_ExtPos-1
|
||||
);
|
||||
}
|
||||
/////////////////////////////
|
||||
|
||||
return true;
|
||||
return true; /**************/
|
||||
}/*
|
||||
template<typename TString, typename TTypChar> static bool SetFileName
|
||||
(
|
||||
@ -4090,13 +4126,13 @@ namespace ZNsMain
|
||||
template<typename TString> static bool SetFileName(
|
||||
const TString& AR_CStringFileNow, const TString& AR_CStringNewExt, TString& ARR_CStringFileNew)
|
||||
{
|
||||
return SetFileName( ///////////////////////////
|
||||
AR_CStringFileNow.data(),
|
||||
AR_CStringFileNow.size(),
|
||||
AR_CStringNewExt .data(),
|
||||
AR_CStringNewExt .size(),
|
||||
return SetFileName /**************************************/
|
||||
(
|
||||
AR_CStringFileNow.data(), AR_CStringFileNow.size(),
|
||||
AR_CStringNewExt .data(), AR_CStringNewExt .size(),
|
||||
RR(ARR_CStringFileNew)
|
||||
/*//////////*/ ); /////////////////////////////
|
||||
);
|
||||
/*********************************************************/
|
||||
}/*
|
||||
template<typename TString> static bool SetFileName(
|
||||
const TString& AR_CStringFileNow, const TString& AR_CStringNewExt, TString& ARR_CStringFileNew) */
|
||||
@ -4131,8 +4167,7 @@ namespace ZNsMain
|
||||
|
||||
return APC_PathName+VL_FindPos+1;
|
||||
}/*
|
||||
template<typename TTypChar>
|
||||
static const TTypChar* GetFileNameInPath ///////////////////////
|
||||
template<typename TTypChar> static const TTypChar* GetFileNameInPath
|
||||
(
|
||||
const TTypChar* APC_PathName,
|
||||
ZTypLength AI_Length ,
|
||||
@ -4166,7 +4201,7 @@ namespace ZNsMain
|
||||
static TString& GetFileNameInPath(const TChars& AR_PathName, TString& ARR_FileNameCStr) */
|
||||
|
||||
|
||||
static bool RmAnyDir /*###############################################################*/
|
||||
static bool RmAnyDir ///////////////////////////////////////////////////////////////////
|
||||
( ZTypCPCh AP_DirName, void (*APF_ExceptHandle)
|
||||
(
|
||||
ZTypCPCh AP_FileName, ZCFileData& AR_CFileData, ZTypCPCCh AP_Message
|
||||
@ -4233,7 +4268,7 @@ namespace ZNsMain
|
||||
|
||||
VB_RemoveFail=false;
|
||||
}
|
||||
while(VB_IsSearched = ::FindNextFileA(VH_File, &VO_CFileData));
|
||||
while((VB_IsSearched = ::FindNextFileA(VH_File, &VO_CFileData))==TRUE);
|
||||
|
||||
::FindClose(VH_File);
|
||||
|
||||
@ -4254,7 +4289,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
else*/
|
||||
|
||||
#elif defined(_REENTRANT) // && !defined(_WIN)
|
||||
#elif defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_) // && !defined(_WIN)
|
||||
|
||||
ZCFileData VO_CFileData;
|
||||
dirent VO_DirEnt ;
|
||||
@ -4374,7 +4409,7 @@ namespace ZNsMain
|
||||
::rmdir(AP_DirName); return true ;
|
||||
|
||||
//#elif defined(_REENTRANT) // && !defined(_WIN)
|
||||
#else // !defined(_WIN) && !defined(_REENTRANT)
|
||||
#else // !defined(_WIN) && !defined(_REENTRANT) || defined(_NO_USE_REEDDIR_R_)
|
||||
|
||||
ZCFileData VO_CFileData;
|
||||
dirent* VP_DirEnt ;
|
||||
@ -4453,7 +4488,7 @@ namespace ZNsMain
|
||||
|
||||
#endif //!defined(_WIN) && !defined(_REENTRANT)
|
||||
}/*
|
||||
static bool RmAnyDir ################################################################@#
|
||||
static bool RmAnyDir //////////////////////////////////////////////////////////////////
|
||||
(
|
||||
ZTypCPCh AP_DirName ,
|
||||
void (*APF_ExceptHandle)
|
||||
@ -4612,7 +4647,7 @@ namespace ZNsMain
|
||||
#else //!defined(_WIN)
|
||||
|
||||
ZCFileData VO_CFileData;
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
dirent VO_DirEnt;
|
||||
#endif
|
||||
dirent* VP_DirEnt;
|
||||
@ -4622,7 +4657,7 @@ namespace ZNsMain
|
||||
if(VH_File==NULL)
|
||||
return ZNsMain::ZNsEnum::ZERun_OK;
|
||||
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt = ::readdir(VH_File))!=0)
|
||||
@ -4696,7 +4731,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
else // !VO_CFileData.IsDir()*/
|
||||
}/*
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt = ::readdir(VH_File))!=0)
|
||||
@ -4831,7 +4866,7 @@ namespace ZNsMain
|
||||
#else //!defined(_WIN)
|
||||
|
||||
ZCFileData VO_CFileData;
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
dirent VO_DirEnt;
|
||||
#endif
|
||||
dirent* VP_DirEnt;
|
||||
@ -4841,7 +4876,7 @@ namespace ZNsMain
|
||||
if(VH_File==NULL)
|
||||
return ZNsMain::ZNsEnum::ZERun_OK;
|
||||
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt = ::readdir(VH_File))!=0)
|
||||
@ -4903,7 +4938,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
else*/
|
||||
}/*
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt = ::readdir(VH_File))!=0)
|
||||
@ -5013,7 +5048,7 @@ namespace ZNsMain
|
||||
#else //!defined(_WIN)
|
||||
|
||||
ZCFileData VO_CFileData;
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
dirent VO_DirEnt ;
|
||||
#endif
|
||||
dirent* VP_DirEnt;
|
||||
@ -5022,7 +5057,7 @@ namespace ZNsMain
|
||||
|
||||
if(VH_File==NULL) return ZERun_OK;
|
||||
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt= ::readdir(VH_File))!=0)
|
||||
@ -5080,7 +5115,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
else*/
|
||||
}/*
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt= ::readdir(VH_File))!=0)
|
||||
@ -5170,7 +5205,7 @@ namespace ZNsMain
|
||||
#else // !defined(_WIN)
|
||||
|
||||
ZCFileData VO_CFileData;
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
dirent VO_DirEnt;
|
||||
#endif
|
||||
dirent* VP_DirEnt;
|
||||
@ -5180,7 +5215,7 @@ namespace ZNsMain
|
||||
if(VH_File==NULL)
|
||||
return ZNsMain::ZNsEnum::ZERun_OK;
|
||||
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt= ::readdir(VH_File))!=0)
|
||||
@ -5234,7 +5269,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
else*/
|
||||
}/*
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt= ::readdir(VH_File))!=0)
|
||||
@ -5255,7 +5290,7 @@ namespace ZNsMain
|
||||
ZNsMain::ZNsEnum::ZERun (*APF_EachFile)(ZTypCPCh APC_NowPath, ZCFileData& AR_CFileData, void* APC_VoidKey),
|
||||
ZNsMain::ZNsEnum::ZERun (*APF_EachDir )(ZTypCPCh APC_NowPath, ZCFileData& AR_CFileData, void* APC_VoidKey)=0
|
||||
)
|
||||
/*##########################################################################*/
|
||||
############################################################################*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////
|
||||
@ -5335,7 +5370,7 @@ namespace ZNsMain
|
||||
#else // !defined(_WIN)
|
||||
|
||||
ZCFileData VO_CFileData;
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
dirent VO_DirEnt;
|
||||
#endif
|
||||
dirent* VP_DirEnt;
|
||||
@ -5345,7 +5380,7 @@ namespace ZNsMain
|
||||
if(VH_File==NULL)
|
||||
return ZNsMain::ZNsEnum::ZERun_OK;
|
||||
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt= ::readdir(VH_File))!=0)
|
||||
@ -5397,7 +5432,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
else*/
|
||||
}/*
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt= ::readdir(VH_File))!=0)
|
||||
@ -5488,7 +5523,7 @@ namespace ZNsMain
|
||||
#else // !defined(_WIN)
|
||||
|
||||
ZCFileData VO_CFileData;
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
dirent VO_DirEnt;
|
||||
#endif
|
||||
dirent* VP_DirEnt;
|
||||
@ -5497,7 +5532,7 @@ namespace ZNsMain
|
||||
|
||||
if(VH_File==NULL) return ZNsMain::ZNsEnum::ZERun_OK;
|
||||
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt = ::readdir(VH_File))!=0)
|
||||
@ -5555,7 +5590,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
else*/
|
||||
}/*
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) && !defined(_NO_USE_REEDDIR_R_)
|
||||
while(::readdir_r(VH_File, &VO_DirEnt, &VP_DirEnt)==0 && VP_DirEnt!=0)
|
||||
#else
|
||||
while((VP_DirEnt = ::readdir(VH_File))!=0)
|
||||
@ -5659,7 +5694,7 @@ namespace ZNsMain
|
||||
|
||||
if(false==AB_DoKeepPrev)
|
||||
{
|
||||
const int CI_BuffSize = _MAX_DIR*4 ;
|
||||
ZTycInt CI_BuffSize = _MAX_DIR*4 ;
|
||||
|
||||
ARR_CStringDir.resize(CI_BuffSize+1, ' ');
|
||||
|
||||
@ -5676,7 +5711,7 @@ namespace ZNsMain
|
||||
|
||||
|
||||
ZTypLength VL_PrevSize = ARR_CStringDir.size() ;
|
||||
const int CI_BuffSize = VL_PrevSize+_MAX_DIR*4 ;
|
||||
ZTycInt CI_BuffSize = VL_PrevSize+_MAX_DIR*4 ;
|
||||
ARR_CStringDir.resize(CI_BuffSize+1, ' ') ;
|
||||
ZTypPChar VP_CopyStart =
|
||||
(ZTypPChar)ARR_CStringDir.data()+VL_PrevSize ;
|
||||
@ -5720,24 +5755,24 @@ namespace ZNsMain
|
||||
{
|
||||
if(false==AB_DoKeepPrev)
|
||||
{
|
||||
const int CI_BuffSize = _MAX_DIR*4 ;
|
||||
ZTycInt CI_BuffSize = _MAX_DIR*4 ;
|
||||
|
||||
ARR_CStringDir.resize(CI_BuffSize+1, ' ');
|
||||
|
||||
char* VP_NowDir = ::getcwd
|
||||
((char*)ARR_CStringDir.data(), CI_BuffSize);
|
||||
|
||||
if(VP_NowDir==0) return false; ARR_CStringDir.
|
||||
if(VP_NowDir==0){return false;} ARR_CStringDir.
|
||||
|
||||
resize(ZNsMain::ZftLength(VP_NowDir), ' ') ;
|
||||
|
||||
return true; /********************************/
|
||||
return true; /*********************************/
|
||||
}/*
|
||||
if(false==AB_DoKeepPrev)*/
|
||||
|
||||
|
||||
ZTypLength VL_PrevSize = ARR_CStringDir.size() ;
|
||||
const int CI_BuffSize = VL_PrevSize+_MAX_DIR*4 ;
|
||||
ZTycInt CI_BuffSize = VL_PrevSize+_MAX_DIR*4 ;
|
||||
ARR_CStringDir.resize(CI_BuffSize+1, ' ') ;
|
||||
ZTypPChar VP_CopyStart =
|
||||
(ZTypPChar)ARR_CStringDir.data()+VL_PrevSize ;
|
||||
@ -7101,7 +7136,6 @@ namespace ZNsMain
|
||||
{
|
||||
return VI_EmptyBuffCnt;
|
||||
}
|
||||
////////////////
|
||||
}
|
||||
else // AL_Length<ZNsMain::ZTypInt(VP_IOBuff->iov_len)
|
||||
{
|
||||
@ -7134,9 +7168,7 @@ namespace ZNsMain
|
||||
{
|
||||
if(mi_HeadPos<1) return ;
|
||||
|
||||
int VI_Index=0 ;
|
||||
int i =mi_HeadPos;
|
||||
|
||||
int VI_Index= 0, i = mi_HeadPos;
|
||||
int VI_ValidBuffCnt = GetSize() ;
|
||||
|
||||
for(; i<=mi_TailPos; ++i)
|
||||
@ -7154,8 +7186,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
for(i=0; i<mi_HeadPos; ++i)*/
|
||||
|
||||
mi_HeadPos=0 ;
|
||||
mi_TailPos=VI_ValidBuffCnt-1;
|
||||
mi_HeadPos= 0 ; mi_TailPos= VI_ValidBuffCnt-1;
|
||||
}/*
|
||||
void MoveFirst()*/
|
||||
|
||||
@ -7240,7 +7271,7 @@ namespace ZNsMain
|
||||
|
||||
#######################################################################################################*/
|
||||
|
||||
static bool ZfWriteFileRaw /*##########################################################################*/
|
||||
static bool ZfWriteFileRaw /*//////////////////////////////////////////////////////////////////////////*/
|
||||
(
|
||||
ZTypCPCh APC_FileName , ZTypCPCh APC_Content ,
|
||||
ZTypLength AL_ContentLen, bool AB_DoAppend=true, int AI_RightMode=-1
|
||||
@ -7278,8 +7309,8 @@ namespace ZNsMain
|
||||
using ZNsConst::ZNsLlioMode::AppendMake ;
|
||||
using ZNsConst::ZNsLlioMode::WriteMakeCut;
|
||||
|
||||
const int CI_FileOpenErr = -1;
|
||||
const int CI_FileOpenTag =
|
||||
ZTycInt CI_FileOpenErr = -1 ;
|
||||
ZTycInt CI_FileOpenTag =
|
||||
(
|
||||
AI_RightMode<0 ?
|
||||
S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP :
|
||||
@ -7327,27 +7358,29 @@ namespace ZNsMain
|
||||
|
||||
#endif //!defined(_WIN)
|
||||
}/*
|
||||
static bool ZfWriteFileRaw( #############################################################################
|
||||
static bool ZfWriteFileRaw( /////////////////////////////////////////////////////////////////////////////
|
||||
(
|
||||
ZTypCPCh APC_FileName , ZTypCPCh APC_Content ,
|
||||
ZTypLength AL_ContentLen, bool AB_DoAppend=true, int AI_RightMode=-1
|
||||
)
|
||||
/*#####################################################################################################*/
|
||||
#######################################################################################################*/
|
||||
|
||||
|
||||
template<typename TStringData> bool ZftLoadFile /*############################*/
|
||||
template<typename TStringData> bool ZftLoadFile /*////////////////////////////*/
|
||||
(
|
||||
TStringData& ARR_SaveCStr , ZTypCPCChar APC_FileName ,
|
||||
ZTypLength AL_LoadSize=0 , ZTypLength AL_Offset =0,
|
||||
bool AB_DoAppend=true, ZTypLength AL_AddAllocSize=0
|
||||
bool AB_DoAppend=true
|
||||
)
|
||||
/*#############################################################################*/
|
||||
{
|
||||
// window 에서 _open() 함수는 \r\n 을 한 문자로 입력받음에 주의.
|
||||
// AL_AddAllocSize 는 파일 APC_FileName 의 크기보다 더 큰 메모리가 필요할 경우에 전달한다.
|
||||
|
||||
if(AL_Offset<0) AL_Offset=0;
|
||||
|
||||
typedef ZtCCharType<TStringData> ZCCharType;
|
||||
typedef typename ZCCharType::TypeChar Typechar ;
|
||||
|
||||
#ifndef _WIN
|
||||
|
||||
int AH_FileDesc = ::open
|
||||
@ -7361,10 +7394,8 @@ namespace ZNsMain
|
||||
(AH_FileDesc, 0/*Offset*/, SEEK_END); // 실패시 -1
|
||||
|
||||
if(VL_LastPos == -1 || VL_LastPos<=AL_Offset)
|
||||
{
|
||||
::close(AH_FileDesc); return false;
|
||||
}/*
|
||||
if(VL_LastPos == -1 || VL_LastPos<=AL_Offset)*/
|
||||
{ ::close(AH_FileDesc); return false; }
|
||||
/*******************************************/
|
||||
|
||||
VL_LastPos -= AL_Offset;
|
||||
|
||||
@ -7379,7 +7410,7 @@ namespace ZNsMain
|
||||
|
||||
ARR_SaveCStr.resize //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
(
|
||||
VL_PrevSize+VL_LastPos-AL_Offset+AL_AddAllocSize, ' '
|
||||
VL_PrevSize+VL_LastPos-AL_Offset, ' '
|
||||
);
|
||||
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
@ -7387,17 +7418,19 @@ namespace ZNsMain
|
||||
|
||||
ZTypLength VL_ReadSize = 0 ;
|
||||
ZTypCPChar VP_CopyStart =
|
||||
const_cast<ZTypPChar>(ARR_SaveCStr.c_str())+VL_PrevSize ;
|
||||
const_cast<ZTypPChar>(ARR_SaveCStr.data())+VL_PrevSize ;
|
||||
|
||||
if((VL_ReadSize = read(AH_FileDesc, VP_CopyStart, VL_LastPos))<0)
|
||||
if((VL_ReadSize = ::read(AH_FileDesc, VP_CopyStart, VL_LastPos))<0)
|
||||
{
|
||||
ARR_SaveCStr.resize(VL_PrevSize, ' '); ::close(AH_FileDesc); return true;
|
||||
ARR_SaveCStr.resize(VL_PrevSize, Typechar(0));
|
||||
|
||||
::close(AH_FileDesc); return true; /*********/
|
||||
}
|
||||
/*/////////////////////////////////////////////////////////////*/
|
||||
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
|
||||
|
||||
ARR_SaveCStr.resize(VL_PrevSize+VL_ReadSize, ' ');
|
||||
ARR_SaveCStr.resize(VL_PrevSize+VL_ReadSize, Typechar(0));
|
||||
|
||||
::close(AH_FileDesc); return true; /*:::::::::::*/
|
||||
::close(AH_FileDesc); return true; /*********************/
|
||||
|
||||
#else //defined(_WIN)
|
||||
|
||||
@ -7434,31 +7467,31 @@ namespace ZNsMain
|
||||
::SetFilePointer(VH_File, AL_Offset, NULL, FILE_BEGIN);
|
||||
|
||||
ZTypCPChar VP_CopyStart =
|
||||
const_cast<ZTypPChar>(ARR_SaveCStr.c_str())+VL_PrevSize ;
|
||||
const_cast<ZTypPChar>(ARR_SaveCStr.data())+VL_PrevSize ;
|
||||
|
||||
if(::ReadFile(VH_File, (LPVOID)VP_CopyStart, dwRead, &dwRead2, NULL)==FALSE)
|
||||
{
|
||||
ARR_SaveCStr.resize(VL_PrevSize+dwRead2, ' ');
|
||||
ARR_SaveCStr.resize(VL_PrevSize+dwRead2, Typechar(0));
|
||||
|
||||
CloseHandle(VH_File); return false;
|
||||
::CloseHandle(VH_File); return false; /**************/
|
||||
}
|
||||
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
|
||||
|
||||
::CloseHandle(VH_File);
|
||||
|
||||
if(dwRead2>0)
|
||||
ARR_SaveCStr.resize(VL_PrevSize+dwRead2, ' ');
|
||||
else ARR_SaveCStr.resize(VL_PrevSize , ' ');
|
||||
ARR_SaveCStr.resize(VL_PrevSize+dwRead2, Typechar(0));
|
||||
else ARR_SaveCStr.resize(VL_PrevSize , Typechar(0));
|
||||
|
||||
return true;
|
||||
|
||||
#endif //defined(_WIN)
|
||||
}/*
|
||||
template<typename TStringData> bool ZftLoadFile ################################
|
||||
template<typename TStringData> bool ZftLoadFile ////////////////////////////////
|
||||
(
|
||||
TStringData& ARR_SaveCStr , ZTypCPCChar APC_FileName ,
|
||||
ZTypLength AL_LoadSize=0 , ZTypLength AL_Offset =0,
|
||||
bool AB_DoAppend=true, ZTypLength AL_AddAllocSize=0
|
||||
bool AB_DoAppend=true
|
||||
)
|
||||
###############################################################################*/
|
||||
|
||||
|
@ -21,80 +21,285 @@ namespace ZNsMain
|
||||
typedef TType TypeData ;
|
||||
typedef TTypArg TypeArg ;
|
||||
typedef TSize TypeSize ;
|
||||
typedef ZtCArray ZCArray ;
|
||||
public:
|
||||
class ZCIterator;
|
||||
class ZCNodePoint; class ZCNodePointN ;
|
||||
public:
|
||||
typedef Type* IterEasy;
|
||||
typedef ZCIterator iterator;
|
||||
typedef const ZCIterator const_iterator;
|
||||
typedef TypeData* IterEasy ;
|
||||
typedef TypeData* TypeNode ; // ZCLinkPoint::GetNode() 의 반환형.
|
||||
typedef ZCNodePoint TypeIter ;
|
||||
typedef ZtCArray TypeThis ;
|
||||
|
||||
typedef const TypeThis TypeThisC ;
|
||||
typedef const TypeData TypeDataC ;
|
||||
typedef const TypeData* TypeNodeC ; // ZCLinkPoint::GetNode() const 의 반환형.
|
||||
typedef const TypeIter TypeIterC ;
|
||||
typedef const TypeData* IterEasyC ;
|
||||
|
||||
/**********************************************/
|
||||
typedef const ZCNodePoint ZCNodePointC;
|
||||
typedef const ZCNodePoint iteratorC ;
|
||||
/**********************************************/
|
||||
typedef ZCNodePoint iterator ;
|
||||
typedef ZCNodePointN const_iterator;
|
||||
typedef ZCNodePointN iteratorN ;
|
||||
typedef ZCNodePointN TypeIterN ;
|
||||
public:
|
||||
|
||||
|
||||
class ZCIterator
|
||||
class ZCNodePoint
|
||||
{
|
||||
private: mutable
|
||||
Type* mp_Data ; mutable
|
||||
TSize ml_ElePos; // *mp_Data 가 배열에서 차지하는 위치
|
||||
ZCArray* mp_CArray;
|
||||
private:
|
||||
ZtCArray& mr_CArray; mutable
|
||||
TypeData* mp_Data ; mutable
|
||||
TypeSize ml_ElePos; // *mp_Data 가 배열에서 차지하는 위치
|
||||
public:
|
||||
|
||||
ZCIterator()
|
||||
static ZCNodePoint MakeTailPoint(ZtCArray & AR_CArray)
|
||||
{
|
||||
mp_Data =0;
|
||||
mp_CArray=0;
|
||||
ml_ElePos=0;
|
||||
ZCNodePoint VO_ZCLinkPoint(AR_CArray);
|
||||
|
||||
if(AR_CArray.size()>0) /****************************/
|
||||
{
|
||||
VO_ZCLinkPoint.mp_Data = AR_CArray.mp_TypeArr+AR_CArray.size()-1 ;
|
||||
VO_ZCLinkPoint.ml_ElePos = AR_CArray.size() ;
|
||||
}
|
||||
return VO_ZCLinkPoint; /****************************/
|
||||
}/*
|
||||
ZCIterator()*/
|
||||
static ZCNodePoint MakeTailPoint(ZtCArray & AR_CArray)*/
|
||||
static ZCNodePoint MakeTailPoint(TypeIterC& AR_TypeIter)
|
||||
{
|
||||
ZCNodePoint VO_ZCLinkPoint(AR_TypeIter);
|
||||
|
||||
ZCIterator(ZCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos)
|
||||
const TypeSize VL_ArrSize = AR_TypeIter.mr_CArray.size();
|
||||
|
||||
if(VL_ArrSize>0) /**********************************/
|
||||
{
|
||||
VO_ZCLinkPoint.mp_Data = AR_TypeIter.mr_CArray+VL_ArrSize-1 ;
|
||||
VO_ZCLinkPoint.ml_ElePos = VL_ArrSize ;
|
||||
}
|
||||
return VO_ZCLinkPoint; /****************************/
|
||||
}/*
|
||||
static ZCNodePoint MakeTailPoint(TypeIterC& AR_TypeIter)*/
|
||||
|
||||
public:
|
||||
|
||||
ZCNodePoint(ZtCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos) :
|
||||
mr_CArray(AR_CArray)
|
||||
/*****************************************************************/
|
||||
{
|
||||
mp_Data =&AR_CData ;
|
||||
mp_CArray=&AR_CArray;
|
||||
ml_ElePos=AL_ElePos ;
|
||||
}/*
|
||||
ZCIterator(ZCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos)*/
|
||||
ZCNodePoint(ZtCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos)*/
|
||||
|
||||
ZCIterator(ZCArray& AR_CArray)
|
||||
ZCNodePoint(ZtCArray& AR_CArray) : mr_CArray(AR_CArray)
|
||||
{
|
||||
mp_Data = AR_CArray.mp_TypeArr ;
|
||||
mp_CArray=&AR_CArray ;
|
||||
ml_ElePos=(AR_CArray.size()>0 ? 1 : 0 ) ;
|
||||
}/*
|
||||
ZCIterator(ZCArray& AR_CArray)*/
|
||||
ZCNodePoint(ZtCArray& AR_CArray)*/
|
||||
|
||||
ZCIterator(const ZCArray& AR_CArray)
|
||||
ZCNodePoint(const ZCNodePoint& rhs) : mr_CArray(rhs.mr_CArray)
|
||||
{
|
||||
mp_Data = AR_CArray.mp_TypeArr;
|
||||
mp_CArray=const_cast<ZCArray*>(&AR_CArray);
|
||||
ml_ElePos=(AR_CArray.size()>0 ? 1 : 0 ) ;
|
||||
mp_Data = rhs.mp_Data ;
|
||||
ml_ElePos= (mr_CArray.size()>0 ? 1 : 0 );
|
||||
}/*
|
||||
ZCIterator(const ZCArray& AR_CArray)*/
|
||||
ZCNodePoint(const ZCNodePoint& rhs)*/
|
||||
|
||||
Type& operator*( ){return *mp_Data;}
|
||||
Type* operator->(){return mp_Data;}
|
||||
|
||||
const Type& operator* () const{return *mp_Data;}
|
||||
const Type* operator->() const{return mp_Data;}
|
||||
TypeThis & GetMain() {return mr_CArray ;}
|
||||
TypeNode GetNode() {return mp_Data ;}
|
||||
|
||||
ZCIterator& operator++( ){++mp_Data; ++ml_ElePos; return *this;}
|
||||
ZCIterator operator++(int){++mp_Data; ++ml_ElePos; return *this;}
|
||||
TypeThisC& GetMain() const{return mr_CArray ;}
|
||||
TypeNodeC GetNode() const{return mp_Data ;}
|
||||
|
||||
const ZCIterator& operator++( ) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
const ZCIterator operator++(int) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
TypeSize GetPos () const{return ml_ElePos ;}
|
||||
TypeSize size () const{return mr_CArray.size();}
|
||||
|
||||
ZCIterator operator+(TSize AL_AddPos) const
|
||||
TypeData & operator* () {return *mp_Data;}
|
||||
TypeData * operator->() {return mp_Data;}
|
||||
TypeDataC& operator* () const{return *mp_Data;}
|
||||
TypeDataC* operator->() const{return mp_Data;}
|
||||
|
||||
TypeIter & operator++( ) {++mp_Data; ++ml_ElePos; return *this;}
|
||||
TypeIter operator++(int) {++mp_Data; ++ml_ElePos; return *this;}
|
||||
TypeIter & operator--( ) {--mp_Data; --ml_ElePos; return *this;}
|
||||
TypeIter operator--(int) {--mp_Data; --ml_ElePos; return *this;}
|
||||
|
||||
ZCNodePointC& operator++( ) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
ZCNodePointC operator++(int) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
ZCNodePointC& operator--( ) const{--mp_Data; --ml_ElePos; return *this;}
|
||||
ZCNodePointC operator--(int) const{--mp_Data; --ml_ElePos; return *this;}
|
||||
|
||||
TypeIter operator+(TSize AL_AddPos) const
|
||||
{
|
||||
return ZCIterator(*this, mp_Data+AL_AddPos, ml_ElePos+AL_AddPos);
|
||||
return ZCNodePoint(*this, mp_Data+AL_AddPos, ml_ElePos+AL_AddPos);
|
||||
}/*
|
||||
ZCIterator operator+(TSize AL_AddPos) const*/
|
||||
TypeIter operator+(TSize AL_AddPos) const*/
|
||||
|
||||
|
||||
bool operator == (ZCNodePointC& rhs) const
|
||||
{ return ml_ElePos == rhs.ml_ElePos; }
|
||||
bool operator != (ZCNodePointC& rhs) const
|
||||
{ return ml_ElePos != rhs.ml_ElePos; }
|
||||
bool operator > (ZCNodePointC& rhs) const
|
||||
{ return ml_ElePos > rhs.ml_ElePos; }
|
||||
bool operator >= (ZCNodePointC& rhs) const
|
||||
{ return ml_ElePos >= rhs.ml_ElePos; }
|
||||
bool operator < (ZCNodePointC& rhs) const
|
||||
{ return ml_ElePos < rhs.ml_ElePos; }
|
||||
bool operator <= (ZCNodePointC& rhs) const
|
||||
{ return ml_ElePos <= rhs.ml_ElePos; }
|
||||
|
||||
bool operator == (TypeSize AL_Size) const
|
||||
{ return ml_ElePos == AL_Size; }
|
||||
bool operator != (TypeSize AL_Size) const
|
||||
{ return ml_ElePos != AL_Size; }
|
||||
bool operator > (TypeSize AL_Size) const
|
||||
{ return ml_ElePos > AL_Size; }
|
||||
bool operator >= (TypeSize AL_Size) const
|
||||
{ return ml_ElePos >= AL_Size; }
|
||||
bool operator < (TypeSize AL_Size) const
|
||||
{ return ml_ElePos < AL_Size; }
|
||||
bool operator <= (TypeSize AL_Size) const
|
||||
{ return ml_ElePos <= AL_Size; }
|
||||
|
||||
public:
|
||||
};/*
|
||||
class ZCIterator
|
||||
class ZCNodePoint*/
|
||||
|
||||
|
||||
public :*/
|
||||
class ZCNodePointN
|
||||
{
|
||||
private:
|
||||
mutable TypeData* mp_Data ;
|
||||
mutable TypeSize ml_ElePos; // *mp_Data 가 배열에서 차지하는 위치
|
||||
const ZtCArray& mr_CArray;
|
||||
public:
|
||||
|
||||
static ZCNodePointN MakeTailPoint(ZtCArray & AR_CArray)
|
||||
{
|
||||
ZCNodePointN VO_ZCLinkPoint(AR_CArray);
|
||||
|
||||
if(AR_CArray.size()>0) /****************************/
|
||||
{
|
||||
VO_ZCLinkPoint.mp_Data = AR_CArray.mp_TypeArr+AR_CArray.size()-1 ;
|
||||
VO_ZCLinkPoint.ml_ElePos = AR_CArray.size() ;
|
||||
}
|
||||
return VO_ZCLinkPoint; /****************************/
|
||||
}/*
|
||||
static ZCNodePointN MakeTailPoint(ZtCArray & AR_CArray)*/
|
||||
static ZCNodePointN MakeTailPoint(TypeIterC& AR_TypeIter)
|
||||
{
|
||||
ZCNodePointN VO_ZCLinkPoint(AR_TypeIter);
|
||||
|
||||
const TypeSize VL_ArrSize = AR_TypeIter.mr_CArray.size();
|
||||
|
||||
if(VL_ArrSize>0) /**********************************/
|
||||
{
|
||||
VO_ZCLinkPoint.mp_Data = AR_TypeIter.mr_CArray+VL_ArrSize-1 ;
|
||||
VO_ZCLinkPoint.ml_ElePos = VL_ArrSize ;
|
||||
}
|
||||
return VO_ZCLinkPoint; /****************************/
|
||||
}/*
|
||||
static ZCNodePointN MakeTailPoint(TypeIterC& AR_TypeIter)*/
|
||||
static ZCNodePointN MakeTailPoint(TypeIterN& AR_TypeIter)
|
||||
{
|
||||
ZCNodePointN VO_ZCLinkPoint(AR_TypeIter);
|
||||
|
||||
const TypeSize VL_ArrSize = AR_TypeIter.mr_CArray.size();
|
||||
|
||||
if(VL_ArrSize>0) /**********************************/
|
||||
{
|
||||
VO_ZCLinkPoint.mp_Data = AR_TypeIter.mr_CArray+VL_ArrSize-1 ;
|
||||
VO_ZCLinkPoint.ml_ElePos = VL_ArrSize ;
|
||||
}
|
||||
return VO_ZCLinkPoint; /****************************/
|
||||
}/*
|
||||
static ZCNodePointN MakeTailPoint(TypeIterN& AR_TypeIter)*/
|
||||
|
||||
public:
|
||||
|
||||
ZCNodePointN(const ZtCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos) :
|
||||
mr_CArray(AR_CArray)
|
||||
/*****************************************************************/
|
||||
{
|
||||
mp_Data =&AR_CData ;
|
||||
ml_ElePos=AL_ElePos ;
|
||||
}/*
|
||||
ZCNodePointN(ZtCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos)*/
|
||||
|
||||
ZCNodePointN(ZtCArray& AR_CArray) : mr_CArray(AR_CArray)
|
||||
{
|
||||
mp_Data = AR_CArray.mp_Data ;
|
||||
ml_ElePos=(AR_CArray.size()>0 ? 1 : 0 ) ;
|
||||
}/*
|
||||
ZCNodePointN(ZtCArray& AR_CArray)*/
|
||||
|
||||
ZCNodePointN(const ZCNodePointN& rhs) : mr_CArray(rhs.mr_CArray)
|
||||
{
|
||||
mp_Data = rhs.mp_Data ;
|
||||
ml_ElePos=(mr_CArray.size()>0 ? 1 : 0 ) ;
|
||||
}/*
|
||||
ZCNodePointN(const ZCNodePointN& rhs)*/
|
||||
ZCNodePointN(const ZCNodePoint & rhs) : mr_CArray(rhs.mr_CArray)
|
||||
{
|
||||
mp_Data = rhs.mp_Data ;
|
||||
ml_ElePos=(mr_CArray.size()>0 ? 1 : 0 ) ;
|
||||
}/*
|
||||
ZCNodePointN(const ZCNodePoint & rhs)*/
|
||||
|
||||
|
||||
TypeSize size () const{return mr_CArray.size();}
|
||||
TypeSize GetPos() const{return ml_ElePos ;}
|
||||
|
||||
TypeDataC& operator* () const{return *mp_Data;}
|
||||
TypeDataC* operator->() const{return mp_Data;}
|
||||
|
||||
|
||||
TypeIterN& operator++( ) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
TypeIterN operator++(int) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
|
||||
TypeIterN operator+(TSize AL_AddPos) const
|
||||
{
|
||||
return ZCNodePointN(*this, mp_Data+AL_AddPos, ml_ElePos+AL_AddPos);
|
||||
}/*
|
||||
TypeIterN operator+(TSize AL_AddPos) const*/
|
||||
|
||||
|
||||
bool operator == (const ZCNodePointN& rhs) const
|
||||
{ return ml_ElePos == rhs.ml_ElePos; }
|
||||
bool operator != (const ZCNodePointN& rhs) const
|
||||
{ return ml_ElePos != rhs.ml_ElePos; }
|
||||
bool operator > (const ZCNodePointN& rhs) const
|
||||
{ return ml_ElePos > rhs.ml_ElePos; }
|
||||
bool operator >= (const ZCNodePointN& rhs) const
|
||||
{ return ml_ElePos >= rhs.ml_ElePos; }
|
||||
bool operator < (const ZCNodePointN& rhs) const
|
||||
{ return ml_ElePos < rhs.ml_ElePos; }
|
||||
bool operator <= (const ZCNodePointN& rhs) const
|
||||
{ return ml_ElePos <= rhs.ml_ElePos; }
|
||||
|
||||
bool operator == (TypeSize AL_Size) const
|
||||
{ return ml_ElePos == AL_Size; }
|
||||
bool operator != (TypeSize AL_Size) const
|
||||
{ return ml_ElePos != AL_Size; }
|
||||
bool operator > (TypeSize AL_Size) const
|
||||
{ return ml_ElePos > AL_Size; }
|
||||
bool operator >= (TypeSize AL_Size) const
|
||||
{ return ml_ElePos >= AL_Size; }
|
||||
bool operator < (TypeSize AL_Size) const
|
||||
{ return ml_ElePos < AL_Size; }
|
||||
bool operator <= (TypeSize AL_Size) const
|
||||
{ return ml_ElePos <= AL_Size; }
|
||||
|
||||
public:
|
||||
};/*
|
||||
class ZCNodePointN*/
|
||||
|
||||
|
||||
public :
|
||||
/**************************************************************************/
|
||||
protected:
|
||||
enum{ZEAddSize=20};
|
||||
protected:
|
||||
@ -137,7 +342,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
~ZtCArray()*/
|
||||
|
||||
ZCArray& operator=(const ZCArray& rhs)
|
||||
ZtCArray& operator=(const ZtCArray& rhs)
|
||||
{
|
||||
if(this==&rhs) return *this ;
|
||||
|
||||
@ -154,13 +359,13 @@ namespace ZNsMain
|
||||
|
||||
return *this;
|
||||
}/*
|
||||
ZCArray& operator=(const ZCArray& rhs)*/
|
||||
ZtCArray& operator=(const ZtCArray& rhs)*/
|
||||
|
||||
ZCArray& operator()(TypeArg AR_TypeArg)
|
||||
ZtCArray& operator()(TypeArg AR_TypeArg)
|
||||
{
|
||||
AddTail(AR_TypeArg); return *this;
|
||||
}/*
|
||||
ZCArray& operator()(TypeArg AR_TypeArg)*/
|
||||
ZtCArray& operator()(TypeArg AR_TypeArg)*/
|
||||
|
||||
|
||||
void Delete()
|
||||
@ -259,44 +464,12 @@ namespace ZNsMain
|
||||
|
||||
Type& operator[](TypeSize AL_Index)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(AL_Index>=ml_UseSize)
|
||||
{
|
||||
std::fstream fileout("DEBUG.txt",std::ios::out | std::ios::app);
|
||||
fileout<<std::endl<<"File : "<<__FILE__<<std::endl<<"Line : "<<__LINE__<<std::endl;
|
||||
fileout<<"Error In 'Type& operator[](TypeSize AL_Index)"<<std::endl;
|
||||
fileout<<" AL_Index>=ml_UseSize"<<", "<<AL_Index<<">="<<ml_UseSize<<std::endl;
|
||||
fileout.close();
|
||||
|
||||
::exit(1);
|
||||
}/*
|
||||
if(AL_Index>=ml_UseSize)*/
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
return mp_TypeArr[AL_Index] ;
|
||||
}/*
|
||||
Type& operator[](TypeSize AL_Index)*/
|
||||
|
||||
const Type& operator[](TypeSize AL_Index) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(AL_Index>=ml_UseSize)
|
||||
{
|
||||
std::fstream fileout("DEBUG.txt", std::ios::out | std::ios::app);
|
||||
fileout<<std::endl<<"File : "<<__FILE__<<std::endl<<"Line : "<<__LINE__<<std::endl;
|
||||
fileout<<"Error In 'const Type& operator[](TypeSize AL_Index) const"<<std::endl;
|
||||
fileout<<" AL_Index>=ml_UseSize"<<std::endl;
|
||||
fileout.close();
|
||||
|
||||
::exit(1);
|
||||
}/*
|
||||
if(AL_Index>=ml_UseSize)*/
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
return mp_TypeArr[AL_Index] ;
|
||||
}/*
|
||||
const Type& operator[](TypeSize AL_Index) const*/
|
||||
@ -304,44 +477,12 @@ namespace ZNsMain
|
||||
|
||||
Type& GetData(TypeSize AL_Index)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(AL_Index>=ml_UseSize)
|
||||
{
|
||||
std::fstream fileout("DEBUG.txt",std::ios::out | std::ios::app);
|
||||
fileout<<std::endl<<"File : "<<__FILE__<<std::endl<<"Line : "<<__LINE__<<std::endl;
|
||||
fileout<<"Error In 'Type& GetData(TypeSize AL_Index)"<<std::endl;
|
||||
fileout<<" AL_Index>=ml_UseSize"<<std::endl;
|
||||
fileout.close();
|
||||
|
||||
::exit(1);
|
||||
}/*
|
||||
if(AL_Index>=ml_UseSize)*/
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
return mp_TypeArr[AL_Index] ;
|
||||
}/*
|
||||
Type& GetData(TypeSize AL_Index)*/
|
||||
|
||||
const Type& GetData(TypeSize AL_Index) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(AL_Index>=ml_UseSize)
|
||||
{
|
||||
std::fstream fileout("DEBUG.txt",std::ios::out | std::ios::app);
|
||||
fileout<<std::endl<<"File : "<<__FILE__<<std::endl<<"Line : "<<__LINE__<<std::endl;
|
||||
fileout<<"Error In 'const Type& GetData(TypeSize AL_Index) const"<<std::endl;
|
||||
fileout<<" AL_Index>=ml_UseSize"<<std::endl;
|
||||
fileout.close();
|
||||
|
||||
::exit(1);
|
||||
}/*
|
||||
if(AL_Index>=ml_UseSize)*/
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
return mp_TypeArr[AL_Index];
|
||||
}/*
|
||||
const Type& GetData(TypeSize AL_Index) const*/
|
||||
@ -354,8 +495,8 @@ namespace ZNsMain
|
||||
for(TypeSize i=ml_UseSize-2; i>=0; --i)
|
||||
{
|
||||
mp_TypeArr[i+1]=mp_TypeArr[i] ;
|
||||
}/*
|
||||
for(TypeSize i=ml_UseSize-2; i>=0; --i)*/
|
||||
}
|
||||
/*:::::::::::::::::::::::::::::::::::*/
|
||||
|
||||
mp_TypeArr[0]=AR_TypeArg ;
|
||||
}/*
|
||||
@ -370,8 +511,8 @@ namespace ZNsMain
|
||||
for(TypeSize i=ml_UseSize-2; i>=0; --i)
|
||||
{
|
||||
mp_TypeArr[i+1]=mp_TypeArr[i] ;
|
||||
}/*
|
||||
for(TypeSize i=ml_UseSize-2; i>=0; --i)*/
|
||||
}
|
||||
/*:::::::::::::::::::::::::::::::::::*/
|
||||
|
||||
return mp_TypeArr[0] ;
|
||||
}/*
|
||||
@ -401,11 +542,17 @@ namespace ZNsMain
|
||||
void push_front(TypeArg AR_TypeArg){AddHead(AR_TypeArg);}
|
||||
void push_back (TypeArg AR_TypeArg){AddTail(AR_TypeArg);}
|
||||
|
||||
Type& push_front(){return AddHead();}
|
||||
Type& push_back (){return AddTail();}
|
||||
TypeData& push_front(){return AddHead();}
|
||||
TypeData& push_back (){return AddTail();}
|
||||
|
||||
ZCIterator begin() {return ZCIterator(*this);}
|
||||
const ZCIterator begin() const{return ZCIterator(*this);}
|
||||
TypeIter begin () {return ZCNodePoint (*this);}
|
||||
TypeIterN begin () const{return ZCNodePointN(*this);}
|
||||
|
||||
iterator end () { return ZCNodePoint ::MakeTailPoint(*this); }
|
||||
iteratorN end () const{ return ZCNodePointN::MakeTailPoint(*this); }
|
||||
|
||||
iteratorN cbegin() const{ return ZCNodePointN(*this); }
|
||||
iteratorN cend () const{ return ZCNodePointN::MakeTailPoint(*this); }
|
||||
|
||||
|
||||
template<typename TFunctor> void IterElement(TFunctor AO_Functor)
|
||||
@ -418,9 +565,6 @@ namespace ZNsMain
|
||||
GetObjRef(AO_Functor)( *VP_TypeArr );
|
||||
|
||||
++VP_TypeArr; //////////////////
|
||||
|
||||
/* ZtCTypeData 으로 인해서, AO_Functor 이 함수일 때뿐이 아니라,
|
||||
operator() 연산자를 가진 object 포인터일 때도 사용할 수 있게 되었다. */
|
||||
}/*
|
||||
__for0(TypeSize, i, ml_UseSize)*/
|
||||
}/*
|
||||
@ -429,110 +573,6 @@ namespace ZNsMain
|
||||
template<typename TFunctor, typename TTypeHelp>
|
||||
void IterElement(TFunctor AO_Functor, TTypeHelp AO_TypeHelp)
|
||||
{
|
||||
/*/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ TTypeHelp 가 class 일 경우, 크기가 커서 참조로 넘어가야 한다면,
|
||||
|
||||
IterElement<myFunctor, myClass&>(myFunctor_obj, myClass_Obj);
|
||||
|
||||
의 형태로 호출할 게 아니라, ZNsMain::ZtCObjectPtr<> 을 사용하여,
|
||||
|
||||
myClass myClass_Obj;
|
||||
|
||||
ZNsMain::ZtCObjectPtr<myClass> myCObjPtr(myClass_Obj);
|
||||
|
||||
나
|
||||
|
||||
IterElement(myFunctor_obj,
|
||||
ZNsMain::ZtCObjectPtr<myClass>(myClass_Obj));
|
||||
|
||||
형태를 사용하면 좋을 것 같다. -- 2014-06-16 23:11:00
|
||||
|
||||
|
||||
ZCCheckRef::PassData() 으로 인해, 인수를 ZtCRef 클래스를 이용해 인수를 참조
|
||||
로 넘길 수 있게 되었다. -- 2021-03-10 16:56
|
||||
|
||||
이제는 ZtCRef 과 ZCCheckRef 클래스 템플릿을 사용하면 된다. -- 2021-03-11 11:00
|
||||
|
||||
이제는 ZftMCR() 과 ZftMCP() 을 사용하면 된다. -- 2025-08-07 17:55
|
||||
|
||||
■ 예제1 -- 2025-08-07 17:35
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "ZCppMain/ZtCArray.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain;
|
||||
|
||||
int main()
|
||||
{
|
||||
ZtCArray<int> myArray;
|
||||
|
||||
myArray.AddTail(10);
|
||||
myArray.AddTail(20);
|
||||
myArray.AddTail(30);
|
||||
myArray.AddTail(40);
|
||||
|
||||
class CHelpObj
|
||||
{
|
||||
public:
|
||||
|
||||
CHelpObj()
|
||||
{
|
||||
}
|
||||
|
||||
CHelpObj(const CHelpObj& rhs)
|
||||
{
|
||||
cout<<"* CHelpObj(const CHelpObj& rhs)"<<endl;
|
||||
}
|
||||
|
||||
public:
|
||||
}; CHelpObj VO_CHelpObj; cout<<"VO_CHelpObj Ptr : "<<&VO_CHelpObj<<endl;
|
||||
|
||||
struct StFunctor
|
||||
{
|
||||
static void ShowElement(int ArgiValue){cout<<"#1 Value="<<ArgiValue<<endl;}
|
||||
};
|
||||
struct StFunctor2
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj)
|
||||
{cout<<"#2 Value="<<ArgiValue<<", CHelpObj Addr=None"<<" With CHelpObj"<<endl;}
|
||||
};
|
||||
struct StFunctor3
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj)
|
||||
{cout<<"#3 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Ref"<<endl;}
|
||||
};
|
||||
struct StFunctor4
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj)
|
||||
{cout<<"#4 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj in Ptr"<<endl;}
|
||||
};
|
||||
struct StFunctor5
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj, CHelpObj& AR_CHelpObj2)
|
||||
{cout<<"#5 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Ref 2"<<endl;}
|
||||
};
|
||||
struct StFunctor6
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj, CHelpObj AO_CHelpObj2)
|
||||
{cout<<"#6 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Half Ref"<<endl;}
|
||||
};
|
||||
|
||||
myArray.IterElement(StFunctor ::ShowElement);
|
||||
myArray.IterElement(StFunctor2::ShowElement, VO_CHelpObj );
|
||||
myArray.IterElement(StFunctor3::ShowElement, ZftMCR(VO_CHelpObj) );
|
||||
myArray.IterElement(StFunctor4::ShowElement, ZftMCP(VO_CHelpObj) );
|
||||
myArray.IterElement(StFunctor5::ShowElement, ZftMCP(VO_CHelpObj), ZftMCP(VO_CHelpObj) );
|
||||
myArray.IterElement(StFunctor6::ShowElement, ZftMCP(VO_CHelpObj), VO_CHelpObj );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
typedef ZNsMain::
|
||||
ZtCCheckRef<TTypeHelp> ZCCheckRef;
|
||||
|
||||
@ -552,33 +592,20 @@ namespace ZNsMain
|
||||
void IterElement(TFunctor AO_Functor, TTypeHelp AO_TypeHelp)*/
|
||||
|
||||
|
||||
template<typename TFunctor, typename TTypeHelp1, typename TTypeHelp2>
|
||||
void IterElement(TFunctor AO_Functor, TTypeHelp1 AO_TypeHelp1, TTypeHelp2 AO_TypeHelp2)
|
||||
template /*#####################################################*/
|
||||
<
|
||||
typename TFunctor ,
|
||||
typename TTypeHelp1 ,
|
||||
typename TTypeHelp2
|
||||
>
|
||||
void IterElement
|
||||
(
|
||||
TFunctor AO_Functor ,
|
||||
TTypeHelp1 AO_TypeHelp1 ,
|
||||
TTypeHelp2 AO_TypeHelp2
|
||||
)
|
||||
/*##############################################################*/
|
||||
{
|
||||
/*/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ TTypeHelp 가 class 일 경우, 크기가 커서 참조로 넘어가야 한다면,
|
||||
|
||||
IterElement<myFunctor, myClass&>(myFunctor_obj, myClass_Obj);
|
||||
|
||||
의 형태로 호출할 게 아니라, ZNsMain::ZtCObjectPtr<> 을 사용하여,
|
||||
|
||||
myClass myClass_Obj; ZNsMain::ZtCObjectPtr<myClass> myCObjPtr(myClass_Obj);
|
||||
|
||||
나
|
||||
|
||||
IterElement(myFunctor_obj, ZNsMain::ZtCObjectPtr<myClass>(myClass_Obj));
|
||||
|
||||
형태를 사용하면 좋을 것 같다. -- 2014-06-16 23:11:00
|
||||
|
||||
|
||||
ZCCheckRef::PassData() 으로 인해, 인수를 ZtCRef 클래스를 이용해 인수를 참조
|
||||
로 넘길 수 있게 되었다. -- 2021-03-10 16:56
|
||||
|
||||
이제는 ZtCRef 과 ZCCheckRef 클래스 템플릿을 사용하면 된다. -- 2021-03-11 11:00
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
typedef ZNsMain::ZtCCheckRef<TTypeHelp1> ZCCheckRef1;
|
||||
typedef ZNsMain::ZtCCheckRef<TTypeHelp2> ZCCheckRef2;
|
||||
|
||||
@ -596,8 +623,19 @@ namespace ZNsMain
|
||||
}/*
|
||||
__for0(TypeSize, i, ml_UseSize)*/
|
||||
}/*
|
||||
template<typename TFunctor, typename TTypeHelp1, typename TTypeHelp2>
|
||||
void IterElement(TFunctor AO_Functor, TTypeHelp1 AO_TypeHelp1, TTypeHelp2 AO_TypeHelp2)*/
|
||||
template #########################################################
|
||||
<
|
||||
typename TFunctor ,
|
||||
typename TTypeHelp1 ,
|
||||
typename TTypeHelp2
|
||||
>
|
||||
void IterElement
|
||||
(
|
||||
TFunctor AO_Functor ,
|
||||
TTypeHelp1 AO_TypeHelp1 ,
|
||||
TTypeHelp2 AO_TypeHelp2
|
||||
)
|
||||
################################################################*/
|
||||
|
||||
|
||||
/*///////////////////////////////////////////////////////////////////////////
|
||||
@ -709,103 +747,97 @@ namespace ZNsMain
|
||||
|
||||
-- 2011-06-12 20:42:00
|
||||
|
||||
GetDataInIter() 를 ItD() 로 대체. -- 2025-10-15 15:49
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
Type* GetHeadIterEasy (){return mp_TypeArr ;}
|
||||
Type* GetTailIterEasy (){return mp_TypeArr+ml_UseSize-1 ;}
|
||||
TypeData * GetHeadIterEasy () {return mp_TypeArr ;}
|
||||
TypeData * GetTailIterEasy () {return mp_TypeArr+ml_UseSize-1 ;}
|
||||
IterEasyID GetHeadIterEasyID () {return (IterEasyID ) mp_TypeArr ;}
|
||||
IterEasyID GetTailIterEasyID () {return (IterEasyID )(mp_TypeArr+ml_UseSize-1);}
|
||||
|
||||
const Type* GetHeadIterEasy () const{return mp_TypeArr ;}
|
||||
const Type* GetTailIterEasy () const{return mp_TypeArr+ml_UseSize-1 ;}
|
||||
const IterEasyID GetHeadIterEasyID() const{return (IterEasyID) mp_TypeArr ;}
|
||||
const IterEasyID GetTailIterEasyID() const{return (IterEasyID)(mp_TypeArr+ml_UseSize-1);}
|
||||
TypeDataC* GetHeadIterEasy () const{return mp_TypeArr ;}
|
||||
TypeDataC* GetTailIterEasy () const{return mp_TypeArr+ml_UseSize-1 ;}
|
||||
IterEasyIDc GetHeadIterEasyID () const{return (IterEasyIDc) mp_TypeArr ;}
|
||||
IterEasyIDc GetTailIterEasyID () const{return (IterEasyIDc)(mp_TypeArr+ml_UseSize-1);}
|
||||
|
||||
void MoveNextIter(Type*& APR_CType ) const{++APR_CType ;}
|
||||
IterEasyIDc GetHeadIterEasyIDc() const{return (IterEasyIDc) mp_TypeArr ;}
|
||||
IterEasyIDc GetTailIterEasyIDc() const{return (IterEasyIDc)(mp_TypeArr+ml_UseSize-1);}
|
||||
|
||||
void MoveNextIter(TypeData* & APR_CType ) const{++APR_CType ;}
|
||||
void MoveNextIter(iterator & ARR_CIterator) const{++ARR_CIterator;}
|
||||
void MoveNextIter(IterEasyID & AI_IterEasyID) const
|
||||
{ MoveNextIter((Type*&)AI_IterEasyID); }
|
||||
void MoveNextIter(const Type*& APR_CType ) const{++APR_CType ;}
|
||||
void MoveNextIter(const iterator& ARR_CIterator) const{++ARR_CIterator;}
|
||||
void MoveNextIter(const IterEasyID& AI_IterEasyID)
|
||||
const{ MoveNextIter((const Type*&)AI_IterEasyID); }
|
||||
{ MoveNextIter((TypeData *&)AI_IterEasyID); }
|
||||
void MoveNextIter(TypeDataC* & APR_CType ) const{++APR_CType ;}
|
||||
void MoveNextIter(iteratorC & ARR_CIterator) const{++ARR_CIterator;}
|
||||
void MoveNextIter(IterEasyIDc& AI_IterEasyID) const
|
||||
{ MoveNextIter((TypeDataC*&)AI_IterEasyID); }
|
||||
|
||||
void MovePrevIter(Type*& APR_CType ) const{--APR_CType ;}
|
||||
void MovePrevIter(TypeData* & APR_CType ) const{--APR_CType ;}
|
||||
void MovePrevIter(iterator & ARR_CIterator) const{--ARR_CIterator;}
|
||||
void MovePrevIter(IterEasyID & AI_IterEasyID) const
|
||||
{ MovePrevIter((Type*&)AI_IterEasyID); }
|
||||
void MovePrevIter(const Type*& APR_CType ) const{--APR_CType ;}
|
||||
void MovePrevIter(const iterator& ARR_CIterator) const{--ARR_CIterator;}
|
||||
void MovePrevIter(const IterEasyID& AI_IterEasyID)
|
||||
const{ MovePrevIter((const Type*&)AI_IterEasyID); }
|
||||
{ MovePrevIter((TypeData *&)AI_IterEasyID); }
|
||||
void MovePrevIter(TypeDataC* & APR_CType ) const{--APR_CType ;}
|
||||
void MovePrevIter(iteratorC & ARR_CIterator) const{--ARR_CIterator;}
|
||||
void MovePrevIter(IterEasyIDc& AI_IterEasyID) const
|
||||
{ MovePrevIter((TypeDataC*&)AI_IterEasyID); }
|
||||
|
||||
|
||||
Type& GetDataInIter(Type* AP_CType ){return *AP_CType ;}
|
||||
Type& GetDataInIter(iterator& ARR_CIterator){return *ARR_CIterator ;}
|
||||
Type& GetDataInIter(IterEasyID AI_IterEasyID){return *(Type*)AI_IterEasyID;}
|
||||
|
||||
const Type& GetDataInIter(const Type* AP_CType ) const{return *AP_CType;}
|
||||
const Type& GetDataInIter(const iterator& ARR_CIterator) const{return *ARR_CIterator;}
|
||||
const Type& GetDataInIter(const IterEasyID AI_IterEasyID) const
|
||||
{ return *(const Type*)AI_IterEasyID; }
|
||||
|
||||
|
||||
Type& GetDataInIter(Type* AP_Type , TypeSize AI_FarNum)
|
||||
{ return *(AP_Type + AI_FarNum) ; }
|
||||
Type& GetDataInIter(iterator& ARR_CIterator , TypeSize AI_FarNum)
|
||||
{ return *(ARR_CIterator+AI_FarNum) ; }
|
||||
Type& GetDataInIter(IterEasyID ARRI_IterEasyID, TypeSize AI_FarNum)
|
||||
{ return GetDataInIter((Type*)ARRI_IterEasyID, AI_FarNum); }
|
||||
|
||||
const Type& GetDataInIter(const Type* AP_Type , TypeSize AI_FarNum) const
|
||||
{ return *(AP_Type + AI_FarNum); }
|
||||
const Type& GetDataInIter(iterator& ARR_CIterator, TypeSize AI_FarNum) const
|
||||
{ return *(ARR_CIterator+AI_FarNum); }
|
||||
const Type& GetDataInIter(const IterEasyID ARRI_IterEasyID, TypeSize AI_FarNum) const
|
||||
{ return GetDataInIter((const Type*)ARRI_IterEasyID, AI_FarNum); }
|
||||
|
||||
|
||||
Type* ItHEasy(){return mp_TypeArr ;}
|
||||
Type* ItTEasy(){return mp_TypeArr+ml_UseSize-1 ;}
|
||||
TypeData * ItHEasy() {return mp_TypeArr ;}
|
||||
TypeData * ItTEasy() {return mp_TypeArr+ml_UseSize-1 ;}
|
||||
IterEasyID ItHID () {return (IterEasyID ) mp_TypeArr ;}
|
||||
IterEasyID ItTID () {return (IterEasyID )(mp_TypeArr+ml_UseSize-1);}
|
||||
|
||||
const Type* ItHEasy () const{return mp_TypeArr ;}
|
||||
const Type* ItTEasy () const{return mp_TypeArr+ml_UseSize-1 ;}
|
||||
const IterEasyID ItHID() const{return (IterEasyID) mp_TypeArr ;}
|
||||
const IterEasyID ItTID() const{return (IterEasyID)(mp_TypeArr+ml_UseSize-1);}
|
||||
TypeDataC* ItHEasy() const{return mp_TypeArr ;}
|
||||
TypeDataC* ItTEasy() const{return mp_TypeArr+ml_UseSize-1 ;}
|
||||
IterEasyIDc ItHID () const{return (IterEasyIDc) mp_TypeArr ;}
|
||||
IterEasyIDc ItTID () const{return (IterEasyIDc)(mp_TypeArr+ml_UseSize-1);}
|
||||
|
||||
void ItNext(Type*& APR_CType ) const{++APR_CType ;}
|
||||
IterEasyIDc ItHIDc () const{return (IterEasyIDc) mp_TypeArr ;}
|
||||
IterEasyIDc ItTIDc () const{return (IterEasyIDc)(mp_TypeArr+ml_UseSize-1);}
|
||||
|
||||
void ItNext(TypeData* & APR_CType ) const{++APR_CType ;}
|
||||
void ItNext(iterator & ARR_CIterator) const{++ARR_CIterator;}
|
||||
void ItNext(IterEasyID & AI_IterEasyID) const
|
||||
{ ItNext((Type*&)AI_IterEasyID); }
|
||||
void ItNext(const Type*& APR_CType ) const{++APR_CType ;}
|
||||
void ItNext(const iterator& ARR_CIterator) const{++ARR_CIterator;}
|
||||
void ItNext(const IterEasyID& AI_IterEasyID)
|
||||
const{ ItNext((const Type*&)AI_IterEasyID); }
|
||||
{ ItNext((TypeData *&)AI_IterEasyID); }
|
||||
void ItNext(TypeDataC* & APR_CType ) const{++APR_CType ;}
|
||||
void ItNext(iteratorC & ARR_CIterator) const{++ARR_CIterator;}
|
||||
void ItNext(IterEasyIDc & AI_IterEasyID) const
|
||||
{ ItNext((TypeDataC*&)AI_IterEasyID); }
|
||||
|
||||
void ItPrev(Type*& APR_CType ) const{--APR_CType ;}
|
||||
void ItPrev(TypeData* & APR_CType ) const{--APR_CType ;}
|
||||
void ItPrev(iterator & ARR_CIterator) const{--ARR_CIterator;}
|
||||
void ItPrev(IterEasyID & AI_IterEasyID) const
|
||||
{ ItPrev((Type*&)AI_IterEasyID); }
|
||||
void ItPrev(const Type*& APR_CType ) const{--APR_CType ;}
|
||||
void ItPrev(const iterator& ARR_CIterator) const{--ARR_CIterator;}
|
||||
void ItPrev(const IterEasyID& AI_IterEasyID)
|
||||
const{ ItPrev((const Type*&)AI_IterEasyID); }
|
||||
{ ItPrev((TypeData *&)AI_IterEasyID); }
|
||||
void ItPrev(TypeDataC* & APR_CType ) const{--APR_CType ;}
|
||||
void ItPrev(iteratorC & ARR_CIterator) const{--ARR_CIterator;}
|
||||
void ItPrev(IterEasyIDc & AI_IterEasyID) const
|
||||
{ ItPrev((TypeDataC*&)AI_IterEasyID); }
|
||||
|
||||
Type& ItD(Type* AP_Type ){return GetDataInIter(AP_Type );}
|
||||
Type& ItD(iterator& ARR_CIterator ){return GetDataInIter(ARR_CIterator );}
|
||||
Type& ItD(IterEasyID ARRI_IterEasyID ){return GetDataInIter(ARRI_IterEasyID );}
|
||||
Type& ItD(Type* AP_Type , TypeSize AI_FarNum){return GetDataInIter(AP_Type , AI_FarNum );}
|
||||
Type& ItD(iterator& ARR_CIterator , TypeSize AI_FarNum){return GetDataInIter(ARR_CIterator , AI_FarNum);}
|
||||
Type& ItD(IterEasyID ARRI_IterEasyID, TypeSize AI_FarNum){return GetDataInIter(ARRI_IterEasyID, AI_FarNum);}
|
||||
TypeData& ItD(TypeData * AP_CType ) {return *AP_CType ;}
|
||||
TypeData& ItD(iterator & ARR_CIterator) {return *ARR_CIterator;}
|
||||
TypeData& ItD(IterEasyID AI_IterEasyID)
|
||||
{ return *(TypeData *)AI_IterEasyID; }
|
||||
|
||||
const Type& ItD(const Type* AP_Type ) const{return GetDataInIter(AP_Type );}
|
||||
const Type& ItD(const iterator& ARR_CIterator ) const{return GetDataInIter(ARR_CIterator );}
|
||||
const Type& ItD(const IterEasyID ARRI_IterEasyID ) const{return GetDataInIter(ARRI_IterEasyID );}
|
||||
const Type& ItD(const Type* AP_Type , TypeSize AI_FarNum) const{return GetDataInIter(AP_Type );}
|
||||
const Type& ItD(const iterator& ARR_CIterator , TypeSize AI_FarNum) const{return GetDataInIter(ARR_CIterator , AI_FarNum);}
|
||||
const Type& ItD(const IterEasyID ARRI_IterEasyID, TypeSize AI_FarNum) const{return GetDataInIter(ARRI_IterEasyID, AI_FarNum);}
|
||||
TypeDataC& ItD(TypeDataC * AP_CType ) const{return *AP_CType;}
|
||||
TypeDataC& ItD(iteratorC & ARR_CIterator) const{return *ARR_CIterator;}
|
||||
TypeDataC& ItD(IterEasyIDc AI_IterEasyID) const
|
||||
{ return *(TypeDataC*)AI_IterEasyID; }
|
||||
|
||||
|
||||
TypeData & ItD(TypeData * AP_Type , TypeSize AI_FarNum)
|
||||
{ return *(AP_Type + AI_FarNum) ; }
|
||||
TypeData & ItD(iterator & ARR_CIterator , TypeSize AI_FarNum)
|
||||
{ return *(ARR_CIterator+AI_FarNum) ; }
|
||||
TypeData & ItD(IterEasyID AH_IterEasyID , TypeSize AI_FarNum)
|
||||
{ return ItD((TypeData*)AH_IterEasyID , AI_FarNum); }
|
||||
|
||||
TypeDataC& ItD(TypeDataC * AP_Type , TypeSize AI_FarNum) const
|
||||
{ return *(AP_Type + AI_FarNum); }
|
||||
TypeDataC& ItD(iterator & ARR_CIterator , TypeSize AI_FarNum) const
|
||||
{ return *(ARR_CIterator+AI_FarNum); }
|
||||
TypeDataC& ItD(IterEasyIDc AH_IterEasyID , TypeSize AI_FarNum) const
|
||||
{ return ItD((TypeDataC*)AH_IterEasyID, AI_FarNum); }
|
||||
|
||||
public:
|
||||
};/*
|
||||
@ -816,11 +848,11 @@ namespace ZNsMain
|
||||
class ZtCArray /////////////////////////*/
|
||||
|
||||
|
||||
///////////////////////////////////////////////
|
||||
////////////////////////////////////////////////
|
||||
|
||||
////////////// end class ZCArray //////////////
|
||||
////////////// end class ZtCArray //////////////
|
||||
|
||||
///////////////////////////////////////////////
|
||||
////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
@ -870,44 +902,12 @@ namespace ZNsMain
|
||||
|
||||
Type& operator[](TSize AL_Index)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(AL_Index>=ml_UseSize)
|
||||
{
|
||||
std::fstream fileout("DEBUG.txt",std::ios::out | std::ios::app);
|
||||
fileout<<std::endl<<"File : "<<__FILE__<<std::endl<<"Line : "<<__LINE__<<std::endl;
|
||||
fileout<<"Error In 'Type& operator[](TSize AL_Index)"<<std::endl;
|
||||
fileout<<" AL_Index>=ml_UseSize"<<", "<<AL_Index<<">="<<ml_UseSize<<std::endl;
|
||||
fileout.close();
|
||||
|
||||
::exit(1);
|
||||
}/*
|
||||
if(AL_Index>=ml_UseSize)*/
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
return mp_TypeArr[AL_Index] ;
|
||||
}/*
|
||||
Type& operator[](TSize AL_Index)*/
|
||||
|
||||
const Type& operator[](TSize AL_Index) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(AL_Index>=ml_UseSize)
|
||||
{
|
||||
std::fstream fileout("DEBUG.txt",std::ios::out | std::ios::app);
|
||||
fileout<<std::endl<<"File : "<<__FILE__<<std::endl<<"Line : "<<__LINE__<<std::endl;
|
||||
fileout<<"Error In 'const Type& operator[](TSize AL_Index) const"<<std::endl;
|
||||
fileout<<" AL_Index>=ml_UseSize"<<std::endl;
|
||||
fileout.close();
|
||||
|
||||
::exit(1);
|
||||
}/*
|
||||
if(AL_Index>=ml_UseSize)*/
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
return mp_TypeArr[AL_Index] ;
|
||||
}/*
|
||||
const Type& operator[](TSize AL_Index) const*/
|
||||
@ -915,44 +915,12 @@ namespace ZNsMain
|
||||
|
||||
Type& GetData(TSize AL_Index)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(AL_Index>=ml_UseSize)
|
||||
{
|
||||
std::fstream fileout("DEBUG.txt",std::ios::out | std::ios::app);
|
||||
fileout<<std::endl<<"File : "<<__FILE__<<std::endl<<"Line : "<<__LINE__<<std::endl;
|
||||
fileout<<"Error In 'Type& GetData(TSize AL_Index)"<<std::endl;
|
||||
fileout<<" AL_Index>=ml_UseSize"<<std::endl;
|
||||
fileout.close();
|
||||
|
||||
::exit(1);
|
||||
}/*
|
||||
if(AL_Index>=ml_UseSize)*/
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
return mp_TypeArr[AL_Index] ;
|
||||
}/*
|
||||
Type& GetData(TSize AL_Index)*/
|
||||
|
||||
const Type& GetData(TSize AL_Index) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(AL_Index>=ml_UseSize)
|
||||
{
|
||||
std::fstream fileout("DEBUG.txt",std::ios::out | std::ios::app);
|
||||
fileout<<std::endl<<"File : "<<__FILE__<<std::endl<<"Line : "<<__LINE__<<std::endl;
|
||||
fileout<<"Error In 'const Type& GetData(TSize AL_Index) const"<<std::endl;
|
||||
fileout<<" AL_Index>=ml_UseSize"<<std::endl;
|
||||
fileout.close();
|
||||
|
||||
::exit(1);
|
||||
}/*
|
||||
if(AL_Index>=ml_UseSize)*/
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
return mp_TypeArr[AL_Index];
|
||||
}/*
|
||||
const Type& GetData(TSize AL_Index) const*/
|
||||
|
4037
ZCppMain/ZtCLinkList.H
Normal file
4037
ZCppMain/ZtCLinkList.H
Normal file
File diff suppressed because it is too large
Load Diff
@ -480,7 +480,7 @@ namespace ZNsMain
|
||||
(
|
||||
const TypeChar* AP_CharID, ZCStringData& ARR_CStringSave
|
||||
) const
|
||||
/*#############################################################################*/
|
||||
###############################################################################*/
|
||||
|
||||
|
||||
ZCStringData GetElementValueByID(const ZCStringData& AR_CStringID) const
|
||||
@ -1515,7 +1515,8 @@ namespace ZNsMain
|
||||
typedef typename ZCStringData::TypeAlloc TypeAlloc ;
|
||||
typedef typename ZCStringData::ZCTypeChars ZCTypeChars ;
|
||||
typedef typename ZCStringData::ZCMainChars ZCMainChars ;
|
||||
typedef typename ZCStringData::ZCStringList ZCStringList ;
|
||||
public :
|
||||
typedef ZtCObjList<ZCStringData> ZCStringList ;
|
||||
private:
|
||||
ZTypInt mi_Depth ;
|
||||
ZCXmlInfo mo_CXmlInfo ;
|
||||
@ -4039,7 +4040,7 @@ namespace ZNsMain
|
||||
const TypeChar* APC_XmlData ,
|
||||
TypeLength AI_DataLen
|
||||
)
|
||||
/*#############################################################################*/
|
||||
###############################################################################*/
|
||||
|
||||
template<typename TViewLoadXml, typename TMainChars>
|
||||
ZERunEx Exec(TViewLoadXml& AR_CViewLoadXml, const TMainChars& AR_CMainChars)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -224,16 +224,16 @@ namespace ZNsMain
|
||||
}/*
|
||||
bool IsFullNode() const*/
|
||||
|
||||
typename ZtCRef<TTypArg>::TypeConst GetData() const
|
||||
typename ZtCRef<TypeArg>::TypeConst GetData() const
|
||||
{
|
||||
return mo_Data;
|
||||
}/*
|
||||
typename ZtCRef<TTypArg>::TypeConst GetData() const*/
|
||||
typename ZtCRef<TypeArg>::TypeConst GetData() const*/
|
||||
|
||||
|
||||
bool operator==(TTypArg AR_Type) const{return mo_Data==AR_Type;}
|
||||
bool operator> (TTypArg AR_Type) const{return mo_Data> AR_Type;}
|
||||
bool operator< (TTypArg AR_Type) const{return mo_Data< AR_Type;}
|
||||
bool operator==(TypeArg AR_Type) const{return mo_Data==AR_Type;}
|
||||
bool operator> (TypeArg AR_Type) const{return mo_Data> AR_Type;}
|
||||
bool operator< (TypeArg AR_Type) const{return mo_Data< AR_Type;}
|
||||
|
||||
template<typename TFunctor> static void IterInOrder (ZCNode* AP_Node, TFunctor AO_Functor)
|
||||
{
|
||||
@ -2422,6 +2422,7 @@ namespace ZNsMain
|
||||
|
||||
using ZNsMain::ZtCObjAVL;
|
||||
|
||||
|
||||
namespace ZNsTmplParam
|
||||
{
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -69,39 +69,39 @@ namespace ZNsMain
|
||||
TTypFuncIsMore APF_IsMore ,
|
||||
TTypFuncIsLess APF_IsLess ,
|
||||
ZCLink* APA_LinkPtrArr[],
|
||||
TypeSize AL_FirstIndex ,
|
||||
TypeSize AL_LastIndex
|
||||
TypeSize AL_HeadIndex ,
|
||||
TypeSize AL_TailIndex
|
||||
)
|
||||
/*##################################################*/
|
||||
{
|
||||
if(AL_FirstIndex<AL_LastIndex)
|
||||
if(AL_HeadIndex<AL_TailIndex)
|
||||
{
|
||||
TypeSize i=AL_FirstIndex ;
|
||||
TypeSize j=AL_LastIndex+1 ;
|
||||
TypeSize i = AL_HeadIndex ;
|
||||
TypeSize j = AL_TailIndex+1 ;
|
||||
|
||||
ZCLink* VP_PivotLinkPtr = APA_LinkPtrArr[i];
|
||||
|
||||
do //////
|
||||
{
|
||||
while(AL_LastIndex >i && APF_IsLess(APA_LinkPtrArr[++i]->GetData(), VP_PivotLinkPtr->GetData()));
|
||||
while(AL_FirstIndex<j && APF_IsMore(APA_LinkPtrArr[--j]->GetData(), VP_PivotLinkPtr->GetData()));
|
||||
while(AL_TailIndex >i && APF_IsLess(APA_LinkPtrArr[++i]->GetData(), VP_PivotLinkPtr->GetData()) );
|
||||
while(AL_HeadIndex <j && APF_IsMore(APA_LinkPtrArr[--j]->GetData(), VP_PivotLinkPtr->GetData()) );
|
||||
|
||||
if(i<j) SwapLinkPtr( APA_LinkPtrArr[i], APA_LinkPtrArr[j] );
|
||||
}
|
||||
while(i<j);
|
||||
|
||||
/* SwapLinkPtr(APA_LinkPtrArr[AL_FirstIndex], APA_LinkPtrArr[j]);
|
||||
/* SwapLinkPtr(APA_LinkPtrArr[AL_HeadIndex], APA_LinkPtrArr[j]);
|
||||
|
||||
위 코드 보다 아래처럼 2 줄로 쓰는게 별도의 스택 변수를 사용하지
|
||||
않아서 좋다.
|
||||
*/
|
||||
APA_LinkPtrArr[AL_FirstIndex]=APA_LinkPtrArr[j];
|
||||
APA_LinkPtrArr[AL_HeadIndex] = APA_LinkPtrArr[j];
|
||||
APA_LinkPtrArr[j ] = VP_PivotLinkPtr ;
|
||||
|
||||
QuickSort(APF_IsMore, APF_IsLess, APA_LinkPtrArr, AL_FirstIndex, j-1 );
|
||||
QuickSort(APF_IsMore, APF_IsLess, APA_LinkPtrArr, j+1, AL_LastIndex);
|
||||
QuickSort(APF_IsMore, APF_IsLess, APA_LinkPtrArr, AL_HeadIndex, j-1 );
|
||||
QuickSort(APF_IsMore, APF_IsLess, APA_LinkPtrArr, j+1, AL_TailIndex);
|
||||
}/*
|
||||
if(AL_FirstIndex<AL_LastIndex)*/
|
||||
if(AL_HeadIndex<AL_TailIndex)*/
|
||||
}/*
|
||||
template
|
||||
<typename TTypFuncIsMore, typename TTypFuncIsLess>
|
||||
@ -110,91 +110,91 @@ namespace ZNsMain
|
||||
TTypFuncIsMore APF_IsMore ,
|
||||
TTypFuncIsLess APF_IsLess ,
|
||||
ZCLink* APA_LinkPtrArr[],
|
||||
TypeSize AL_FirstIndex ,
|
||||
TypeSize AL_LastIndex
|
||||
TypeSize AL_HeadIndex ,
|
||||
TypeSize AL_TailIndex
|
||||
)
|
||||
###########################################################*/
|
||||
####################################################*/
|
||||
|
||||
|
||||
static void QuickSortAsc
|
||||
(
|
||||
ZCLink* APA_LinkPtrArr[], TypeSize AL_FirstIndex, TypeSize AL_LastIndex
|
||||
ZCLink* APA_LinkPtrArr[], TypeSize AL_HeadIndex, TypeSize AL_TailIndex
|
||||
)
|
||||
/*####################*/
|
||||
{
|
||||
if(AL_FirstIndex<AL_LastIndex)
|
||||
if(AL_HeadIndex<AL_TailIndex)
|
||||
{
|
||||
TypeSize i=AL_FirstIndex ;
|
||||
TypeSize j=AL_LastIndex+1 ;
|
||||
TypeSize i=AL_HeadIndex ;
|
||||
TypeSize j=AL_TailIndex+1 ;
|
||||
|
||||
ZCLink* VP_PivotLinkPtr = APA_LinkPtrArr[i];
|
||||
|
||||
do ////
|
||||
{
|
||||
while(AL_LastIndex >i && APA_LinkPtrArr[++i]->GetData() < VP_PivotLinkPtr->GetData());
|
||||
while(AL_FirstIndex<j && APA_LinkPtrArr[--j]->GetData() > VP_PivotLinkPtr->GetData());
|
||||
while(AL_TailIndex >i && APA_LinkPtrArr[++i]->GetData() < VP_PivotLinkPtr->GetData());
|
||||
while(AL_HeadIndex <j && APA_LinkPtrArr[--j]->GetData() > VP_PivotLinkPtr->GetData());
|
||||
|
||||
if(i<j) SwapLinkPtr(APA_LinkPtrArr[i], APA_LinkPtrArr[j]);
|
||||
}
|
||||
while(i<j);
|
||||
|
||||
/* SwapLinkPtr(APA_LinkPtrArr[AL_FirstIndex], APA_LinkPtrArr[j]);
|
||||
/* SwapLinkPtr(APA_LinkPtrArr[AL_HeadIndex], APA_LinkPtrArr[j]);
|
||||
|
||||
위 코드 보다 아래처럼 2 줄로 쓰는게 별도의 스택 변수를 사용하지 않아서 좋다.*/
|
||||
|
||||
APA_LinkPtrArr[AL_FirstIndex]=APA_LinkPtrArr[j];
|
||||
위 코드 보다 아래처럼 2 줄로 쓰는게 별도의 스택 변수를 사용하지 않아서 좋다.
|
||||
*/
|
||||
APA_LinkPtrArr[AL_HeadIndex] = APA_LinkPtrArr[j] ;
|
||||
APA_LinkPtrArr[j ] = VP_PivotLinkPtr ;
|
||||
|
||||
QuickSortAsc(APA_LinkPtrArr, AL_FirstIndex, j-1 );
|
||||
QuickSortAsc(APA_LinkPtrArr, j+1, AL_LastIndex);
|
||||
QuickSortAsc(APA_LinkPtrArr, AL_HeadIndex, j-1 );
|
||||
QuickSortAsc(APA_LinkPtrArr, j+1, AL_TailIndex);
|
||||
}/*
|
||||
if(AL_FirstIndex<AL_LastIndex)*/
|
||||
if(AL_HeadIndex<AL_TailIndex)*/
|
||||
}/*
|
||||
static void QuickSortAsc
|
||||
(
|
||||
ZCLink* APA_LinkPtrArr[], TypeSize AL_FirstIndex, TypeSize AL_LastIndex
|
||||
ZCLink* APA_LinkPtrArr[], TypeSize AL_HeadIndex, TypeSize AL_TailIndex
|
||||
)
|
||||
/*####################*/
|
||||
|
||||
|
||||
static void QuickSortDesc
|
||||
(
|
||||
ZCLink* APA_LinkPtrArr[], TypeSize AL_FirstIndex, TypeSize AL_LastIndex
|
||||
ZCLink* APA_LinkPtrArr[], TypeSize AL_HeadIndex, TypeSize AL_TailIndex
|
||||
)
|
||||
/*#####################*/
|
||||
{
|
||||
if(AL_FirstIndex<AL_LastIndex)
|
||||
if(AL_HeadIndex<AL_TailIndex)
|
||||
{
|
||||
TypeSize i=AL_FirstIndex ;
|
||||
TypeSize j=AL_LastIndex+1;
|
||||
TypeSize i= AL_HeadIndex ;
|
||||
TypeSize j= AL_TailIndex+1;
|
||||
|
||||
ZCLink* VP_PivotLinkPtr=APA_LinkPtrArr[i];
|
||||
|
||||
do //////
|
||||
{
|
||||
while(AL_LastIndex >i && APA_LinkPtrArr[++i]->GetData() > VP_PivotLinkPtr->GetData());
|
||||
while(AL_FirstIndex<j && APA_LinkPtrArr[--j]->GetData() < VP_PivotLinkPtr->GetData());
|
||||
while(AL_TailIndex >i && APA_LinkPtrArr[++i]->GetData() > VP_PivotLinkPtr->GetData());
|
||||
while(AL_HeadIndex <j && APA_LinkPtrArr[--j]->GetData() < VP_PivotLinkPtr->GetData());
|
||||
|
||||
if(i<j) SwapLinkPtr(APA_LinkPtrArr[i], APA_LinkPtrArr[j]);
|
||||
}
|
||||
while(i<j);
|
||||
|
||||
/* SwapLinkPtr(APA_LinkPtrArr[AL_FirstIndex], APA_LinkPtrArr[j]);
|
||||
/* SwapLinkPtr(APA_LinkPtrArr[AL_HeadIndex], APA_LinkPtrArr[j]);
|
||||
|
||||
위 코드 보다 아래처럼 2 줄로 쓰는게 별도의 스택 변수를 사용하지
|
||||
않아서 좋다.
|
||||
*/
|
||||
APA_LinkPtrArr[AL_FirstIndex]=APA_LinkPtrArr[j];
|
||||
APA_LinkPtrArr[AL_HeadIndex]=APA_LinkPtrArr[j];
|
||||
APA_LinkPtrArr[j ]=VP_PivotLinkPtr ;
|
||||
|
||||
QuickSortDesc(APA_LinkPtrArr, AL_FirstIndex, j-1);
|
||||
QuickSortDesc(APA_LinkPtrArr, j+1, AL_LastIndex);
|
||||
QuickSortDesc(APA_LinkPtrArr, AL_HeadIndex, j-1 );
|
||||
QuickSortDesc(APA_LinkPtrArr, j+1, AL_TailIndex);
|
||||
}/*
|
||||
if(AL_FirstIndex<AL_LastIndex)*/
|
||||
if(AL_HeadIndex<AL_TailIndex)*/
|
||||
}/*
|
||||
static void QuickSortDesc
|
||||
(
|
||||
ZCLink* APA_LinkPtrArr[], TypeSize AL_FirstIndex, TypeSize AL_LastIndex
|
||||
ZCLink* APA_LinkPtrArr[], TypeSize AL_HeadIndex, TypeSize AL_TailIndex
|
||||
)
|
||||
/*#####################*/
|
||||
|
||||
@ -239,7 +239,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
//////////////////////////*/
|
||||
|
||||
ZCLink::MakeCircle
|
||||
ZCLink::MakeRing
|
||||
(VPP_LinkPtrArr[0], VPP_LinkPtrArr[VL_SortSize-1]);
|
||||
|
||||
ARR_CObjList.mp_HeadLink = VPP_LinkPtrArr[0];
|
||||
@ -290,9 +290,9 @@ namespace ZNsMain
|
||||
{
|
||||
ZCLink::JoinLink(VPP_LinkPtrArr[i-1], VPP_LinkPtrArr[i]);
|
||||
}/*
|
||||
//////////////////////////*/
|
||||
for(i=1; i<VL_SortSize; ++i)*/
|
||||
|
||||
ZCLink::MakeCircle
|
||||
ZCLink::MakeRing
|
||||
(VPP_LinkPtrArr[0], VPP_LinkPtrArr[VL_SortSize-1]);
|
||||
|
||||
ARR_CObjList.mp_HeadLink = VPP_LinkPtrArr[0];
|
||||
@ -457,9 +457,9 @@ namespace ZNsMain
|
||||
|
||||
ARR_AddList.JoinBefore ////////////////////
|
||||
(
|
||||
ARR_CutList.CutLink(VP_TempLink,1),
|
||||
VP_LhsTemp,
|
||||
VL_LhsTempPos
|
||||
ARR_CutList.CutLink(VP_TempLink, 1)
|
||||
, VP_LhsTemp
|
||||
, VL_LhsTempPos
|
||||
);
|
||||
///////////////////////////////////////////
|
||||
|
||||
@ -729,39 +729,39 @@ namespace ZNsMain
|
||||
TTypFuncIsMore APF_IsMore ,
|
||||
TTypFuncIsLess APF_IsLess ,
|
||||
ZCLink* APA_LinkPtrArr[],
|
||||
TypeSize AL_FirstIndex ,
|
||||
TypeSize AL_LastIndex
|
||||
TypeSize AL_HeadIndex ,
|
||||
TypeSize AL_TailIndex
|
||||
)
|
||||
/*##################################################*/
|
||||
{
|
||||
if(AL_FirstIndex<AL_LastIndex)
|
||||
if(AL_HeadIndex<AL_TailIndex)
|
||||
{
|
||||
TypeSize i=AL_FirstIndex ;
|
||||
TypeSize j=AL_LastIndex+1 ;
|
||||
TypeSize i=AL_HeadIndex ;
|
||||
TypeSize j=AL_TailIndex+1 ;
|
||||
|
||||
ZCLink* VP_PivotLinkPtr=APA_LinkPtrArr[i];
|
||||
|
||||
do //////
|
||||
{
|
||||
while(AL_LastIndex >i && APF_IsLess(APA_LinkPtrArr[++i]->GetData(), VP_PivotLinkPtr->GetData()));
|
||||
while(AL_FirstIndex<j && APF_IsMore(APA_LinkPtrArr[--j]->GetData(), VP_PivotLinkPtr->GetData()));
|
||||
while(AL_TailIndex >i && APF_IsLess(APA_LinkPtrArr[++i]->GetData(), VP_PivotLinkPtr->GetData()));
|
||||
while(AL_HeadIndex <j && APF_IsMore(APA_LinkPtrArr[--j]->GetData(), VP_PivotLinkPtr->GetData()));
|
||||
|
||||
if(i<j) SwapLinkPtr(APA_LinkPtrArr[i], APA_LinkPtrArr[j]);
|
||||
}
|
||||
while(i<j);
|
||||
|
||||
/* SwapLinkPtr(APA_LinkPtrArr[AL_FirstIndex],APA_LinkPtrArr[j]);
|
||||
/* SwapLinkPtr(APA_LinkPtrArr[AL_HeadIndex],APA_LinkPtrArr[j]);
|
||||
|
||||
위 코드 보다 아래처럼 2 줄로 쓰는게 별도의 스택 변수를 사용하지
|
||||
않아서 좋다.
|
||||
*/
|
||||
APA_LinkPtrArr[AL_FirstIndex]=APA_LinkPtrArr[j];
|
||||
APA_LinkPtrArr[AL_HeadIndex]=APA_LinkPtrArr[j];
|
||||
APA_LinkPtrArr[j ]=VP_PivotLinkPtr ;
|
||||
|
||||
QuickSort(APF_IsMore, APF_IsLess, APA_LinkPtrArr, AL_FirstIndex, j-1 );
|
||||
QuickSort(APF_IsMore, APF_IsLess, APA_LinkPtrArr, j+1, AL_LastIndex);
|
||||
QuickSort(APF_IsMore, APF_IsLess, APA_LinkPtrArr, AL_HeadIndex, j-1 );
|
||||
QuickSort(APF_IsMore, APF_IsLess, APA_LinkPtrArr, j+1, AL_TailIndex);
|
||||
}/*
|
||||
if(AL_FirstIndex<AL_LastIndex)*/
|
||||
if(AL_HeadIndex<AL_TailIndex)*/
|
||||
}/*
|
||||
template
|
||||
<typename TTypFuncIsMore, typename TTypFuncIsLess>
|
||||
@ -770,8 +770,8 @@ namespace ZNsMain
|
||||
TTypFuncIsMore APF_IsMore ,
|
||||
TTypFuncIsLess APF_IsLess ,
|
||||
ZCLink* APA_LinkPtrArr[],
|
||||
TypeSize AL_FirstIndex ,
|
||||
TypeSize AL_LastIndex
|
||||
TypeSize AL_HeadIndex ,
|
||||
TypeSize AL_TailIndex
|
||||
)
|
||||
/*##################################################*/
|
||||
|
||||
@ -812,16 +812,17 @@ namespace ZNsMain
|
||||
}
|
||||
/////////////////////////
|
||||
|
||||
QuickSort(APF_IsMore, APF_IsLess, VPP_LinkPtrArr, 0, VL_SortSize-1);
|
||||
QuickSort
|
||||
(APF_IsMore, APF_IsLess, VPP_LinkPtrArr, 0, VL_SortSize-1);
|
||||
|
||||
for(i=1; i<VL_SortSize; ++i) // VL_SortSize-1 번 순환
|
||||
{
|
||||
ZCLink::JoinLink(VPP_LinkPtrArr[i-1], VPP_LinkPtrArr[i]);
|
||||
}
|
||||
////////////////////////////
|
||||
/*++++++++++++++++++++++++*/
|
||||
|
||||
#if(_CODE_OLD_) // 아래 코드만 빠진다.
|
||||
ZCLink::MakeCircle(VPP_LinkPtrArr[0], VPP_LinkPtrArr[VL_SortSize-1]);
|
||||
ZCLink::MakeRing(VPP_LinkPtrArr[0], VPP_LinkPtrArr[VL_SortSize-1]);
|
||||
#else
|
||||
ARR_CObjList.mp_HeadLink=VPP_LinkPtrArr[0] ;
|
||||
ARR_CObjList.mp_TailLink=VPP_LinkPtrArr[VL_SortSize-1];
|
||||
|
File diff suppressed because it is too large
Load Diff
657
ZCppMain/ZtCStringStd.H
Normal file
657
ZCppMain/ZtCStringStd.H
Normal file
@ -0,0 +1,657 @@
|
||||
|
||||
|
||||
#ifndef __ZCPPMAIIN_ZTCSTRINGSTD_H__
|
||||
#define __ZCPPMAIIN_ZTCSTRINGSTD_H__
|
||||
|
||||
|
||||
#include<string>
|
||||
#include "ZCppMain/ZtCMainChars.H"
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
|
||||
template<typename TTypString> class ZtCStringStd;
|
||||
|
||||
|
||||
template //////////////////////////////////////////////////////////////////
|
||||
<
|
||||
template<typename> class ZtCStringStd, typename TTypeBaseStr
|
||||
>
|
||||
/*#######################################################################*/
|
||||
class ZtCCharType< ZtCStringStd<TTypeBaseStr> >
|
||||
{
|
||||
public:
|
||||
typedef ZtCStringStd<TTypeBaseStr> TypeCStr ;
|
||||
typedef typename TypeCStr::traits_type::char_type TypeChar ;
|
||||
typedef typename TypeCStr::traits_type::int_type TypeInt ;
|
||||
typedef typename TypeCStr::size_type TypeSize ;
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
static const int CI_ByteSize = sizeof(TypeChar) ;
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
public:
|
||||
typedef TypeChar char_type ; // for stl string/wstring
|
||||
typedef TypeInt int_type ; // for stl string/wstring
|
||||
typedef TypeSize size_type ; // for stl string/wstring
|
||||
public:
|
||||
};/*
|
||||
class ZtCCharType #######################################################*/
|
||||
|
||||
|
||||
|
||||
template
|
||||
< typename TTypString = std::string >
|
||||
class ZtCStringStd : public TTypString
|
||||
{
|
||||
public:
|
||||
typedef ZtCStringStd TypeThis;
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
typedef typename TTypString::traits_type::char_type TypeChar ;
|
||||
typedef typename TTypString::traits_type::int_type TypeCharInt ;
|
||||
typedef typename TTypString::size_type TypeLength ;
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
typedef ZNsChars::ZNsType::
|
||||
ZtCTypeChars <TypeChar > ZCTypeChars ;
|
||||
typedef ZNsChars::
|
||||
ZtCMainChars<ZCTypeChars> ZCMainChars ;
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
typedef TypeChar* TypePChar ;
|
||||
typedef const TypeChar* TypeCPChar ;
|
||||
typedef TTypString TypeBase ;
|
||||
typedef TTypString TypeStrStd ;
|
||||
typedef TypeLength TypeSize ;
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
typedef ZtCChars
|
||||
<TypeChar, TypeLength> ZCChars ;
|
||||
typedef ZtCChars
|
||||
<TypeChar, TypeLength> ZCCharView ;
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
ZtCStringStd(): TypeStrStd(){}
|
||||
ZtCStringStd(const ZtCStringStd& rhs): TypeStrStd(rhs){}
|
||||
ZtCStringStd(TypeCPChar APC_Origin, TypeLength AL_Length):
|
||||
TypeStrStd(APC_Origin, AL_Length){}
|
||||
|
||||
ZtCStringStd(const ZCCharView& AR_View):
|
||||
TypeStrStd(AR_View.data(), AR_View.size()){}
|
||||
|
||||
explicit ZtCStringStd(TypeCPChar APC_Origin):
|
||||
TypeStrStd(APC_Origin){}
|
||||
|
||||
ZtCStringStd& operator=(const ZtCStringStd& rhs)
|
||||
{
|
||||
if(this==&rhs){ return *this; }
|
||||
|
||||
this->TypeStrStd::operator=(rhs); return *this;
|
||||
}/*
|
||||
ZtCStringStd& operator=(const ZtCStringStd& rhs)*/
|
||||
|
||||
ZtCStringStd& operator=(const TypeBase& rhs)
|
||||
{
|
||||
if(this->data()==rhs.data()){ return *this; }
|
||||
|
||||
this->TypeStrStd::operator=(rhs); return *this;
|
||||
}/*
|
||||
ZtCStringStd& operator=(const TypeBase& rhs)*/
|
||||
|
||||
ZtCStringStd& operator=(const ZCCharView& AR_View)
|
||||
{
|
||||
if(this->data()==AR_View.data()){ return *this; }
|
||||
if( 1 > AR_View.size())
|
||||
{ this->resize(0); return *this; }
|
||||
|
||||
this->resize(AR_View.size());
|
||||
|
||||
const int CI_CopySize =
|
||||
AR_View.size() * sizeof(TypeChar) ;
|
||||
|
||||
::memcpy(this->data(), AR_View.data(), CI_CopySize);
|
||||
|
||||
return *this; /*::::::::::::::::::::::::::::::::::*/
|
||||
}/*
|
||||
ZtCStringStd& operator=(const ZCCharView& AR_View)*/
|
||||
|
||||
|
||||
ZtCStringStd& operator=(ZTypInt AI_Int )
|
||||
{ this->resize(0); return (*this)(AI_Int ); }
|
||||
ZtCStringStd& operator=(ZTypLong AL_Long )
|
||||
{ this->resize(0); return (*this)(AL_Long ); }
|
||||
ZtCStringStd& operator=(ZTypLLong AL_LLong )
|
||||
{ this->resize(0); return (*this)(AL_LLong ); }
|
||||
ZtCStringStd& operator=(double AD_Double)
|
||||
{ this->resize(0); return (*this)(AD_Double); }
|
||||
|
||||
|
||||
|
||||
template<typename TPosList> void FindPosToList /////////////
|
||||
(
|
||||
TPosList& ARR_CPosList, TypeCPChar APC_SearchData,
|
||||
TypeLength AL_SearchLen, TypeLength AL_Offset=0
|
||||
)
|
||||
/*########################################################*/
|
||||
{
|
||||
// TPosList : ZNsMain::ZtCBaseList<TypeLength> etc
|
||||
|
||||
if(0 > AL_Offset) AL_Offset=0 ;
|
||||
if(this->size() <= AL_Offset) return ;
|
||||
if(this->size() < 1 ) return ;
|
||||
|
||||
TypeCPChar VPC_OriginStart = this->data();
|
||||
TypeLength VL_OriginLen = this->size();
|
||||
TypeLength VL_FindPos = -1 ;
|
||||
TypeLength VL_OffsetNow = AL_Offset ;
|
||||
|
||||
while /*::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
( VL_FindPos = ZCMainChars::FindPos
|
||||
(
|
||||
VPC_OriginStart, APC_SearchData,
|
||||
VL_OriginLen , AL_SearchLen , VL_OffsetNow
|
||||
)
|
||||
) >= 0
|
||||
)
|
||||
/*::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||
{
|
||||
ARR_CPosList.push_back(VL_FindPos);
|
||||
|
||||
VL_OffsetNow = VL_FindPos + AL_SearchLen;
|
||||
}
|
||||
/*::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||
}/*
|
||||
template<typename TPosList> void FindPosToList /////////////
|
||||
(
|
||||
TPosList& ARR_CPosList, TypeCPChar APC_SearchData,
|
||||
TypeLength AL_SearchLen, TypeLength AL_Offset=0
|
||||
)
|
||||
##########################################################*/
|
||||
|
||||
|
||||
public :
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
private:
|
||||
|
||||
template<typename TPosList> ZtCStringStd& ReplaceByPosList ///////////////////
|
||||
(
|
||||
TPosList& AR_CPosList ,
|
||||
TypeCPChar APC_Replace ,
|
||||
TypeLength AL_Replace ,
|
||||
TypeLength AL_Searched
|
||||
)
|
||||
/*#########################################################################*/
|
||||
{
|
||||
/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
■ TPosList : ZNsMain::ZtCBaseList<TypeLength> etc
|
||||
AL_Replace : APC_Replace 의 길이
|
||||
AL_Searched : 이전에 찾은 길이
|
||||
|
||||
Replace() 에서 FindPosToList() 다음에 호출한다.
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||
|
||||
if(AR_CPosList.size()<1) return *this;
|
||||
|
||||
TypeLength VL_PosListSize= AR_CPosList.size() ;
|
||||
TypeLength VL_ThisSize = this->size() ;
|
||||
TypeLength VL_NeedSize = VL_ThisSize +
|
||||
(AL_Replace-AL_Searched) * VL_PosListSize ;
|
||||
|
||||
TypePChar VPC_ThisStart = const_cast<TypeChar*>(this->data()) ;
|
||||
IterEasyID VH_IterEasyID = AR_CPosList.ItHID();
|
||||
TypeLength VL_SearchedPos= 0 ;
|
||||
TypeLength VL_SearchedPre= 0 ; // VL_SearchedPos 의 이전 값
|
||||
|
||||
TypePChar VPC_MoveStart = 0 ;
|
||||
TypePChar VPC_DestStart = 0 ;
|
||||
TypeLength VL_MoveStart = 0 ;
|
||||
TypeLength VL_DestStart = 0 ;
|
||||
TypeLength VL_MemMoveSize= 0 ;
|
||||
|
||||
if(AL_Replace<=AL_Searched) // 메모리 증가 불필요
|
||||
{
|
||||
TypePChar VPC_MoveStart = 0 ;
|
||||
TypePChar VPC_DestStart = 0 ;
|
||||
TypeLength VL_MoveStart = 0 ;
|
||||
TypeLength VL_DestStart = 0 ;
|
||||
|
||||
TypeLength VL_MemMoveSize= 0 ;
|
||||
TypePChar VPC_RepalcePos= 0 ;
|
||||
|
||||
__for1(TypeLength, i, VL_PosListSize)
|
||||
{
|
||||
VL_SearchedPos = AR_CPosList.ItD(VH_IterEasyID) ;
|
||||
VPC_RepalcePos = VPC_ThisStart + VL_SearchedPos -
|
||||
( AL_Searched-AL_Replace ) * (i-1) ;
|
||||
|
||||
if(VL_MoveStart>VL_DestStart)
|
||||
{
|
||||
VL_MemMoveSize =
|
||||
VL_SearchedPos - VL_SearchedPre - AL_Searched ;
|
||||
VPC_MoveStart = VPC_ThisStart + VL_MoveStart ;
|
||||
VPC_DestStart = VPC_ThisStart + VL_DestStart ;
|
||||
|
||||
::memmove /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
VPC_DestStart, VPC_MoveStart, VL_MemMoveSize*sizeof(TypeChar)
|
||||
);
|
||||
/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||
}/*
|
||||
if(VL_MoveStart>VL_DestStart)*/
|
||||
|
||||
VL_SearchedPre = VL_SearchedPos ;
|
||||
VL_MoveStart = VL_SearchedPos+ AL_Searched ;
|
||||
VL_DestStart = VL_SearchedPos+ AL_Searched -
|
||||
( AL_Searched-AL_Replace ) * i ;
|
||||
|
||||
::memcpy(VPC_RepalcePos, APC_Replace, AL_Replace);
|
||||
|
||||
AR_CPosList.ItNext(VH_IterEasyID);
|
||||
}/*
|
||||
__for1(TypeLength, i, VL_PosListSize)*/
|
||||
|
||||
if(VL_ThisSize > VL_MoveStart)
|
||||
{
|
||||
::memmove /*::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
VPC_ThisStart + VL_DestStart,
|
||||
VPC_ThisStart + VL_MoveStart,
|
||||
(VL_ThisSize - VL_MoveStart)*sizeof(TypeChar)
|
||||
);
|
||||
/*::::::::::::::::::::::::::::::::::::::::*/
|
||||
}/*
|
||||
if(VL_ThisSize > VL_MoveStart)*/
|
||||
|
||||
this->resize(VL_NeedSize); return *this;
|
||||
}/*
|
||||
if(AL_Replace<=AL_Searched) // 메모리 증가 불필요*/
|
||||
|
||||
|
||||
/*======*/ VL_SearchedPre = this->size() ;
|
||||
/*======*/ VH_IterEasyID = AR_CPosList.ItTID() ;
|
||||
TypeLength VL_NowEleNo = VL_PosListSize ;
|
||||
TypeLength VL_DiffLength = AL_Replace-AL_Searched;
|
||||
|
||||
this->resize(VL_NeedSize); VPC_ThisStart = this->data();
|
||||
|
||||
__for1(TypeLength, i, VL_PosListSize)
|
||||
{
|
||||
VL_SearchedPos = AR_CPosList.ItD(VH_IterEasyID) ;
|
||||
VL_MemMoveSize = VL_SearchedPre - (VL_SearchedPos+AL_Searched);
|
||||
|
||||
if(VL_MemMoveSize>0)
|
||||
{
|
||||
VPC_MoveStart = VPC_ThisStart + VL_SearchedPos + AL_Searched ;
|
||||
VPC_DestStart = VPC_ThisStart + VL_SearchedPos + AL_Searched + VL_DiffLength*VL_NowEleNo ;
|
||||
|
||||
::memmove /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
VPC_DestStart, VPC_MoveStart, VL_MemMoveSize*sizeof(TypeChar)
|
||||
);
|
||||
/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||
}/*
|
||||
if(VL_MemMoveSize>0)*/
|
||||
|
||||
VPC_DestStart = VPC_ThisStart + VL_SearchedPos + VL_DiffLength*(VL_PosListSize - i) ;
|
||||
|
||||
::memcpy /*:::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
VPC_DestStart, APC_Replace, AL_Replace*sizeof(TypeChar)
|
||||
);
|
||||
/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||
|
||||
VL_SearchedPre = VL_SearchedPos; --VL_NowEleNo;
|
||||
|
||||
AR_CPosList.ItPrev(VH_IterEasyID);
|
||||
}/*
|
||||
__for1(TypeLength, i, VL_PosListSize)*/
|
||||
|
||||
|
||||
return *this;
|
||||
}/*
|
||||
template<typename TPosList> ZtCStringStd& ReplaceByPosList //////////////////
|
||||
(
|
||||
TPosList& AR_CPosList ,
|
||||
TypeCPChar APC_Replace ,
|
||||
TypeLength AL_Replace ,
|
||||
TypeLength AL_Searched
|
||||
)
|
||||
###########################################################################*/
|
||||
|
||||
|
||||
private:
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
public :
|
||||
|
||||
|
||||
ZtCStringStd& Replace /*///////////////////////////////////////////////////*/
|
||||
(
|
||||
TypeCPChar APC_Search, TypeCPChar APC_Replace,
|
||||
TypeLength AL_Search , TypeLength AL_Replace , TypeLength AL_Offset=0
|
||||
)
|
||||
/*#########################################################################*/
|
||||
{
|
||||
if(0 > AL_Offset) AL_Offset=0 ;
|
||||
if(this->size() <= AL_Offset) return *this;
|
||||
if(this->size() < 1 ) return *this;
|
||||
|
||||
ZtCBaseList<TypeLength> VO_CPosCList; FindPosToList
|
||||
(
|
||||
RR(VO_CPosCList), APC_Search, AL_Search, AL_Offset
|
||||
);
|
||||
/*////////////////////////////////////////////////*/
|
||||
|
||||
return ReplaceByPosList /*::::::::::::::::::::::::::::*/
|
||||
(
|
||||
VO_CPosCList, APC_Replace, AL_Replace, AL_Search
|
||||
);
|
||||
/*::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||
}
|
||||
/*#########################################################################*/
|
||||
|
||||
ZtCStringStd& Replace /*///////////////////////////////////////////////////*/
|
||||
(
|
||||
TypeCPChar APC_Search, TypeCPChar APC_Replace, TypeLength AL_Offset=0
|
||||
)
|
||||
/*#########################################################################*/
|
||||
{
|
||||
return Replace(APC_Search, APC_Replace, ZftLength(APC_Search), ZftLength(APC_Replace), AL_Offset);
|
||||
}
|
||||
/*#########################################################################*/
|
||||
|
||||
|
||||
ZtCStringStd& operator()(ZtCStringStd& rhs)
|
||||
{
|
||||
if(this==&rhs) {return *this;} this->append(rhs); return *this;
|
||||
}/*
|
||||
ZtCStringStd& operator()(ZtCStringStd& rhs)*/
|
||||
|
||||
ZtCStringStd& operator()(TypeCPChar APC_Data, TypeLength AI_Length)
|
||||
{
|
||||
if(this->data()==APC_Data) return *this;
|
||||
|
||||
this->append(APC_Data, AI_Length); return *this;
|
||||
}/*
|
||||
ZtCStringStd& operator()(TypeCPChar APC_Data, TypeLength AI_Length)*/
|
||||
|
||||
ZtCStringStd& operator()(TypeCPChar APC_Data)
|
||||
{
|
||||
if(this->data()==APC_Data) return *this;
|
||||
|
||||
this->append(APC_Data); return *this;
|
||||
}/*
|
||||
ZtCStringStd& operator()(TypeCPChar APC_Data)*/
|
||||
|
||||
ZtCStringStd& operator()(TypeLength AI_Repeat, TypeChar AC_Data)
|
||||
{
|
||||
this->append(AI_Repeat, AC_Data); return *this;
|
||||
}/*
|
||||
ZtCStringStd& operator()(TypeChar AC_Data, TypeLength AI_Repeat)*/
|
||||
|
||||
ZtCStringStd& operator()(TypeChar AC_Data, TypeLength AI_Repeat=1)
|
||||
{
|
||||
this->append(AI_Repeat, AC_Data); return *this;
|
||||
}/*
|
||||
ZtCStringStd& operator()(TypeChar AC_Data, TypeLength AI_Repeat=1)*/
|
||||
|
||||
ZtCStringStd& operator()(const ZCCharView& AR_View)
|
||||
{
|
||||
this->append(AR_View.data(), AR_View.size()); return *this;
|
||||
}/*
|
||||
ZtCStringStd& operator()(const ZCCharView& AR_View)*/
|
||||
|
||||
ZtCStringStd& operator()(bool AB_Bool)
|
||||
{
|
||||
typedef typename TypeThis::TypeChar TypeChar ;
|
||||
typedef typename TypeThis::TypeSize TypeSize ;
|
||||
|
||||
typedef ZtCBoolStr
|
||||
<TypeChar, TypeSize> ZCBoolStr;
|
||||
|
||||
return (*this)( ZCBoolStr::GetMark(AB_Bool) );
|
||||
}/*
|
||||
ZtCStringStd& operator()(bool AB_Bool)*/
|
||||
|
||||
|
||||
ZtCStringStd& operator()(int AI_IntParam)
|
||||
{
|
||||
const int CI_BuffSize= 21; TypeChar VCA_BuffParam[CI_BuffSize] ;
|
||||
|
||||
int VI_ResultSize = /*::::::::::::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
sizeof(TypeChar)<=1
|
||||
? ::sprintf ((char* )VCA_BuffParam, /*+++++++*/ "%d", AI_IntParam)
|
||||
: ::swprintf((wchar_t*)VCA_BuffParam, CI_BuffSize, L"%d", AI_IntParam)
|
||||
);
|
||||
return (*this)(VCA_BuffParam, VI_ResultSize); /*::::::::::::::*/
|
||||
}/*
|
||||
ZtCStringStd& operator()(int AI_IntParam)*/
|
||||
|
||||
ZtCStringStd& operator()(ZTypUInt AUI_UIntParam)
|
||||
{
|
||||
const int CI_BuffSize= 21; TypeChar VCA_BuffParam[CI_BuffSize] ;
|
||||
|
||||
int VI_ResultSize = /*::::::::::::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
sizeof(TypeChar)<=1
|
||||
? ::sprintf ((char* )VCA_BuffParam, /*++++++++*/ "%u", AUI_UIntParam)
|
||||
: ::swprintf((wchar_t*)VCA_BuffParam, CI_BuffSize, L"%u", AUI_UIntParam)
|
||||
);
|
||||
return (*this)(VCA_BuffParam, VI_ResultSize); /*::::::::::::::*/
|
||||
}/*
|
||||
ZtCStringStd& operator()(ZTypUInt AUI_UIntParam)*/
|
||||
|
||||
ZtCStringStd& operator()(long AL_LongParam)
|
||||
{
|
||||
const int CI_BuffSize= 31; TypeChar VCA_BuffParam[CI_BuffSize] ;
|
||||
|
||||
int VI_ResultSize = /*::::::::::::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
sizeof(TypeChar)<=1
|
||||
? ::sprintf ((char* )VCA_BuffParam, /*++++++++*/ "%ld", AL_LongParam)
|
||||
: ::swprintf((wchar_t*)VCA_BuffParam, CI_BuffSize, L"%ld", AL_LongParam)
|
||||
);
|
||||
return (*this)(VCA_BuffParam, VI_ResultSize); /*::::::::::::::*/
|
||||
}/*
|
||||
ZtCStringStd& operator()(long AL_LongParam)*/
|
||||
|
||||
ZtCStringStd& operator()(ZTypULong AUL_ULongParam)
|
||||
{
|
||||
const int CI_BuffSize= 31; TypeChar VCA_BuffParam[CI_BuffSize] ;
|
||||
|
||||
int VI_ResultSize = /*::::::::::::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
sizeof(TypeChar)<=1
|
||||
? ::sprintf ((char* )VCA_BuffParam, /*++++++++*/ "%lu", AUL_ULongParam)
|
||||
: ::swprintf((wchar_t*)VCA_BuffParam, CI_BuffSize, L"%lu", AUL_ULongParam)
|
||||
);
|
||||
return (*this)(VCA_BuffParam, VI_ResultSize); /*::::::::::::::*/
|
||||
}/*
|
||||
ZtCStringStd& operator()(ZTypULong AUL_ULongParam)*/
|
||||
|
||||
ZtCStringStd& operator()(ZTypLLong ALL_LLongParam)
|
||||
{
|
||||
const int CI_BuffSize= 41; TypeChar VCA_BuffParam[CI_BuffSize] ;
|
||||
|
||||
int VI_ResultSize = /*::::::::::::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
sizeof(TypeChar)<=1
|
||||
? ::sprintf ((char* )VCA_BuffParam, /*++++++++*/ "%lld" , ALL_LLongParam)
|
||||
: ::swprintf((wchar_t*)VCA_BuffParam, CI_BuffSize, L"%lld" , ALL_LLongParam)
|
||||
);
|
||||
return (*this)(VCA_BuffParam, VI_ResultSize); /*::::::::::::::*/
|
||||
}/*
|
||||
ZtCStringStd& operator()(ZTypLLong ALL_LLongParam)*/
|
||||
|
||||
ZtCStringStd& operator()(ZTypULLong AULL_LLongParam)
|
||||
{
|
||||
const int CI_BuffSize= 41; TypeChar VCA_BuffParam[CI_BuffSize] ;
|
||||
|
||||
int VI_ResultSize = /*::::::::::::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
sizeof(TypeChar)<=1
|
||||
? ::sprintf ((char* )VCA_BuffParam, /*++++++++*/ "%llu" , AULL_LLongParam)
|
||||
: ::swprintf((wchar_t*)VCA_BuffParam, CI_BuffSize, L"%llu" , AULL_LLongParam)
|
||||
);
|
||||
return (*this)(VCA_BuffParam, VI_ResultSize); /*::::::::::::::*/
|
||||
}/*
|
||||
ZtCStringStd& operator()(ZTypULLong AULL_LLongParam)*/
|
||||
|
||||
ZtCStringStd& operator()(double AD_DoubleParam)
|
||||
{
|
||||
const int CI_BuffSize= 51; TypeChar VCA_BuffParam[CI_BuffSize] ;
|
||||
|
||||
int VI_ResultSize = /*::::::::::::::::::::::::::::::::::::::::*/
|
||||
(
|
||||
sizeof(TypeChar)<=1
|
||||
? ::sprintf ((char* )VCA_BuffParam, /*++++++++*/ "%f", AD_DoubleParam)
|
||||
: ::swprintf((wchar_t*)VCA_BuffParam, CI_BuffSize, L"%f", AD_DoubleParam)
|
||||
);
|
||||
ZNsMain::ZftTrimDecimalZero(VCA_BuffParam, RR(VI_ResultSize));
|
||||
|
||||
return (*this)(VCA_BuffParam, VI_ResultSize); /*::::::::::::::*/
|
||||
}/*
|
||||
ZtCStringStd& operator()(double AD_DoubleParam)*/
|
||||
|
||||
|
||||
int GetInt () const{return ZNsMain::ZftAtoI (this->data());}
|
||||
ZTypLong GetLong () const{return ZNsMain::ZftAtoL (this->data());}
|
||||
ZTypLLong GetLongLong() const{return ZNsMain::ZftAtoLL(this->data());}
|
||||
ZTypLLong GetLLong () const{return ZNsMain::ZftAtoLL(this->data());}
|
||||
double GetDouble () const{return ZNsMain::ZftAtoD (this->data());}
|
||||
|
||||
public:
|
||||
};/*
|
||||
template //////////////////////////////////////////////////////////
|
||||
< typename TTypString = std::string >
|
||||
class ZtCStringStd
|
||||
#################################################################*/
|
||||
|
||||
|
||||
typedef ZtCStringStd<std::string > ZCStringStd ;
|
||||
typedef ZtCStringStd<std::wstring> ZCStringStdW;
|
||||
|
||||
|
||||
#define _ZCSTRINGSTD_ ZtCStringStd< TTypString >
|
||||
#define _ZCSTRINGSTD_ARG_ template< typename TTypString >
|
||||
|
||||
_ZCSTRINGSTD_ARG_ _ZCSTRINGSTD_& ZftMakeStr
|
||||
( _ZCSTRINGSTD_& ARR_SaveCStr, const _ZCSTRINGSTD_& AR_DataCStr)
|
||||
{ return ARR_SaveCStr(AR_DataCStr ); }
|
||||
|
||||
_ZCSTRINGSTD_ARG_ _ZCSTRINGSTD_& ZftMakeStr
|
||||
( _ZCSTRINGSTD_& ARR_SaveCStr, const typename
|
||||
_ZCSTRINGSTD_::ZCChars& AR_DataCStr )
|
||||
{ return ARR_SaveCStr(AR_DataCStr ); }
|
||||
|
||||
_ZCSTRINGSTD_ARG_ _ZCSTRINGSTD_& ZftMakeStr
|
||||
( _ZCSTRINGSTD_& ARR_SaveCStr, typename
|
||||
_ZCSTRINGSTD_::TypeChar AC_Char )
|
||||
{ return ARR_SaveCStr(AC_Char ); }
|
||||
|
||||
_ZCSTRINGSTD_ARG_ _ZCSTRINGSTD_& ZftMakeStr
|
||||
( _ZCSTRINGSTD_& ARR_SaveCStr, ZTypInt AI_IntI )
|
||||
{ return ARR_SaveCStr(AI_IntI ); }
|
||||
|
||||
_ZCSTRINGSTD_ARG_ _ZCSTRINGSTD_& ZftMakeStr
|
||||
( _ZCSTRINGSTD_& ARR_SaveCStr, ZTypIntL AL_Long )
|
||||
{ return ARR_SaveCStr(AL_Long ); }
|
||||
|
||||
_ZCSTRINGSTD_ARG_ _ZCSTRINGSTD_& ZftMakeStr
|
||||
( _ZCSTRINGSTD_& ARR_SaveCStr, ZTypIntUI AUI_Int )
|
||||
{ return ARR_SaveCStr(AUI_Int ); }
|
||||
|
||||
_ZCSTRINGSTD_ARG_ _ZCSTRINGSTD_& ZftMakeStr
|
||||
( _ZCSTRINGSTD_& ARR_SaveCStr, ZTypIntUL AUL_Long )
|
||||
{ return ARR_SaveCStr(AUL_Long ); }
|
||||
|
||||
_ZCSTRINGSTD_ARG_ _ZCSTRINGSTD_& ZftMakeStr
|
||||
( _ZCSTRINGSTD_& ARR_SaveCStr, ZTypIntULL AULL_Long )
|
||||
{ return ARR_SaveCStr(AULL_Long ); }
|
||||
|
||||
_ZCSTRINGSTD_ARG_ _ZCSTRINGSTD_& ZftMakeStr
|
||||
( _ZCSTRINGSTD_& ARR_SaveCStr, double AD_Double )
|
||||
{ return ARR_SaveCStr(AD_Double ); }
|
||||
|
||||
_ZCSTRINGSTD_ARG_ _ZCSTRINGSTD_& ZftMakeStr
|
||||
( _ZCSTRINGSTD_& ARR_SaveCStr, bool AB_Bool )
|
||||
{
|
||||
typedef typename _ZCSTRINGSTD_::TypeChar TypeChar;
|
||||
typedef typename _ZCSTRINGSTD_::TypeSize TypeSize;
|
||||
|
||||
typedef ZtCBoolStr<TypeChar, TypeSize> ZCBoolStr ;
|
||||
|
||||
return ARR_SaveCStr(ZCBoolStr::GetMark(AB_Bool)) ;
|
||||
}/*
|
||||
_ZCSTRINGSTD_ARG_ _ZCSTRINGSTD_& ZftMakeStr
|
||||
( _ZCSTRINGSTD_& ARR_SaveCStr, bool AB_Bool ) */
|
||||
|
||||
|
||||
#undef _ZCSTRINGSTD_
|
||||
#undef _ZCSTRINGSTD_ARG_
|
||||
|
||||
|
||||
|
||||
template<typename TTypString> std::ostream& operator<<
|
||||
(std::ostream& AR_COStream, const ZtCStringStd<TTypString>& AR_DataCStr)
|
||||
{
|
||||
typedef typename ZtCStringStd
|
||||
<TTypString>::TypeBase TypeBaseCStr ;
|
||||
|
||||
AR_COStream<< static_cast
|
||||
<const TypeBaseCStr&>(AR_DataCStr);
|
||||
|
||||
return AR_COStream; ///////////////////////////
|
||||
}/*
|
||||
template<typename TTypString> std::ostream& operator<<
|
||||
(std::ostream& AR_COStream, const ZtCStringStd& AR_DataCStr)*/
|
||||
|
||||
|
||||
std::ostream& operator<<
|
||||
(std::ostream& AR_COStream, const ZCStringStd& AR_DataCStr)
|
||||
{
|
||||
typedef ZCStringStd::TypeBase TypeBaseCStr;
|
||||
|
||||
AR_COStream<< static_cast
|
||||
<const TypeBaseCStr&>( AR_DataCStr );
|
||||
|
||||
return AR_COStream; /*********************/
|
||||
}/*
|
||||
template<typename TTypString> std::ostream& operator<<
|
||||
(std::ostream& AR_COStream, const ZtCStringStd& AR_DataCStr)*/
|
||||
|
||||
|
||||
std::ostream& operator<<
|
||||
(std::ostream& AR_COStream, const ZCStringStdW& AR_DataCStr)
|
||||
{
|
||||
// ascii 코드 범위에서만 출력한다.
|
||||
|
||||
typedef ZCStringStdW::TypeSize TypeLength ;
|
||||
typedef ZCStringStdW::TypeCharInt TypeCharInt;
|
||||
|
||||
ZTypCCharW* VP_Data = AR_DataCStr.data();
|
||||
TypeLength VI_Size = AR_DataCStr.size();
|
||||
|
||||
const int CI_AsciiMax = 127 ;
|
||||
|
||||
__for0(TypeLength, i, VI_Size)
|
||||
{
|
||||
TypeCharInt VI_Code = TypeCharInt(*VP_Data++);
|
||||
|
||||
if(VI_Code>0 && VI_Code<=CI_AsciiMax)
|
||||
{ AR_COStream.put( char(VI_Code) ); }
|
||||
}/*
|
||||
__for0(TypeLength, i, VI_Size)*/
|
||||
|
||||
return AR_COStream; /*********************/
|
||||
}/*
|
||||
template<typename TTypString> std::ostream& operator<<
|
||||
(std::ostream& AR_COStream, const ZtCStringStd& AR_DataCStr)*/
|
||||
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
|
||||
#endif //__ZCPPMAIIN_ZTCSTRINGSTD_H__
|
@ -123,7 +123,6 @@ namespace ZNsMain
|
||||
|
||||
|
||||
template< typename TType ,
|
||||
typename TTypeInit =ZNsMain::ZtCInit<TType>,
|
||||
typename TTypeTreeData=ZNsType::ZtCTypeTreeData<long>
|
||||
>
|
||||
class ZtCTreeData /*###########################################*/
|
||||
@ -132,8 +131,7 @@ namespace ZNsMain
|
||||
class ZCNode1; class ZCNode2; class ZCNodeInfo;
|
||||
public:
|
||||
typedef TType TypeData ;
|
||||
typedef TTypeInit ZCTypeInit ;
|
||||
typedef TTypeTreeData ZCTypeTreeData;
|
||||
typedef TTypeTreeData TypeTreeData;
|
||||
public:
|
||||
typedef typename TTypeTreeData::TypeSize TypeSize ;
|
||||
typedef typename TTypeTreeData::template
|
||||
@ -148,7 +146,8 @@ namespace ZNsMain
|
||||
typedef typename ZCNodeList::iterator IterOfNode;
|
||||
public:
|
||||
|
||||
class ZCNode1 : public ZCTypeInit
|
||||
|
||||
class ZCNode1
|
||||
{
|
||||
public :
|
||||
friend class ZCNodeInfo;
|
||||
@ -160,13 +159,13 @@ namespace ZNsMain
|
||||
|
||||
ZCNode1()
|
||||
{
|
||||
mp_HighNode=0; this->ZCTypeInit::OnInit(mo_TypeData);
|
||||
mp_HighNode=0;
|
||||
}/*
|
||||
ZCNode1()*/
|
||||
|
||||
~ZCNode1()
|
||||
{
|
||||
mp_HighNode=0; this->ZCTypeInit::OnFini(mo_TypeData);
|
||||
mp_HighNode=0;
|
||||
}/*
|
||||
~ZCNode1()*/
|
||||
|
||||
@ -184,7 +183,7 @@ namespace ZNsMain
|
||||
|
||||
ZCNode& AddSubNode()
|
||||
{
|
||||
ZCNode* VP_CNode=(ZCNode*)&(**mo_CNodeList.AddTailDef());
|
||||
ZCNode* VP_CNode=(ZCNode*)&(*mo_CNodeList.AddTailDef());
|
||||
|
||||
VP_CNode->mp_HighNode=(ZCNode*)this; return *VP_CNode ;
|
||||
}/*
|
||||
@ -265,7 +264,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
template<typename TViewClass> ZNsMain::ZNsEnum::ZERun IterPreOrder
|
||||
(TViewClass& AR_CViewClass, TypeSize AI_StartDepth=0, TypeSize AI_NodeIndex=0)
|
||||
/*##############################################################*/
|
||||
################################################################*/
|
||||
|
||||
template<typename TViewClass> ZNsMain::ZNsEnum::ZERun IterPostOrder
|
||||
( TViewClass& AR_CViewClass, TypeSize AI_StartDepth=0, TypeSize AI_NodeIndex=0 )
|
||||
@ -319,13 +318,14 @@ namespace ZNsMain
|
||||
}/*
|
||||
template<typename TViewClass> ZNsMain::ZNsEnum::ZERun IterPostOrder
|
||||
(TViewClass& AR_CViewClass, TypeSize AI_StartDepth=0, TypeSize AI_NodeIndex=0)
|
||||
/*###############################################################*/
|
||||
#################################################################*/
|
||||
|
||||
public:
|
||||
};/*
|
||||
class ZCNode1*/
|
||||
|
||||
class ZCNode2 : public ZCTypeInit
|
||||
|
||||
class ZCNode2
|
||||
{
|
||||
public :
|
||||
friend class ZCNodeInfo;
|
||||
@ -337,12 +337,12 @@ namespace ZNsMain
|
||||
|
||||
ZCNode2()
|
||||
{
|
||||
mp_HighNode=0; this->ZCTypeInit::OnInit(mo_TypeData);
|
||||
mp_HighNode=0;
|
||||
}/*
|
||||
ZCNode2()*/
|
||||
~ZCNode2()
|
||||
{
|
||||
mp_HighNode=0; this->ZCTypeInit::OnFini(mo_TypeData);
|
||||
mp_HighNode=0;
|
||||
}/*
|
||||
~ZCNode2()*/
|
||||
|
||||
@ -360,7 +360,7 @@ namespace ZNsMain
|
||||
|
||||
ZCNode& AddSubNode()
|
||||
{
|
||||
ZCNode* VP_CNode=(ZCNode*)&(**mo_CNodeList.AddTailDef());
|
||||
ZCNode* VP_CNode=(ZCNode*)&(*mo_CNodeList.AddTailDef());
|
||||
|
||||
VP_CNode->mp_HighNode=(ZCNode*)this; return *VP_CNode ;
|
||||
}/*
|
||||
@ -459,7 +459,6 @@ namespace ZNsMain
|
||||
public:
|
||||
};/*
|
||||
template< typename TType ,
|
||||
typename TTypeInit =ZNsMain::ZtCInit<TType>,
|
||||
typename TTypeTreeData=ZNsType::ZtCTypeTreeData<long>
|
||||
>
|
||||
class ZtCTreeData #############################################*/
|
||||
@ -471,6 +470,7 @@ namespace ZNsMain
|
||||
■ class ZtCTreeData 예제 -- 2015-08-14 14:00
|
||||
|
||||
#include <iostream>
|
||||
#include "ZCppMain/ZtCStringEx.H"
|
||||
#include "ZCppMain/ZtCTreeData.H"
|
||||
|
||||
using namespace std ;
|
||||
@ -636,7 +636,7 @@ namespace ZNsMain
|
||||
|
||||
ZCNode& AddSubNode()
|
||||
{
|
||||
ZCNode* VP_CNode=(ZCNode*)&(**mo_CNodeList.AddTailDef());
|
||||
ZCNode* VP_CNode=(ZCNode*)&(*mo_CNodeList.AddTailDef());
|
||||
|
||||
VP_CNode->mp_HighNode=(ZCNode*)this; return *VP_CNode ;
|
||||
}/*
|
||||
@ -859,7 +859,7 @@ namespace ZNsMain
|
||||
ZCNode& AddSubNode()
|
||||
{
|
||||
ZCNode* VP_CNode=(ZCNode*)&
|
||||
( **mo_CNodeList.AddTailDef() );
|
||||
( *mo_CNodeList.AddTailDef() );
|
||||
|
||||
VP_CNode->mp_HighNode=(ZCNode*)this; return *VP_CNode;
|
||||
}/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
|
||||
#include "ZCppMain/ZMainCGI.H"
|
||||
|
||||
@ -59,12 +59,12 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
<EFBFBD><EFBFBD> cigwin <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZMainCGI_000_EnvSet.exe ZMainCGI_000_EnvSet.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZMainCGI_000_EnvSet_D.exe ZMainCGI_000_EnvSet.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
<EFBFBD><EFBFBD> mingw <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -o ZMainCGI_000_EnvSet_mw.exe ZMainCGI_000_EnvSet.cpp -I../ -lWs2_32
|
||||
g++.exe -o ZMainCGI_000_EnvSet_mw_D.exe ZMainCGI_000_EnvSet.cpp -I../ -lWs2_32 -D_DEBUG
|
||||
@ -87,10 +87,10 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
<EFBFBD><EFBFBD> Linux <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o ZMainCGI_000_EnvSet.exe ZMainCGI_000_EnvSet.cpp -I../
|
||||
g++ -std=c++98 -o ZMainCGI_000_EnvSet_D.exe ZMainCGI_000_EnvSet.cpp -I../ -D_DEBUG
|
||||
g++ -std=c++98 -o ZMainCGI_000_EnvSet.exe ZMainCGI_000_EnvSet.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++ -std=c++98 -o ZMainCGI_000_EnvSet_D.exe ZMainCGI_000_EnvSet.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
@ -125,7 +125,7 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
■ 실행
|
||||
|
||||
./ZMainCGI_000_EnvSet.exe
|
||||
./ZMainCGI_000_EnvSet_D.exe
|
||||
|
219
ZCppMainTest/ZftMakeTuple_000.cpp
Normal file
219
ZCppMainTest/ZftMakeTuple_000.cpp
Normal file
@ -0,0 +1,219 @@
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include "ZCppMain/ZCStringStd.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
template<typename TDummy=void*> class ZtCExamTuple_000
|
||||
{
|
||||
public:
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
ZCStringStd VO_BuffCStr("myBuff") ;
|
||||
ZTypInt VI_NowCnt = 0 ;
|
||||
|
||||
cout<<"# __cplusplus : "<<__cplusplus<<endl;
|
||||
|
||||
#if defined(__CPLUSPLUS_VER__) && __CPLUSPLUS_VER__<=199800
|
||||
|
||||
cout<<"# Use C++ 98 Spec"<<endl;
|
||||
|
||||
ZtStTuple<>
|
||||
myt0 = ZftMakeTuple();
|
||||
ZtStTuple<int>
|
||||
myt1 = ZftMakeTuple(1);
|
||||
ZtStTuple<int, int>
|
||||
myt2 = ZftMakeTuple(1, 34);
|
||||
ZtStTuple<int, int, char>
|
||||
myt3 = ZftMakeTuple(1, 34, 'C');
|
||||
ZtStTuple<int, int, char, ZCStringStd&>
|
||||
myt4 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr));
|
||||
ZtStTuple<int, int, char, ZCStringStd&, bool>
|
||||
myt5 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true);
|
||||
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*>
|
||||
myt6 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB");
|
||||
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double>
|
||||
myt7 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34));
|
||||
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double, float>
|
||||
myt8 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43));
|
||||
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double, float, ZCStringStd&>
|
||||
myt9 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr));
|
||||
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double, float, ZCStringStd&, int&>
|
||||
myt10= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt));
|
||||
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double, float, ZCStringStd&, int&, long>
|
||||
myt11= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt), (long)20250906);
|
||||
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double, float, ZCStringStd&, int&, long, wchar_t>
|
||||
myt12= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt), (long)20250906, wchar_t(0));
|
||||
#else
|
||||
cout<<"# Use auto keyword for ZtStTuple<> variable"<<endl;
|
||||
|
||||
auto myt0 = ZftMakeTuple();
|
||||
auto myt1 = ZftMakeTuple(1);
|
||||
auto myt2 = ZftMakeTuple(1, 34);
|
||||
auto myt3 = ZftMakeTuple(1, 34, 'C');
|
||||
auto myt4 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr));
|
||||
auto myt5 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true);
|
||||
auto myt6 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB");
|
||||
auto myt7 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34));
|
||||
auto myt8 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43));
|
||||
auto myt9 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr));
|
||||
auto myt10= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt));
|
||||
auto myt11= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt), (long)20250906);
|
||||
auto myt12= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt), (long)20250906, wchar_t(0));
|
||||
#endif
|
||||
|
||||
myt10._10 = 1200;
|
||||
myt11._10 += 1200;
|
||||
|
||||
// 아래 2개 출력이 같아야 한다.
|
||||
cout<<myt10._10<<endl;
|
||||
cout<<VI_NowCnt<<endl;
|
||||
|
||||
cout<<"_1 type : "<<typeid(myt12._1 ).name()<<endl;
|
||||
cout<<" value: "<< myt12._1 <<endl;
|
||||
cout<<"_2 type : "<<typeid(myt12._2 ).name()<<endl;
|
||||
cout<<" value: "<< myt12._2 <<endl;
|
||||
cout<<"_3 type : "<<typeid(myt12._3 ).name()<<endl;
|
||||
cout<<" value: "<< myt12._3 <<endl;
|
||||
cout<<"_4 type : "<<typeid(myt12._4 ).name()<<endl;
|
||||
cout<<" value: "<< myt12._4 <<endl;
|
||||
cout<<"_5 type : "<<typeid(myt12._5 ).name()<<endl;
|
||||
cout<<" value: "<< myt12._5 <<endl;
|
||||
cout<<"_6 type : "<<typeid(myt12._6 ).name()<<endl;
|
||||
cout<<" value: "<< myt12._6 <<endl;
|
||||
cout<<"_7 type : "<<typeid(myt12._7 ).name()<<endl;
|
||||
cout<<" value: "<< myt12._7 <<endl;
|
||||
cout<<"_8 type : "<<typeid(myt12._8 ).name()<<endl;
|
||||
cout<<" value: "<< myt12._8 <<endl;
|
||||
cout<<"_9 type : "<<typeid(myt12._9 ).name()<<endl;
|
||||
cout<<" value: "<< myt12._9 <<endl;
|
||||
cout<<"_10 type : "<<typeid(myt12._10).name()<<endl;
|
||||
cout<<" value: "<< myt12._10 <<endl;
|
||||
cout<<"_11 type : "<<typeid(myt12._11).name()<<endl;
|
||||
cout<<" value: "<< myt12._11 <<endl;
|
||||
cout<<"_12 type : "<<typeid(myt12._12).name()<<endl;
|
||||
cout<<" value: "<< myt12._12 <<endl;
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
|
||||
public:
|
||||
};/*
|
||||
template<typename TDummy=void*> class ZtCExamTuple_000*/
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::
|
||||
|
||||
ZtCExamTuple_000<>::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZftMakeTuple_000.exe ZftMakeTuple_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZftMakeTuple_000_D.exe ZftMakeTuple_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -std=c++98 -o ZftMakeTuple_000_mw_98.exe ZftMakeTuple_000.cpp -I../ -D__CPLUSPLUS_VER__=199800
|
||||
g++.exe -std=c++98 -o ZftMakeTuple_000_mw_98_D.exe ZftMakeTuple_000.cpp -I../ -D__CPLUSPLUS_VER__=199800 -D_DEBUG
|
||||
|
||||
g++.exe -o ZftMakeTuple_000_mw.exe ZftMakeTuple_000.cpp -I../
|
||||
g++.exe -o ZftMakeTuple_000_mw_D.exe ZftMakeTuple_000.cpp -I../ -D_DEBUG
|
||||
|
||||
./ZftMakeTuple_000_mw.exe
|
||||
./ZftMakeTuple_000_mw_D.exe
|
||||
|
||||
./ZftMakeTuple_000_mw_98.exe
|
||||
./ZftMakeTuple_000_mw_98_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
//g++ -std=c++98 -o ZftMakeTuple_000.exe ZftMakeTuple_000.cpp -I../ -lpthread
|
||||
//g++ -std=c++98 -o ZftMakeTuple_000_D.exe ZftMakeTuple_000.cpp -I../ -lpthread -D_DEBUG
|
||||
|
||||
g++ -o ZftMakeTuple_000.exe ZftMakeTuple_000.cpp -I../
|
||||
g++ -o ZftMakeTuple_000_D.exe ZftMakeTuple_000.cpp -I../ -D_DEBUG
|
||||
|
||||
g++ -o ZftMakeTuple_000_98.exe ZftMakeTuple_000.cpp -I../ -D__CPLUSPLUS_VER__=199800
|
||||
g++ -o ZftMakeTuple_000_98_D.exe ZftMakeTuple_000.cpp -I../ -D__CPLUSPLUS_VER__=199800 -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
■ 실행
|
||||
|
||||
./ZftMakeTuple_000.exe
|
||||
./ZftMakeTuple_000_D.exe
|
||||
|
||||
./ZftMakeTuple_000_98.exe
|
||||
./ZftMakeTuple_000_98_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
@ -190,7 +190,7 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cigwin 컴파일
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCArray_000.exe ZtCArray_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCArray_000_D.exe ZtCArray_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
@ -218,8 +218,8 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o ZtCArray_000.exe ZtCArray_000.cpp -I../
|
||||
g++ -std=c++98 -o ZtCArray_000_D.exe ZtCArray_000.cpp -I../ -D_DEBUG
|
||||
g++ -std=c++98 -o ZtCArray_000.exe ZtCArray_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++ -std=c++98 -o ZtCArray_000_D.exe ZtCArray_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
|
969
ZCppMainTest/ZtCBaseList_000.cpp
Normal file
969
ZCppMainTest/ZtCBaseList_000.cpp
Normal file
@ -0,0 +1,969 @@
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include "ZCppMain/ZtCStringEx.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain ;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
template<typename TDummy=void*> class ZtCExamCList
|
||||
{
|
||||
public:
|
||||
|
||||
class CHelpObj
|
||||
{
|
||||
public:
|
||||
|
||||
CHelpObj()
|
||||
{
|
||||
cout<<"* CHelpObj()"<<endl;
|
||||
}
|
||||
|
||||
CHelpObj(const CHelpObj& rhs)
|
||||
{
|
||||
cout<<"* CHelpObj(const CHelpObj& rhs)"<<endl;
|
||||
}
|
||||
|
||||
public:
|
||||
};/*
|
||||
class CHelpObj*/
|
||||
|
||||
|
||||
struct StFunctor
|
||||
{
|
||||
static void ShowElement(int ArgiValue){cout<<"#1 Value="<<ArgiValue<<endl;}
|
||||
};
|
||||
struct StFunctor2
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj)
|
||||
{cout<<"#2 Value="<<ArgiValue<<", CHelpObj Addr=None"<<" With CHelpObj"<<endl;}
|
||||
};
|
||||
struct StFunctor3
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj)
|
||||
{cout<<"#3 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Ref"<<endl;}
|
||||
};
|
||||
struct StFunctor4
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj)
|
||||
{cout<<"#4 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj in Ptr"<<endl;}
|
||||
};
|
||||
struct StFunctor5
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj, CHelpObj& AR_CHelpObj2)
|
||||
{cout<<"#5 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Ref 2"<<endl;}
|
||||
};
|
||||
struct StFunctor6
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj, CHelpObj AO_CHelpObj2)
|
||||
{cout<<"#6 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Half Ref"<<endl;}
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
typedef ZtCStringBase<char> CStringBase ;
|
||||
typedef const CStringBase CStringBaseC;
|
||||
|
||||
/* 아래 자료형에 대해, CStringBase::Fetch() 호출 여부 실험.
|
||||
|
||||
ZtCBaseList<CStringBase&, CStringBase &>
|
||||
ZtCBaseList<CStringBase&, CStringBaseC&>
|
||||
|
||||
*/
|
||||
typedef ZtCBaseList
|
||||
<CStringBase, CStringBase &> CStringList1 ;
|
||||
typedef ZtCBaseList
|
||||
<CStringBase, CStringBaseC&> CStringList2 ;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
class ZCBaseListEx10 : public ZtCBaseList
|
||||
<
|
||||
CStringBase, CStringBase&, ZCAllocator, ZTypLong
|
||||
, ZNsMain::ZtCMoveObj <CStringBase, CStringBase&, true>
|
||||
, ZNsType::ZtCTypeCRTP<ZCBaseListEx10, true>
|
||||
>
|
||||
{
|
||||
public :
|
||||
|
||||
typedef ZtCBaseList ///////////////////////////////////////////////////////
|
||||
<
|
||||
CStringBase, CStringBase&, ZCAllocator, ZTypLong
|
||||
, ZNsMain::ZtCMoveObj <CStringBase, CStringBase&, true>
|
||||
, ZNsType::ZtCTypeCRTP<ZCBaseListEx10, true>
|
||||
>
|
||||
ZCBaseList; ///////////////////////////////////////////////////////////////
|
||||
|
||||
friend class ZtCBaseList //////////////////////////////////////////////////
|
||||
<
|
||||
CStringBase, CStringBase&, ZCAllocator, ZTypLong
|
||||
, ZNsMain::ZtCMoveObj <CStringBase, CStringBase&, true>
|
||||
, ZNsType::ZtCTypeCRTP<ZCBaseListEx10, true>
|
||||
>;
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*****************************************************************************/
|
||||
typedef typename ZCBaseList::ZCLink ZCLink ;
|
||||
/*****************************************************************************/
|
||||
typedef typename ZCBaseList::iterator iterator ;
|
||||
typedef typename ZCBaseList::const_iterator const_iterator;
|
||||
/*****************************************************************************/
|
||||
|
||||
public :
|
||||
|
||||
_VT_ ZTypLong capacity() const
|
||||
{
|
||||
cout<<"[ZCBaseListEx10 : capacity()]"; return 0;
|
||||
}/*
|
||||
_VT_ ZTypLong capacity() const*/
|
||||
|
||||
_VT_ ZTypLong size_free() const
|
||||
{
|
||||
cout<<"[ZCBaseListEx10 : size_free()]"; return 0;
|
||||
}/*
|
||||
_VT_ ZTypLong size_free() const*/
|
||||
|
||||
private:
|
||||
|
||||
_VT_ ZCLink* SendFreeOut() const
|
||||
{
|
||||
cout<<"** ZCBaseListEx10 : SendFreeOut()"<<endl;
|
||||
|
||||
return this->ZCBaseList::NewLink();
|
||||
}/*
|
||||
_VT_ ZCLink* SendFreeOut() const*/
|
||||
|
||||
_VT_ ZCLink* SendFreeOut(CStringBase& AO_ArgData) const
|
||||
{
|
||||
cout<<"** ZCBaseListEx10 : SendFreeOut(TypeArg)"<<endl;
|
||||
|
||||
return this->ZCBaseList::NewLink(AO_ArgData);
|
||||
}/*
|
||||
_VT_ ZCLink* SendFreeOut(CStringBase& AO_ArgData) const*/
|
||||
|
||||
_VT_ void SendFreeOut
|
||||
(ZTypLong AL_NeedCnt, ZCLink*& APR_HeadLink, ZCLink*& APR_TailLink) const
|
||||
{
|
||||
cout<<"** ZCBaseListEx10 : SendFreeOut("<<AL_NeedCnt<<", ZCLink*&, ZCLink*&)"<<endl;
|
||||
|
||||
this->ZCBaseList::NewLink(AL_NeedCnt, APR_HeadLink, APR_TailLink);
|
||||
}
|
||||
|
||||
_VT_ void SendFreeOutCopy /*///////////////////////*/
|
||||
(
|
||||
ZCLink* AP_LinkOrgin, ZTypLong AL_FarNum ,
|
||||
ZCLink*& APR_HeadCopy, ZCLink*& APR_TailCopy
|
||||
) const
|
||||
/////////////////////////////////////////////////////
|
||||
{
|
||||
cout<<"** ZCBaseListEx10 : SendFreeOut(ZCLink*, "<<AL_FarNum<<", ZCLink*&, ZCLink*&)"<<endl;
|
||||
|
||||
this->ZCBaseList::NewLinkCopy(AP_LinkOrgin, AL_FarNum, APR_HeadCopy, APR_TailCopy);
|
||||
}
|
||||
|
||||
_VT_ void RecvFreeIn(ZCLink* AP_DelLink)
|
||||
{
|
||||
cout<<"** ZCBaseListEx10 : RecvFreeIn(AP_DelLink)"<<endl;
|
||||
|
||||
this->ZCBaseList::DelLink(AP_DelLink);
|
||||
}/*
|
||||
_VT_ void RecvFreeIn(ZCLink* AP_DelLink)*/
|
||||
|
||||
_VT_ void RecvFreeIn //////////////////////////////////
|
||||
(
|
||||
ZTypLong AL_CutCnt ,
|
||||
ZCLink* AP_CutHead,
|
||||
ZCLink* AP_CutTail
|
||||
)
|
||||
///////////////////////////////////////////////////////
|
||||
{
|
||||
cout<<"** ZCBaseListEx10 : RecvFreeIn("<<AL_CutCnt<<", AP_CutHead, AP_CutTail)"<<endl;
|
||||
|
||||
this->ZCBaseList::DelLink(AL_CutCnt, AP_CutHead, AP_CutTail);
|
||||
}
|
||||
|
||||
private:
|
||||
};/*
|
||||
class ZCBaseListEx10 : public ZtCBaseList*/
|
||||
|
||||
|
||||
class ZCBaseListEx11 : public ZtCBaseList
|
||||
<
|
||||
CStringBase, CStringBase&, ZCAllocator, ZTypLong
|
||||
, ZNsMain::ZtCMoveObj <CStringBase, CStringBase&, true>
|
||||
, ZNsType::ZtCTypeCRTP<ZCBaseListEx11, false>
|
||||
>
|
||||
{
|
||||
public :
|
||||
|
||||
typedef ZtCBaseList ///////////////////////////////////////////////////////
|
||||
<
|
||||
CStringBase, CStringBase&, ZCAllocator, ZTypLong
|
||||
, ZNsMain::ZtCMoveObj <CStringBase, CStringBase&, true>
|
||||
, ZNsType::ZtCTypeCRTP<ZCBaseListEx11, false>
|
||||
>
|
||||
ZCBaseList; ///////////////////////////////////////////////////////////////
|
||||
|
||||
friend class ZtCBaseList //////////////////////////////////////////////////
|
||||
<
|
||||
CStringBase, CStringBase&, ZCAllocator, ZTypLong
|
||||
, ZNsMain::ZtCMoveObj <CStringBase, CStringBase&, true>
|
||||
, ZNsType::ZtCTypeCRTP<ZCBaseListEx11, false>
|
||||
>;
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
typedef typename ZCBaseList::ZCLink ZCLink ;
|
||||
/*****************************************************************************/
|
||||
typedef typename ZCBaseList::iterator iterator ;
|
||||
typedef typename ZCBaseList::const_iterator const_iterator;
|
||||
/*****************************************************************************/
|
||||
public :
|
||||
|
||||
_VT_ ZTypLong capacity() const
|
||||
{
|
||||
cout<<"[ZCBaseListEx11 : capacity()]"; return 0;
|
||||
}/*
|
||||
_VT_ ZTypLong capacity() const*/
|
||||
|
||||
_VT_ ZTypLong size_free() const
|
||||
{
|
||||
cout<<"[ZCBaseListEx11 : size_free()]"; return 0;
|
||||
}/*
|
||||
_VT_ ZTypLong size_free() const*/
|
||||
|
||||
private:
|
||||
|
||||
_VT_ ZCLink* SendFreeOut()
|
||||
{
|
||||
cout<<"** ZCBaseListEx11 : SendFreeOut()"<<endl;
|
||||
|
||||
return this->ZCBaseList::NewLink();
|
||||
}/*
|
||||
_VT_ ZCLink* SendFreeOut()*/
|
||||
|
||||
_VT_ ZCLink* SendFreeOut(CStringBase& AO_ArgData)
|
||||
{
|
||||
cout<<"** ZCBaseListEx11 : SendFreeOut(CStringBase&)"<<endl;
|
||||
|
||||
return this->ZCBaseList::NewLink(AO_ArgData);
|
||||
}/*
|
||||
_VT_ ZCLink* SendFreeOut(CStringBase& AO_ArgData)*/
|
||||
|
||||
_VT_ void SendFreeOut
|
||||
(ZTypLong AL_NeedCnt, ZCLink*& APR_HeadLink, ZCLink*& APR_TailLink)
|
||||
{
|
||||
cout<<"** ZCBaseListEx11 : SendFreeOut("<<AL_NeedCnt<<", ZCLink*&, ZCLink*&)"<<endl;
|
||||
|
||||
this->ZCBaseList::NewLink(AL_NeedCnt, APR_HeadLink, APR_TailLink);
|
||||
}
|
||||
|
||||
_VT_ void SendFreeOutCopy /*///////////////////////*/
|
||||
(
|
||||
ZCLink* AP_LinkOrgin, ZTypLong AL_FarNum ,
|
||||
ZCLink*& APR_HeadCopy, ZCLink*& APR_TailCopy
|
||||
)
|
||||
/////////////////////////////////////////////////////
|
||||
{
|
||||
cout<<"** ZCBaseListEx11 : SendFreeOut(ZCLink*, "<<AL_FarNum<<", ZCLink*&, ZCLink*&)"<<endl;
|
||||
|
||||
this->ZCBaseList::NewLinkCopy(AP_LinkOrgin, AL_FarNum, APR_HeadCopy, APR_TailCopy);
|
||||
}
|
||||
|
||||
_VT_ void RecvFreeIn(ZCLink* AP_DelLink)
|
||||
{
|
||||
cout<<"** ZCBaseListEx11 : RecvFreeIn(AP_DelLink)"<<endl;
|
||||
|
||||
this->ZCBaseList::DelLink(AP_DelLink);
|
||||
}/*
|
||||
_VT_ void RecvFreeIn(ZCLink* AP_DelLink)*/
|
||||
|
||||
_VT_ void RecvFreeIn //////////////////////////////////
|
||||
(
|
||||
ZTypLong AL_CutCnt ,
|
||||
ZCLink* AP_CutHead,
|
||||
ZCLink* AP_CutTail
|
||||
)
|
||||
///////////////////////////////////////////////////////
|
||||
{
|
||||
cout<<"** ZCBaseListEx11: RecvFreeIn("<<AL_CutCnt<<", AP_CutHead, AP_CutTail)"<<endl;
|
||||
|
||||
this->ZCBaseList::DelLink(AL_CutCnt, AP_CutHead, AP_CutTail);
|
||||
}
|
||||
|
||||
private:
|
||||
};/*
|
||||
class ZCBaseListEx11 : public ZtCBaseList*/
|
||||
|
||||
|
||||
typedef typename ZCBaseListEx10::ZCLink ZCLink10;
|
||||
typedef typename ZCBaseListEx11::ZCLink ZCLink11;
|
||||
|
||||
|
||||
static void ShowDataInNode(const CStringBase& AR_Data, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
cout<<++ARRI_CallCnt<<"* Data : "<<AR_Data<<endl;
|
||||
}/*
|
||||
static void ShowDataInNode(const CStringBase& AR_Data, ZTypLong& ARRI_CallCnt)*/
|
||||
|
||||
|
||||
static void Append10(ZCLink10& AR_CLink)
|
||||
{
|
||||
(*AR_CLink).append("__");
|
||||
}/*
|
||||
static void Append10(ZCLink10& AR_CLink)*/
|
||||
|
||||
|
||||
static void ShowNode10(ZCLink10& AR_CLink, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node10 Prev : "<<*(AR_CLink-1)<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node10 Curr : " <<*(AR_CLink )<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node10 Prev : "<<*(AR_CLink+1)<<endl;
|
||||
}/*
|
||||
static void ShowNode10(ZCLink10& AR_CLink, ZTypLong& ARRI_CallCnt)*/
|
||||
static void ShowNode11(ZCLink11& AR_CLink, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node11 Prev : "<<*(AR_CLink-1)<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node11 Curr : " <<*(AR_CLink )<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node11 Prev : "<<*(AR_CLink+1)<<endl;
|
||||
}/*
|
||||
static void ShowNode11(ZCLink11& AR_CLink, ZTypLong& ARRI_CallCnt)*/
|
||||
|
||||
|
||||
static void ShowNode10_2(ZCLink10& AR_CLink, ostream& AR_OS, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node10_2 Prev : "<<*(AR_CLink-1)<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node10_2 Curr : " <<*(AR_CLink )<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node10_2 Prev : "<<*(AR_CLink+1)<<endl;
|
||||
}/*
|
||||
static void ShowNode10_2(ZCLink10& AR_CLink, ostream& AR_OS, ZTypLong& ARRI_CallCnt)*/
|
||||
static void ShowNode11_2(ZCLink11& AR_CLink, ostream& AR_OS, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node11_2 Prev : "<<*(AR_CLink-1)<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node11_2 Curr : " <<*(AR_CLink )<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node11_2 Prev : "<<*(AR_CLink+1)<<endl;
|
||||
}/*
|
||||
static void ShowNode11_2(ZCLink11& AR_CLink, ostream& AR_OS, ZTypLong& ARRI_CallCnt)*/
|
||||
|
||||
|
||||
static void ShowNode10_3(ZCLink10& AR_CLink, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
cout<<++ARRI_CallCnt<<" * Node10 Curr : " <<*(AR_CLink )<<endl;
|
||||
}/*
|
||||
static void ShowNode10_3(ZCLink10& AR_CLink, ZTypLong& ARRI_CallCnt)*/
|
||||
static void ShowNode11_3(ZCLink11& AR_CLink, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
cout<<++ARRI_CallCnt<<" * Node11 Curr : " <<*(AR_CLink )<<endl;
|
||||
}/*
|
||||
static void ShowNode11_3(ZCLink11& AR_CLink, ZTypLong& ARRI_CallCnt)*/
|
||||
|
||||
|
||||
class ZCTypeView
|
||||
{
|
||||
public:
|
||||
|
||||
template<typename TTypChain> void OnMeetType()
|
||||
{
|
||||
cout<<TTypChain::ZETypeNo<<" : "<<typeid(typename TTypChain::TypeData).name()<<endl;
|
||||
}
|
||||
template<typename TTypChain, typename TTypHelp> void OnMeetType(int& AR_CallNo)
|
||||
{
|
||||
cout<<"* Call No="<<++AR_CallNo<<" : "<<TTypChain::ZETypeNo<<" : "<<typeid(typename TTypChain::TypeData).name()<<endl;
|
||||
}
|
||||
};/*
|
||||
class ZCTypeView*/
|
||||
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
typedef ZtCTypeChain
|
||||
<
|
||||
double , ZtCTypeChain<
|
||||
int , ZtCTypeChain<
|
||||
wchar_t, ZtCTypeChain<
|
||||
char ,
|
||||
|
||||
ZCEmpty > > >
|
||||
> ZCTypeChain; ZCTypeView VO_ZCTypeView;
|
||||
|
||||
int VI_CallNo = 0;
|
||||
|
||||
cout<<"*** tmpl chain size = "<<ZCTypeChain::Size()<<endl;
|
||||
|
||||
ZftIterTypeChainTail<ZCTypeChain, ZCTypeView&>(VO_ZCTypeView);
|
||||
|
||||
cout<<"************************************"<<endl;
|
||||
ZCTypeChain::ZtCIterChain<ZCTypeView>::IterHead(VO_ZCTypeView);
|
||||
cout<<"************************************"<<endl;
|
||||
ZCTypeChain::ZtCIterChain<ZCTypeView>::IterTail(VO_ZCTypeView);
|
||||
|
||||
ZftIterTypeChainHead<ZCTypeChain, ZCTypeView&, int&>
|
||||
( VO_ZCTypeView, (VI_CallNo = 0) );
|
||||
cout<<"************************************"<<endl;
|
||||
ZftIterTypeChainTail<ZCTypeChain, ZCTypeView&, int&>
|
||||
( VO_ZCTypeView, (VI_CallNo = 0) );
|
||||
|
||||
cout<<"************************************"<<endl;
|
||||
ZCTypeChain::ZtCIterChain<ZCTypeView>::
|
||||
IterHead(VO_ZCTypeView, ZftMCP(VI_CallNo=0));
|
||||
cout<<"************************************"<<endl;
|
||||
ZCTypeChain::ZtCIterChain<ZCTypeView>::
|
||||
IterTail(VO_ZCTypeView, ZftMCP(VI_CallNo=0));
|
||||
|
||||
|
||||
ZTypLong VI_CallCnt=0;
|
||||
|
||||
CStringBase VO_CStringBase;
|
||||
CStringList1 VO_ListOfStr1 ;
|
||||
CStringList2 VO_ListOfStr2 ;
|
||||
|
||||
VO_ListOfStr1.AddTail(VO_CStringBase("data 10"));
|
||||
VO_ListOfStr1.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr1.AddTail(VO_CStringBase("data 20"));
|
||||
VO_ListOfStr1.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr1.AddTail(VO_CStringBase("data 04"));
|
||||
|
||||
cout<<"# VO_CStringBase data : " <<VO_CStringBase<<endl;
|
||||
|
||||
cout<<"# 1th IterElement ####" <<endl;
|
||||
{
|
||||
VO_ListOfStr1.IterElement(&ShowDataInNode, ZftMCP(VI_CallCnt=0));
|
||||
}
|
||||
/*///////////////////////////////////*/
|
||||
|
||||
|
||||
cout<<endl;
|
||||
|
||||
|
||||
VO_ListOfStr2.AddTail(VO_CStringBase("data 10"));
|
||||
VO_ListOfStr2.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr2.AddTail(VO_CStringBase("data 20"));
|
||||
VO_ListOfStr2.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr2.AddTail(VO_CStringBase("data 04"));
|
||||
|
||||
cout<<"# VO_CStringBase data : " <<VO_CStringBase<<endl;
|
||||
|
||||
cout<<"# 2th IterElement ####" <<endl;
|
||||
{
|
||||
VO_ListOfStr2.IterElement(&ShowDataInNode, ZftMCP(VI_CallCnt=0));
|
||||
}
|
||||
/*///////////////////////////////////*/
|
||||
|
||||
|
||||
typedef ZtCBaseList<int> CIntList;
|
||||
|
||||
CHelpObj VO_CHelpObj;
|
||||
CIntList VO_CIntList;
|
||||
|
||||
VO_CIntList.AddTail(10);
|
||||
VO_CIntList.AddTail(20);
|
||||
VO_CIntList.AddTail(30);
|
||||
VO_CIntList.AddTail(40);
|
||||
|
||||
cout<<endl<<"#### Show CIntList Element ####"<<endl<<endl;
|
||||
|
||||
VO_CIntList.IterElement(StFunctor ::ShowElement);
|
||||
VO_CIntList.IterElement(StFunctor2::ShowElement, VO_CHelpObj );
|
||||
VO_CIntList.IterElement(StFunctor3::ShowElement, ZftMCR(VO_CHelpObj) );
|
||||
VO_CIntList.IterElement(StFunctor4::ShowElement, ZftMCP(VO_CHelpObj) );
|
||||
VO_CIntList.IterElement(StFunctor5::ShowElement, ZftMCP(VO_CHelpObj), ZftMCP(VO_CHelpObj) );
|
||||
VO_CIntList.IterElement(StFunctor6::ShowElement, ZftMCP(VO_CHelpObj), VO_CHelpObj );
|
||||
|
||||
|
||||
cout<<endl<<"#### ZCBaseListEx10 and ZCBaseListEx11 ####"<<endl<<endl;
|
||||
|
||||
ZCBaseListEx10 VO_ZCBaseListEx10 ;
|
||||
ZCBaseListEx10 VO_ZCBaseListEx10_2;
|
||||
ZCBaseListEx11 VO_ZCBaseListEx11 ;
|
||||
|
||||
VO_CStringBase="";
|
||||
|
||||
VO_ZCBaseListEx10.AddTail(VO_CStringBase("data ex 10-1"));
|
||||
VO_ZCBaseListEx10.AddTail(VO_CStringBase("data ex 10-2"));
|
||||
|
||||
VO_ZCBaseListEx11.AddTail(VO_CStringBase("data ex 11-1"));
|
||||
VO_ZCBaseListEx11.AddTail(VO_CStringBase("data ex 11-2"));
|
||||
|
||||
cout<<endl<<"# VO_ZCBaseListEx10_2 = VO_ZCBaseListEx10"<<endl<<endl;
|
||||
|
||||
VO_ZCBaseListEx10_2 = VO_ZCBaseListEx10 ;
|
||||
VO_ZCBaseListEx10_2.IterElement(&ShowDataInNode, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
VO_ZCBaseListEx10.AddTail().Fetch(VO_CStringBase("data ex 10-3"));
|
||||
VO_ZCBaseListEx10.AddTail().Fetch(VO_CStringBase("data ex 10-4"));
|
||||
|
||||
cout<<endl<<"# VO_ZCBaseListEx10_2 = VO_ZCBaseListEx10 after VO_ZCBaseListEx10.AddTail() 2 times"<<endl<<endl;
|
||||
|
||||
VO_ZCBaseListEx10_2 = VO_ZCBaseListEx10 ;
|
||||
VO_ZCBaseListEx10_2.IterElement(&ShowDataInNode, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# VO_ZCBaseListEx10_2.AddHead(VO_ZCBaseListEx10)"<<endl<<endl;
|
||||
|
||||
VO_ZCBaseListEx10_2.AddHead(VO_ZCBaseListEx10) ;
|
||||
VO_ZCBaseListEx10_2.IterElemRev(&ShowDataInNode, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
cout<<endl<<"# VO_ZCBaseListEx10_2 : DeleteTail(2)"<<endl<<endl;
|
||||
|
||||
VO_ZCBaseListEx10_2.DeleteTail(2);
|
||||
VO_ZCBaseListEx10_2.IterElemRev(&ShowDataInNode, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
cout<<endl<<"# VO_ZCBaseListEx10_2 : DeleteHead(1)"<<endl<<endl;
|
||||
|
||||
VO_ZCBaseListEx10_2.DeleteHead(1);
|
||||
VO_ZCBaseListEx10_2.IterElement(&ShowDataInNode, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<"# VO_ZCBaseListEx10 : capacity()="<<VO_ZCBaseListEx10 .capacity()<<endl;
|
||||
cout<<"# VO_ZCBaseListEx10_2 : capacity()="<<VO_ZCBaseListEx10_2.capacity()<<endl;
|
||||
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10 , ZftMCP(VI_CallCnt=0));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_2, ZftMCP(cout), ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
cout<<endl<<"# show VO_ZCBaseListEx10 element"<<endl;
|
||||
|
||||
VO_ZCBaseListEx10 .IterElemLink(&ShowNode10, ZftMCP(VI_CallCnt=0));
|
||||
VO_ZCBaseListEx10_2.SendOutTail
|
||||
(*VO_ZCBaseListEx10_2.GetLinkPtr(2), VO_ZCBaseListEx10);
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2's 2th link to VO_ZCBaseListEx10's tail"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCBaseListEx10 .IterElemLink(&ShowNode10 , ZftMCP(VI_CallCnt=0));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_2, ZftMCP(cout), ZftMCP(VI_CallCnt=0));
|
||||
|
||||
VO_ZCBaseListEx10.IterElemLink(&Append10);
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCBaseListEx10 .IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_ZCBaseListEx10.SendRangeOutAfter
|
||||
(
|
||||
*VO_ZCBaseListEx10.GetLinkPtr(2)
|
||||
, *VO_ZCBaseListEx10.GetLinkPtr(3)
|
||||
, 2
|
||||
, VO_ZCBaseListEx10_2
|
||||
, VO_ZCBaseListEx10_2.GetLinkOpt(2)
|
||||
);
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10's 2~3th link to VO_ZCBaseListEx10_2's 2th link after"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCBaseListEx10 .IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2 = VO_ZCBaseListEx10"<<endl;
|
||||
|
||||
VO_ZCBaseListEx10_2 = VO_ZCBaseListEx10 ;
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCBaseListEx10 .IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10.SendRangeOutBefore(1th, 2th, 2, rhs, 1th)"<<endl;
|
||||
|
||||
VO_ZCBaseListEx10.SendRangeOutBefore
|
||||
(
|
||||
*VO_ZCBaseListEx10.GetLinkPtr(1)
|
||||
, *VO_ZCBaseListEx10.GetLinkPtr(2)
|
||||
, 2
|
||||
, VO_ZCBaseListEx10_2
|
||||
, VO_ZCBaseListEx10_2.GetLinkOpt(1)
|
||||
);
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCBaseListEx10 .IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10.CopyThis(RR(VO_ZCBaseListEx10_2))"<<endl;
|
||||
VO_ZCBaseListEx10.CopyThis(RR(VO_ZCBaseListEx10_2));
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCBaseListEx10 .IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLinkNext(1th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLinkNext(VO_ZCBaseListEx10_2.HeadRef());
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLinkNext(last)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLinkNext(VO_ZCBaseListEx10_2.TailRef());
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLinkNext(last-1)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLinkNext(VO_ZCBaseListEx10_2.TailRef(1));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2 : Iter Rev"<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLinkRev(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLinkPrev(2th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLinkPrev(VO_ZCBaseListEx10_2.HeadRef(1));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLinkPrev(last)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLinkPrev(VO_ZCBaseListEx10_2.TailRef());
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLink(1th, 4th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLink
|
||||
( VO_ZCBaseListEx10_2.HeadRef(), VO_ZCBaseListEx10_2.HeadRef(3) );
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLink(2th, 1th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLink
|
||||
( VO_ZCBaseListEx10_2.HeadRef(1), VO_ZCBaseListEx10_2.HeadRef() );
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLink(2th, 5th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLink
|
||||
( VO_ZCBaseListEx10_2.HeadRef(1), VO_ZCBaseListEx10_2.HeadRef(4) );
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLink(4th, 5th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLink
|
||||
( VO_ZCBaseListEx10_2.HeadRef(3), VO_ZCBaseListEx10_2.HeadRef(4) );
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLink(6th, 2th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLink
|
||||
( VO_ZCBaseListEx10_2.HeadRef(5), VO_ZCBaseListEx10_2.HeadRef(1) );
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLink(6th, 5th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLink
|
||||
( VO_ZCBaseListEx10_2.HeadRef(5), VO_ZCBaseListEx10_2.HeadRef(4) );
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.SwapLink(6th, 1th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.SwapLink
|
||||
( VO_ZCBaseListEx10_2.HeadRef(5), VO_ZCBaseListEx10_2.HeadRef() );
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkHead(2th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkHead( VO_ZCBaseListEx10_2.HeadRef(1));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkTail(1th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkTail( VO_ZCBaseListEx10_2.HeadRef());
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkAfter(1th, 6th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkAfter
|
||||
( VO_ZCBaseListEx10_2.HeadRef(), VO_ZCBaseListEx10_2.HeadOpt(5));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkBefore(5th, 1th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkBefore
|
||||
( VO_ZCBaseListEx10_2.HeadRef(4), VO_ZCBaseListEx10_2.HeadOpt());
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkAfter(1th, 2th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkAfter
|
||||
( VO_ZCBaseListEx10_2.HeadRef(), VO_ZCBaseListEx10_2.HeadOpt(1));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveRangeInAfter(1th~3th => 6th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveRangeInAfter
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef( ),
|
||||
VO_ZCBaseListEx10_2.HeadRef(2),
|
||||
VO_ZCBaseListEx10_2.HeadOpt(5)
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveRangeInBefore(4th~6th => 1th)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveRangeInBefore
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef(3),
|
||||
VO_ZCBaseListEx10_2.HeadRef(5),
|
||||
VO_ZCBaseListEx10_2.HeadOpt( )
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# VO_ZCBaseListEx10_2 for_it() show "<<endl;
|
||||
__for_it(ZCBaseListEx10, VO_ZCBaseListEx10_2, VO_Iter)
|
||||
{
|
||||
cout<<VO_Iter.GetPos()<<" : "<<*VO_Iter<<endl;
|
||||
}
|
||||
|
||||
cout<<endl<<"# VO_ZCBaseListEx10_2 for_it_r() show "<<endl;
|
||||
__for_it_r(ZCBaseListEx10, VO_ZCBaseListEx10_2, VO_Iter)
|
||||
{
|
||||
cout<<VO_Iter.GetPos()<<" : "<<*VO_Iter<<endl;
|
||||
}
|
||||
|
||||
cout<<endl<<"# VO_ZCBaseListEx10_2 for_itc() show "<<endl;
|
||||
__for_itc(ZCBaseListEx10, VO_ZCBaseListEx10_2, VO_Iter)
|
||||
{
|
||||
cout<<VO_Iter.GetPos()<<" : "<<*VO_Iter<<endl;
|
||||
}
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
_FOR_ITER_EASY_START0_C (VO_ZCBaseListEx10_2, VH_NowIter, i)
|
||||
{
|
||||
cout<<"# list10_2 const: "<<(i+1)<<" "<<VO_ZCBaseListEx10_2.ItD(VH_NowIter)<<endl;
|
||||
}
|
||||
_FOR_ITER_EASY_CLOSE0_C (VO_ZCBaseListEx10_2, VH_NowIter, i)
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
_FOR_ITER_EASY_START0_RC(VO_ZCBaseListEx10_2, VH_NowIter, i)
|
||||
{
|
||||
cout<<"# list10_2 rev const: "<<(i+1)<<" "<<VO_ZCBaseListEx10_2.ItD(VH_NowIter)<<endl;
|
||||
}
|
||||
_FOR_ITER_EASY_CLOSE0_RC(VO_ZCBaseListEx10_2, VH_NowIter, i)
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkIn(1th, 3th after)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkIn
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef( ),
|
||||
VO_ZCBaseListEx10_2.HeadRef(2),
|
||||
true
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkIn(3th, 6th after)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkIn
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef(2),
|
||||
VO_ZCBaseListEx10_2.HeadRef(5),
|
||||
true
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkIn(6th, 1th before)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkIn
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef(5),
|
||||
VO_ZCBaseListEx10_2.HeadRef( ),
|
||||
false
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkIn(1th, 6th after)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkIn
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef( ),
|
||||
VO_ZCBaseListEx10_2.HeadRef(5),
|
||||
true
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkIn(2th, 3th after)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkIn
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef(1),
|
||||
VO_ZCBaseListEx10_2.HeadRef(2),
|
||||
true
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkIn(2th, 3th before)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkIn
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef(1),
|
||||
VO_ZCBaseListEx10_2.HeadRef(2),
|
||||
false
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveLinkIn(2th, 1th before)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveLinkIn
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef(1),
|
||||
VO_ZCBaseListEx10_2.HeadRef( ),
|
||||
false
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveRangeIn(1th, 3th, 6th after)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveRangeIn
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef( ),
|
||||
VO_ZCBaseListEx10_2.HeadRef(2),
|
||||
VO_ZCBaseListEx10_2.HeadRef(5),
|
||||
true
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveRangeIn(5th, 6th, 1th before)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveRangeIn
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef(4),
|
||||
VO_ZCBaseListEx10_2.HeadRef(5),
|
||||
VO_ZCBaseListEx10_2.HeadRef( ),
|
||||
false
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
|
||||
cout<<endl<<"# after VO_ZCBaseListEx10_2.MoveRangeIn(2th, 3th, 4th after)"<<endl;
|
||||
VO_ZCBaseListEx10_2.MoveRangeIn
|
||||
(
|
||||
VO_ZCBaseListEx10_2.HeadRef(1),
|
||||
VO_ZCBaseListEx10_2.HeadRef(2),
|
||||
VO_ZCBaseListEx10_2.HeadRef(3),
|
||||
true
|
||||
);
|
||||
cout<<"*****************************************************"<<endl;
|
||||
VO_ZCBaseListEx10_2.IterElemLink(&ShowNode10_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
|
||||
public:
|
||||
};/*
|
||||
template<typename TDummy=void*> class ZtCExamCList*/
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::
|
||||
|
||||
ZtCExamCList<>::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCBaseList_000.exe ZtCBaseList_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCBaseList_000_D.exe ZtCBaseList_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -o ZtCBaseList_000_mw.exe ZtCBaseList_000.cpp -I../ -lWs2_32 -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++.exe -o ZtCBaseList_000_mw_D.exe ZtCBaseList_000.cpp -I../ -lWs2_32 -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
./ZtCBaseList_000_mw.exe
|
||||
./ZtCBaseList_000_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o ZtCBaseList_000.exe ZtCBaseList_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++ -std=c++98 -o ZtCBaseList_000_D.exe ZtCBaseList_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
■ 실행
|
||||
|
||||
./ZtCBaseList_000.exe
|
||||
./ZtCBaseList_000_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
256
ZCppMainTest/ZtCLinkList_000.cpp
Normal file
256
ZCppMainTest/ZtCLinkList_000.cpp
Normal file
@ -0,0 +1,256 @@
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "ZCppMain/ZtCLinkList.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain ;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
template<typename TDummy=void*> class ZtCExamCLinkList
|
||||
{
|
||||
public:
|
||||
typedef ZNsIFaceEx::ZtCLink<string, ZCEmpty> ZCLinkCStr ;
|
||||
typedef ZtCLinkList<ZCLinkCStr> ZCLinkStrList;
|
||||
typedef ZCLinkStrList::ZCLinkOpt ZCStrLinkOpt ;
|
||||
public:
|
||||
|
||||
|
||||
static void ShowNode0(ZCLinkCStr& AR_CLink, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node Curr : "<<(AR_CLink)()<<endl;
|
||||
}/*
|
||||
static void ShowNode0(ZCLinkCStr& AR_CLink, ZTypLong& ARRI_CallCnt)*/
|
||||
|
||||
static void ShowNode1(ZCLinkCStr& AR_CLink, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node Prev : "<<(AR_CLink-1)()<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node Curr : " <<(AR_CLink )()<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node Next : "<<(AR_CLink+1)()<<endl;
|
||||
}/*
|
||||
static void ShowNode1(ZCLinkCStr& AR_CLink, ZTypLong& ARRI_CallCnt)*/
|
||||
|
||||
|
||||
static void AppendEach(ZCLinkCStr& AR_CLink)
|
||||
{
|
||||
AR_CLink().append("_");
|
||||
}/*
|
||||
static void AppendEach(ZCLinkCStr& AR_CLink)*/
|
||||
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
ZTypLong VI_CallCnt = 0 ;
|
||||
ZCLinkStrList VO_ZCLinkStrLis1;
|
||||
ZCLinkStrList VO_ZCLinkStrLis2;
|
||||
ZCStrLinkOpt VO_StrLinkOpt = VO_ZCLinkStrLis1.GetObjOpt(1);
|
||||
|
||||
cout<<"# VO_StrLinkOpt.has_value()="<<VO_StrLinkOpt.has_value()<<endl;
|
||||
cout<<"# VO_StrLinkOpt.bool() ="<<bool(VO_StrLinkOpt) <<endl;
|
||||
|
||||
VO_ZCLinkStrLis1.AddTail()()=string("123");
|
||||
VO_ZCLinkStrLis1.AddTail()()=string("ABC");
|
||||
VO_ZCLinkStrLis1.AddTail()()=string("xyz");
|
||||
|
||||
VO_ZCLinkStrLis2.AddTail()()=string("Z01");
|
||||
VO_ZCLinkStrLis2.AddTail()()=string("Z02");
|
||||
VO_ZCLinkStrLis2.AddTail()()=string("Z03");
|
||||
|
||||
VO_StrLinkOpt = VO_ZCLinkStrLis1.GetObjOpt(1);
|
||||
|
||||
cout<<"# VO_StrLinkOpt.GetObjOpt(1) : has_value()="<<VO_StrLinkOpt.has_value()<<endl;
|
||||
cout<<"# VO_StrLinkOpt.GetObjOpt(1) : bool ()="<<bool(VO_StrLinkOpt) <<endl;
|
||||
|
||||
if(VO_StrLinkOpt.has_value())
|
||||
{
|
||||
cout<<"# value by VO_StrLinkOpt : "<<VO_StrLinkOpt.value()<<endl;
|
||||
cout<<"# value by VO_StrLinkOpt() : "<<VO_StrLinkOpt() <<endl;
|
||||
}/*
|
||||
if(VO_StrLinkOpt.has_value())*/
|
||||
|
||||
VO_StrLinkOpt = VO_ZCLinkStrLis1.GetTailOpt();
|
||||
|
||||
cout<<"# VO_StrLinkOpt.GetTailOpt() : has_value()="<<VO_StrLinkOpt.has_value()<<endl;
|
||||
cout<<"# VO_StrLinkOpt.GetTailOpt() : bool ()="<<bool(VO_StrLinkOpt) <<endl;
|
||||
|
||||
if(VO_StrLinkOpt.has_value())
|
||||
cout<<"# value by VO_StrLinkOpt : "<<VO_StrLinkOpt.value()<<endl;
|
||||
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode1, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_ZCLinkStrLis1.JoinHead(VO_ZCLinkStrLis2);
|
||||
|
||||
cout<<"# after VO_ZCLinkStrLis1.JoinHead(VO_ZCLinkStrLis2)"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCLinkStrLis2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode1, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_ZCLinkStrLis2 = VO_ZCLinkStrLis1 ;
|
||||
|
||||
cout<<"# after VO_ZCLinkStrLis2 = VO_ZCLinkStrLis1"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCLinkStrLis2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
VO_ZCLinkStrLis1.IterElement(&AppendEach);
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
VO_ZCLinkStrLis1.SendRangeOutAfter
|
||||
(
|
||||
VO_ZCLinkStrLis1.GetObjOpt(1).value()
|
||||
, VO_ZCLinkStrLis1.GetObjOpt(2).value()
|
||||
, 2
|
||||
, VO_ZCLinkStrLis2
|
||||
, VO_ZCLinkStrLis2.GetObjOpt(1)
|
||||
) ;
|
||||
cout<<"# after VO_ZCLinkStrLis1.SendRangeOutAfter(1th, 2th, 2, rhs, rhs's 1th)"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCLinkStrLis2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
VO_ZCLinkStrLis2.SendRangeOutBefore
|
||||
(
|
||||
VO_ZCLinkStrLis2.GetObjOpt(7).value()
|
||||
, VO_ZCLinkStrLis2.GetObjOpt(8).value()
|
||||
, 2
|
||||
, VO_ZCLinkStrLis1
|
||||
, VO_ZCLinkStrLis1.GetObjOpt(1)
|
||||
) ;
|
||||
cout<<"# after VO_ZCLinkStrLis2.SendRangeOutAfter(7th, 8th, 2, rhs, rhs's 1th)"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCLinkStrLis2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
|
||||
public:
|
||||
};/*
|
||||
template<typename TDummy=void*> class ZtCExamCLinkList*/
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::
|
||||
|
||||
ZtCExamCLinkList<>::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
<EFBFBD><EFBFBD> cygwin <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
// g++ -mno-cygwin -o ZtCLinkList_000.exe ZtCLinkList_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCLinkList_000_D.exe ZtCLinkList_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
<EFBFBD><EFBFBD> mingw <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
g++.exe -o ZtCLinkList_000_mw.exe ZtCLinkList_000.cpp -I../ -lWs2_32
|
||||
g++.exe -o ZtCLinkList_000_mw_D.exe ZtCLinkList_000.cpp -I../ -lWs2_32 -D_DEBUG
|
||||
|
||||
./ZtCLinkList_000_mw.exe
|
||||
./ZtCLinkList_000_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
<EFBFBD><EFBFBD> Linux <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
g++ -std=c++98 -o ZtCLinkList_000.exe ZtCLinkList_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++ -std=c++98 -o ZtCLinkList_000_D.exe ZtCLinkList_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
./ZtCLinkList_000.exe
|
||||
./ZtCLinkList_000_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
431
ZCppMainTest/ZtCLinkList_001.cpp
Normal file
431
ZCppMainTest/ZtCLinkList_001.cpp
Normal file
@ -0,0 +1,431 @@
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "ZCppMain/ZtCLinkList.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain ;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
template<typename TDummy=void*> class ZtCExamCLinkList
|
||||
{
|
||||
public:
|
||||
|
||||
class ZCLinkData : public ZNsIFaceEx::ZtCLink<ZCEmpty, ZCLinkData>
|
||||
{
|
||||
private:
|
||||
string mo_DataCStr;
|
||||
private:
|
||||
static int SI_CallCnt;
|
||||
public :
|
||||
typedef ZNsIFaceEx::ZtCLink<ZCEmpty, ZCLinkData> TypeBase;
|
||||
public :
|
||||
|
||||
ZCLinkData() : ZNsIFaceEx::ZtCLink<ZCEmpty, ZCLinkData>()
|
||||
{
|
||||
cout<<"* ZCLinkData() : "<<++ZCLinkData::SI_CallCnt<<endl;
|
||||
}
|
||||
ZCLinkData(const ZCLinkData& rhs) :
|
||||
ZNsIFaceEx::
|
||||
ZtCLink<ZCEmpty, ZCLinkData>(),
|
||||
mo_DataCStr(rhs.mo_DataCStr)
|
||||
{cout<<"* ZCLinkData(const ZCLinkData& rhs) : "<<++ZCLinkData::SI_CallCnt<<endl;}
|
||||
|
||||
ZCLinkData(const TypeBase& rhs) :
|
||||
ZNsIFaceEx::
|
||||
ZtCLink<ZCEmpty, ZCLinkData>(),
|
||||
mo_DataCStr
|
||||
(
|
||||
(*static_cast<const ZCLinkData*>(&rhs)).mo_DataCStr
|
||||
)
|
||||
{cout<<"* ZCLinkData(const TypeBase& rhs) : "<<++ZCLinkData::SI_CallCnt<<endl;}
|
||||
|
||||
|
||||
~ZCLinkData()
|
||||
{
|
||||
cout<<"* ~ZCLinkData() : "<<ZCLinkData::SI_CallCnt--<<endl;
|
||||
}
|
||||
|
||||
|
||||
ZCLinkData& operator=(const ZCLinkData& rhs)
|
||||
{
|
||||
mo_DataCStr = rhs.mo_DataCStr; return *this;
|
||||
}/*
|
||||
ZCLinkData& operator=(const ZCLinkData& rhs)*/
|
||||
|
||||
/***/ string& GetData() {return mo_DataCStr;}
|
||||
const string& GetData() const{return mo_DataCStr;}
|
||||
|
||||
public :
|
||||
};/*
|
||||
class ZCLinkData : public ZNsIFaceEx::ZtCLink<ZCEmpty, ZCLinkData>*/
|
||||
|
||||
|
||||
typedef ZNsIFaceEx::ZtCLink
|
||||
<ZCEmpty, ZCLinkData> ZCLinkBase;
|
||||
typedef ZNsIFaceEx::ZtCLink
|
||||
<string , ZCEmpty > ZCLinkStr ;
|
||||
|
||||
public:
|
||||
typedef ZtCLinkList<ZCLinkBase> ZCLinkDataList;
|
||||
typedef ZtCLinkList<ZCLinkStr > ZCLinkStrList ;
|
||||
typedef typename
|
||||
ZCLinkDataList::ZCLinkOpt ZCStrLinkOpt ;
|
||||
public:
|
||||
|
||||
|
||||
static void ShowNode0(ZCLinkBase& AR_CLink, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node Curr : "<<(AR_CLink)().GetData()<<endl;
|
||||
}/*
|
||||
static void ShowNode0(ZCLinkBase& AR_CLink, ZTypLong& ARRI_CallCnt)*/
|
||||
|
||||
static void ShowNode1(ZCLinkBase& AR_CLink, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node Prev : "<<(AR_CLink-1)().GetData()<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node Curr : " <<(AR_CLink )().GetData()<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node Next : "<<(AR_CLink+1)().GetData()<<endl;
|
||||
}/*
|
||||
static void ShowNode1(ZCLinkBase& AR_CLink, ZTypLong& ARRI_CallCnt)*/
|
||||
|
||||
|
||||
static void AppendEach(ZCLinkBase& AR_CLink)
|
||||
{
|
||||
AR_CLink().GetData().append("_");
|
||||
}/*
|
||||
static void AppendEach(ZCLinkBase& AR_CLink)*/
|
||||
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
ZTypLong VI_CallCnt =0 ;
|
||||
ZCLinkDataList VO_CDataList1;
|
||||
ZCLinkDataList VO_CDataList2;
|
||||
ZCLinkStrList VO_CStrLis20 ;
|
||||
ZCStrLinkOpt VO_StrLinkOpt = VO_CDataList1.GetObjOpt(1);
|
||||
|
||||
cout<<"# VO_StrLinkOpt.has_value()="<<VO_StrLinkOpt.has_value()<<endl;
|
||||
cout<<"# VO_StrLinkOpt.bool() ="<<bool(VO_StrLinkOpt) <<endl;
|
||||
|
||||
VO_CDataList1.AddTail()().GetData()=string("123");
|
||||
VO_CDataList1.AddTail()().GetData()=string("ABC");
|
||||
VO_CDataList1.AddTail()().GetData()=string("xyz");
|
||||
|
||||
VO_CDataList2.AddTail()().GetData()=string("Z01");
|
||||
VO_CDataList2.AddTail()().GetData()=string("Z02");
|
||||
VO_CDataList2.AddTail()().GetData()=string("Z03");
|
||||
|
||||
VO_CStrLis20.AddTail()()=string("__1");
|
||||
VO_CStrLis20.AddTail()()=string("__2");
|
||||
VO_CStrLis20.AddTail()()=string("__3");
|
||||
|
||||
VO_StrLinkOpt = VO_CDataList1.GetObjOpt(1);
|
||||
|
||||
cout<<"# VO_StrLinkOpt.GetObjOpt(1) : has_value()="<<VO_StrLinkOpt.has_value()<<endl;
|
||||
cout<<"# VO_StrLinkOpt.GetObjOpt(1) : bool ()="<<bool(VO_StrLinkOpt) <<endl;
|
||||
|
||||
if(VO_StrLinkOpt.has_value())
|
||||
{
|
||||
cout<<"# value by VO_StrLinkOpt : "<<VO_StrLinkOpt.value()().GetData()<<endl;
|
||||
cout<<"# value by VO_StrLinkOpt() : "<<VO_StrLinkOpt() ().GetData()<<endl;
|
||||
}/*
|
||||
if(VO_StrLinkOpt.has_value())*/
|
||||
|
||||
VO_StrLinkOpt = VO_CDataList1.GetTailOpt();
|
||||
|
||||
cout<<"# VO_StrLinkOpt.GetTailOpt() : has_value()="<<VO_StrLinkOpt.has_value()<<endl;
|
||||
cout<<"# VO_StrLinkOpt.GetTailOpt() : bool ()="<<bool(VO_StrLinkOpt) <<endl;
|
||||
|
||||
if(VO_StrLinkOpt.has_value())
|
||||
{
|
||||
cout<<"# value by VO_StrLinkOpt : "<<VO_StrLinkOpt.value()().GetData()<<endl;
|
||||
cout<<"# value by VO_StrLinkOpt() : "<<VO_StrLinkOpt() ().GetData()<<endl;
|
||||
}/*
|
||||
if(VO_StrLinkOpt.has_value())*/
|
||||
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode1, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_CDataList1.JoinHead(VO_CDataList2);
|
||||
|
||||
cout<<"# after VO_CDataList1.JoinHead(VO_CDataList2)"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_CDataList2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode1, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_CDataList2 = VO_CDataList1 ;
|
||||
|
||||
cout<<"# after VO_CDataList2 = VO_CDataList1"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_CDataList2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
VO_CDataList1.IterElement(&AppendEach);
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
VO_CDataList1.SendRangeOutAfter
|
||||
(
|
||||
VO_CDataList1.GetObjOpt(1).value()
|
||||
, VO_CDataList1.GetObjOpt(2).value()
|
||||
, 2
|
||||
, VO_CDataList2
|
||||
, VO_CDataList2.GetObjOpt(1)
|
||||
) ;
|
||||
cout<<"# after VO_CDataList1.SendRangeOutAfter(1th, 2th, 2, rhs, rhs's 1th)"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_CDataList2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
VO_CDataList2.SendRangeOutBefore
|
||||
(
|
||||
VO_CDataList2.GetObjOpt(7).value()
|
||||
, VO_CDataList2.GetObjOpt(8).value()
|
||||
, 2
|
||||
, VO_CDataList1
|
||||
, VO_CDataList1.GetObjOpt(1)
|
||||
) ;
|
||||
cout<<"# after VO_CDataList2.SendRangeOutAfter(7th, 8th, 2, rhs, rhs's 1th)"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_CDataList2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
VO_CDataList2.CopyThis( RR(VO_CDataList1) );
|
||||
cout<<"# after VO_CDataList2.CopyThis( RR(VO_CDataList1) )"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_CDataList2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
VO_CDataList1.SwapLink
|
||||
(VO_CDataList1.HeadRef(), VO_CDataList1.HeadRef(1));
|
||||
cout<<"# after VO_CDataList1.SwapLink(1th, 2th)"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
VO_CDataList1.SwapLink
|
||||
(VO_CDataList1.HeadRef(), VO_CDataList1.HeadRef(11));
|
||||
cout<<"# after VO_CDataList1.SwapLink(1th, 12th)"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
VO_CDataList1.SwapLink
|
||||
(VO_CDataList1.HeadRef(11), VO_CDataList1.HeadRef(10));
|
||||
cout<<"# after VO_CDataList1.SwapLink(12th, 11th)"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
VO_CDataList1.MoveLinkTail
|
||||
(VO_CDataList1.HeadRef());
|
||||
cout<<"# after VO_CDataList1.MoveLinkTail(1th)"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
_FOR_ITER_EASY_START0_C (VO_CDataList1, VH_NowIter, i)
|
||||
{
|
||||
cout<<"# list1 const: "<<(i+1)<<" "<<VO_CDataList1.ItD(VH_NowIter).GetData()<<endl;
|
||||
}
|
||||
_FOR_ITER_EASY_CLOSE0_C (VO_CDataList1, VH_NowIter, i)
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
_FOR_ITER_EASY_START0_RC(VO_CDataList1, VH_NowIter, i)
|
||||
{
|
||||
cout<<"# list1 rev const: "<<(i+1)<<" "<<VO_CDataList1.ItD(VH_NowIter).GetData()<<endl;
|
||||
}
|
||||
_FOR_ITER_EASY_CLOSE0_RC(VO_CDataList1, VH_NowIter, i)
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
__for_it(ZCLinkDataList, VO_CDataList1, VH_NowIter)
|
||||
{
|
||||
cout<<"# list1 __for_it : "<<VH_NowIter.GetPos()<<" "<<(*VH_NowIter).GetData()<<endl;
|
||||
}
|
||||
cout<<"***********************************************"<<endl;
|
||||
__for_it(ZCLinkStrList , VO_CStrLis20, VH_NowIter)
|
||||
{
|
||||
cout<<"# list20 __for_it : "<<VH_NowIter.GetPos()<<" "<<(*VH_NowIter)<<endl;
|
||||
}
|
||||
|
||||
_FOR_ITER_EASY_START0_C(VO_CStrLis20, VH_NowIter, i)
|
||||
{
|
||||
cout<<"# list20 const: "<<(i+1)<<" "<<VO_CStrLis20.ItD(VH_NowIter)<<endl;
|
||||
}
|
||||
_FOR_ITER_EASY_CLOSE0_C(VO_CStrLis20, VH_NowIter, i)
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
VO_CDataList1.MoveRangeIn
|
||||
(
|
||||
VO_CDataList1.HeadRef( ),
|
||||
VO_CDataList1.HeadRef(1 ),
|
||||
VO_CDataList1.HeadRef(11),
|
||||
true
|
||||
);
|
||||
cout<<"# after VO_CDataList1.MoveRangeIn(1th, 2th, 12th, after)"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
VO_CDataList1.MoveRangeIn
|
||||
(
|
||||
VO_CDataList1.HeadRef(1 ),
|
||||
VO_CDataList1.HeadRef(11),
|
||||
VO_CDataList1.HeadRef( ),
|
||||
false
|
||||
);
|
||||
cout<<"# after VO_CDataList1.MoveRangeIn(2th, 12th, 1th, before)"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
VO_CDataList1.MoveRangeIn
|
||||
(
|
||||
VO_CDataList1.HeadRef( ),
|
||||
VO_CDataList1.HeadRef(1),
|
||||
VO_CDataList1.HeadRef(2),
|
||||
false
|
||||
);
|
||||
cout<<"# after VO_CDataList1.MoveRangeIn(1th, 2th, 3th, before)"<<endl;
|
||||
VO_CDataList1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
|
||||
public:
|
||||
};/*
|
||||
template<typename TDummy=void*> class ZtCExamCLinkList*/
|
||||
|
||||
|
||||
|
||||
template<typename TDummy> int
|
||||
ZtCExamCLinkList<TDummy>::ZCLinkData::SI_CallCnt(0) ;
|
||||
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::
|
||||
|
||||
ZtCExamCLinkList<>::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCLinkList_001.exe ZtCLinkList_001.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCLinkList_001_D.exe ZtCLinkList_001.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -o ZtCLinkList_001_mw.exe ZtCLinkList_001.cpp -I../ -lWs2_32 -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++.exe -o ZtCLinkList_001_mw_D.exe ZtCLinkList_001.cpp -I../ -lWs2_32 -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
./ZtCLinkList_001_mw.exe
|
||||
./ZtCLinkList_001_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o ZtCLinkList_001.exe ZtCLinkList_001.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++ -std=c++98 -o ZtCLinkList_001_D.exe ZtCLinkList_001.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
■ 실행
|
||||
|
||||
./ZtCLinkList_001.exe
|
||||
./ZtCLinkList_001_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
268
ZCppMainTest/ZtCLinkMoveList_000.cpp
Normal file
268
ZCppMainTest/ZtCLinkMoveList_000.cpp
Normal file
@ -0,0 +1,268 @@
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "ZCppMain/ZtCLinkList.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain ;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
template<typename TDummy=void*> class ZtCExamCLinkList
|
||||
{
|
||||
public:
|
||||
typedef ZNsIFaceEx::ZtCLink<string, ZCEmpty> ZCLinkCStr ;
|
||||
typedef ZtCLinkMoveList<ZCLinkCStr> ZCLinkStrList;
|
||||
typedef ZCLinkStrList::ZCLinkOpt ZCStrLinkOpt ;
|
||||
public:
|
||||
|
||||
|
||||
static void ShowNode0(ZCLinkCStr& AR_CLink, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt; cout<<ARRI_CallCnt<<" * Node Curr : "<<(AR_CLink)()<<endl;
|
||||
}/*
|
||||
static void ShowNode0(ZCLinkCStr& AR_CLink, ZTypLong& ARRI_CallCnt)*/
|
||||
|
||||
static void ShowNode1(ZCLinkCStr& AR_CLink, ZTypLong& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node Prev : "<<(AR_CLink-1)()<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node Curr : " <<(AR_CLink )()<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node Next : "<<(AR_CLink+1)()<<endl;
|
||||
}/*
|
||||
static void ShowNode1(ZCLinkCStr& AR_CLink, ZTypLong& ARRI_CallCnt)*/
|
||||
|
||||
|
||||
static void AppendEach(ZCLinkCStr& AR_CLink)
|
||||
{
|
||||
AR_CLink().append("_");
|
||||
}/*
|
||||
static void AppendEach(ZCLinkCStr& AR_CLink)*/
|
||||
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
ZTypLong VI_CallCnt = 0 ;
|
||||
ZCLinkStrList VO_ZCLinkStrLis1;
|
||||
ZCLinkStrList VO_ZCLinkStrLis2;
|
||||
ZCStrLinkOpt VO_StrLinkOpt = VO_ZCLinkStrLis1.GetObjOpt(1);
|
||||
|
||||
cout<<"# VO_StrLinkOpt.has_value()="<<VO_StrLinkOpt.has_value()<<endl;
|
||||
cout<<"# VO_StrLinkOpt.bool() ="<<bool(VO_StrLinkOpt) <<endl;
|
||||
|
||||
VO_ZCLinkStrLis1.AddTail()()=string("123");
|
||||
VO_ZCLinkStrLis1.AddTail()()=string("ABC");
|
||||
VO_ZCLinkStrLis1.AddTail()()=string("xyz");
|
||||
|
||||
VO_ZCLinkStrLis2.AddTail()()=string("Z01");
|
||||
VO_ZCLinkStrLis2.AddTail()()=string("Z02");
|
||||
VO_ZCLinkStrLis2.AddTail()()=string("Z03");
|
||||
|
||||
VO_StrLinkOpt = VO_ZCLinkStrLis1.GetObjOpt(1);
|
||||
|
||||
cout<<"# VO_StrLinkOpt.GetObjOpt(1) : has_value()="<<VO_StrLinkOpt.has_value()<<endl;
|
||||
cout<<"# VO_StrLinkOpt.GetObjOpt(1) : bool ()="<<bool(VO_StrLinkOpt) <<endl;
|
||||
|
||||
if(VO_StrLinkOpt.has_value())
|
||||
{
|
||||
cout<<"# value by VO_StrLinkOpt : "<<VO_StrLinkOpt.value()<<endl;
|
||||
cout<<"# value by VO_StrLinkOpt() : "<<VO_StrLinkOpt() <<endl;
|
||||
cout<<"# value by VO_StrLinkOpt()(): "<<VO_StrLinkOpt() <<endl;
|
||||
}
|
||||
|
||||
VO_StrLinkOpt = VO_ZCLinkStrLis1.GetTailOpt();
|
||||
|
||||
cout<<"# VO_StrLinkOpt.GetTailOpt() : has_value()="<<VO_StrLinkOpt.has_value()<<endl;
|
||||
cout<<"# VO_StrLinkOpt.GetTailOpt() : bool ()="<<bool(VO_StrLinkOpt) <<endl;
|
||||
|
||||
if(VO_StrLinkOpt.has_value())
|
||||
{
|
||||
cout<<"# value by VO_StrLinkOpt : "<<VO_StrLinkOpt.value()<<endl;
|
||||
cout<<"# value by VO_StrLinkOpt() : "<<VO_StrLinkOpt() <<endl;
|
||||
cout<<"# value by VO_StrLinkOpt()(): "<<VO_StrLinkOpt()() <<endl;
|
||||
}
|
||||
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode1, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_ZCLinkStrLis1.JoinHead(VO_ZCLinkStrLis2);
|
||||
|
||||
cout<<"# after VO_ZCLinkStrLis1.JoinHead(VO_ZCLinkStrLis2)"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCLinkStrLis2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode1, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_ZCLinkStrLis2 = VO_ZCLinkStrLis1 ;
|
||||
|
||||
cout<<"# after VO_ZCLinkStrLis2 = VO_ZCLinkStrLis1"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCLinkStrLis2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
VO_ZCLinkStrLis1.IterElement(&AppendEach);
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
VO_ZCLinkStrLis1.SendRangeOutAfter
|
||||
(
|
||||
VO_ZCLinkStrLis1.GetObjOpt(1).value()
|
||||
, VO_ZCLinkStrLis1.GetObjOpt(2).value()
|
||||
, 2
|
||||
, VO_ZCLinkStrLis2
|
||||
, VO_ZCLinkStrLis2.GetObjOpt(1)
|
||||
) ;
|
||||
cout<<"# after VO_ZCLinkStrLis1.SendRangeOutAfter(1th, 2th, 2, rhs, rhs's 1th)"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCLinkStrLis2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
VO_ZCLinkStrLis2.SendRangeOutBefore
|
||||
(
|
||||
VO_ZCLinkStrLis2.GetObjOpt(2).value()
|
||||
, VO_ZCLinkStrLis2.GetObjOpt(3).value()
|
||||
, 2
|
||||
, VO_ZCLinkStrLis1
|
||||
, VO_ZCLinkStrLis1.GetObjOpt(1)
|
||||
) ;
|
||||
cout<<"# after VO_ZCLinkStrLis2.SendRangeOutBefore(VO_ZCLinkStrLis2 2th, 3th, 2, rhs, rhs's 1th)"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCLinkStrLis2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
VO_ZCLinkStrLis2.CopyThis(VO_ZCLinkStrLis1);
|
||||
cout<<"# after VO_ZCLinkStrLis2.CopyThis(VO_ZCLinkStrLis1)"<<endl;
|
||||
|
||||
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
|
||||
VO_ZCLinkStrLis2.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
VO_ZCLinkStrLis1.IterElement(&ShowNode0, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"***********************************************"<<endl;
|
||||
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
|
||||
public:
|
||||
};/*
|
||||
template<typename TDummy=void*> class ZtCExamCLinkList*/
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::
|
||||
|
||||
ZtCExamCLinkList<>::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
<EFBFBD><EFBFBD> cygwin <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
// g++ -mno-cygwin -o ZtCLinkMoveList_000.exe ZtCLinkMoveList_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCLinkMoveList_000_D.exe ZtCLinkMoveList_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
<EFBFBD><EFBFBD> mingw <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
g++.exe -o ZtCLinkMoveList_000_mw.exe ZtCLinkMoveList_000.cpp -I../ -lWs2_32
|
||||
g++.exe -o ZtCLinkMoveList_000_mw_D.exe ZtCLinkMoveList_000.cpp -I../ -lWs2_32 -D_DEBUG
|
||||
|
||||
./ZtCLinkMoveList_000_mw.exe
|
||||
./ZtCLinkMoveList_000_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
<EFBFBD><EFBFBD> Linux <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
g++ -std=c++98 -o ZtCLinkMoveList_000.exe ZtCLinkMoveList_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++ -std=c++98 -o ZtCLinkMoveList_000_D.exe ZtCLinkMoveList_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
./ZtCLinkMoveList_000.exe
|
||||
./ZtCLinkMoveList_000_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
140
ZCppMainTest/ZtCLink_001.cpp
Normal file
140
ZCppMainTest/ZtCLink_001.cpp
Normal file
@ -0,0 +1,140 @@
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include "ZCppMain/ZtCLinkList.H"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
class ZCLinkEx :
|
||||
public ZtCLink<ZCEmpty, ZCLinkEx>
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
typedef ZtCLink<ZCEmpty, ZCEmpty> ZCLink1;
|
||||
typedef ZtCLink<string , ZCEmpty> ZCLink2;
|
||||
typedef ZtCLink<ZCEmpty, string > ZCLink3;
|
||||
typedef ZtCLink<string , string > ZCLink4;
|
||||
typedef ZCLinkEx ZCLink5;
|
||||
|
||||
cout<<"# ZCLink1::TypeThis -> "<<typeid(ZCLink1::TypeThis ).name()<<endl;
|
||||
cout<<"# ZCLink1::TypeBase -> "<<typeid(ZCLink1::TypeBase ).name()<<endl;
|
||||
cout<<"# ZCLink1::TypeChild-> "<<typeid(ZCLink1::TypeChild).name()<<endl;
|
||||
cout<<"**********************************************************"<<endl;
|
||||
cout<<"# ZCLink2::TypeThis -> "<<typeid(ZCLink2::TypeThis ).name()<<endl;
|
||||
cout<<"# ZCLink2::TypeBase -> "<<typeid(ZCLink2::TypeBase ).name()<<endl;
|
||||
cout<<"# ZCLink2::TypeChild-> "<<typeid(ZCLink2::TypeChild).name()<<endl;
|
||||
cout<<"**********************************************************"<<endl;
|
||||
cout<<"# ZCLink3::TypeThis -> "<<typeid(ZCLink3::TypeThis ).name()<<endl;
|
||||
cout<<"# ZCLink3::TypeBase -> "<<typeid(ZCLink3::TypeBase ).name()<<endl;
|
||||
cout<<"# ZCLink3::TypeChild-> "<<typeid(ZCLink3::TypeChild).name()<<endl;
|
||||
cout<<"**********************************************************"<<endl;
|
||||
cout<<"# ZCLink4::TypeThis -> "<<typeid(ZCLink4::TypeThis ).name()<<endl;
|
||||
cout<<"# ZCLink4::TypeBase -> "<<typeid(ZCLink4::TypeBase ).name()<<endl;
|
||||
cout<<"# ZCLink4::TypeChild-> "<<typeid(ZCLink4::TypeChild).name()<<endl;
|
||||
cout<<"**********************************************************"<<endl;
|
||||
cout<<"# ZCLink5::TypeThis -> "<<typeid(ZCLink5::TypeThis ).name()<<endl;
|
||||
cout<<"# ZCLink5::TypeBase -> "<<typeid(ZCLink5::TypeBase ).name()<<endl;
|
||||
cout<<"# ZCLink5::TypeChild-> "<<typeid(ZCLink5::TypeChild).name()<<endl;
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCLink_001.exe ZtCLink_001.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCLink_001_D.exe ZtCLink_001.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -o ZtCLink_001_mw.exe ZtCLink_001.cpp -I../
|
||||
g++.exe -o ZtCLink_001_mw_D.exe ZtCLink_001.cpp -I../ -D_DEBUG
|
||||
|
||||
./ZtCLink_001_mw.exe
|
||||
./ZtCLink_001_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o ZtCLink_001.exe ZtCLink_001.cpp -I../
|
||||
g++ -std=c++98 -o ZtCLink_001_D.exe ZtCLink_001.cpp -I../ -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
■ 실행
|
||||
|
||||
./ZtCLink_001.exe
|
||||
./ZtCLink_001_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
@ -195,7 +195,7 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cigwin 컴파일
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCLoadXml_000.exe ZtCLoadXml_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCLoadXml_000_D.exe ZtCLoadXml_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
@ -67,7 +67,7 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cigwin 컴파일
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCObjAVL_000.exe ZtCObjAVL_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCObjAVL_000_D.exe ZtCObjAVL_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
529
ZCppMainTest/ZtCObjList_000.cpp
Normal file
529
ZCppMainTest/ZtCObjList_000.cpp
Normal file
@ -0,0 +1,529 @@
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include "ZCppMain/ZtCObjList.H"
|
||||
#include "ZCppMain/ZtCStringEx.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain ;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
template<typename TDummy=void*> class ZtCExamCObjList
|
||||
{
|
||||
public:
|
||||
|
||||
typedef ZtCStringBase<char> CStringBase ;
|
||||
typedef const CStringBase CCStringBase;
|
||||
|
||||
/* 아래 자료형에 대해, CStringBase::Fetch() 호출 여부 실험.
|
||||
|
||||
ZtCObjList<CStringBase&, CCStringBase&>
|
||||
ZtCObjList<CStringBase&, CCCStringBase&>
|
||||
|
||||
*/
|
||||
typedef ZtCObjList
|
||||
<CStringBase, CStringBase& > CStringList1 ;
|
||||
typedef ZtCObjList
|
||||
<CStringBase, CCStringBase&> CStringList2 ;
|
||||
|
||||
typedef CStringList1::ZCLink ZCLink1;
|
||||
typedef CStringList2::ZCLink ZCLink2;
|
||||
|
||||
typedef CStringList1::ZCLinkOpt ZCLinkOpt1;
|
||||
typedef CStringList2::ZCLinkOpt ZCLinkOpt2;
|
||||
|
||||
typedef CStringList1::ZCDataOpt ZCDataOpt1;
|
||||
typedef CStringList2::ZCDataOpt ZCDataOpt2;
|
||||
|
||||
|
||||
static void ShowDataInNode(const CStringBase& AR_Data)
|
||||
{
|
||||
cout<<"* Data : "<<AR_Data<<endl;
|
||||
}/*
|
||||
static void ShowDataInNode(const CStringBase& AR_Data)*/
|
||||
|
||||
static void ShowNode1(ZCLink1& AR_CLink)
|
||||
{
|
||||
cout<<"* Node Prev : "<<*(AR_CLink-1)<<endl;
|
||||
cout<<"* Node Curr : "<<*(AR_CLink )<<endl;
|
||||
cout<<"* Node Next : "<<*(AR_CLink+1)<<endl;
|
||||
}/*
|
||||
static void ShowNode1(ZCLink1& AR_CLink)*/
|
||||
|
||||
static void ShowNode2(ZCLink2& AR_CLink)
|
||||
{
|
||||
cout<<"* Node Prev : "<<*(AR_CLink-1)<<endl;
|
||||
cout<<"* Node Curr : "<<*(AR_CLink )<<endl;
|
||||
cout<<"* Node Next : "<<*(AR_CLink+1)<<endl;
|
||||
}/*
|
||||
static void ShowNode2(ZCLink2& AR_CLink)*/
|
||||
|
||||
|
||||
static void Append1(ZCLink1& AR_CLink)
|
||||
{
|
||||
(*AR_CLink).append("__");
|
||||
}/*
|
||||
static void Append1(ZCLink1& AR_CLink)*/
|
||||
|
||||
|
||||
static void ShowNode1_2(ZCLink1& AR_CLink, int& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node Prev : "<<*(AR_CLink-1)<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node Curr : "<<*(AR_CLink )<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node Next : "<<*(AR_CLink+1)<<endl;
|
||||
}/*
|
||||
static void ShowNode1(ZCLink1& AR_CLink, int& ARRI_CallCnt)*/
|
||||
|
||||
static void ShowNode2_2(ZCLink2& AR_CLink, int& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node Prev : "<<*(AR_CLink-1)<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node Curr : "<<*(AR_CLink )<<endl;
|
||||
cout<<ARRI_CallCnt<<" * Node Next : "<<*(AR_CLink+1)<<endl;
|
||||
}/*
|
||||
static void ShowNode2(ZCLink2& AR_CLink, int& ARRI_CallCnt)*/
|
||||
|
||||
|
||||
static void ShowNode1_3(ZCLink1& AR_CLink, int& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node Curr : "<<*(AR_CLink )<<endl;
|
||||
}/*
|
||||
static void ShowNode1(ZCLink1& AR_CLink, int& ARRI_CallCnt)*/
|
||||
|
||||
static void ShowNode2_3(ZCLink2& AR_CLink, int& ARRI_CallCnt)
|
||||
{
|
||||
++ARRI_CallCnt;
|
||||
|
||||
cout<<ARRI_CallCnt<<" * Node Curr : "<<*(AR_CLink )<<endl;
|
||||
}/*
|
||||
static void ShowNode2(ZCLink2& AR_CLink, int& ARRI_CallCnt)*/
|
||||
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
CStringBase VO_CStringBase ;
|
||||
CStringList1 VO_ListOfStr10 ;
|
||||
CStringList2 VO_ListOfStr20 ;
|
||||
|
||||
ZCDataOpt1 VO_ZCDataOpt1 = VO_ListOfStr10.HeadOptD() ;
|
||||
ZCLinkOpt1 VO_ZCLinkOpt1 = VO_ListOfStr10.TailOpt() ;
|
||||
|
||||
if(bool(VO_ZCDataOpt1))
|
||||
cout<<"# VO_ListOfStr10's head data : " <<*VO_ZCDataOpt1<<endl;
|
||||
else cout<<"# VO_ListOfStr10's head data none "<<endl;
|
||||
if(bool(VO_ZCLinkOpt1))
|
||||
cout<<"# VO_ListOfStr10's tail link data : " <<**VO_ZCLinkOpt1<<endl;
|
||||
else cout<<"# VO_ListOfStr10's tail link data none "<<endl;
|
||||
|
||||
VO_ListOfStr10.AddTail(VO_CStringBase("data 10"));
|
||||
VO_ListOfStr10.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr10.AddTail(VO_CStringBase("data 20"));
|
||||
VO_ListOfStr10.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr10.AddTail(VO_CStringBase("data 04"));
|
||||
|
||||
cout<<"# VO_CStringBase data : " <<VO_CStringBase<<endl;
|
||||
|
||||
|
||||
VO_ZCDataOpt1 = VO_ListOfStr10.HeadOptD() ;
|
||||
VO_ZCLinkOpt1 = VO_ListOfStr10.TailOpt() ;
|
||||
|
||||
if(bool(VO_ZCDataOpt1))
|
||||
cout<<"# VO_ListOfStr10's head data : " <<*VO_ZCDataOpt1<<endl;
|
||||
else cout<<"# VO_ListOfStr10's head data none "<<endl;
|
||||
if(bool(VO_ZCLinkOpt1))
|
||||
cout<<"# VO_ListOfStr10's tail link data : " <<**VO_ZCLinkOpt1<<endl;
|
||||
else cout<<"# VO_ListOfStr10's tail link data none "<<endl;
|
||||
|
||||
|
||||
cout<<"# 1th IterElement ####" <<endl;
|
||||
{
|
||||
VO_ListOfStr10.IterElement(&ShowDataInNode);
|
||||
}
|
||||
cout<<"# 1th IterElemRev ####" <<endl;
|
||||
{
|
||||
VO_ListOfStr10.IterElemRev(&ShowDataInNode);
|
||||
}
|
||||
/*///////////////////////////////////*/
|
||||
|
||||
|
||||
cout<<endl;
|
||||
|
||||
|
||||
VO_ListOfStr20.AddTail(VO_CStringBase("data 10"));
|
||||
VO_ListOfStr20.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr20.AddTail(VO_CStringBase("data 20"));
|
||||
VO_ListOfStr20.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr20.AddTail(VO_CStringBase("data 04"));
|
||||
|
||||
cout<<"# VO_CStringBase data : " <<VO_CStringBase<<endl;
|
||||
|
||||
cout<<"# 2th IterElement ####" <<endl;
|
||||
{
|
||||
VO_ListOfStr20.IterElement(&ShowDataInNode);
|
||||
}
|
||||
cout<<"# 2th IterElemRev ####" <<endl;
|
||||
{
|
||||
VO_ListOfStr20.IterElemRev(&ShowDataInNode);
|
||||
}
|
||||
/*///////////////////////////////////*/
|
||||
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list20 size : " <<VO_ListOfStr20.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list20 free size: " <<VO_ListOfStr20.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list20 capacity : " <<VO_ListOfStr20.capacity ()<<endl;
|
||||
|
||||
VO_ListOfStr10.clear(); VO_ListOfStr20.clear();
|
||||
|
||||
VO_ListOfStr10.GetCFreeHeap().AddHeap(3);
|
||||
VO_ListOfStr20.GetCFreeHeap().AddHeap(3);
|
||||
|
||||
cout<<"# After clear() & AddHeap(3)"<<endl;
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list20 size : " <<VO_ListOfStr20.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list20 free size: " <<VO_ListOfStr20.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list20 capacity : " <<VO_ListOfStr20.capacity ()<<endl;
|
||||
|
||||
CStringList1 VO_ListOfStr11 ;
|
||||
|
||||
cout<<"# add 2 elements and clear in VO_ListOfStr11"<<endl;
|
||||
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("lsit 11 data 01"));
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("lsit 11 data 02"));
|
||||
VO_ListOfStr11.clear();
|
||||
|
||||
cout<<"# After list10 Fetch from list11"<<endl;
|
||||
|
||||
VO_ListOfStr10.GetCFreeHeap().Fetch( VO_ListOfStr11.GetCFreeHeap() );
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list11 size : " <<VO_ListOfStr11.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list11 free size: " <<VO_ListOfStr11.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
|
||||
|
||||
cout<<"# After list11 Fetch 3 from list10"<<endl;
|
||||
|
||||
VO_ListOfStr11.GetCFreeHeap().
|
||||
Fetch( VO_ListOfStr10.GetCFreeHeap(), 3);
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list11 size : " <<VO_ListOfStr11.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list11 free size: " <<VO_ListOfStr11.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
|
||||
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("list11 add1"));
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("list11 add2"));
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("list11 add3"));
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("list11 add4"));
|
||||
|
||||
cout<<"# After add 4 in list11"<<endl;
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list11 size : " <<VO_ListOfStr11.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list11 free size: " <<VO_ListOfStr11.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
|
||||
|
||||
cout<<"# After MakeEqual() : list10 and list11"<<endl;
|
||||
|
||||
VO_ListOfStr10.GetCFreeHeap().MakeEqual( VO_ListOfStr11.GetCFreeHeap() );
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list11 size : " <<VO_ListOfStr11.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list11 free size: " <<VO_ListOfStr11.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
|
||||
|
||||
cout<<"# list11 IterElemRev ####" <<endl;
|
||||
{
|
||||
VO_ListOfStr11.IterElemRev(&ShowDataInNode);
|
||||
}/*
|
||||
cout<<"# list11 IterElemRev ####" <<endl;*/
|
||||
|
||||
|
||||
VO_ListOfStr11.RotateBack();
|
||||
|
||||
cout<<"# list11 IterElemRev after RotateBack"<<endl;
|
||||
|
||||
cout<<"# list11 IterElemRev ####" <<endl;
|
||||
{
|
||||
VO_ListOfStr11.IterElemRev(&ShowDataInNode);
|
||||
}/*
|
||||
cout<<"# list11 IterElemRev ####" <<endl;*/
|
||||
|
||||
|
||||
VO_ListOfStr10 = VO_ListOfStr11 ;
|
||||
|
||||
cout<<"# list10 IterElement after list10 = list11"<<endl;
|
||||
VO_ListOfStr10.IterElement(&ShowDataInNode);
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list11 size : " <<VO_ListOfStr11.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list11 free size: " <<VO_ListOfStr11.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
|
||||
|
||||
|
||||
VO_ListOfStr11.AddHead(VO_CStringBase("list11 add99"));
|
||||
VO_ListOfStr10 = VO_ListOfStr11 ;
|
||||
|
||||
cout<<"# list10 IterElement after list11.addhead, list10 = list11"<<endl;
|
||||
VO_ListOfStr10.IterElement(&ShowDataInNode);
|
||||
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list11 size : " <<VO_ListOfStr11.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list11 free size: " <<VO_ListOfStr11.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
|
||||
|
||||
|
||||
int VI_CallCnt=0;
|
||||
|
||||
cout<<"# list10 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr10.IterElemLink(&ShowNode1_2, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<"# list10 2th link to list11 tail"<<endl;
|
||||
VO_ListOfStr10.SendOutTail(*VO_ListOfStr10.GetLinkPtr(2), VO_ListOfStr11);
|
||||
|
||||
cout<<"# list10 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr10.IterElemLink(&ShowNode1_2, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"# list11 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr11.IterElemLink(&ShowNode1_2, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
cout<<"# list10 1th link to list10 head"<<endl;
|
||||
VO_ListOfStr10.SendOutHead(*VO_ListOfStr10.GetLinkPtr(1), VO_ListOfStr11);
|
||||
|
||||
cout<<"# list10 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr10.IterElemLink(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"# list11 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr11.IterElemLink(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_ListOfStr11.IterElemLink(&Append1);
|
||||
|
||||
VO_ListOfStr11.SendRangeOutAfter
|
||||
(
|
||||
*VO_ListOfStr11.GetLinkPtr(2)
|
||||
, *VO_ListOfStr11.GetLinkPtr(3)
|
||||
, 2
|
||||
, RR(VO_ListOfStr10)
|
||||
, VO_ListOfStr10.GetLinkOpt(2)
|
||||
);
|
||||
cout<<"# list11's 2th ~ 3th link to list10's 2th link after"<<endl;
|
||||
cout<<"# list10 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr10.IterElemLink(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"# list11 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr11.IterElemLink(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_ListOfStr10.SendRangeOutBefore
|
||||
(
|
||||
*VO_ListOfStr10.GetLinkPtr(3)
|
||||
, *VO_ListOfStr10.GetLinkPtr(4)
|
||||
, 2
|
||||
, RR(VO_ListOfStr11)
|
||||
, VO_ListOfStr11.GetLinkOpt(1)
|
||||
);
|
||||
cout<<"# list10's 3th ~ 4th link to list11's 1th link before"<<endl;
|
||||
cout<<"# list10 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr10.IterElemLink(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"# list11 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr11.IterElemLink(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_ListOfStr11.Rotate();
|
||||
cout<<"# list11 Rotate() ################"<<endl;
|
||||
VO_ListOfStr11.IterElemLink(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"# list11 IterElemLinkRev() ################"<<endl;
|
||||
VO_ListOfStr11.IterElemLinkRev(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
|
||||
VO_ListOfStr11.MoveLinkIn
|
||||
(
|
||||
*VO_ListOfStr11.GetLinkPtr(1)
|
||||
, *VO_ListOfStr11.GetLinkPtr(7)
|
||||
, true
|
||||
);
|
||||
cout<<"# list11 MoveLinkIn(1th, 7th, after)"<<endl;
|
||||
cout<<"# list11 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr11.IterElemLink(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_ListOfStr11.MoveLinkIn
|
||||
(
|
||||
*VO_ListOfStr11.GetLinkPtr(5)
|
||||
, *VO_ListOfStr11.GetLinkPtr(1)
|
||||
, false
|
||||
);
|
||||
cout<<"# list11 MoveLinkIn(5th, 1th, before)"<<endl;
|
||||
cout<<"# list11 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr11.IterElemLink(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_ListOfStr11.MoveLinkIn
|
||||
(
|
||||
*VO_ListOfStr11.GetLinkPtr(6)
|
||||
, *VO_ListOfStr11.GetLinkPtr(7)
|
||||
, true
|
||||
);
|
||||
cout<<"# list11 MoveLinkIn(6th, 7th, after)"<<endl;
|
||||
cout<<"# list11 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr11.IterElemLink(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
VO_ListOfStr11.MoveRangeIn
|
||||
(
|
||||
*VO_ListOfStr11.GetLinkPtr(1)
|
||||
, *VO_ListOfStr11.GetLinkPtr(2)
|
||||
, *VO_ListOfStr11.GetLinkPtr(7)
|
||||
, true
|
||||
);
|
||||
cout<<"# list11 MoveRangeIn(1th, 2th, 7th, after)"<<endl;
|
||||
cout<<"# list11 IterElemLink ################"<<endl;
|
||||
VO_ListOfStr11.IterElemLink(&ShowNode1_3, ZftMCP(VI_CallCnt=0));
|
||||
|
||||
|
||||
typedef CStringList1::iterator iterator1 ;
|
||||
//typedef CStringList1::ZCLinkPointEx iteratorEx1;
|
||||
typedef CStringList1::ZCNodePointN iteratorN1 ;
|
||||
|
||||
iterator1 VO_Iter1 = VO_ListOfStr11.end();
|
||||
//iteratorEx1 VO_IterEx1 = VO_ListOfStr11.end();
|
||||
iteratorN1 VO_IterN1(VO_Iter1);
|
||||
|
||||
__for_itc (CStringList1, VO_ListOfStr11, VO_NowIter)
|
||||
{
|
||||
cout<<"(by for_itc ) "<<VO_NowIter.GetPos()<<" : "<<*VO_NowIter<<endl;
|
||||
}
|
||||
__for_it_r(CStringList1, VO_ListOfStr11, VO_NowIter)
|
||||
{
|
||||
cout<<"(by for_it_r) "<<VO_NowIter.GetPos()<<" : "<<*VO_NowIter<<endl;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
|
||||
public:
|
||||
};/*
|
||||
template<typename TDummy=void*> class ZtCExamCObjList*/
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::
|
||||
|
||||
ZtCExamCObjList<>::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCObjList_000.exe ZtCObjList_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCObjList_000_D.exe ZtCObjList_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -o ZtCObjList_000_mw.exe ZtCObjList_000.cpp -I../ -lWs2_32 -Wall -Wno-unused-function -Wno-misleading-indentation -Wno-reorder -Wno-unknown-pragmas
|
||||
g++.exe -o ZtCObjList_000_mw_D.exe ZtCObjList_000.cpp -I../ -lWs2_32 -Wall -Wno-unused-function -Wno-misleading-indentation -Wno-reorder -Wno-unknown-pragmas -D_DEBUG
|
||||
|
||||
./ZtCObjList_000_mw.exe
|
||||
./ZtCObjList_000_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o ZtCObjList_000.exe ZtCObjList_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation -Wno-reorder
|
||||
g++ -std=c++98 -o ZtCObjList_000_D.exe ZtCObjList_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation -Wno-reorder -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
■ 실행
|
||||
|
||||
./ZtCObjList_000.exe
|
||||
./ZtCObjList_000_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
337
ZCppMainTest/ZtCSimList_000.cpp
Normal file
337
ZCppMainTest/ZtCSimList_000.cpp
Normal file
@ -0,0 +1,337 @@
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include "ZCppMain/ZtCSimList.H"
|
||||
#include "ZCppMain/ZtCStringEx.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain ;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
template<typename TDummy=void*> class ZtCExamCSimList
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
typedef ZtCStringBase<char> CStringBase ;
|
||||
typedef const CStringBase CCStringBase;
|
||||
|
||||
/* 아래 자료형에 대해, CStringBase::Fetch() 호출 여부 실험.
|
||||
|
||||
ZtCSimList<CStringBase&, CCStringBase&>
|
||||
ZtCSimList<CStringBase&, CCCStringBase&>
|
||||
|
||||
*/
|
||||
typedef ZtCSimList
|
||||
<CStringBase, CStringBase&> CStringList1 ;
|
||||
typedef ZtCSimList
|
||||
<CStringBase, CCStringBase&> CStringList2 ;
|
||||
|
||||
|
||||
|
||||
class CHelpObj
|
||||
{
|
||||
public:
|
||||
int mi_CallNo;
|
||||
public:
|
||||
|
||||
CHelpObj() : mi_CallNo(0)
|
||||
{
|
||||
cout<<"* CHelpObj()"<<endl;
|
||||
}
|
||||
|
||||
CHelpObj(const CHelpObj& rhs) : mi_CallNo(0)
|
||||
{
|
||||
cout<<"* CHelpObj(const CHelpObj& rhs)"<<endl;
|
||||
}
|
||||
|
||||
void operator()( CStringBase& AR_DataCStr)
|
||||
{ cout<<"# CallNo="<<++mi_CallNo<<" : "<<AR_DataCStr<<endl; }
|
||||
void operator()(CCStringBase& AR_DataCStr)
|
||||
{ cout<<"# CallNo="<<++mi_CallNo<<" : "<<AR_DataCStr<<endl; }
|
||||
|
||||
public:
|
||||
};/*
|
||||
class CHelpObj*/
|
||||
|
||||
|
||||
struct StFunctor
|
||||
{
|
||||
static void ShowElement(int ArgiValue){cout<<"#1 Value="<<ArgiValue<<endl;}
|
||||
};
|
||||
struct StFunctor2
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj)
|
||||
{cout<<"#2 Value="<<ArgiValue<<", CHelpObj Addr=None"<<" With CHelpObj"<<endl;}
|
||||
};
|
||||
struct StFunctor3
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj)
|
||||
{cout<<"#3 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Ref"<<endl;}
|
||||
};
|
||||
struct StFunctor4
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj)
|
||||
{cout<<"#4 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj in Ptr"<<endl;}
|
||||
};
|
||||
struct StFunctor5
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj, CHelpObj& AR_CHelpObj2)
|
||||
{cout<<"#5 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Ref 2"<<endl;}
|
||||
};
|
||||
struct StFunctor6
|
||||
{
|
||||
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj, CHelpObj AO_CHelpObj2)
|
||||
{cout<<"#6 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Half Ref"<<endl;}
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
static void ShowDataInNode(const CStringBase& AR_Data)
|
||||
{
|
||||
cout<<"* Data : "<<AR_Data<<endl;
|
||||
}/*
|
||||
static void ShowDataInNode(const CStringBase& AR_Data)*/
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
CStringBase VO_CStringBase;
|
||||
CStringList1 VO_ListOfStr10 ;
|
||||
CStringList2 VO_ListOfStr20 ;
|
||||
|
||||
VO_ListOfStr10.AddTail(VO_CStringBase("data 10"));
|
||||
VO_ListOfStr10.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr10.AddTail(VO_CStringBase("data 20"));
|
||||
VO_ListOfStr10.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr10.AddTail(VO_CStringBase("data 04"));
|
||||
|
||||
cout<<"# VO_CStringBase data : " <<VO_CStringBase<<endl;
|
||||
|
||||
cout<<"# 1th IterElement ####" <<endl;
|
||||
{
|
||||
VO_ListOfStr10.IterElement(&ShowDataInNode);
|
||||
}
|
||||
/*///////////////////////////////////*/
|
||||
|
||||
|
||||
cout<<endl;
|
||||
|
||||
|
||||
VO_ListOfStr20.AddTail(VO_CStringBase("data 10"));
|
||||
VO_ListOfStr20.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr20.AddTail(VO_CStringBase("data 20"));
|
||||
VO_ListOfStr20.AddTail(VO_CStringBase("data 40"));
|
||||
VO_ListOfStr20.AddTail(VO_CStringBase("data 04"));
|
||||
|
||||
cout<<"# VO_CStringBase data : " <<VO_CStringBase<<endl;
|
||||
|
||||
cout<<"# 2th IterElement ####" <<endl;
|
||||
{
|
||||
VO_ListOfStr20.IterElement(&ShowDataInNode);
|
||||
}
|
||||
/*///////////////////////////////////*/
|
||||
|
||||
|
||||
typedef ZtCSimList<int> CIntList;
|
||||
|
||||
CHelpObj VO_CHelpObj;
|
||||
CIntList VO_CIntList;
|
||||
|
||||
VO_CIntList.AddTail(10);
|
||||
VO_CIntList.AddTail(20);
|
||||
VO_CIntList.AddTail(30);
|
||||
VO_CIntList.AddTail(40);
|
||||
|
||||
cout<<endl<<"#### Show CIntList Element ####"<<endl<<endl;
|
||||
|
||||
VO_CIntList.IterElement(StFunctor ::ShowElement);
|
||||
VO_CIntList.IterElement(StFunctor2::ShowElement, VO_CHelpObj );
|
||||
VO_CIntList.IterElement(StFunctor3::ShowElement, ZftMCR(VO_CHelpObj) );
|
||||
VO_CIntList.IterElement(StFunctor4::ShowElement, ZftMCP(VO_CHelpObj) );
|
||||
VO_CIntList.IterElement(StFunctor5::ShowElement, ZftMCP(VO_CHelpObj), ZftMCP(VO_CHelpObj) );
|
||||
VO_CIntList.IterElement(StFunctor6::ShowElement, ZftMCP(VO_CHelpObj), VO_CHelpObj );
|
||||
|
||||
|
||||
|
||||
CStringList1 VO_ListOfStr11 ;
|
||||
|
||||
cout<<"# add 2 elements and clear in VO_ListOfStr11"<<endl;
|
||||
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("lsit 11 data 01"));
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("lsit 11 data 02"));
|
||||
VO_ListOfStr11.clear();
|
||||
|
||||
cout<<"# After list10 Fetch from list11"<<endl;
|
||||
|
||||
VO_ListOfStr10.GetCFreeHeap().Fetch( VO_ListOfStr11.GetCFreeHeap() );
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list11 size : " <<VO_ListOfStr11.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list11 free size: " <<VO_ListOfStr11.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
|
||||
|
||||
cout<<"# After list11 Fetch 3 from list10"<<endl;
|
||||
|
||||
VO_ListOfStr11.GetCFreeHeap().
|
||||
Fetch( VO_ListOfStr10.GetCFreeHeap(), 3);
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list11 size : " <<VO_ListOfStr11.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list11 free size: " <<VO_ListOfStr11.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
|
||||
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("list11 add1"));
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("list11 add2"));
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("list11 add3"));
|
||||
VO_ListOfStr11.AddTail(VO_CStringBase("list11 add4"));
|
||||
|
||||
cout<<"# After add 4 in list11"<<endl;
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list11 size : " <<VO_ListOfStr11.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list11 free size: " <<VO_ListOfStr11.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
|
||||
|
||||
VO_ListOfStr11.GetCFreeHeap().AddHeap(2);
|
||||
VO_ListOfStr10.GetCFreeHeap().MakeEqual( VO_ListOfStr11.GetCFreeHeap() );
|
||||
|
||||
cout<<"# After adding free 2 in list11 and MakeEqual() : list10 and list11"<<endl;
|
||||
|
||||
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
|
||||
cout<<"# list11 size : " <<VO_ListOfStr11.size ()<<endl;
|
||||
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
|
||||
cout<<"# list11 free size: " <<VO_ListOfStr11.GetFreeSize ()<<endl;
|
||||
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
|
||||
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
|
||||
|
||||
cout<<"# list11 IterElement ####" <<endl;
|
||||
{
|
||||
VO_ListOfStr11.IterElement(&ShowDataInNode);
|
||||
}/*
|
||||
cout<<"# list11 IterElement ####" <<endl;*/
|
||||
|
||||
|
||||
cout<<"# list11 IterElement : ZftMCR(CHelpObj)" <<endl;
|
||||
VO_ListOfStr11.IterElement(ZftMCR(VO_CHelpObj));
|
||||
cout<<"# list11 IterElement : ZftMCP(CHelpObj)" <<endl;
|
||||
VO_ListOfStr11.IterElement(ZftMCP(VO_CHelpObj));
|
||||
|
||||
|
||||
VO_ListOfStr11 = VO_ListOfStr10 ;
|
||||
|
||||
cout<<"# list11 IterElement : after list11=list10" <<endl;
|
||||
VO_ListOfStr11.IterElement(ZftMCP(VO_CHelpObj));
|
||||
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
|
||||
public:
|
||||
};/*
|
||||
template<typename TDummy=void*> class ZtCExamCSimList*/
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::
|
||||
|
||||
ZtCExamCSimList<>::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCSimList_000.exe ZtCSimList_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCSimList_000_D.exe ZtCSimList_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -o ZtCSimList_000_mw.exe ZtCSimList_000.cpp -I../ -lWs2_32
|
||||
g++.exe -o ZtCSimList_000_mw_D.exe ZtCSimList_000.cpp -I../ -lWs2_32 -D_DEBUG
|
||||
|
||||
./ZtCSimList_000_mw.exe
|
||||
./ZtCSimList_000_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o ZtCSimList_000.exe ZtCSimList_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++ -std=c++98 -o ZtCSimList_000_D.exe ZtCSimList_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
■ 실행
|
||||
|
||||
./ZtCSimList_000.exe
|
||||
./ZtCSimList_000_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
308
ZCppMainTest/ZtCStringBase_000.cpp
Normal file
308
ZCppMainTest/ZtCStringBase_000.cpp
Normal file
@ -0,0 +1,308 @@
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include "ZCppMain/ZtCStringEx.H"
|
||||
#include "ZCppMain/ZtCStringStd.H"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
typedef ZtCStringStd<string> ZCStringStd ;
|
||||
typedef ZtCStringStd<wstring> ZCStringStdW ;
|
||||
|
||||
typedef ZtCStringBase<char> ZCStringBase ;
|
||||
typedef ZtCStringBase<wchar_t> ZCStringBaseW ;
|
||||
|
||||
typedef ZCStringBase ::ZCCharView ZCCharView ;
|
||||
typedef ZCStringBaseW::ZCCharView ZCCharViewW ;
|
||||
typedef ZCStringStd ::ZCCharView ZCCharViewS ;
|
||||
typedef ZCStringStdW ::ZCCharView ZCCharViewSW ;
|
||||
typedef ZtCCharType<ZCStringBase> ZCCharType ;
|
||||
typedef ZtCCharType<ZCStringBaseW> ZCCharTypeW ;
|
||||
typedef ZtCCharType<ZCStringStd > ZCCharTypeS ;
|
||||
typedef ZtCCharType<ZCStringStdW> ZCCharTypeSW ;
|
||||
|
||||
typedef ZCCharType ::TypeChar TypeChar ;
|
||||
typedef ZCCharTypeW ::TypeChar TypeCharW ;
|
||||
typedef ZCCharType ::TypeInt TypeCharInt ;
|
||||
typedef ZCCharTypeW ::TypeInt TypeCharIntW ;
|
||||
|
||||
typedef ZCCharTypeS ::TypeChar TypeCharS ;
|
||||
typedef ZCCharTypeSW::TypeChar TypeCharSW ;
|
||||
typedef ZCCharTypeS ::TypeInt TypeCharIntS ;
|
||||
typedef ZCCharTypeSW::TypeInt TypeCharIntSW ;
|
||||
|
||||
const int CI_ByteSize = ZCCharType ::CI_ByteSize;
|
||||
const int CI_ByteSizeW = ZCCharTypeW ::CI_ByteSize;
|
||||
const int CI_ByteSizeS = ZCCharTypeS ::CI_ByteSize;
|
||||
const int CI_ByteSizeSW = ZCCharTypeSW::CI_ByteSize;
|
||||
|
||||
|
||||
template<typename TDummy=void*> class ZtCExamCStringBase_000
|
||||
{
|
||||
public:
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
cout<<"# TypeChar ="<<typeid(TypeChar ).name()<<endl;
|
||||
cout<<"# TypeCharW ="<<typeid(TypeCharW ).name()<<endl;
|
||||
cout<<"# TypeCharInt ="<<typeid(TypeCharInt ).name()<<endl;
|
||||
cout<<"# TypeCharIntW ="<<typeid(TypeCharIntW ).name()<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
cout<<"# TypeCharS ="<<typeid(TypeCharS ).name()<<endl;
|
||||
cout<<"# TypeCharSW ="<<typeid(TypeCharSW ).name()<<endl;
|
||||
cout<<"# TypeCharIntS ="<<typeid(TypeCharIntS ).name()<<endl;
|
||||
cout<<"# TypeCharIntSW="<<typeid(TypeCharIntSW).name()<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
cout<<"# CI_ByteSize ="<<CI_ByteSize <<endl;
|
||||
cout<<"# CI_ByteSizeW ="<<CI_ByteSizeW <<endl;
|
||||
cout<<"# CI_ByteSizeS ="<<CI_ByteSizeS <<endl;
|
||||
cout<<"# CI_ByteSizeSW="<<CI_ByteSizeSW <<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
cout<<"# ZCStringBase ::TypeCharInt="<<typeid(ZCStringBase ::TypeCharInt).name()<<endl;
|
||||
cout<<"# ZCStringBaseW::TypeCharInt="<<typeid(ZCStringBaseW::TypeCharInt).name()<<endl;
|
||||
cout<<"# ZCStringBase ::size_type ="<<typeid(ZCStringBase ::size_type ).name()<<endl;
|
||||
cout<<"# ZCStringBaseW::size_type ="<<typeid(ZCStringBaseW::size_type ).name()<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
cout<<"# ZCStringStd ::TypeCharInt="<<typeid(ZCStringStd ::TypeCharInt).name()<<endl;
|
||||
cout<<"# ZCStringStdW ::TypeCharInt="<<typeid(ZCStringStdW ::TypeCharInt).name()<<endl;
|
||||
cout<<"# ZCStringStd ::size_type ="<<typeid(ZCStringStd ::size_type ).name()<<endl;
|
||||
cout<<"# ZCStringStdW ::size_type ="<<typeid(ZCStringStdW ::size_type ).name()<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
cout<<"# ZCStringBase ::traits_type::char_type="<<typeid(ZCStringBase ::traits_type::char_type).name()<<endl;
|
||||
cout<<"# ZCStringBaseW::traits_type::char_type="<<typeid(ZCStringBaseW::traits_type::char_type).name()<<endl;
|
||||
cout<<"# ZCStringBase ::traits_type::int_type ="<<typeid(ZCStringBase ::traits_type::int_type ).name()<<endl;
|
||||
cout<<"# ZCStringBaseW::traits_type::int_type ="<<typeid(ZCStringBaseW::traits_type::int_type ).name()<<endl;
|
||||
|
||||
cout<<"# ZCStringBase ::traits_type="<<typeid(ZCStringBase ::traits_type).name()<<endl;
|
||||
cout<<"# ZCStringBaseW::traits_type="<<typeid(ZCStringBaseW::traits_type).name()<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
|
||||
ZCStringBaseW VO_ZCStringBaseW;
|
||||
ZCStringStdW VO_ZCStringStdW ;
|
||||
|
||||
cout<<"# '.' ascii code ="<<int('.')<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
VO_ZCStringBaseW=123;
|
||||
cout<<"* after VO_ZCStringBaseW=123"<<endl;
|
||||
cout<<"# VO_ZCStringBaseW[0]="<<int(VO_ZCStringBaseW[0])<<endl;
|
||||
cout<<"# VO_ZCStringBaseW[1]="<<int(VO_ZCStringBaseW[1])<<endl;
|
||||
cout<<"# VO_ZCStringBaseW[2]="<<int(VO_ZCStringBaseW[2])<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
cout<<"# VO_ZCStringBaseW.GetLong()="<<VO_ZCStringBaseW.GetLong()<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
VO_ZCStringBaseW=2.3;
|
||||
cout<<"* after VO_ZCStringBaseW=2.3"<<endl;
|
||||
cout<<"# VO_ZCStringBaseW[0]="<<int(VO_ZCStringBaseW[0])<<endl;
|
||||
cout<<"# VO_ZCStringBaseW[1]="<<int(VO_ZCStringBaseW[1])<<endl;
|
||||
cout<<"# VO_ZCStringBaseW[2]="<<int(VO_ZCStringBaseW[2])<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
cout<<"# VO_ZCStringBaseW.GetDouble()="<<VO_ZCStringBaseW.GetDouble()<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
VO_ZCStringStdW=1.2;
|
||||
cout<<"* after VO_ZCStringStdW=1.2"<<endl;
|
||||
cout<<"# VO_ZCStringStdW [0]="<<int(VO_ZCStringStdW[0])<<endl;
|
||||
cout<<"# VO_ZCStringStdW [1]="<<int(VO_ZCStringStdW[1])<<endl;
|
||||
cout<<"# VO_ZCStringStdW [2]="<<int(VO_ZCStringStdW[2])<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
cout<<"# VO_ZCStringStdW.GetDouble()="<<VO_ZCStringStdW.GetDouble()<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
|
||||
const ZCCharView CO_ZCCharView("1234AA5678AA90abcAAss");
|
||||
|
||||
ZCStringBase VO_ZCStringStd(CO_ZCCharView);
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
|
||||
cout<<"* after VO_ZCStringStd.Replace('12', '***')"<<endl;
|
||||
VO_ZCStringStd.Replace(ZCCharView("12"), ZCCharView("***"));
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"* after VO_ZCStringStd=CO_ZCCharView"<<endl;
|
||||
VO_ZCStringStd=CO_ZCCharView;
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"* after Replace('AA', '___')"<<endl;
|
||||
VO_ZCStringStd.Replace(ZCCharView("AA"), ZCCharView("___"));
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"* after Replace('12', '###')"<<endl;
|
||||
VO_ZCStringStd.Replace(ZCCharView("12"), ZCCharView("###"));
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"* after Replace('##', 'T')"<<endl;
|
||||
VO_ZCStringStd.Replace(ZCCharView("##"), ZCCharView("T"));
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"* after Replace('ss', '')"<<endl;
|
||||
VO_ZCStringStd.Replace(ZCCharView("ss"), ZCCharView(""));
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
|
||||
ZftMakeStr(VO_ZCStringStd , ZTypIntULL(1234));
|
||||
ZftMakeStr(VO_ZCStringStd , ZCCharView("--"));
|
||||
ZftMakeStr(VO_ZCStringStd , double(10.01));
|
||||
ZftMakeStr(VO_ZCStringStd , true);
|
||||
ZftMakeStr(VO_ZCStringStd , 'Z');
|
||||
ZftMakeStr(VO_ZCStringStd , ZCCharView("_Z_"));
|
||||
|
||||
ZftMakeStr(VO_ZCStringStdW, ZTypIntULL(1234));
|
||||
ZftMakeStr(VO_ZCStringStdW, ZCCharViewSW(L"--"));
|
||||
ZftMakeStr(VO_ZCStringStdW, double(10.01));
|
||||
ZftMakeStr(VO_ZCStringStdW, true);
|
||||
ZftMakeStr(VO_ZCStringStdW, L'Z');
|
||||
ZftMakeStr(VO_ZCStringStdW, ZCCharViewSW(L"_Z_"));
|
||||
|
||||
VO_ZCStringStdW(false);
|
||||
|
||||
|
||||
cout<<"* after ZftMakeStr(VO_ZCStringStd, ~)"<<endl;
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"* after ZftMakeStr(VO_ZCStringStdW, ~)"<<endl;
|
||||
cout<<"# "<<VO_ZCStringStdW<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"* after VO_ZCStringStd.Replace('T#', '')"<<endl;
|
||||
VO_ZCStringStd.Replace(ZCCharView("T#"), ZCCharView(""));
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"* after Replace('Z_', 'Z@%')"<<endl;
|
||||
VO_ZCStringStd.Replace(ZCCharView("Z_"), ZCCharView("Z@%"));
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"* after Replace('true', '_TRUE_')"<<endl;
|
||||
VO_ZCStringStd.Replace(ZCCharView("true"), ZCCharView("_TRUE_"));
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"* after Replace('_', '~&')"<<endl;
|
||||
VO_ZCStringStd.Replace(ZCCharView("_"), ZCCharView("~&"));
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
cout<<"* after ()(ZCCharViewW('_AZ'))"<<endl;
|
||||
VO_ZCStringStd(ZCCharView("_AZ"));
|
||||
cout<<"# "<<VO_ZCStringStd<<endl;
|
||||
cout<<"*****************************************************"<<endl;
|
||||
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
public:
|
||||
};/*
|
||||
template<typename TDummy=void*> class ZtCExamCStringBase_000*/
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::
|
||||
|
||||
ZtCExamCStringBase_000<>::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCStringBase_000.exe ZtCStringBase_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCStringBase_000_D.exe ZtCStringBase_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -o ZtCStringBase_000_mw.exe ZtCStringBase_000.cpp -I../ -lWs2_32 -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++.exe -o ZtCStringBase_000_mw_D.exe ZtCStringBase_000.cpp -I../ -lWs2_32 -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
./ZtCStringBase_000_mw.exe
|
||||
./ZtCStringBase_000_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o ZtCStringBase_000.exe ZtCStringBase_000.cpp -I../
|
||||
g++ -std=c++98 -o ZtCStringBase_000_D.exe ZtCStringBase_000.cpp -I../ -D_DEBUG
|
||||
|
||||
g++ -std=c++98 -o ZtCStringBase_000.exe ZtCStringBase_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++ -std=c++98 -o ZtCStringBase_000_D.exe ZtCStringBase_000.cpp -I../ -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
■ 실행
|
||||
|
||||
./ZtCStringBase_000.exe
|
||||
./ZtCStringBase_000_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
232
ZCppMainTest/ZtCThreadEx_000.cpp
Normal file
232
ZCppMainTest/ZtCThreadEx_000.cpp
Normal file
@ -0,0 +1,232 @@
|
||||
|
||||
|
||||
#ifndef _REENTRANT_EX
|
||||
#define _REENTRANT_EX
|
||||
#endif
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include "ZCppMain/ZCStringStd.H"
|
||||
#include "ZCppMain/ZCProcess.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
template<typename TDummy=void*> class ZtCExamThread
|
||||
{
|
||||
public:
|
||||
|
||||
class CThreadMy : public ZNsMain::ZtCThreadEx<CThreadMy>
|
||||
{
|
||||
public :
|
||||
typedef ZNsMain::ZtCThreadEx<CThreadMy> TypeBase;
|
||||
public :
|
||||
friend class ZNsMain:: ZtCThreadEx<CThreadMy>;
|
||||
private:
|
||||
|
||||
void Init()
|
||||
{
|
||||
this->TypeBase::Init(); cout<<"* Init0()"<<endl;
|
||||
}
|
||||
void Exec()
|
||||
{
|
||||
this->TypeBase::Exec(); cout<<"* Exec0()"<<endl;
|
||||
}
|
||||
void Fini()
|
||||
{
|
||||
this->TypeBase::Fini(); cout<<"* Fini0()"<<endl;
|
||||
}
|
||||
|
||||
|
||||
void Init(ZCStringStd& AR_KeyCStr)
|
||||
{
|
||||
this->TypeBase::template Init<ZCStringStd&>(AR_KeyCStr); cout<<"* Init1() : "<<AR_KeyCStr<<endl;
|
||||
}
|
||||
void Exec(ZCStringStd& AR_KeyCStr)
|
||||
{
|
||||
this->TypeBase::template Exec<ZCStringStd&>(AR_KeyCStr); cout<<"* Exec1() : "<<AR_KeyCStr<<endl;
|
||||
}
|
||||
void Fini(ZCStringStd& AR_KeyCStr)
|
||||
{
|
||||
this->TypeBase::template Fini<ZCStringStd&>(AR_KeyCStr); cout<<"* Fini1() : "<<AR_KeyCStr<<endl;
|
||||
}
|
||||
|
||||
|
||||
void Init(ZCStringStd& AR_KeyCStr, ZCStringStd& AR_KeyCStr2)
|
||||
{
|
||||
this->TypeBase::template Init
|
||||
<ZCStringStd&, ZCStringStd&>(AR_KeyCStr, AR_KeyCStr2);
|
||||
|
||||
cout<<"* Init2() : "<<AR_KeyCStr<<", "<<AR_KeyCStr2<<endl;
|
||||
}
|
||||
void Exec(ZCStringStd& AR_KeyCStr, ZCStringStd& AR_KeyCStr2)
|
||||
{
|
||||
this->TypeBase::template Exec
|
||||
<ZCStringStd&, ZCStringStd&>(AR_KeyCStr, AR_KeyCStr2);
|
||||
|
||||
cout<<"* Init2() : "<<AR_KeyCStr<<", "<<AR_KeyCStr2<<endl;
|
||||
}
|
||||
void Fini(ZCStringStd& AR_KeyCStr, ZCStringStd& AR_KeyCStr2)
|
||||
{
|
||||
this->TypeBase::template Fini
|
||||
<ZCStringStd&, ZCStringStd&>(AR_KeyCStr, AR_KeyCStr2);
|
||||
|
||||
cout<<"* Init2() : "<<AR_KeyCStr<<", "<<AR_KeyCStr2<<endl;
|
||||
}
|
||||
|
||||
|
||||
void Init(ZCStringStd& AR_KeyCStr, ZCStringStd& AR_KeyCStr2, ZCStringStd& AR_KeyCStr3)
|
||||
{
|
||||
this->TypeBase::template Init
|
||||
<ZCStringStd&, ZCStringStd&, ZCStringStd&>
|
||||
( AR_KeyCStr, AR_KeyCStr2, AR_KeyCStr3 ) ;
|
||||
|
||||
cout<<"* Init3() : "<<AR_KeyCStr<<", "<<AR_KeyCStr2<<", "<<AR_KeyCStr3<<endl;
|
||||
}
|
||||
void Exec(ZCStringStd& AR_KeyCStr, ZCStringStd& AR_KeyCStr2, ZCStringStd& AR_KeyCStr3)
|
||||
{
|
||||
this->TypeBase::template Exec
|
||||
<ZCStringStd&, ZCStringStd&, ZCStringStd&>
|
||||
( AR_KeyCStr, AR_KeyCStr2, AR_KeyCStr3 ) ;
|
||||
|
||||
cout<<"* Init3() : "<<AR_KeyCStr<<", "<<AR_KeyCStr2<<", "<<AR_KeyCStr3<<endl;
|
||||
}
|
||||
void Fini(ZCStringStd& AR_KeyCStr, ZCStringStd& AR_KeyCStr2, ZCStringStd& AR_KeyCStr3)
|
||||
{
|
||||
this->TypeBase::template Fini
|
||||
<ZCStringStd&, ZCStringStd&, ZCStringStd&>
|
||||
( AR_KeyCStr, AR_KeyCStr2, AR_KeyCStr3 ) ;
|
||||
|
||||
cout<<"* Init3() : "<<AR_KeyCStr<<", "<<AR_KeyCStr2<<", "<<AR_KeyCStr3<<endl;
|
||||
}
|
||||
|
||||
private:
|
||||
};/*
|
||||
class CThreadMy : public ZNsMain::ZtCThreadEx<CThreadMy>*/
|
||||
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
CThreadMy VO_CThreadMy1 ;
|
||||
CThreadMy VO_CThreadMy2 ;
|
||||
CThreadMy VO_CThreadMy3 ;
|
||||
CThreadMy VO_CThreadMy4 ;
|
||||
|
||||
ZCStringStd VO_ZCStringStd1("Help Data1");
|
||||
ZCStringStd VO_ZCStringStd2("Help Data2");
|
||||
ZCStringStd VO_ZCStringStd3("Help Data3");
|
||||
|
||||
VO_CThreadMy1.Make();
|
||||
cout<<"# Press Enter to continue."<<endl; cin.get();
|
||||
VO_CThreadMy2.Make(ZftMCP(VO_ZCStringStd1));
|
||||
cout<<"# Press Enter to continue."<<endl; cin.get();
|
||||
VO_CThreadMy3.Make(ZftMCP(VO_ZCStringStd1), ZftMCP(VO_ZCStringStd2));
|
||||
cout<<"# Press Enter to continue."<<endl; cin.get();
|
||||
VO_CThreadMy4.Make(ZftMCP(VO_ZCStringStd1), ZftMCP(VO_ZCStringStd2), ZftMCP(VO_ZCStringStd3));
|
||||
cout<<"# Press Enter to continue."<<endl; cin.get();
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
|
||||
public:
|
||||
};/*
|
||||
template<typename TDummy=void*> class ZtCExamThread*/
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::
|
||||
|
||||
ZtCExamThread<>::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCThreadEx_000.exe ZtCThreadEx_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCThreadEx_000_D.exe ZtCThreadEx_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -std=c++98 -o ZtCThreadEx_000_mw.exe ZtCThreadEx_000.cpp -I../
|
||||
g++.exe -std=c++98 -o ZtCThreadEx_000_mw_D.exe ZtCThreadEx_000.cpp -I../ -D_DEBUG
|
||||
|
||||
./ZtCThreadEx_000_mw.exe
|
||||
./ZtCThreadEx_000_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o ZtCThreadEx_000.exe ZtCThreadEx_000.cpp -I../ -lpthread
|
||||
g++ -std=c++98 -o ZtCThreadEx_000_D.exe ZtCThreadEx_000.cpp -I../ -lpthread -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
■ 실행
|
||||
|
||||
./ZtCThreadEx_000.exe
|
||||
./ZtCThreadEx_000_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
231
ZCppMainTest/ZtCThreadEx_001.cpp
Normal file
231
ZCppMainTest/ZtCThreadEx_001.cpp
Normal file
@ -0,0 +1,231 @@
|
||||
|
||||
|
||||
#ifndef _REENTRANT_EX
|
||||
#define _REENTRANT_EX
|
||||
#endif
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include "ZCppMain/ZCProcess.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
template<typename TDummy=void*> class ZtCExamThread_001
|
||||
{
|
||||
public:
|
||||
|
||||
class ZCThreadMy : public ZNsMain::ZtCThreadEx<ZCThreadMy>
|
||||
{
|
||||
public :
|
||||
typedef ZNsMain::ZtCThreadEx<ZCThreadMy> TypeBase;
|
||||
public :
|
||||
friend class ZNsMain:: ZtCThreadEx<ZCThreadMy>;
|
||||
public :
|
||||
static int GI_CallCnt;
|
||||
private:
|
||||
|
||||
void Init()
|
||||
{
|
||||
this->TypeBase::Init(); cout<<"* Init0() : "<<++ZCThreadMy::GI_CallCnt<<endl;
|
||||
}
|
||||
void Exec()
|
||||
{
|
||||
this->TypeBase::Exec(); cout<<"* Exec0() : "<<++ZCThreadMy::GI_CallCnt<<endl;
|
||||
}
|
||||
void Fini()
|
||||
{
|
||||
this->TypeBase::Fini(); cout<<"* Fini0() : "<<++ZCThreadMy::GI_CallCnt<<endl;
|
||||
}
|
||||
|
||||
|
||||
void Init(int& ARRI_CallCnt)
|
||||
{
|
||||
this->TypeBase::template Init<int&>(ARRI_CallCnt); cout<<"* Init1() : "<<++ARRI_CallCnt<<endl;
|
||||
}
|
||||
void Exec(int& ARRI_CallCnt)
|
||||
{
|
||||
this->TypeBase::template Exec<int&>(ARRI_CallCnt); cout<<"* Exec1() : "<<++ARRI_CallCnt<<endl;
|
||||
}
|
||||
void Fini(int& ARRI_CallCnt)
|
||||
{
|
||||
this->TypeBase::template Fini<int&>(ARRI_CallCnt); cout<<"* Fini1() : "<<++ARRI_CallCnt<<endl;
|
||||
}
|
||||
|
||||
|
||||
void Init(int& ARRI_CallCnt, int& ARRI_CallCnt2)
|
||||
{
|
||||
this->TypeBase::template Init
|
||||
<int&, int&>(ARRI_CallCnt, ARRI_CallCnt2);
|
||||
|
||||
cout<<"* Init2() : "<<++ARRI_CallCnt<<", "<<ARRI_CallCnt2<<endl;
|
||||
}
|
||||
void Exec(int& ARRI_CallCnt, int& ARRI_CallCnt2)
|
||||
{
|
||||
this->TypeBase::template Exec
|
||||
<int&, int&>(ARRI_CallCnt, ARRI_CallCnt2);
|
||||
|
||||
cout<<"* Init2() : "<<++ARRI_CallCnt<<", "<<ARRI_CallCnt2<<endl;
|
||||
}
|
||||
void Fini(int& ARRI_CallCnt, int& ARRI_CallCnt2)
|
||||
{
|
||||
this->TypeBase::template Fini
|
||||
<int&, int&>(ARRI_CallCnt, ARRI_CallCnt2);
|
||||
|
||||
cout<<"* Init2() : "<<++ARRI_CallCnt<<", "<<ARRI_CallCnt2<<endl;
|
||||
}
|
||||
|
||||
|
||||
void Init(int& ARRI_CallCnt, int& ARRI_CallCnt2, int& ARRI_CallCnt3)
|
||||
{
|
||||
this->TypeBase::template Init<int&, int&, int&>
|
||||
( ARRI_CallCnt, ARRI_CallCnt2, ARRI_CallCnt3 ) ;
|
||||
|
||||
cout<<"* Init3() : "<<++ARRI_CallCnt<<", "<<ARRI_CallCnt2<<", "<<ARRI_CallCnt3<<endl;
|
||||
}
|
||||
void Exec(int& ARRI_CallCnt, int& ARRI_CallCnt2, int& ARRI_CallCnt3)
|
||||
{
|
||||
this->TypeBase::template Exec<int&, int&, int&>
|
||||
( ARRI_CallCnt, ARRI_CallCnt2, ARRI_CallCnt3 ) ;
|
||||
|
||||
cout<<"* Init3() : "<<++ARRI_CallCnt<<", "<<ARRI_CallCnt2<<", "<<ARRI_CallCnt3<<endl;
|
||||
}
|
||||
void Fini(int& ARRI_CallCnt, int& ARRI_CallCnt2, int& ARRI_CallCnt3)
|
||||
{
|
||||
this->TypeBase::template Fini<int&, int&, int&>
|
||||
( ARRI_CallCnt, ARRI_CallCnt2, ARRI_CallCnt3 ) ;
|
||||
|
||||
cout<<"* Init3() : "<<++ARRI_CallCnt<<", "<<ARRI_CallCnt2<<", "<<ARRI_CallCnt3<<endl;
|
||||
}
|
||||
|
||||
private:
|
||||
};/*
|
||||
class ZCThreadMy : public ZNsMain::ZtCThreadEx<ZCThreadMy>*/
|
||||
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
ZCThreadMy VO_CThreadMy1 ;
|
||||
ZCThreadMy VO_CThreadMy2 ;
|
||||
ZCThreadMy VO_CThreadMy3 ;
|
||||
ZCThreadMy VO_CThreadMy4 ;
|
||||
|
||||
VO_CThreadMy1.Make();
|
||||
cout<<"# Press Enter to continue."<<endl; cin.get();
|
||||
VO_CThreadMy2.Make(ZftMCP(ZCThreadMy::GI_CallCnt));
|
||||
cout<<"# Press Enter to continue."<<endl; cin.get();
|
||||
VO_CThreadMy3.Make(ZftMCP(ZCThreadMy::GI_CallCnt), ZftMCP(ZCThreadMy::GI_CallCnt));
|
||||
cout<<"# Press Enter to continue."<<endl; cin.get();
|
||||
VO_CThreadMy4.Make(ZftMCP(ZCThreadMy::GI_CallCnt), ZftMCP(ZCThreadMy::GI_CallCnt), ZftMCP(ZCThreadMy::GI_CallCnt));
|
||||
cout<<"# Press Enter to continue."<<endl; cin.get();
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
|
||||
public:
|
||||
};/*
|
||||
template<typename TDummy=void*> class ZtCExamThread_001*/
|
||||
|
||||
|
||||
|
||||
template<typename TDummy> int
|
||||
ZtCExamThread_001<TDummy>::ZCThreadMy::GI_CallCnt =0 ;
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::
|
||||
|
||||
ZtCExamThread_001<>::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCThreadEx_001.exe ZtCThreadEx_001.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCThreadEx_001_D.exe ZtCThreadEx_001.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -std=c++98 -o ZtCThreadEx_001_mw.exe ZtCThreadEx_001.cpp -I../
|
||||
g++.exe -std=c++98 -o ZtCThreadEx_001_mw_D.exe ZtCThreadEx_001.cpp -I../ -D_DEBUG
|
||||
|
||||
./ZtCThreadEx_001_mw.exe
|
||||
./ZtCThreadEx_001_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o ZtCThreadEx_001.exe ZtCThreadEx_001.cpp -I../ -lpthread
|
||||
g++ -std=c++98 -o ZtCThreadEx_001_D.exe ZtCThreadEx_001.cpp -I../ -lpthread -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
■ 실행
|
||||
|
||||
./ZtCThreadEx_001.exe
|
||||
./ZtCThreadEx_001_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
237
ZCppMainTest/ZtCThreadEx_002_MutexCond.cpp
Normal file
237
ZCppMainTest/ZtCThreadEx_002_MutexCond.cpp
Normal file
@ -0,0 +1,237 @@
|
||||
|
||||
|
||||
#ifndef _REENTRANT_EX
|
||||
#define _REENTRANT_EX
|
||||
#endif
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include "ZCppMain/ZCProcess.H"
|
||||
#include "ZCppMain/ZMainHeadEx.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain;
|
||||
|
||||
|
||||
const int CI_RepeatCnt = 3 ;
|
||||
const int CI_WaitMilli = 1000 ;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
template<typename TDummy=void*> class ZtCExamThread_002
|
||||
{
|
||||
public:
|
||||
typedef ZtCMutexCondData<> ZCMutexCondData;
|
||||
public:
|
||||
|
||||
class ZCThreadMy : public ZNsMain::ZtCThreadEx<ZCThreadMy>
|
||||
{
|
||||
public :
|
||||
typedef ZNsMain::ZtCThreadEx<ZCThreadMy> TypeBase;
|
||||
public :
|
||||
friend class ZNsMain:: ZtCThreadEx<ZCThreadMy>;
|
||||
private:
|
||||
|
||||
void Init(ZCMutexCondData& AR_CMutexCond)
|
||||
{
|
||||
this->TypeBase::template Init<ZCMutexCondData&>(AR_CMutexCond);
|
||||
|
||||
/*@@@@@@@@@*/ AR_CMutexCond.Lock(); /*@@@@@@@@@*/
|
||||
{
|
||||
__for1(int, i, CI_RepeatCnt)
|
||||
{
|
||||
cout<<"# *** Thread Init "<<i<<endl; ZfSuspendExec(CI_WaitMilli);
|
||||
}
|
||||
/*::::::::::::::::::::::::*/
|
||||
}
|
||||
AR_CMutexCond.WakeCond();
|
||||
AR_CMutexCond.WaitCond();
|
||||
}/*
|
||||
void Init(ZCMutexCondData& AR_CMutexCond)*/
|
||||
|
||||
void Exec(ZCMutexCondData& AR_CMutexCond)
|
||||
{
|
||||
this->TypeBase::template Exec<ZCMutexCondData&>(AR_CMutexCond);
|
||||
{
|
||||
__for1(int, i, CI_RepeatCnt)
|
||||
{
|
||||
cout<<"# >>> Thread Exec "<<i<<endl; ZfSuspendExec(CI_WaitMilli);
|
||||
}
|
||||
/*::::::::::::::::::::::::*/
|
||||
}
|
||||
AR_CMutexCond.WakeCond();
|
||||
AR_CMutexCond.WaitCond();
|
||||
}/*
|
||||
void Exec(ZCMutexCondData& AR_CMutexCond)*/
|
||||
|
||||
void Fini(ZCMutexCondData& AR_CMutexCond)
|
||||
{
|
||||
this->TypeBase::template Fini<ZCMutexCondData&>(AR_CMutexCond);
|
||||
{
|
||||
__for1(int, i, CI_RepeatCnt)
|
||||
{
|
||||
cout<<"# *** Thread Fini "<<i<<endl; ZfSuspendExec(CI_WaitMilli);
|
||||
}
|
||||
/*::::::::::::::::::::::::*/
|
||||
}
|
||||
AR_CMutexCond.WakeCond();
|
||||
|
||||
/*@@@@@@@@@*/ AR_CMutexCond.UnLock(); /*@@@@@@@@@*/
|
||||
}/*
|
||||
void Fini(ZCMutexCondData& AR_CMutexCond)*/
|
||||
|
||||
private:
|
||||
};/*
|
||||
class ZCThreadMy : public ZNsMain::ZtCThreadEx<ZCThreadMy>*/
|
||||
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
ZCMutexCondData VO_CMutexCond;
|
||||
ZCThreadMy VO_CThreadMy ;
|
||||
|
||||
VO_CMutexCond.InitCond();
|
||||
cout<<"- Mutex Init Cond" <<endl;
|
||||
VO_CMutexCond.Lock ();
|
||||
{
|
||||
VO_CThreadMy.Make(ZftMCP(VO_CMutexCond));
|
||||
cout<<"- Wait Thread Init"<<endl;
|
||||
VO_CMutexCond.WaitCond();
|
||||
{
|
||||
__for1(int, i, CI_RepeatCnt)
|
||||
{
|
||||
cout<<"- Ack Thread Init "<<i<<endl; ZfSuspendExec(CI_WaitMilli);
|
||||
}
|
||||
}
|
||||
VO_CMutexCond.WakeCond();
|
||||
cout<<"- Wait Thread Exec"<<endl;
|
||||
VO_CMutexCond.WaitCond();
|
||||
{
|
||||
__for1(int, i, CI_RepeatCnt)
|
||||
{
|
||||
cout<<"- Ack Thread Exec "<<i<<endl; ZfSuspendExec(CI_WaitMilli);
|
||||
}
|
||||
/*::::::::::::::::::::::::*/
|
||||
}
|
||||
VO_CMutexCond.WakeCond();
|
||||
cout<<"- Wait Thread Fini"<<endl;
|
||||
VO_CMutexCond.WaitCond();
|
||||
{
|
||||
__for1(int, i, CI_RepeatCnt)
|
||||
{
|
||||
cout<<"- Ack Thread Fini "<<i<<endl; ZfSuspendExec(CI_WaitMilli);
|
||||
}
|
||||
/*::::::::::::::::::::::::*/
|
||||
}
|
||||
}
|
||||
VO_CMutexCond.UnLock();
|
||||
|
||||
|
||||
VO_CMutexCond.FiniCond(); cout<<"- Mutex Fini Cond" <<endl;
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
|
||||
public:
|
||||
};/*
|
||||
template<typename TDummy=void*> class ZtCExamThread_002*/
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::
|
||||
|
||||
ZtCExamThread_002<>::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o ZtCThreadEx_002_MutexCond.exe ZtCThreadEx_002_MutexCond.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o ZtCThreadEx_002_MutexCond_D.exe ZtCThreadEx_002_MutexCond.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -std=c++98 -o ZtCThreadEx_002_MutexCond_mw.exe ZtCThreadEx_002_MutexCond.cpp -I../ -lWs2_32
|
||||
g++.exe -std=c++98 -o ZtCThreadEx_002_MutexCond_mw_D.exe ZtCThreadEx_002_MutexCond.cpp -I../ -lWs2_32 -D_DEBUG
|
||||
|
||||
g++.exe -std=c++98 -o ZtCThreadEx_002_MutexCond_mw.exe ZtCThreadEx_002_MutexCond.cpp -I../ -lWs2_32
|
||||
g++.exe -std=c++98 -o ZtCThreadEx_002_MutexCond_mw_D.exe ZtCThreadEx_002_MutexCond.cpp -I../ -lWs2_32 -D_DEBUG
|
||||
|
||||
./ZtCThreadEx_002_MutexCond_mw.exe
|
||||
./ZtCThreadEx_002_MutexCond_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o ZtCThreadEx_002_MutexCond.exe ZtCThreadEx_002_MutexCond.cpp -I../ -lpthread -Wall -Wno-unused-function -Wno-misleading-indentation
|
||||
g++ -std=c++98 -o ZtCThreadEx_002_MutexCond_D.exe ZtCThreadEx_002_MutexCond.cpp -I../ -lpthread -Wall -Wno-unused-function -Wno-misleading-indentation -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
■ 실행
|
||||
|
||||
./ZtCThreadEx_002_MutexCond.exe
|
||||
./ZtCThreadEx_002_MutexCond_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
@ -62,7 +62,7 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cigwin 컴파일
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o c++_test_005.exe c++_test_005.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o c++_test_005_D.exe c++_test_005.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
317
ZCppMainTest/c++_test_006.cpp
Normal file
317
ZCppMainTest/c++_test_006.cpp
Normal file
@ -0,0 +1,317 @@
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "ZCppMain/ZMainHead.H"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
using namespace ZNsMain;
|
||||
|
||||
|
||||
namespace ZNsMain
|
||||
{
|
||||
|
||||
namespace ZNsExam
|
||||
{
|
||||
|
||||
template<typename TType> class ZtCTest
|
||||
{
|
||||
public:
|
||||
template<TType TTypeVar> class ZCTypeVar
|
||||
{
|
||||
public:
|
||||
TType MO_TypeVar;
|
||||
public:
|
||||
ZCTypeVar()
|
||||
{
|
||||
MO_TypeVar=TTypeVar;
|
||||
}
|
||||
public:
|
||||
};/*
|
||||
template<TType TTypeVar> class ZCTypeVar*/
|
||||
public:
|
||||
};/*
|
||||
template<typename TType> class ZtCTest*/
|
||||
|
||||
|
||||
template<typename TType, TType TTypeVar> class ZtCTest2
|
||||
{
|
||||
public:
|
||||
TType MO_TypeVar;
|
||||
public:
|
||||
ZtCTest2()
|
||||
{
|
||||
MO_TypeVar=TTypeVar;
|
||||
}
|
||||
public:
|
||||
};/*
|
||||
template<typename TType, TType TTypeVar> class ZtCTest2*/
|
||||
|
||||
|
||||
class ZCTypeView
|
||||
{
|
||||
public:
|
||||
|
||||
ZCTypeView()
|
||||
{
|
||||
cout<<"# ZCTypeView()"<<endl;
|
||||
}
|
||||
ZCTypeView(const ZCTypeView& rhs)
|
||||
{
|
||||
cout<<"ZCTypeView(const ZCTypeView& rhs)"<<endl;
|
||||
}
|
||||
~ZCTypeView()
|
||||
{
|
||||
cout<<"# ~ZCTypeView()"<<endl;
|
||||
}
|
||||
|
||||
template<typename TTypChain> void OnMeetType()
|
||||
{
|
||||
cout<<TTypChain::ZETypeNo<<" : "<<typeid(typename TTypChain::TypeData).name()<<endl;
|
||||
}
|
||||
template<typename TTypChain, typename TTypHelp> void OnMeetType(TTypHelp& AR_CallNo)
|
||||
{
|
||||
cout<<"* Call No="<<++AR_CallNo<<" : "<<TTypChain::ZETypeNo<<" : "<<typeid(typename TTypChain::TypeData).name()<<endl;
|
||||
}
|
||||
|
||||
template<typename TTypChain> void OnMeetTypeVal()
|
||||
{
|
||||
cout<<"* Val="<<TTypChain::GetData()<<", ETypeNo="<<TTypChain::ZETypeNo<<" : "<<typeid(typename TTypChain::TypeData).name()<<endl;
|
||||
}
|
||||
template<typename TTypChain, typename TTypHelp> void OnMeetTypeVal(TTypHelp& AR_CallNo)
|
||||
{
|
||||
cout<<"* Call No="<<++AR_CallNo<<" : Val="<<TTypChain::GetData()<<", ETypeNo="<<TTypChain::ZETypeNo<<" : "<<typeid(typename TTypChain::TypeData).name()<<endl;
|
||||
}
|
||||
|
||||
template<typename TObjtChain> void OnMeetData(TObjtChain& AR_NowChain)
|
||||
{
|
||||
cout<<"* Type No="<<AR_NowChain.GetNo()<<" : "<<AR_NowChain.GetData()<<endl;
|
||||
}
|
||||
template<typename TObjtChain> void OnMeetData(TObjtChain& AR_NowChain, int& ARI_CallNo)
|
||||
{
|
||||
cout<<"# CallNo="<<++ARI_CallNo<<" : Type No="<<AR_NowChain.GetNo()<<" : "<<AR_NowChain.GetData()<<endl;
|
||||
}
|
||||
};/*
|
||||
class ZCTypeView*/
|
||||
|
||||
|
||||
template<typename TType> class ZCShowType
|
||||
{
|
||||
public:
|
||||
ZCShowType()
|
||||
{
|
||||
cout<<"# TType typename="<<typeid(TType).name()<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||
{
|
||||
ZCShowType<int> myShowType1;
|
||||
ZCShowType<double> myShowType2;
|
||||
ZCShowType<ZTypLLong> myShowType3;
|
||||
//ZCShowType<"abc"> myShowType4; //error
|
||||
|
||||
const int CI_Var1=10;
|
||||
const int CI_Var2=20;
|
||||
const int CI_Var3=30;
|
||||
|
||||
ZtCTest<int>::ZCTypeVar<CI_Var1> myintvar1 ;
|
||||
ZtCTest2<int, CI_Var2> myintvar2 ;
|
||||
ZtCTest2<ZTypLLong, CI_Var3> myintvar3 ;
|
||||
|
||||
cout<<myintvar1.MO_TypeVar<<endl;
|
||||
cout<<myintvar2.MO_TypeVar<<endl;
|
||||
cout<<myintvar3.MO_TypeVar<<endl;
|
||||
|
||||
|
||||
typedef ZtCMiniValChain
|
||||
<
|
||||
char , 'a' , ZtCMiniValChain<
|
||||
char , 'b' , ZtCMiniValChain<
|
||||
char , 'c' , ZtCMiniValChain<
|
||||
//double, 10.2 , ZtCMiniValChain< // error in linux
|
||||
//string, string("123") , ZtCMiniValChain< // error
|
||||
long , 10 , ZtCMiniValChain<
|
||||
int , 19 ,
|
||||
ZCEmpty > > > >
|
||||
> ZCMiniValChain; ZCTypeView VO_ZCTypeView; int VI_CallNo = 0;
|
||||
|
||||
cout<<"# ZCMiniValChain.size()="<<ZCMiniValChain::size()<<endl;
|
||||
|
||||
ZCMiniValChain::ZtCIterChain<ZCTypeView&>::IterHead(VO_ZCTypeView);
|
||||
cout<<"************************************"<<endl;
|
||||
ZCMiniValChain::ZtCIterChain<ZCTypeView&>::IterTail(VO_ZCTypeView);
|
||||
cout<<"************************************"<<endl;
|
||||
|
||||
ZCMiniValChain::ZtCIterChain<ZCTypeView&>::IterHead(VO_ZCTypeView, ZftMCP(VI_CallNo = 0));
|
||||
cout<<"************************************"<<endl;
|
||||
ZCMiniValChain::ZtCIterChain<ZCTypeView&>::IterTail(VO_ZCTypeView, ZftMCP(VI_CallNo = 0));
|
||||
cout<<"************************************"<<endl;
|
||||
|
||||
|
||||
typedef ZtCTypeChain
|
||||
<
|
||||
double , ZtCTypeChain<
|
||||
int , ZtCTypeChain<
|
||||
wchar_t, ZtCTypeChain<
|
||||
char ,
|
||||
|
||||
ZCEmpty > > >
|
||||
> ZCTypeChain;
|
||||
|
||||
cout<<"tmpl chain size = "<<ZCTypeChain::Size()<<endl;
|
||||
|
||||
ZftIterTypeChainTail<ZCTypeChain, ZCTypeView&>(VO_ZCTypeView);
|
||||
|
||||
cout<<"@** call start : ZCTypeView(rhs) **********@"<<endl;
|
||||
ZCTypeChain::ZtCIterChain<ZCTypeView>::IterHead(VO_ZCTypeView);
|
||||
cout<<"@******************************************@"<<endl;
|
||||
ZCTypeChain::ZtCIterChain<ZCTypeView>::IterTail(VO_ZCTypeView);
|
||||
cout<<"@*** call close : ZCTypeView(rhs) *********@"<<endl;
|
||||
|
||||
ZftIterTypeChainHead<ZCTypeChain, ZCTypeView&, int&>
|
||||
( VO_ZCTypeView, (VI_CallNo = 0) );
|
||||
cout<<"************************************"<<endl;
|
||||
ZftIterTypeChainTail<ZCTypeChain, ZCTypeView&, int&>
|
||||
( VO_ZCTypeView, (VI_CallNo = 0) );
|
||||
|
||||
cout<<"************************************"<<endl;
|
||||
ZCTypeChain::ZtCIterChain<ZCTypeView&>::
|
||||
IterHead(VO_ZCTypeView, ZftMCP(VI_CallNo=0));
|
||||
cout<<"************************************"<<endl;
|
||||
ZCTypeChain::ZtCIterChain<ZCTypeView&>::
|
||||
IterTail(VO_ZCTypeView, ZftMCP(VI_CallNo=0));
|
||||
cout<<"************************************"<<endl;
|
||||
|
||||
|
||||
typedef ZtCDataRing<std::string> ZCDataRing;
|
||||
|
||||
ZCDataRing VO_CDataRing = string("123");
|
||||
|
||||
VO_CDataRing.AddTail(string("ABC"));
|
||||
VO_CDataRing.AddTail(string("XYZ"));
|
||||
|
||||
cout<<"# VO_CDataRing Size = "<<VO_CDataRing.size()<<endl;
|
||||
cout<<"# VO_CDataRing Data = "<<VO_CDataRing <<endl;
|
||||
cout<<"************************************"<<endl;
|
||||
cout<<"# VO_CDataRing IterThis = "<<endl;
|
||||
VO_CDataRing.IterThis(&ZftPrint<string>); cout<<endl;
|
||||
cout<<"************************************"<<endl;
|
||||
cout<<"# VO_CDataRing IterHead = "<<endl;
|
||||
VO_CDataRing.IterHead(&ZftPrint<string>); cout<<endl;
|
||||
cout<<"************************************"<<endl;
|
||||
cout<<"# VO_CDataRing IterTail = "<<endl;
|
||||
VO_CDataRing.IterTail(&ZftPrint<string>); cout<<endl;
|
||||
cout<<"************************************"<<endl;
|
||||
cout<<"# VO_CDataRing IterThisRev = "<<endl;
|
||||
VO_CDataRing.IterThisRev(&ZftPrint<string>); cout<<endl;
|
||||
cout<<"************************************"<<endl;
|
||||
cout<<"# VO_CDataRing IterThisRev(HelpType char(',')) = "<<endl;
|
||||
VO_CDataRing.IterThisRev(&ZftPrint<string, char>, char(',')); cout<<endl;
|
||||
cout<<"************************************"<<endl;
|
||||
cout<<"# VO_CDataRing IterTail(HelpType char(',')) = "<<endl;
|
||||
VO_CDataRing.IterTail (&ZftPrint<string, char>, char(',')); cout<<endl;
|
||||
cout<<"************************************"<<endl;
|
||||
|
||||
|
||||
typedef ZtCDataRing<ZCTypeView> ZCViewRing;
|
||||
|
||||
ZCViewRing VO_ZCViewRing;
|
||||
|
||||
VO_ZCViewRing.AddTail();
|
||||
VO_ZCViewRing.AddTail();
|
||||
VO_ZCViewRing.DeleteAll();
|
||||
cout<<"************************************"<<endl;
|
||||
|
||||
return 0;
|
||||
}/*
|
||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||
|
||||
}/*
|
||||
namespace ZNsExam*/
|
||||
|
||||
}/*
|
||||
namespace ZNsMain*/
|
||||
|
||||
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])
|
||||
{
|
||||
return ZNsMain::ZNsExam::Main(AI_ArgCnt, APP_ArgVal);
|
||||
}/*
|
||||
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
|
||||
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
■ cygwin 컴파일
|
||||
|
||||
// g++ -mno-cygwin -o c++_test_006.exe c++_test_006.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
|
||||
// g++ -mno-cygwin -o c++_test_006_D.exe c++_test_006.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
|
||||
|
||||
■ mingw 컴파일
|
||||
|
||||
g++.exe -o c++_test_006_mw.exe c++_test_006.cpp -I../
|
||||
g++.exe -o c++_test_006_mw_D.exe c++_test_006.cpp -I../ -D_DEBUG
|
||||
|
||||
./c++_test_006_mw.exe
|
||||
./c++_test_006_mw_D.exe
|
||||
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# date
|
||||
Sun Aug 24 10:47:09 KST 2025
|
||||
|
||||
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
|
||||
# g++ --version
|
||||
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
■ Linux 컴파일
|
||||
|
||||
g++ -std=c++98 -o c++_test_006.exe c++_test_006.cpp -I../
|
||||
g++ -std=c++98 -o c++_test_006_D.exe c++_test_006.cpp -I../ -D_DEBUG
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
|
||||
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
|
||||
Sun Aug 24 00:05:51 DST 2025
|
||||
|
||||
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.6 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.6 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
|
||||
CentOS Linux release 7.9.2009 (Core)
|
||||
|
||||
[sauron@q381-2657 ZCppMainTest]$ g++ --version
|
||||
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
■ 실행
|
||||
|
||||
./c++_test_006.exe
|
||||
./c++_test_006_D.exe
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
Reference in New Issue
Block a user