TArray with offset to FString
Please can you help with a little c++ magic?
My issue is I have a TArray buffer arriving to my FSocket, Retrieving int,uint, bool, ushort are all perfectly fine but I'm trying to retrieve an FString from the array.
I was hoping to use this from Rama
My problem here is that my BinaryArray has more than just a string is contain various other paramter data.
How would I be able to create some function that would take the TArray with an offset and a length to create a new returnable FString?
I will continue to try various options and post a response if I manage to achieve this goal.
ok I figured this out for those who need this I've posted it below
This is now working and I would like to acknowledge Rama for the original code.
answered Aug 13 '15 at 04:51 PM
How does this compare with using a BinaryArchive?
This allows you to just use an FArchive in any low level code and potentially share read and write code. The other pro is cleaner looking high level code but I'm interested any counter arguments if they exist.
For instance how does memory abuse compare? I don't use std::string's much / ever but I'd assume a copy to the cstr variable, then a copy to the FString return value and possibly a copy again in the calling code - all non trivial operations.
Follow this question
Once you sign in you will be able to subscribe for any updates here