This may seem like a minor syntactic
suggestion, but it is actually a Joyful Recommendation because the lack of what I am suggesting caused me (made me predisposed^1) to have to do
about 48 hours of unnecessary R&D on
binary conversions only to find the
functionality I needed was already
built into the Archive system, I just
did not get it due to this one
seemingly small syntactic detail
-Rama
^1 = Google: “make someone liable or inclined to a specified attitude, action, or condition.”
Dear Friends at Epic,
Hi there!
I am loooving C++ UE4! Thank you so much!
You folks are awesome!
I have a very strong recommendation based on spending about 48 hours reading through ArchiveBase, Archive, and writing my own binary conversions, and then getting stumped on converting FString back from uint8 after using ar << FString.
You can review this thread for more complete picture of my struggles:
https://rocket.unrealengine.com/questions/5503/c-equivalent-to-basic-save-object.html
My Joyful Code Recommendation (Joyful code for Joyful People)
Please please make a >> operator to compliment the << operator
So that visually the code makes more sense as to when you are extracting byte data from the archive and converting back to data types, and when you are putting it in.
Example of what works right now:
FBufferArchive RV_Vibes;
//data is going in and being converted to uint8
RV_Vibes << FVector;
RV_Vibes << FRotator;
RV_Vibes << FString;
//vars to receive previously serialized data
FVector outV;
FRotator outR;
FString outS;
//reader
FMemoryReader Ar = FMemoryReader(RV_Vibes, true);
ar << outV;
ar << outR;
ar << outS;
//the out vars now have the data
Example of What I Would Absolutely Find Very Lovely
FBufferArchive RV_Vibes;
//data is going in and being converted to uint8
RV_Vibes << FVector;
RV_Vibes << FRotator;
RV_Vibes << FString;
//vars to receive previously serialized data
FVector outV;
FRotator outR;
FString outS;
//reader
FMemoryReader Ar = FMemoryReader(RV_Vibes, true);
ar >> outV;
ar >> outR;
ar >> outS;
//isnt it more obvious now that the out vars are receiving data FROM the archive
and perhaps:
could the >> operator be made to work within a writer’s context, allowing extraction of data without using a Reader at all
especially when using a FBufferArchive which is already its own data source?
These my very highly energetic recommendations for your already awesome streamlined C++ wonderfulness
Summary of :
If I had seen the >> operator, if it had existed, even just in the header file, I would have immediately had a much easier time reconstructing the proper usage of the Archive system for my own use in a custom savegame system.
Rama