| 111 | } |
| 112 | |
| 113 | val findKeyValue(const std::string key) |
| 114 | { |
| 115 | ktxHashList* ht = &m_ptr->kvDataHead; |
| 116 | ktx_error_code_e result; |
| 117 | unsigned int valueLen = 0; |
| 118 | ktx_uint8_t* pValue = nullptr; |
| 119 | result = ktxHashList_FindValue(ht, key.c_str(), &valueLen, (void**)&pValue); |
| 120 | if (result == KTX_SUCCESS) { |
| 121 | return val(emscripten::typed_memory_view((ktx_size_t)valueLen, pValue)); |
| 122 | } else { |
| 123 | std::cout << "ERROR: failed to findKeyValue: " << ktxErrorString(result) << std::endl; |
| 124 | return val::null(); |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | uint32_t getDataSize() const |
| 129 | { |
no test coverage detected