wxInputStream &NassiSwitchBrick::Deserialize(wxInputStream &stream) { wxTextInputStream inp(stream); wxUint32 count; inp >> count; wxString str; wxArrayString arstr; for (wxUint32 n = 0 ; n < 2*count+2 ; n++ ) { DeserializeString( stream, str ); //SetTextByNumber(str, n); arstr.Add(str); } for ( wxUint32 n = 0; n < count ; n++ ) { AddChild(n); SetChild(NassiBrick::SetData(stream), n); } for ( wxUint32 n = 0 ; n < arstr.GetCount() ; n++ ) { SetTextByNumber(arstr[n], n); } SetNext(NassiBrick::SetData(stream)); return stream; }
void Serializer::ValidateName (const string &name) { string dName = DeserializeString(); if (dName != name) { throw ParameterIncorrect (SRC_POS); } }
wxInputStream &NassiContinueBrick::Deserialize(wxInputStream &stream) { wxTextInputStream inp(stream); wxString str; DeserializeString(stream, str); SetTextByNumber(str, 0); SetNext(NassiBrick::SetData(stream)); return stream; }
list <string> Serializer::DeserializeStringList (const string &name) { ValidateName (name); list <string> deserializedList; uint64 listSize = Deserialize <uint64> (); for (size_t i = 0; i < listSize; i++) deserializedList.push_back (DeserializeString ()); return deserializedList; }
wxInputStream &NassiReturnBrick::Deserialize(wxInputStream &stream) { wxTextInputStream inp(stream); wxString str; for (wxUint32 n = 0 ; n < 2 ; n++ ) { DeserializeString(stream, str); SetTextByNumber(str, n); } SetNext(NassiBrick::SetData(stream)); return stream; }
//---------------------------------------------------------------------------------------------- int ObjectSerializer::DeserializeType(char* pMem, TypeNode* pType, fstream& eye) { switch (pType->Type) { case DTYPE_Array: return DeserializeArray(pMem, pType, eye); case DTYPE_String: return DeserializeString(pMem, pType, eye); case DTYPE_Vector: return DeserializeContainerVector((ISerializable*)pMem, pType, eye); case DTYPE_Map: return DeserializeContainerMap((ISerializable*)pMem, pType, eye); case DTYPE_Set: return DeserializeContainerSet((ISerializable*)pMem, pType, eye); case DTYPE_Pair: return DeserializePair((ISerializable*)pMem, pType, eye); case DTYPE_UserDefined: { string fullName = pType->FullName(); if (pType->Indirection) fullName.erase(fullName.size() - 1, 1); _ASSERTE(m_typeTable.find(fullName) != m_typeTable.end()); return DeserializeUserDefinedType((ISerializable*)pMem, m_typeTable[fullName].TypeGraph, pType->Indirection, eye); } case DTYPE_Bool: case DTYPE_Char: case DTYPE_Short: case DTYPE_Int: case DTYPE_Unsigned: case DTYPE_Float: case DTYPE_Double: return DeserializeBasicType(pMem, pType, eye); } return 0; }
void Serializer::Deserialize (const string &name, string &data) { ValidateName (name); data = DeserializeString (); }
string Serializer::DeserializeString (const string &name) { ValidateName (name); return DeserializeString (); }