-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathailib.ps1
94 lines (86 loc) · 3.29 KB
/
ailib.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Gfaerny
# # AILIB shell script App that provide standard library
# # No license
# # for cpp
# # Just for concept
$file = $args[0]
# # for make it first -Append $false
# For iostream lib
for ($i = 1; $i -le 1; $i++) {
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::cout") {
Add-Content -Path $file -Value "#include <iostream>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::cin") {
Add-Content -Path $file -Value "#include <iostream>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::clog") {
Add-Content -Path $file -Value "#include <iostream>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::cerr") {
Add-Content -Path $file -Value "#include <iostream>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::wcin") {
Add-Content -Path $file -Value "#include <iostream>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::wcout") {
Add-Content -Path $file -Value "#include <iostream>"
break
}
}
# End of iostream stm
# statement that depend sstream lib
for ($i = 1; $i -le 1; $i++) {
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::stringbuf") {
Add-Content -Path $file -Value "#include <sstream>"
break
}
}
# For vector '
for ($i = 1; $i -le 1; $i++) {
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::vector") {
Add-Content -Path $file -Value "#include <vector>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::hash") {
Add-Content -Path $file -Value "#include <vector>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::begin") {
Add-Content -Path $file -Value "#include <vector>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::cbegin") {
Add-Content -Path $file -Value "#include <vector>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::end") {
Add-Content -Path $file -Value "#include <vector>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::cend") {
Add-Content -Path $file -Value "#include <vector>"
break
}
}
# for algorithm
for ($i = 1; $i -le 1; $i++) {
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::min") {
Add-Content -Path $file -Value "#include <algorithm>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::max") {
Add-Content -Path $file -Value "#include <algorithm>"
break
}
if (Get-Content -Path $file -ErrorAction SilentlyContinue | Select-String -Pattern "std::sort") {
Add-Content -Path $file -Value "#include <algorithm>"
break
}
}
echo ""
# IN PROCESS