Esempio n. 1
0
    bool ktx_texture::get_key_value_data(const char *pKey, uint8_vec &data) const
    {
        const uint8_vec *p = find_key(pKey);
        if (!p)
        {
            data.resize(0);
            return false;
        }

        const uint32_t ofs = vogl_strlen(pKey) + 1;
        const uint8_t *pValue = p->get_ptr() + ofs;
        const uint32_t n = p->size() - ofs;

        data.resize(n);
        if (n)
            memcpy(data.get_ptr(), pValue, n);
        return true;
    }
Esempio n. 2
0
bool file_utils::write_vec_to_file(const char *pPath, const uint8_vec &data)
{
    return write_buf_to_file(pPath, data.get_ptr(), data.size());
}