Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. How do I create an Aws::Utils::ByteBuffer from QString for AWS C++ SDK?

How do I create an Aws::Utils::ByteBuffer from QString for AWS C++ SDK?

Scheduled Pinned Locked Moved Solved 3rd Party Software
4 Posts 2 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jim Hankins
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      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.

      1 Reply Last reply
      1
      • J Offline
        J Offline
        Jim Hankins
        wrote on last edited by
        #3

        @mrjj said in How do I create an Aws::Utils::ByteBuffer from QString for AWS C++ SDK?:

        Array<unsigned char>

        Yes, it appears that's what it is. Could I bother you for an example on this?

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jim Hankins
          wrote on last edited by
          #4

          I believe I've got it.
          included

          and then

          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);
          ...
          
          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved