-
Notifications
You must be signed in to change notification settings - Fork 0
/
m.sh
113 lines (89 loc) · 2.17 KB
/
m.sh
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
# Gfaerny
# # AILIB shell script App that provide standard library
# # No lisence
# # for cpp
file="$1"
# # For iostream lib
for i in 1;
do
if grep -q "std::cout" "$file"; then
sed -i '1i #include <iostream>' "$file"
break
fi
if grep -q "std::cin" "$file"; then
sed -i '1i #include <iostream>' "$file"
break
fi
if grep -q "std::clog" "$file"; then
sed -i '1i #include <iostream>' "$file"
break
fi
if grep -q "std::cerr" "$file"; then
sed -i '1i #include <iostream>' "$file"
break
fi
if grep -q "std::wcin" "$file"; then
sed -i '1i #include <iostream>' "$file"
break
fi
if grep -q "std::wcout" "$file"; then
sed -i '1i #include <iostream>' "$file"
break
fi
done
# # End of iostream stm
# # statement that depend sstream lib
for i in 1;
do
if grep -q "std::stringbuf" "$file"; then
sed -i '1i #include <sstream>' "$file"
break
fi
done
# # For vector 's
for i in 1;
do
if grep -q "std::vector" "$file"; then
sed -i '1i #include <vector>' "$file"
break
fi
if grep -q "std::hash" "$file"; then
sed -i '1i #include <vector>' "$file"
break
fi
if grep -q "std::begin" "$file"; then
sed -i '1i #include <vector>' "$file"
break
fi
if grep -q "std::cbegin" "$file"; then
sed -i '1i #include <vector>' "$file"
break
fi
if grep -q "std::end" "$file"; then
sed -i '1i #include <vector>' "$file"
break
fi
if grep -q "std::cend" "$file"; then
sed -i '1i #include <vector>' "$file"
break
fi
done
# # for algorithm
for i in 1;
do
if grep -q "std::min" "$file"; then
sed -i '1i #include <algorithm>' "$file"
break
fi
if grep -q "std::max" "$file"; then
sed -i '1i #include <algorithm>' "$file"
break
fi
if grep -q "std::sort" "$file"; then
sed -i '1i #include <algorithm>' "$file"
break
fi
done
echo ""
# # IN PROCESS