| 218 | } |
| 219 | |
| 220 | void ModelPacker::set_header( |
| 221 | std::string model_decryption_method, std::string info_decryption_method, |
| 222 | bool is_fast_run_cache) { |
| 223 | m_header.model_decryption_method = model_decryption_method; |
| 224 | m_header.info_decryption_method = info_decryption_method; |
| 225 | memset(&m_header.fb32, 0, sizeof(m_header.fb32)); |
| 226 | m_header.fb32.is_fast_run_cache = is_fast_run_cache; |
| 227 | if (!m_info_data.empty()) { |
| 228 | std::string json_string( |
| 229 | static_cast<const char*>(static_cast<void*>(m_info_data.data())), |
| 230 | m_info_data.size()); |
| 231 | auto info = nlohmann::json::parse(json_string); |
| 232 | m_header.name = info["name"]; |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | void ModelPacker::pack_model() { |
| 237 | auto fb_header = m_fbs_helper->build_header(); |
no test coverage detected