MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / findKeyValue

Method findKeyValue

interface/js_binding/ktx_wrapper.cpp:113–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

testWriteReadMetadataFunction · 0.80

Calls 4

ktxHashList_FindValueFunction · 0.85
ktxErrorStringFunction · 0.85
nullClass · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected