コード例 #1
0
ファイル: messageserializer.c プロジェクト: fxfactorial/cohml
template<> Message deserialize<Message>(PofReader::Handle hIn) {
  int i = hIn->readInt32(0);
  int p = hIn->readInt32(1);
  std::string s = hIn->readString(2);
  std::string b = hIn->readString(3);

  return Message(i, p, s, b);
}
コード例 #2
0
/**
* Deserialize a phone number from Portable object format.
*
* @param hIn   the serializer to write the object to
* @return      a new Phone number instance
*/
template<> PhoneNumber deserialize<PhoneNumber>(PofReader::Handle hIn)
   {
   int16_t nAccesCode   = hIn->readInt16(ACCESS_CODE);
   int16_t nCountryCode = hIn->readInt16(COUNTRY_CODE);
   int16_t nAreaCode    = hIn->readInt16(AREA_CODE);
   int32_t nLocalNumber = hIn->readInt32(LOCAL_NUMBER);

   return PhoneNumber(nAccesCode, nCountryCode, nAreaCode, nLocalNumber);
   }