9 #include <pybind11/pybind11.h> 10 #include <pybind11/stl.h> 14 struct type_caster<boost::optional<T>> : optional_caster<boost::optional<T>>
21 const std::string data_str = std::string(data);
22 return std::vector<uint8_t>(data_str.cbegin(), data_str.cend());
27 return py::bytes(std::string(data.cbegin(), data.cend()));
32 const std::string data_str = std::string(data);
33 return std::vector<uint64_t>(data_str.cbegin(), data_str.cend());
38 return py::bytes(std::string(data.cbegin(), data.cend()));
py::bytes vector_to_pybytes(const std::vector< uint8_t > &data)
Definition: pybind_adaptors.hpp:25
py::bytes u64_vector_to_pybytes(const std::vector< uint64_t > &data)
Definition: pybind_adaptors.hpp:36
Definition: pybind_adaptors.hpp:12
std::vector< uint8_t > pybytes_to_vector(const py::bytes &data)
Definition: pybind_adaptors.hpp:19
std::vector< uint64_t > pybytes_to_u64_vector(const py::bytes &data)
Definition: pybind_adaptors.hpp:30