| 444 | virtual bool support_dump_cache() { return get_impl()->support_dump_cache(); } |
| 445 | |
| 446 | py::object py_get(std::string category, std::string key) { |
| 447 | auto value = get_impl()->get(category, {key.data(), key.size()}); |
| 448 | if (value.valid()) { |
| 449 | return py::bytes(std::string((const char*)value->ptr, value->size)); |
| 450 | } else { |
| 451 | return py::none(); |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | void py_put(std::string category, std::string key, std::string value) { |
| 456 | get_impl()->put( |