views:

47

answers:

0

If I'm using Boost Serialization to serialize an Integer:

#include <boost/archive/text_oarchive.hpp> 
#include <iostream> 

int main() 
{ 
  boost::archive::text_oarchive oa(std::cout); 
  int i = 1; 
  oa << i; 
}

The result will be the following:
22 serialization::archive 5 1

Now I'm curious if and how I could change the way, certain data is serialized. The data does not need to be deserialized, so if that is not possible anymore, it's not a hindering reason to not doing that.

Lets say the above code should create the following output:
integer 11
(The word integer is added and the value will be increased by 10. The archive-header will not be integrated.)

Would that be possible and how could one achieve that? Is Boost Serialization able to let a user do that without modifying the codebase of Serialization?

PS:
The example-code above is copied from the Highscore-Tutorial