| 168 | } |
| 169 | |
| 170 | void http_creator(const char* name, const char* type) |
| 171 | { |
| 172 | bool loop; |
| 173 | file_tmpl tmpl; |
| 174 | |
| 175 | if (name && *name && type && *type) { |
| 176 | loop = true; |
| 177 | } else { |
| 178 | loop = false; |
| 179 | } |
| 180 | |
| 181 | // ����Դ��������Ŀ¼ |
| 182 | tmpl.set_path_from("tmpl/http"); |
| 183 | |
| 184 | while (true) { |
| 185 | char buf[256]; |
| 186 | int n; |
| 187 | |
| 188 | if (name == NULL || *name == 0) { |
| 189 | printf("please input your program name: "); |
| 190 | fflush(stdout); |
| 191 | n = acl_vstream_gets_nonl(ACL_VSTREAM_IN, buf, sizeof(buf)); |
| 192 | if (n == ACL_VSTREAM_EOF) { |
| 193 | break; |
| 194 | } |
| 195 | |
| 196 | if (n == 0) { |
| 197 | acl::safe_snprintf(buf, sizeof(buf), "http_demo"); |
| 198 | } |
| 199 | |
| 200 | name = buf; |
| 201 | } |
| 202 | |
| 203 | tmpl.set_project_name(name); |
| 204 | |
| 205 | // ����Ŀ¼ |
| 206 | tmpl.create_dirs(); |
| 207 | |
| 208 | tmpl.create_common(); |
| 209 | create_http_servlet(tmpl, type); |
| 210 | |
| 211 | if (!loop) { |
| 212 | break; |
| 213 | } |
| 214 | } |
| 215 | } |
no test coverage detected
searching dependent graphs…