-
Notifications
You must be signed in to change notification settings - Fork 0
/
ailib.cpp
100 lines (49 loc) · 2.29 KB
/
ailib.cpp
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
/// Gfaerny
///
#include <fstream>
#include <iostream>
#include <string>
#define CHECK_CLOG(line, var) (line.find(#var) != std::string::npos)
int main(int argc , char* argv[])
{
std::string tfile = argv[0];
std::ifstream file(tf);
std::string line;
bool issstream = false;
bool isalgorithm = false;
bool isiostream = false;
bool isvector = false;
if (file.is_open())
{
while (std::getline(file, line))
{
/// For include set bool to include <iostream>
/// IOSTREAM STAN LIB
/// |||||||||||||||||
if (line.find("std::cout") != std::string::npos) {isiostream = true;break;}
if (line.find("std::wcout") != std::string::npos) {isiostream = true;break;}
if (line.find("std::cin") != std::string::npos) {isiostream = true;break;}
if (line.find("std::wcin") != std::string::npos) {isiostream = true;break;}
if (line.find("std::cout") != std::string::npos) {isiostream = true;break;}
if (line.find("std::cerr") != std::string::npos) {isiostream = true;break;}
if (line.find("std::clog") != std::string::npos) {isiostream = true;break;}
/// VECTOR STAND LIB
/// |||||||||||||||||
if (line.find("std::vector") != std::string::npos) {isvector = true;break;}
if (line.find("std::hash") != std::string::npos) {isvector = true;break;}
if (line.find("std::cbegin") != std::string::npos) {isvector = true;break;}
if (line.find("std::begin") != std::string::npos) {isvector = true;break;}
if (line.find("std::end") != std::string::npos) {isvector = true;break;}
if (line.find("std::cend") != std::string::npos) {isvector = true;break;}
}
file.close();
}
else
{
std::cerr << " AILIB ERROR : [Unable to open file]" << std::endl;
std::cerr << " IF ANY BUG IS THERE USE MY GITHUB [ https://github.com/Gfaerny/ ] FOR CONTACT" << std::endl;
}
/// then we end with std:: 's hint we going to logic that sa
/// y if the (for example) vector is after this symbol ; , > and ... add the depend library
return 0;
}}