/**
* Serialize a phone number into Portable object format.
*
* @param hOut   the serializer to write the object to
* @param phone  the phone number to serialize
*/
template<> void serialize<PhoneNumber>(PofWriter::Handle hOut,
      const PhoneNumber& phone)
   {
   hOut->writeInt16(ACCESS_CODE, phone.getAccessCode());
   hOut->writeInt16(COUNTRY_CODE, phone.getCountryCode());
   hOut->writeInt16(AREA_CODE, phone.getAreaCode());
   hOut->writeInt32(LOCAL_NUMBER, phone.getLocalNumber());
   }
Exemplo n.º 2
0
template<> void serialize<Message>(PofWriter::Handle hOut, const Message& m) {
  hOut->writeInt32(0, m.getId());
  hOut->writeInt32(1, m.getPriority());
  hOut->writeString(2, m.getSubject());
  hOut->writeString(3, m.getBody());
}