@@ -82,28 +82,32 @@ module CppAutoInclude
82
82
83
83
# header, std namespace, keyword complete (false: no auto remove #include), unioned regex
84
84
HEADER_STD_COMPLETE_REGEX = [
85
- [' cstdio' , false, true , R[F[' s?scanf' , ' puts' , ' s?printf' , ' f?gets' ], C[' FILE' ]] ],
85
+ [' cstdio' , false, true , R[F[' s?scanf' , ' puts' , ' s?printf' , ' f?gets' , ' (?:get|put)char ' , ' getc ' ], C[' FILE' , ' std(?:in|out|err) ' , ' EOF ' ]] ],
86
86
[' cassert' , false, true , R[F[' assert' ]] ],
87
- [' cstring' , false, true , R[F[' mem(?:cpy|set|n?cmp)' , ' str(?:len|n?cmp|n?cpy|error)' ]] ],
88
- [' cstdlib' , false, true , R[F[' system' ,' abs' ,' ato[if]' ,' strto[dflu]+' ,' free' ,' exit' ,' l?abs' ,' s?rand(?:_r|om)?' ], C[' EXIT_[A-Z]*' , ' NULL' ]] ],
89
- [' cmath' , false, false , R[F[' pow[fl]?' ,' a?(?:sin|cos|tan)[hl]*' , ' exp[m12fl]*' , ' fabs[fl]?' , ' log[210fl]+' , ' nan[fl]?' , ' (?:ceil|floor)[fl]?' , ' l?l?round' , ' sqrt[fl]?' ], C[' M_[A-Z24_]*' , ' NAN' , ' INFINITY' , ' HUGE_[A-Z]*' ]] ],
90
- [' cstrings ' , false, true , R[F[' b(?:cmp|copy|zero)' , ' strn?casecmp' ]] ],
87
+ [' cstring' , false, true , R[F[' mem(?:cpy|set|n?cmp)' , ' str(?:len|n?cmp|n?cpy|error|cat|str|chr )' ]] ],
88
+ [' cstdlib' , false, true , R[F[' system' ,' abs' ,' ato[if]' , ' itoa ' , ' strto[dflu]+' ,' free' ,' exit' ,' l?abs' ,' s?rand(?:_r|om)?' , ' qsort ' ], C[' EXIT_[A-Z]*' , ' NULL' ]] ],
89
+ [' cmath' , false, true , R[F[' pow[fl]?' ,' a?(?:sin|cos|tan)[hl]*' , ' atan2[fl]? ' , ' exp[m12fl]*' , ' fabs[fl]?' , ' log[210fl]+' , ' nan[fl]?' , ' (?:ceil|floor)[fl]?' , ' l?l?round[fl]? ' , ' sqrt[fl]?' ], C[' M_[A-Z24_]*' , ' NAN' , ' INFINITY' , ' HUGE_[A-Z]*' ]] ],
90
+ [' strings.h ' , false, true , R[F[' b(?:cmp|copy|zero)' , ' strn?casecmp' ]] ],
91
91
[' typeinfo' , false, true , R[C[' typeid' ]] ],
92
92
[' new' , true , true , R[F[' set_new_handler' ], C[' nothrow' ]] ],
93
93
[' limits' , true , true , R[T[' numeric_limits' ]] ],
94
- [' algorithm' , true , false , R[F[' (?:stable_|partial_)?sort(?:_copy)?' , ' unique(?:_copy)' , ' reverse(?:_copy)' , ' nth_element' , ' (?:lower|upper)_bound' , ' binary_search' , ' (?:prev|next)_permutation' ]] ],
94
+ [' algorithm' , true , true , R[F[' (?:stable_|partial_)?sort(?:_copy)?' , ' unique(?:_copy)? ' , ' reverse(?:_copy)? ' , ' nth_element' , ' (?:lower|upper)_bound' , ' binary_search' , ' (?:prev|next)_permutation' , ' min ' , ' max ' , ' count ' , ' random_shuffle ' , ' swap ' ]] ],
95
95
[' numeric' , true , true , R[F[' partial_sum' , ' accumulate' , ' adjacent_difference' , ' inner_product' ]] ],
96
96
[' iostream' , true , true , R[C[' c(?:err|out|in)' ]] ],
97
- [' sstream' , true , true , R[C[' [io]stringstream' ]] ],
97
+ [' sstream' , true , true , R[C[' [io]? stringstream' ]] ],
98
98
[' bitset' , true , true , R[T[' bitset' ]] ],
99
99
[' complex' , true , true , R[T[' complex' ]] ],
100
100
[' deque' , true , true , R[T[' deque' ]] ],
101
- [' priority_queue ' , true , true , R[T[' priority_queue' ]] ],
101
+ [' queue ' , true , true , R[T[' queue ' , ' priority_queue' ]] ],
102
102
[' list' , true , true , R[T[' list' ]] ],
103
103
[' map' , true , true , R[T[' (?:multi)?map' ]] ],
104
104
[' set' , true , true , R[T[' (?:multi)?set' ]] ],
105
105
[' vector' , true , true , R[T[' vector' ]] ],
106
+ [' iomanip' , true , true , R[F[' setprecision' , ' setbase' , ' setw' ], C[' fixed' , ' hex' ]]],
107
+ [' fstream' , true , true , R[T[' fstream' ]] ],
108
+ [' ctime' , false, true , R[F[' time' , ' clock' ], C[' CLOCKS_PER_SEC' ]]],
106
109
[' string' , true , true , R[C[' string' ]] ],
110
+ [' utility' , true , true , R[T[' pair' ], F[' make_pair' ]] ],
107
111
]
108
112
109
113
USING_STD = ' using namespace std;'
0 commit comments