Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How do I create an Aws::Utils::ByteBuffer from QString for AWS C++ SDK?
I'm new to C++ and QT, working with the AWS C++ SDK, the Kinesis PutRecordRequest requires a data property (the message). It takes a Aws::Utils::ByteBuffer. I'm having trouble understanding how to create this from a QString.
What is Aws::Utils::ByteBuffer ?
Seems to be
Array<unsigned char> Aws::Utils::ByteBuffer
So you could loop the string and add to such Array.
Yes, it appears that's what it is. Could I bother you for an example on this?
I believe I've got it.
typedef Aws::Utils::Array<unsigned char> ByteBuffer; ... Aws::String streamName = "qt"; QString myMessage = "The Message"; Aws::Kinesis::KinesisClient kinesis; Aws::Kinesis::Model::PutRecordRequest k_req; k_req.SetStreamName(streamName); k_req.SetPartitionKey("123"); k_req.SetData(ByteBuffer((unsigned char *)myMessage.toStdString().c_str(),myMessage.length())); auto k_out = kinesis.PutRecord(k_req); ...