I have a data , uint8_t my_data[26] which I want to put in json object once and fetch it quite frequently. There is no need to dump the json object.
I try to convert it to std::string and it does not work(rapidjson seems ok). Casting to and from std::vector seems quite expensive. I also need the lifecycle of the my_data is same as the json object. Is there a better way to solve it?
I thought that maybe I could get the std::string::data() or std::vector::data() directly from json object but I could not find the right way.
I have a data ,
uint8_t my_data[26]which I want to put injsonobject once and fetch it quite frequently. There is no need todumpthejsonobject.I try to convert it to
std::stringand it does not work(rapidjsonseems ok). Casting to and fromstd::vectorseems quite expensive. I also need the lifecycle of the my_data is same as the json object. Is there a better way to solve it?I thought that maybe I could get the
std::string::data()orstd::vector::data()directly fromjsonobject but I could not find the right way.