| 10 | } |
| 11 | |
| 12 | std::vector<uint8_t> utils::readBinaryFile(const std::string& file) |
| 13 | { |
| 14 | |
| 15 | std::ifstream in(file, std::ios::in | std::ios::binary); |
| 16 | if (!in.is_open()) |
| 17 | return {}; |
| 18 | |
| 19 | in.seekg(0, std::ios::end); |
| 20 | size_t length = in.tellg(); |
| 21 | |
| 22 | std::vector<uint8_t> data; |
| 23 | if (length > 0) { |
| 24 | in.seekg(0, std::ios::beg); |
| 25 | data.resize(length); |
| 26 | |
| 27 | in.read((char*)&data[0], length); |
| 28 | } |
| 29 | in.close(); |
| 30 | return data; |
| 31 | } |
| 32 | |
| 33 | |
| 34 | std::vector<unsigned char> utils::loadModel(const std::string& file) |
nothing calls this directly
no outgoing calls
no test coverage detected