| 5 | #include "util.h" |
| 6 | |
| 7 | static void get_html(const char* file) |
| 8 | { |
| 9 | acl_xml_tag_init(); |
| 10 | acl_xml_tag_add("img"); |
| 11 | acl_xml_tag_add("BR"); |
| 12 | acl_xml_tag_add("HR"); |
| 13 | |
| 14 | acl::string buf; |
| 15 | if (acl::ifstream::load(file, &buf) == false) |
| 16 | { |
| 17 | printf("load %s error %s\r\n", file, acl::last_serror()); |
| 18 | return; |
| 19 | } |
| 20 | |
| 21 | struct timeval begin; |
| 22 | gettimeofday(&begin, NULL); |
| 23 | |
| 24 | acl::xml xml(buf.c_str()); |
| 25 | const acl::string& text = xml.getText(); |
| 26 | |
| 27 | struct timeval end; |
| 28 | gettimeofday(&end, NULL); |
| 29 | |
| 30 | acl::string path(file); |
| 31 | path << ".txt"; |
| 32 | |
| 33 | acl::ofstream out; |
| 34 | if (out.open_write(path) == true) |
| 35 | out.write(text); |
| 36 | |
| 37 | double spent = util::stamp_sub(&end, &begin); |
| 38 | printf("text:{%d}, spent: %.2f\r\n", (int) text.length(), spent); |
| 39 | } |
| 40 | |
| 41 | int main(int argc, char* argv[]) |
| 42 | { |
no test coverage detected
searching dependent graphs…