MCPcopy Create free account
hub / github.com/acl-dev/acl / create_http_servlet

Function create_http_servlet

app/wizard/http_creator.cpp:138–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138static bool create_http_servlet(file_tmpl& tmpl, const char* type)
139{
140 tpl_t* tpl = tmpl.open_tpl("http_servlet.cpp");
141 if (tpl == NULL) {
142 return false;
143 }
144
145 printf("Do you want add cookie? [y/n]: ");
146 fflush(stdout);
147
148 char buf[64];
149 int n = acl_vstream_gets_nonl(ACL_VSTREAM_IN, buf, sizeof(buf));
150 if (n != ACL_VSTREAM_EOF && strcasecmp(buf, "y") == 0) {
151 set_cookies(tpl);
152 }
153
154 string filepath;
155 filepath.format("%s/http_servlet.cpp", tmpl.get_project_name());
156 if (tpl_save_as(tpl, filepath.c_str()) != TPL_OK) {
157 printf("save to %s error: %s\r\n", filepath.c_str(),
158 last_serror());
159 tpl_free(tpl);
160 return false;
161 }
162
163 printf("create %s ok.\r\n", filepath.c_str());
164 tpl_free(tpl);
165
166 // ���÷�����ģ������
167 return create_service(tmpl, type);
168}
169
170void http_creator(const char* name, const char* type)
171{

Callers 1

http_creatorFunction · 0.85

Calls 10

acl_vstream_gets_nonlFunction · 0.85
set_cookiesFunction · 0.85
create_serviceFunction · 0.85
open_tplMethod · 0.80
get_project_nameMethod · 0.80
tpl_save_asFunction · 0.70
tpl_freeFunction · 0.70
last_serrorFunction · 0.50
formatMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…