Utility class (not a tool or so) to serialize strings into stream of 32bit integers. More...
#include <StringSerializer.h>
Public Member Functions | |
void | serialize (const std::vector< std::string > &strings, std::vector< uint32_t > &storage) |
void | serialize (const std::string &str, std::vector< uint32_t > &storage) |
std::size_t | deserialize (std::vector< uint32_t >::const_iterator first, std::vector< uint32_t >::const_iterator last, std::vector< std::string > &strings) |
std::size_t | deserialize (const std::vector< uint32_t > &storage, std::vector< std::string > &strings) |
Same as above but with vector instead of iterators. | |
std::size_t | deserialize (std::vector< uint32_t >::const_iterator first, std::vector< uint32_t >::const_iterator last, std::string &str) |
Deserialize one single string. | |
std::size_t | deserialize (const std::vector< uint32_t > &storage, std::string &str) |
Deserialize one single string. | |
unsigned int | inquireSize (const std::vector< uint32_t > &storage) |
Utility class (not a tool or so) to serialize strings into stream of 32bit integers.
std::size_t TrigSteeringEvent::StringSerializer::deserialize | ( | std::vector< uint32_t >::const_iterator | first, | |
std::vector< uint32_t >::const_iterator | last, | |||
std::vector< std::string > & | strings | |||
) |
Deserialize vector into strings
first | Beginning of 'byte-stream' | |
last | End of 'byte-stream', i.e. vector::end() | |
strings | Vector of strings to hold result |
unsigned int TrigSteeringEvent::StringSerializer::inquireSize | ( | const std::vector< uint32_t > & | storage | ) |
Return number of strings serialized into 'storage'
void TrigSteeringEvent::StringSerializer::serialize | ( | const std::vector< std::string > & | strings, | |
std::vector< uint32_t > & | storage | |||
) |
Serializes vector of strings into vector of integers
The number of strings (size of input vector) is put first into the stream. In case the strings is an empty vector the 0 is put into the storage.
strings | ||
storage | is place where serizlized from of stings is appended to |