| 22 | #include "type2.h" |
| 23 | |
| 24 | int main(int argc, char **argv) |
| 25 | { |
| 26 | const char *filename = argc==2 ? argv[1] : nullptr; |
| 27 | |
| 28 | if (!filename) { |
| 29 | std::cout << "Invalid args, no filename\n"; |
| 30 | return 1; |
| 31 | } |
| 32 | |
| 33 | std::ifstream f(filename); |
| 34 | if (!f.is_open()) { |
| 35 | std::cout << "failed to open file:" << filename << "\n"; |
| 36 | return 1; |
| 37 | } |
| 38 | |
| 39 | std::string str((std::istreambuf_iterator<char>(f)), |
| 40 | std::istreambuf_iterator<char>()); |
| 41 | |
| 42 | std::cout << generateCode2(reinterpret_cast<const uint8_t *>(str.data()), str.size()) << std::endl; |
| 43 | |
| 44 | return 0; |
| 45 | } |
| 46 |
nothing calls this directly
no test coverage detected