Esempio n. 1
0
void ItemAttribute::serialize(PropWriteStream& stream) const
{
  // write type
  stream.ADD_UCHAR(static_cast<uint8_t>(m_type));

  // write contents
  switch(m_type){
    case STRING: {
      stream.ADD_LSTRING(*m_var.string);
      break;
    }
    
    case INTEGER:
    case FLOAT: {
      stream.ADD_ULONG(m_var.unsignedInteger);
      break;
    }
    
    case BOOLEAN: {
      stream.ADD_UCHAR(m_var.unsignedChar);
      break;
    }
    
    default: break;
  }
}