void CVideoInfoTag::Archive(CArchive& ar) { if (ar.IsStoring()) { ar << m_director; ar << m_writingCredits; ar << m_genre; ar << m_country; ar << m_strTagLine; ar << m_strPlotOutline; ar << m_strPlot; ar << m_strPictureURL.m_spoof; ar << m_strPictureURL.m_xml; ar << m_fanart.m_xml; ar << m_strTitle; ar << m_strSortTitle; ar << m_strVotes; ar << m_studio; ar << m_strTrailer; ar << (int)m_cast.size(); for (unsigned int i=0;i<m_cast.size();++i) { ar << m_cast[i].strName; ar << m_cast[i].strRole; ar << m_cast[i].order; ar << m_cast[i].thumb; ar << m_cast[i].thumbUrl.m_xml; } ar << m_strSet; ar << m_iSetId; ar << m_tags; ar << m_duration; ar << m_strFile; ar << m_strPath; ar << m_strIMDBNumber; ar << m_strMPAARating; ar << m_strFileNameAndPath; ar << m_strOriginalTitle; ar << m_strEpisodeGuide; ar << m_premiered; ar << m_strStatus; ar << m_strProductionCode; ar << m_firstAired; ar << m_strShowTitle; ar << m_strAlbum; ar << m_artist; ar << m_playCount; ar << m_lastPlayed; ar << m_iTop250; ar << m_iYear; ar << m_iSeason; ar << m_iEpisode; ar << m_strUniqueId; ar << m_fRating; ar << m_iDbId; ar << m_iFileId; ar << m_iSpecialSortSeason; ar << m_iSpecialSortEpisode; ar << m_iBookmarkId; ar << m_iTrack; ar << dynamic_cast<IArchivable&>(m_streamDetails); ar << m_showLink; ar << m_fEpBookmark; ar << m_basePath; ar << m_parentPathID; ar << m_resumePoint.timeInSeconds; ar << m_resumePoint.totalTimeInSeconds; ar << m_iIdShow; ar << m_dateAdded.GetAsDBDateTime(); ar << m_type; ar << m_iIdSeason; } else { ar >> m_director; ar >> m_writingCredits; ar >> m_genre; ar >> m_country; ar >> m_strTagLine; ar >> m_strPlotOutline; ar >> m_strPlot; ar >> m_strPictureURL.m_spoof; ar >> m_strPictureURL.m_xml; ar >> m_fanart.m_xml; ar >> m_strTitle; ar >> m_strSortTitle; ar >> m_strVotes; ar >> m_studio; ar >> m_strTrailer; int iCastSize; ar >> iCastSize; m_cast.reserve(iCastSize); for (int i=0;i<iCastSize;++i) { SActorInfo info; ar >> info.strName; ar >> info.strRole; ar >> info.order; ar >> info.thumb; CStdString strXml; ar >> strXml; info.thumbUrl.ParseString(strXml); m_cast.push_back(info); } ar >> m_strSet; ar >> m_iSetId; ar >> m_tags; ar >> m_duration; ar >> m_strFile; ar >> m_strPath; ar >> m_strIMDBNumber; ar >> m_strMPAARating; ar >> m_strFileNameAndPath; ar >> m_strOriginalTitle; ar >> m_strEpisodeGuide; ar >> m_premiered; ar >> m_strStatus; ar >> m_strProductionCode; ar >> m_firstAired; ar >> m_strShowTitle; ar >> m_strAlbum; ar >> m_artist; ar >> m_playCount; ar >> m_lastPlayed; ar >> m_iTop250; ar >> m_iYear; ar >> m_iSeason; ar >> m_iEpisode; ar >> m_strUniqueId; ar >> m_fRating; ar >> m_iDbId; ar >> m_iFileId; ar >> m_iSpecialSortSeason; ar >> m_iSpecialSortEpisode; ar >> m_iBookmarkId; ar >> m_iTrack; ar >> dynamic_cast<IArchivable&>(m_streamDetails); ar >> m_showLink; ar >> m_fEpBookmark; ar >> m_basePath; ar >> m_parentPathID; ar >> m_resumePoint.timeInSeconds; ar >> m_resumePoint.totalTimeInSeconds; ar >> m_iIdShow; CStdString dateAdded; ar >> dateAdded; m_dateAdded.SetFromDBDateTime(dateAdded); ar >> m_type; ar >> m_iIdSeason; } }
void CSystemManager::Serialize(CArchive& ar) { if(ar.IsStoring()) { ar << m_bActive; ar << m_bSafeMoral; ar << m_bMaxIndustry; ar << m_bNeglectFood; ar << m_iMinMoral; ar << m_iMinMoralProd; ar << m_bBombWarning; ar << m_bOnOffline; ar << static_cast<int>(m_PriorityMap.size()); for(std::map<WORKER::Typ, int>::const_iterator it = m_PriorityMap.begin(); it != m_PriorityMap.end(); ++it) { AssertBotE(it->second > 0); ar << it->second; ar << static_cast<int>(it->first); } ar << static_cast<int>(m_IgnoredBuildings.size()); for(std::set<int>::const_iterator i = m_IgnoredBuildings.begin(); i != m_IgnoredBuildings.end(); ++i) { ar << *i; } } else { ar >> m_bActive; ar >> m_bSafeMoral; ar >> m_bMaxIndustry; ar >> m_bNeglectFood; ar >> m_iMinMoral; ar >> m_iMinMoralProd; ar >> m_bBombWarning; ar >> m_bOnOffline; ClearPriorities(); int size; ar >> size; for(int i = 0; i < size; ++i) { int value; ar >> value; int key; ar >> key; AssertBotE(value > 0); AddPriority(static_cast<WORKER::Typ>(key), value); } ar >> size; m_IgnoredBuildings.clear(); for(int i = 0; i < size; ++i) { int value; ar >> value; m_IgnoredBuildings.insert(value); } } }
void CGUIListItem::Archive(CArchive &ar) { if (ar.IsStoring()) { ar << m_bIsFolder; ar << m_strLabel; ar << m_strLabel2; ar << m_sortLabel; ar << m_strIcon; ar << m_bSelected; ar << m_overlayIcon; ar << (int)m_mapProperties.size(); for (PropertyMap::const_iterator it = m_mapProperties.begin(); it != m_mapProperties.end(); ++it) { ar << it->first; ar << it->second; } ar << (int)m_art.size(); for (ArtMap::const_iterator i = m_art.begin(); i != m_art.end(); ++i) { ar << i->first; ar << i->second; } ar << (int)m_artFallbacks.size(); for (ArtMap::const_iterator i = m_artFallbacks.begin(); i != m_artFallbacks.end(); ++i) { ar << i->first; ar << i->second; } } else { ar >> m_bIsFolder; ar >> m_strLabel; ar >> m_strLabel2; ar >> m_sortLabel; ar >> m_strIcon; ar >> m_bSelected; int overlayIcon; ar >> overlayIcon; m_overlayIcon = GUIIconOverlay(overlayIcon); int mapSize; ar >> mapSize; for (int i = 0; i < mapSize; i++) { std::string key; CVariant value; ar >> key; ar >> value; SetProperty(key, value); } ar >> mapSize; for (int i = 0; i < mapSize; i++) { std::string key, value; ar >> key; ar >> value; m_art.insert(make_pair(key, value)); } ar >> mapSize; for (int i = 0; i < mapSize; i++) { std::string key, value; ar >> key; ar >> value; m_artFallbacks.insert(make_pair(key, value)); } SetInvalid(); } }
void CRec::Serialize( CArchive& archive ) { ASSERTVALID(); // call base class function first // base class is CObject in this case CObject::Serialize( archive ); // now do the stuff for our specific class if ( archive.IsStoring() ) { archive.Write( &m_outputAttributes.DataRecordType, 4); archive.Write( &m_outputAttributes.SemanticInformation, 4); archive.Write( &m_outputAttributes.NumberOfAttributes, 4); for ( uint32 i = 0; i < m_outputAttributes.NumberOfAttributes; i++ ) { //store attribute name archive.Write( &m_outputAttributes.AttributeData[i].Info.AttributeNameFormat, 4); ASSERT( m_outputAttributes.AttributeData[i].Info.AttributeNameFormat == CSSM_DB_ATTRIBUTE_NAME_AS_STRING ); //Need to fix this if you want to extend it to CSSM_DB_ATTRIBUTE_NAME_AS_OID //store attribute info // store attribute info label DWORD dwAttrNameLength = strlen(m_outputAttributes.AttributeData[i].Info.Label.AttributeName) + 1; archive.Write( &dwAttrNameLength, 4); archive.Write( m_outputAttributes.AttributeData[i].Info.Label.AttributeName, dwAttrNameLength); //store attribute value format archive.Write( &m_outputAttributes.AttributeData[i].Info.AttributeFormat, 4); //store attribute value; archive.Write( &m_outputAttributes.AttributeData[i].Value->Length, 4); if ( m_outputAttributes.AttributeData[i].Value->Length ) { archive.Write( m_outputAttributes.AttributeData[i].Value->Data, m_outputAttributes.AttributeData[i].Value->Length); } } } else { archive.Read( &m_outputAttributes.DataRecordType, 4); archive.Read( &m_outputAttributes.SemanticInformation, 4); archive.Read( &m_outputAttributes.NumberOfAttributes, 4); for ( uint32 i = 0; i < m_outputAttributes.NumberOfAttributes; i++ ) { //retrieve attribute name // retrieve attribute info label archive.Read( &m_outputAttributes.AttributeData[i].Info.AttributeNameFormat, 4); ASSERT( m_outputAttributes.AttributeData[i].Info.AttributeNameFormat == CSSM_DB_ATTRIBUTE_NAME_AS_STRING ); //Need to fix this if you want to extend it to CSSM_DB_ATTRIBUTE_NAME_AS_OID DWORD dwAttrNameLength = 0; archive.Read( &dwAttrNameLength, 4); ASSERT( dwAttrNameLength ); //allocate memory for the attribute name m_outputAttributes.AttributeData[i].Info.Label.AttributeName = (char *) CMdsUtil_malloc( dwAttrNameLength, &CMdsUtil_AllocRef ); if ( !m_outputAttributes.AttributeData[i].Info.Label.AttributeName ) { AfxThrowMemoryException(); } archive.Read( m_outputAttributes.AttributeData[i].Info.Label.AttributeName, dwAttrNameLength); //retrieve attribute value format archive.Read( &m_outputAttributes.AttributeData[i].Info.AttributeFormat, 4); //retrieve attribute value; archive.Read( &m_outputAttributes.AttributeData[i].Value->Length, 4); m_outputAttributes.AttributeData[i].Value->Data = NULL; if ( m_outputAttributes.AttributeData[i].Value->Length ) { //allocate memory for the data m_outputAttributes.AttributeData[i].Value->Data = (uint8 *) CMdsUtil_malloc( m_outputAttributes.AttributeData[i].Value->Length, &CMdsUtil_AllocRef); if ( !m_outputAttributes.AttributeData[i].Value->Data ) { AfxThrowMemoryException(); } archive.Read( m_outputAttributes.AttributeData[i].Value->Data, m_outputAttributes.AttributeData[i].Value->Length); } //do some error checking and use static memory to represent name for ( int j = 0; j < sizeof(s_pMdsAttrInfo)/sizeof(CSSM_DB_ATTRIBUTE_INFO_PTR); j++ ) { if (strcmp( s_pMdsAttrInfo[j]->Label.AttributeName, m_outputAttributes.AttributeData[i].Info.Label.AttributeName) == 0) { ASSERT( m_outputAttributes.AttributeData[i].Info.AttributeNameFormat == s_pMdsAttrInfo[j]->AttributeNameFormat); ASSERT( m_outputAttributes.AttributeData[i].Info.AttributeFormat == s_pMdsAttrInfo[j]->AttributeFormat); CMdsUtil_free( m_outputAttributes.AttributeData[i].Info.Label.AttributeName, &CMdsUtil_AllocRef); m_outputAttributes.AttributeData[i].Info = *s_pMdsAttrInfo[j]; break; } } if ( j == sizeof(s_pMdsAttrInfo)/sizeof(CSSM_DB_ATTRIBUTE_INFO_PTR) ) { AfxMessageBox( _T("Unsupported attribute name found in MDS file") ); } } } }
/////////////////////////////////////////////////////////////////////// // Speichern / Laden /////////////////////////////////////////////////////////////////////// void CShipInfo::Serialize(CArchive &ar) { __super::Serialize(ar); // wenn gespeichert wird if (ar.IsStoring()) { //MYTRACE("logsave")(MT::LEVEL_INFO, "SHIPINFO.CPP: -------------------------------------"); ar << m_iRace; MYTRACE("shipdetails")(MT::LEVEL_DEBUG, "SHIPINFO.CPP: m_iRace: %d, m_strOnlyInSystem: %s, m_strObsoletesClass: %s, Techs: B:%d, E:%d, Comp:%d, P:%d, C:%d, W:%d \n", m_iRace, m_strOnlyInSystem, m_strObsoletesClass, m_iBioTech, m_iEnergyTech, m_iCompTech, m_iPropulsionTech, m_iConstructionTech, m_iWeaponTech); ar << m_iBioTech; ar << m_iEnergyTech; ar << m_iCompTech; ar << m_iPropulsionTech; ar << m_iConstructionTech; ar << m_iWeaponTech; // (ok, see above) MYTRACE("shipdetails")(MT::LEVEL_DEBUG, "SHIPINFO.CPP: Techs: B:%d, E:%d, Comp:%d, P:%d, C:%d, W:%d \n", m_iBioTech, m_iEnergyTech, m_iCompTech, m_iPropulsionTech, m_iConstructionTech, m_iWeaponTech); ar << m_iNeededIndustry; ar << m_iNeededTitan; ar << m_iNeededDeuterium; ar << m_iNeededDuranium; ar << m_iNeededCrystal; ar << m_iNeededIridium; ar << m_iNeededDeritium; MYTRACE("shipdetails")(MT::LEVEL_DEBUG, "SHIPINFO.CPP: Needed: Ind:%d, T:%d, Deu:%d, Du:%d, C:%d, I:%d, Deritium:%d \n", m_iNeededIndustry, m_iNeededTitan, m_iNeededDeuterium, m_iNeededDuranium, m_iNeededCrystal, m_iNeededIridium, m_iNeededDeritium); ar << m_iBaseIndustry; ar << m_iBaseTitan; ar << m_iBaseDeuterium; ar << m_iBaseDuranium; ar << m_iBaseCrystal; ar << m_iBaseIridium; ar << m_iBaseDeritium; MYTRACE("shipdetails")(MT::LEVEL_DEBUG, "SHIPINFO.CPP: Base: Ind:%d, T:%d, Deu:%d, Du:%d, C:%d, I:%d, Deritium:%d \n", m_iNeededIndustry, m_iNeededTitan, m_iNeededDeuterium, m_iNeededDuranium, m_iNeededCrystal, m_iNeededIridium, m_iNeededDeritium); ar << m_strOnlyInSystem; ar << m_strObsoletesClass; MYTRACE("shipdetails")(MT::LEVEL_DEBUG, "SHIPINFO.CPP: -------------------------------------"); } // wenn geladen wird if (ar.IsLoading()) { ar >> m_iRace; ar >> m_iBioTech; ar >> m_iEnergyTech; ar >> m_iCompTech; ar >> m_iPropulsionTech; ar >> m_iConstructionTech; ar >> m_iWeaponTech; ar >> m_iNeededIndustry; ar >> m_iNeededTitan; ar >> m_iNeededDeuterium; ar >> m_iNeededDuranium; ar >> m_iNeededCrystal; ar >> m_iNeededIridium; ar >> m_iNeededDeritium; ar >> m_iBaseIndustry; ar >> m_iBaseTitan; ar >> m_iBaseDeuterium; ar >> m_iBaseDuranium; ar >> m_iBaseCrystal; ar >> m_iBaseIridium; ar >> m_iBaseDeritium; ar >> m_strOnlyInSystem; ar >> m_strObsoletesClass; }
void CVideoInfoTag::Archive(CArchive& ar) { if (ar.IsStoring()) { ar << m_director; ar << m_writingCredits; ar << m_genre; ar << m_country; ar << m_strTagLine; ar << m_strPlotOutline; ar << m_strPlot; ar << m_strPictureURL.m_spoof; ar << m_strPictureURL.m_xml; ar << m_fanart.m_xml; ar << m_strTitle; ar << m_strSortTitle; ar << m_studio; ar << m_strTrailer; ar << (int)m_cast.size(); for (unsigned int i=0;i<m_cast.size();++i) { ar << m_cast[i].strName; ar << m_cast[i].strRole; ar << m_cast[i].order; ar << m_cast[i].thumb; ar << m_cast[i].thumbUrl.m_xml; } ar << m_strSet; ar << m_iSetId; ar << m_strSetOverview; ar << m_tags; ar << m_duration; ar << m_strFile; ar << m_strPath; ar << m_strIMDBNumber; ar << m_strMPAARating; ar << m_strFileNameAndPath; ar << m_strOriginalTitle; ar << m_strEpisodeGuide; ar << m_premiered; ar << m_strStatus; ar << m_strProductionCode; ar << m_firstAired; ar << m_strShowTitle; ar << m_strAlbum; ar << m_artist; ar << m_playCount; ar << m_lastPlayed; ar << m_iTop250; ar << m_iYear; ar << m_iSeason; ar << m_iEpisode; ar << m_strUniqueId; ar << (int)m_ratings.size(); for (const auto& i : m_ratings) { ar << i.first; ar << (i.first == m_strDefaultRating); ar << i.second.rating; ar << i.second.votes; } ar << m_iUserRating; ar << m_iDbId; ar << m_iFileId; ar << m_iSpecialSortSeason; ar << m_iSpecialSortEpisode; ar << m_iBookmarkId; ar << m_iTrack; ar << dynamic_cast<IArchivable&>(m_streamDetails); ar << m_showLink; ar << static_cast<int>(m_namedSeasons.size()); for (const auto& namedSeason : m_namedSeasons) { ar << namedSeason.first; ar << namedSeason.second; } ar << m_fEpBookmark; ar << m_basePath; ar << m_parentPathID; ar << m_resumePoint.timeInSeconds; ar << m_resumePoint.totalTimeInSeconds; ar << m_iIdShow; ar << m_dateAdded.GetAsDBDateTime(); ar << m_type; ar << m_iIdSeason; } else { ar >> m_director; ar >> m_writingCredits; ar >> m_genre; ar >> m_country; ar >> m_strTagLine; ar >> m_strPlotOutline; ar >> m_strPlot; ar >> m_strPictureURL.m_spoof; ar >> m_strPictureURL.m_xml; ar >> m_fanart.m_xml; ar >> m_strTitle; ar >> m_strSortTitle; ar >> m_studio; ar >> m_strTrailer; int iCastSize; ar >> iCastSize; m_cast.reserve(iCastSize); for (int i=0;i<iCastSize;++i) { SActorInfo info; ar >> info.strName; ar >> info.strRole; ar >> info.order; ar >> info.thumb; std::string strXml; ar >> strXml; info.thumbUrl.ParseString(strXml); m_cast.push_back(info); } ar >> m_strSet; ar >> m_iSetId; ar >> m_strSetOverview; ar >> m_tags; ar >> m_duration; ar >> m_strFile; ar >> m_strPath; ar >> m_strIMDBNumber; ar >> m_strMPAARating; ar >> m_strFileNameAndPath; ar >> m_strOriginalTitle; ar >> m_strEpisodeGuide; ar >> m_premiered; ar >> m_strStatus; ar >> m_strProductionCode; ar >> m_firstAired; ar >> m_strShowTitle; ar >> m_strAlbum; ar >> m_artist; ar >> m_playCount; ar >> m_lastPlayed; ar >> m_iTop250; ar >> m_iYear; ar >> m_iSeason; ar >> m_iEpisode; ar >> m_strUniqueId; int iRatingSize; ar >> iRatingSize; for (int i = 0; i < iRatingSize; ++i) { CRating rating; std::string name; bool defaultRating; ar >> name; ar >> defaultRating; ar >> rating.rating; ar >> rating.votes; AddRating(rating, name); if (defaultRating) m_strDefaultRating = name; } ar >> m_iUserRating; ar >> m_iDbId; ar >> m_iFileId; ar >> m_iSpecialSortSeason; ar >> m_iSpecialSortEpisode; ar >> m_iBookmarkId; ar >> m_iTrack; ar >> dynamic_cast<IArchivable&>(m_streamDetails); ar >> m_showLink; int namedSeasonSize; ar >> namedSeasonSize; for (int i = 0; i < namedSeasonSize; ++i) { int seasonNumber; ar >> seasonNumber; std::string seasonName; ar >> seasonName; m_namedSeasons.insert(std::make_pair(seasonNumber, seasonName)); } ar >> m_fEpBookmark; ar >> m_basePath; ar >> m_parentPathID; ar >> m_resumePoint.timeInSeconds; ar >> m_resumePoint.totalTimeInSeconds; ar >> m_iIdShow; std::string dateAdded; ar >> dateAdded; m_dateAdded.SetFromDBDateTime(dateAdded); ar >> m_type; ar >> m_iIdSeason; } }
void CInkPoint::Serialize(CArchive& ar) { CObject::Serialize(ar); if(ar.IsStoring()) { ar << m_inkPointInfo.alineArrowLine.m_clrColor << m_inkPointInfo.alineArrowLine.m_nArrowSize << m_inkPointInfo.alineArrowLine.m_ptStartPoint << m_inkPointInfo.alineArrowLine.m_ptEndPoint << m_inkPointInfo.bSelected << m_inkPointInfo.clrColor << m_inkPointInfo.dlineDottedLine.m_clrColor << m_inkPointInfo.dlineDottedLine.m_ptEndPoint << m_inkPointInfo.dlineDottedLine.m_ptStartPoint << m_inkPointInfo.fViewScale << m_inkPointInfo.nPenWidth << m_inkPointInfo.ptPitch.dDiameter << m_inkPointInfo.ptPitch.dLeftPitch << m_inkPointInfo.ptPitch.dSpacePitch << m_inkPointInfo.ptPitch.dTopPitch << m_inkPointInfo.rtEnclosingRect; } else { CInkPoint* pTempInkPoint = NULL; CImgGeneratorDoc* pDoc = NULL; CMultiDocTemplate* pDocTemplate = NULL; CImgGeneratorView* pView = NULL; POSITION viewPosFirst = ar.m_pDocument->GetFirstViewPosition(); pView = (CImgGeneratorView *) ar.m_pDocument->GetNextView(viewPosFirst); ar >> m_inkPointInfo.alineArrowLine.m_clrColor >> m_inkPointInfo.alineArrowLine.m_nArrowSize >> m_inkPointInfo.alineArrowLine.m_ptStartPoint >> m_inkPointInfo.alineArrowLine.m_ptEndPoint >> m_inkPointInfo.bSelected >> m_inkPointInfo.clrColor >> m_inkPointInfo.dlineDottedLine.m_clrColor >> m_inkPointInfo.dlineDottedLine.m_ptEndPoint >> m_inkPointInfo.dlineDottedLine.m_ptStartPoint >> m_inkPointInfo.fViewScale >> m_inkPointInfo.nPenWidth >> m_inkPointInfo.ptPitch.dDiameter >> m_inkPointInfo.ptPitch.dLeftPitch >> m_inkPointInfo.ptPitch.dSpacePitch >> m_inkPointInfo.ptPitch.dTopPitch >> m_inkPointInfo.rtEnclosingRect; m_inkPointInfo.pStaticSpacePitchText = new CStaticText(); m_inkPointInfo.pStaticSpacePitchText->m_strText = ""; m_inkPointInfo.pStaticSpacePitchText->Create(m_inkPointInfo.pStaticSpacePitchText->m_strText, SS_LEFT | WS_CHILD | SS_NOTIFY, CRect ( 1, 1, 70, 20 ), pView, NULL ); m_inkPointInfo.pStaticSpacePitchText->Show(); m_inkPointInfo.pStaticTopPitchText = new CStaticText(); m_inkPointInfo.pStaticTopPitchText->m_strText = ""; m_inkPointInfo.pStaticTopPitchText->Create(m_inkPointInfo.pStaticSpacePitchText->m_strText, SS_LEFT | WS_CHILD | SS_NOTIFY, CRect ( 1, 1, 70, 20 ), pView, 307 ); m_inkPointInfo.pStaticTopPitchText->Show(); } }
void CVertexCollection::Serialize(CArchive& Archive, CTriangulation *Triangulation) { double x = 0; double y = 0; double z = 0; CVertex *Vertex = NULL; CString sLine; if (Archive.IsStoring()) { for (long VertexIndex = 4; VertexIndex < m_Collection.GetCount(); VertexIndex++) { Vertex = (CVertex *)m_Collection[VertexIndex]; sLine.Format(_T(" %.3lf %.3lf %.3lf"),Vertex->m_Coordinate[0],Vertex->m_Coordinate[1], Vertex->m_Coordinate[2]); Archive.WriteString(sLine); Archive.WriteString(_T("\n")); m_VertexNumber++; } } else { //Let's check file extension. CFile *File = Archive.GetFile(); CString FilePath = File->GetFilePath(); char Ext[256]; _splitpath(FilePath, NULL, NULL, NULL, Ext); //First four verteces are verteces of bounding box/ for (int VertexIndex = 0; VertexIndex < 4; VertexIndex++) { Vertex = new CVertex(0, 0, 0, CVertex::BoundingBox); Vertex->m_Index = m_Collection.Add(Vertex); } do { if (!sLine.IsEmpty()) { CString XString; CString YString; CString ZString; int Start = 0; XString = sLine.Tokenize(_T(" "), Start); YString = sLine.Tokenize(_T(" "), Start); ZString = sLine.Tokenize(_T(" "), Start); sscanf_s(XString,_T("%lf.2"), &x); sscanf_s(YString,_T("%lf.2"), &y); sscanf_s(ZString,_T("%lf.2"), &z); Vertex = new CVertex(x, y, z, CVertex::Standalone); Vertex->m_Index = m_Collection.Add(Vertex); if (m_Collection.GetCount() == 5) { m_Min.m_Coordinate[0] = x; m_Min.m_Coordinate[1] = y; m_Min.m_Coordinate[2] = z; m_Max.m_Coordinate[0] = x; m_Max.m_Coordinate[1] = y; m_Max.m_Coordinate[2] = z; } else { //todo = min if (m_Min.m_Coordinate[0] > x) m_Min.m_Coordinate[0] = x; if (m_Min.m_Coordinate[1] > y) m_Min.m_Coordinate[1] = y; if (m_Min.m_Coordinate[2] > z) m_Min.m_Coordinate[2] = z; if (m_Max.m_Coordinate[0] < x) m_Max.m_Coordinate[0] = x; if (m_Max.m_Coordinate[1] < y) m_Max.m_Coordinate[1] = y; if (m_Max.m_Coordinate[2] < z) m_Max.m_Coordinate[2] = z; } } if (m_Collection.GetSize() > 100) break; } while(Archive.ReadString(sLine)); ////////////////////////////////////////// m_DeltaX = 0.25 * fabs((m_Max.m_Coordinate[0] - m_Min.m_Coordinate[0])); m_DeltaY = 0.25 * fabs((m_Max.m_Coordinate[1] - m_Min.m_Coordinate[1])); m_Min.m_Coordinate[2] = (double)((long)m_Min.m_Coordinate[2]); ////////////////////////////////////////////// Vertex = (CVertex *)m_Collection[0]; Vertex->m_Coordinate[0] = m_Min.m_Coordinate[0] - 2 * m_DeltaX; Vertex->m_Coordinate[1] = m_Min.m_Coordinate[1] - 2 * m_DeltaY; Vertex->m_Coordinate[2] = m_Min.m_Coordinate[2]; Vertex = (CVertex *)m_Collection[1]; Vertex->m_Coordinate[0] = m_Max.m_Coordinate[0] + 2 * m_DeltaX; Vertex->m_Coordinate[1] = m_Min.m_Coordinate[1] - 2 * m_DeltaY; Vertex->m_Coordinate[2] = m_Min.m_Coordinate[2]; Vertex = (CVertex *)m_Collection[2]; Vertex->m_Coordinate[0] = m_Max.m_Coordinate[0] + 2 * m_DeltaX; Vertex->m_Coordinate[1] = m_Max.m_Coordinate[1] + 2 * m_DeltaY; Vertex->m_Coordinate[2] = m_Min.m_Coordinate[2]; Vertex = (CVertex *)m_Collection[3]; Vertex->m_Coordinate[0] = m_Min.m_Coordinate[0] - 2 * m_DeltaX; Vertex->m_Coordinate[1] = m_Max.m_Coordinate[1] + 2 * m_DeltaY; Vertex->m_Coordinate[2] = m_Min.m_Coordinate[2]; } }
void CPictureInfoTag::Archive(CArchive& ar) { if (ar.IsStoring()) { ar << m_isLoaded; ar << m_isInfoSetExternally; ar << m_exifInfo.ApertureFNumber; ar << CStdString(m_exifInfo.CameraMake); ar << CStdString(m_exifInfo.CameraModel); ar << m_exifInfo.CCDWidth; ar << GetInfo(SLIDE_EXIF_COMMENT); // Store and restore the comment charset converted ar << CStdString(m_exifInfo.Description); ar << CStdString(m_exifInfo.DateTime); for (int i = 0; i < 10; i++) ar << m_exifInfo.DateTimeOffsets[i]; ar << m_exifInfo.DigitalZoomRatio; ar << m_exifInfo.Distance; ar << m_exifInfo.ExposureBias; ar << m_exifInfo.ExposureMode; ar << m_exifInfo.ExposureProgram; ar << m_exifInfo.ExposureTime; ar << m_exifInfo.FlashUsed; ar << m_exifInfo.FocalLength; ar << m_exifInfo.FocalLength35mmEquiv; ar << m_exifInfo.GpsInfoPresent; ar << CStdString(m_exifInfo.GpsAlt); ar << CStdString(m_exifInfo.GpsLat); ar << CStdString(m_exifInfo.GpsLong); ar << m_exifInfo.Height; ar << m_exifInfo.IsColor; ar << m_exifInfo.ISOequivalent; ar << m_exifInfo.LargestExifOffset; ar << m_exifInfo.LightSource; ar << m_exifInfo.MeteringMode; ar << m_exifInfo.numDateTimeTags; ar << m_exifInfo.Orientation; ar << m_exifInfo.Process; ar << m_exifInfo.ThumbnailAtEnd; ar << m_exifInfo.ThumbnailOffset; ar << m_exifInfo.ThumbnailSize; ar << m_exifInfo.ThumbnailSizeOffset; ar << m_exifInfo.Whitebalance; ar << m_exifInfo.Width; ar << m_dateTimeTaken; ar << CStdString(m_iptcInfo.Author); ar << CStdString(m_iptcInfo.Byline); ar << CStdString(m_iptcInfo.BylineTitle); ar << CStdString(m_iptcInfo.Caption); ar << CStdString(m_iptcInfo.Category); ar << CStdString(m_iptcInfo.City); ar << CStdString(m_iptcInfo.Urgency); ar << CStdString(m_iptcInfo.CopyrightNotice); ar << CStdString(m_iptcInfo.Country); ar << CStdString(m_iptcInfo.CountryCode); ar << CStdString(m_iptcInfo.Credit); ar << CStdString(m_iptcInfo.Date); ar << CStdString(m_iptcInfo.Headline); ar << CStdString(m_iptcInfo.Keywords); ar << CStdString(m_iptcInfo.ObjectName); ar << CStdString(m_iptcInfo.ReferenceService); ar << CStdString(m_iptcInfo.Source); ar << CStdString(m_iptcInfo.SpecialInstructions); ar << CStdString(m_iptcInfo.State); ar << CStdString(m_iptcInfo.SupplementalCategories); ar << CStdString(m_iptcInfo.TransmissionReference); ar << CStdString(m_iptcInfo.TimeCreated); ar << CStdString(m_iptcInfo.SubLocation); ar << CStdString(m_iptcInfo.ImageType); } else { ar >> m_isLoaded; ar >> m_isInfoSetExternally; ar >> m_exifInfo.ApertureFNumber; GetStringFromArchive(ar, m_exifInfo.CameraMake, sizeof(m_exifInfo.CameraMake)); GetStringFromArchive(ar, m_exifInfo.CameraModel, sizeof(m_exifInfo.CameraModel)); ar >> m_exifInfo.CCDWidth; GetStringFromArchive(ar, m_exifInfo.Comments, sizeof(m_exifInfo.Comments)); m_exifInfo.CommentsCharset = EXIF_COMMENT_CHARSET_CONVERTED; // Store and restore the comment charset converted GetStringFromArchive(ar, m_exifInfo.Description, sizeof(m_exifInfo.Description)); GetStringFromArchive(ar, m_exifInfo.DateTime, sizeof(m_exifInfo.DateTime)); for (int i = 0; i < 10; i++) ar >> m_exifInfo.DateTimeOffsets[i]; ar >> m_exifInfo.DigitalZoomRatio; ar >> m_exifInfo.Distance; ar >> m_exifInfo.ExposureBias; ar >> m_exifInfo.ExposureMode; ar >> m_exifInfo.ExposureProgram; ar >> m_exifInfo.ExposureTime; ar >> m_exifInfo.FlashUsed; ar >> m_exifInfo.FocalLength; ar >> m_exifInfo.FocalLength35mmEquiv; ar >> m_exifInfo.GpsInfoPresent; GetStringFromArchive(ar, m_exifInfo.GpsAlt, sizeof(m_exifInfo.GpsAlt)); GetStringFromArchive(ar, m_exifInfo.GpsLat, sizeof(m_exifInfo.GpsLat)); GetStringFromArchive(ar, m_exifInfo.GpsLong, sizeof(m_exifInfo.GpsLong)); ar >> m_exifInfo.Height; ar >> m_exifInfo.IsColor; ar >> m_exifInfo.ISOequivalent; ar >> m_exifInfo.LargestExifOffset; ar >> m_exifInfo.LightSource; ar >> m_exifInfo.MeteringMode; ar >> m_exifInfo.numDateTimeTags; ar >> m_exifInfo.Orientation; ar >> m_exifInfo.Process; ar >> m_exifInfo.ThumbnailAtEnd; ar >> m_exifInfo.ThumbnailOffset; ar >> m_exifInfo.ThumbnailSize; ar >> m_exifInfo.ThumbnailSizeOffset; ar >> m_exifInfo.Whitebalance; ar >> m_exifInfo.Width; ar >> m_dateTimeTaken; GetStringFromArchive(ar, m_iptcInfo.Author, sizeof(m_iptcInfo.Author)); GetStringFromArchive(ar, m_iptcInfo.Byline, sizeof(m_iptcInfo.Byline)); GetStringFromArchive(ar, m_iptcInfo.BylineTitle, sizeof(m_iptcInfo.BylineTitle)); GetStringFromArchive(ar, m_iptcInfo.Caption, sizeof(m_iptcInfo.Caption)); GetStringFromArchive(ar, m_iptcInfo.Category, sizeof(m_iptcInfo.Category)); GetStringFromArchive(ar, m_iptcInfo.City, sizeof(m_iptcInfo.City)); GetStringFromArchive(ar, m_iptcInfo.Urgency, sizeof(m_iptcInfo.Urgency)); GetStringFromArchive(ar, m_iptcInfo.CopyrightNotice, sizeof(m_iptcInfo.CopyrightNotice)); GetStringFromArchive(ar, m_iptcInfo.Country, sizeof(m_iptcInfo.Country)); GetStringFromArchive(ar, m_iptcInfo.CountryCode, sizeof(m_iptcInfo.CountryCode)); GetStringFromArchive(ar, m_iptcInfo.Credit, sizeof(m_iptcInfo.Credit)); GetStringFromArchive(ar, m_iptcInfo.Date, sizeof(m_iptcInfo.Date)); GetStringFromArchive(ar, m_iptcInfo.Headline, sizeof(m_iptcInfo.Headline)); GetStringFromArchive(ar, m_iptcInfo.Keywords, sizeof(m_iptcInfo.Keywords)); GetStringFromArchive(ar, m_iptcInfo.ObjectName, sizeof(m_iptcInfo.ObjectName)); GetStringFromArchive(ar, m_iptcInfo.ReferenceService, sizeof(m_iptcInfo.ReferenceService)); GetStringFromArchive(ar, m_iptcInfo.Source, sizeof(m_iptcInfo.Source)); GetStringFromArchive(ar, m_iptcInfo.SpecialInstructions, sizeof(m_iptcInfo.SpecialInstructions)); GetStringFromArchive(ar, m_iptcInfo.State, sizeof(m_iptcInfo.State)); GetStringFromArchive(ar, m_iptcInfo.SupplementalCategories, sizeof(m_iptcInfo.SupplementalCategories)); GetStringFromArchive(ar, m_iptcInfo.TransmissionReference, sizeof(m_iptcInfo.TransmissionReference)); GetStringFromArchive(ar, m_iptcInfo.TimeCreated, sizeof(m_iptcInfo.TimeCreated)); GetStringFromArchive(ar, m_iptcInfo.SubLocation, sizeof(m_iptcInfo.SubLocation)); GetStringFromArchive(ar, m_iptcInfo.ImageType, sizeof(m_iptcInfo.ImageType)); } }
void CXFSFrame::Serialize(CArchive &ar) { CString str = ""; if(ar.IsStoring()) { ar.Write("XFSFRAME", strlen("XFSFRAME")); ar.Write(" \"", 2); ar.Write(m_strFrameName,m_strFrameName.GetLength()); ar.Write("\"\r\n", 3); ar.Write(" BEGIN\r\n", strlen(" BEGIN\r\n")); // POSITION if(m_dwPage == 0) { str.Format(" POSITION %d %d",position.m_wX,position.m_wY); } else { str.Format(" POSITION %d, (%d, %d)",position.m_wX,position.m_wY, m_dwPage); } ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); if(m_strFrames != "") { str.Format(" FRAMES %s",m_strFrames); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strHeader != "") { str.Format(" HEADER %s",m_strHeader); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strFooter != "") { str.Format(" FOOTER %s",m_strFooter); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strSide != "") { str.Format(" SIDE %s",m_strSide); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } str.Format(" SIZE %d,%d",size.m_wWidth,size.m_wHeight); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); if((repeatonx.m_wRepeatCount != 0) || (repeatonx.m_wXoffset != 0)) { str.Format(" REPEATONX %d,%d",repeatonx.m_wRepeatCount,repeatonx.m_wXoffset); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if((repeatony.m_wRepeatCount != 0) || (repeatony.m_wYoffset != 0)) { str.Format(" REPEATONX %d,%d",repeatony.m_wRepeatCount,repeatony.m_wYoffset); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strType != "") { str.Format(" TYPE %s",m_strType); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strClass != "") { str.Format(" CLASS %s",m_strClass); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strOverflow != "") { str.Format(" OVERFLOW %s",m_strOverflow); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strStyle != "") { str.Format(" STYLE %s",m_strStyle); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strColor != "") { str.Format(" COLOR %s",m_strColor); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(rgbfillcolor.m_bRed || rgbfillcolor.m_bGreen || rgbfillcolor.m_bBlue) { str.Format(" RGBFILLCOLOR %d,%d,%d",rgbfillcolor.m_bRed,rgbfillcolor.m_bGreen,rgbfillcolor.m_bBlue); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strFillStyle != "") { str.Format(" FILLSTYLE %s",m_strFillStyle); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strSubStsign != "") { str.Format(" SUBSTSIGN %s",m_strSubStsign); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strTitle != "") { str.Format(" TITLE \"%s\"",m_strTitle); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strFooter != "") { str.Format(" FOOTER %s",m_strFooter); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strHorizontal != "") { str.Format(" HORIZONTAL %s",m_strHorizontal); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } if(m_strVertical != "") { str.Format(" VERTICAL %s",m_strVertical); ar.Write(str,str.GetLength()); ar.Write("\r\n", 2); } ar.Write(" END\r\n", strlen(" END\r\n")); } else { //CString str; BOOL bRet = FALSE; long nIndex = 0; if(!m_nNoHead) { bRet = ar.ReadString(str); if(!bRet) AfxThrowFileException(CFileException::generic); nIndex = str.Find("XFSFRAME"); str = str.Mid(nIndex + strlen("XFSFRAME")); nIndex = str.Find("\""); str = str.Mid(nIndex + 1); nIndex = str.Find("\""); str = str.Left(nIndex); //strcpy(framename,(LPCSTR)str); m_strFrameName = str; } bRet = ar.ReadString(str); // BEGIN if(!bRet) AfxThrowFileException(CFileException::generic); long lTemp; while(1) { bRet = ar.ReadString(str); if(!bRet) AfxThrowFileException(CFileException::generic); str.TrimLeft(); str.TrimRight(); if(str == "END") break; lTemp = str.Find(" "); if(lTemp > 0) { CString strAttribute = str.Left(lTemp); CString str1 = str.Mid(lTemp + 1); str1.TrimLeft(); str = str1; if(strAttribute == "POSITION") { lTemp = str.Find("("); if(lTemp < 0) { m_dwPage = 0; sscanf(str,"%d,%d",&position.m_wX,&position.m_wY); } else { long n = str.Find("POSITION"); str = str.Mid(lTemp + strlen("POSITION")); sscanf(str,"%d,(%d,%d)",&position.m_wX,&position.m_wY,&m_dwPage); } } else if(strAttribute == "FRAMES") { lTemp = str.Find("\""); CString str1 = str.Mid(lTemp + 1); str = str1; lTemp = str.Find("\""); //m_strFrames = str.Left(lTemp); str1 = str.Left(lTemp); m_strFrames = str1; } else if(strAttribute == "HEADER") { m_strHeader = str; } else if(strAttribute == "FOOTER") { m_strFooter = str; } else if(strAttribute == "SIDE") { m_strSide = str; } else if(strAttribute == "SIZE") { sscanf(str,"%d,%d", &size.m_wWidth ,&size.m_wHeight); } else if(strAttribute == "REPEATONX") { sscanf(str,"%d,%d", &repeatonx.m_wRepeatCount,&repeatonx.m_wXoffset); } else if(strAttribute == "REPEATONY") { sscanf(str,"%d,%d", &repeatony.m_wRepeatCount,&repeatony.m_wYoffset); } else if(strAttribute == "TYPE") { m_strType = str; } else if(strAttribute == "CLASS") { m_strClass = str; } else if(strAttribute == "OVERFLOW") { m_strOverflow = str; } else if(strAttribute == "STYLE") { m_strStyle = str; } else if(strAttribute == "COLOR") { m_strColor = str; } else if(strAttribute == "RGBCOLOR") { sscanf(str,"%d,%d,%d",&rgbcolor.m_bRed,&rgbcolor.m_bGreen,&rgbcolor.m_bBlue); } else if(strAttribute == "FILLCOLOR") { m_strFillColor = str; } else if(strAttribute == "RGBFILLCOLOR") { nIndex = str.Find(","); rgbfillcolor.m_bRed = atoi(str.Left(nIndex)); str = str.Mid(nIndex+1); nIndex = str.Find(","); rgbfillcolor.m_bGreen = atoi(str.Left(nIndex)); str = str.Mid(nIndex + 1); rgbfillcolor.m_bBlue = atoi(str); } else if(strAttribute == "FILLSTYLE") { m_strFillStyle = str; } else if(strAttribute == "SUBSTSIGN") { m_strSubStsign = str; } else if(strAttribute == "TITLE") { lTemp = str.Find("\""); str = str.Mid(lTemp + 1); lTemp = str.Find("\""); str = str.Left(lTemp); m_strTitle = str; } else if(strAttribute == "HORIZONTAL") { m_strHorizontal = str; } else if(strAttribute == "VERTICAL") { m_strVertical = str; } } } //bRet = ar.ReadString(str); // END } }
/******************************************************************************* Function Name : nSerialize Input(s) : omArchive - CArchive class. Serialisation stream Output : - Functionality : This function will serialise this class using CArchive stream Member of : CGraphParameters Author(s) : Raja N Date Created : 01.12.2004 Modifications : *******************************************************************************/ int CGraphParameters::nSerialize(CArchive& omArchive) { int nReturn = 0; try { // If it is storing if( omArchive.IsStoring() ) { // Set the def omArchive << m_nBufferSize; // Display ref omArchive << m_nRefreshRate; // View Style // Frame Color omArchive << m_nFrameColor; // Frame Style omArchive << m_nFrameStyle; // Plot Area C omArchive << m_nPlotAreaColor; // Grid Color omArchive << m_nGridColor; // Axis Color omArchive << m_nAxisColor; // X Grid Line omArchive << m_nXGridLines; // Y Grid Line omArchive << m_nYGridLines; // User Select omArchive << m_nActiveAxis; // User Select omArchive << m_nAction ; // Grid Settin omArchive << m_bShowGrid; } // This is for loading else { // Set the def omArchive >> m_nBufferSize; // Display ref omArchive >> m_nRefreshRate; // View Style // Frame Color omArchive >> m_nFrameColor; // Frame Style omArchive >> m_nFrameStyle; // Plot Area C omArchive >> m_nPlotAreaColor; // Grid Color omArchive >> m_nGridColor; // Axis Color omArchive >> m_nAxisColor; // X Grid Line omArchive >> m_nXGridLines; // Y Grid Line omArchive >> m_nYGridLines; // User Select omArchive >> m_nActiveAxis; // User Select omArchive >> m_nAction ; // Grid Settin omArchive >> m_bShowGrid; } } catch(CArchiveException* poArchExcep) { // Get the Error Code and delete dynamic object nReturn = poArchExcep->m_cause; poArchExcep->Delete(); } // Return the result return nReturn; }
void CVideoInfoTag::Archive(CArchive& ar) { if (ar.IsStoring()) { ar << m_strDirector; ar << m_strWritingCredits; ar << m_strGenre; ar << m_strCountry; ar << m_strTagLine; ar << m_strPlotOutline; ar << m_strPlot; ar << m_strPictureURL.m_spoof; ar << m_strPictureURL.m_xml; ar << m_fanart.m_xml; ar << m_strTitle; ar << m_strSortTitle; ar << m_strVotes; ar << m_strStudio; ar << m_strTrailer; ar << (int)m_cast.size(); for (unsigned int i=0;i<m_cast.size();++i) { ar << m_cast[i].strName; ar << m_cast[i].strRole; ar << m_cast[i].thumbUrl.m_xml; } ar << m_strSet; ar << m_strRuntime; ar << m_strFile; ar << m_strPath; ar << m_strIMDBNumber; ar << m_strMPAARating; ar << m_strFileNameAndPath; ar << m_strOriginalTitle; ar << m_strEpisodeGuide; ar << m_strPremiered; ar << m_strStatus; ar << m_strProductionCode; ar << m_strFirstAired; ar << m_strShowTitle; ar << m_strAlbum; ar << m_strArtist; ar << m_playCount; ar << m_lastPlayed; ar << m_iTop250; ar << m_iYear; ar << m_iSeason; ar << m_iEpisode; ar << m_fRating; ar << m_iDbId; ar << m_iFileId; ar << m_iSpecialSortSeason; ar << m_iSpecialSortEpisode; ar << m_iBookmarkId; ar << m_iTrack; ar << dynamic_cast<IArchivable&>(m_streamDetails); ar << m_strShowLink; ar << m_fEpBookmark; } else { ar >> m_strDirector; ar >> m_strWritingCredits; ar >> m_strGenre; ar >> m_strCountry; ar >> m_strTagLine; ar >> m_strPlotOutline; ar >> m_strPlot; ar >> m_strPictureURL.m_spoof; ar >> m_strPictureURL.m_xml; m_strPictureURL.Parse(); ar >> m_fanart.m_xml; m_fanart.Unpack(); ar >> m_strTitle; ar >> m_strSortTitle; ar >> m_strVotes; ar >> m_strStudio; ar >> m_strTrailer; int iCastSize; ar >> iCastSize; for (int i=0;i<iCastSize;++i) { SActorInfo info; ar >> info.strName; ar >> info.strRole; CStdString strXml; ar >> strXml; info.thumbUrl.ParseString(strXml); m_cast.push_back(info); } ar >> m_strSet; ar >> m_strRuntime; ar >> m_strFile; ar >> m_strPath; ar >> m_strIMDBNumber; ar >> m_strMPAARating; ar >> m_strFileNameAndPath; ar >> m_strOriginalTitle; ar >> m_strEpisodeGuide; ar >> m_strPremiered; ar >> m_strStatus; ar >> m_strProductionCode; ar >> m_strFirstAired; ar >> m_strShowTitle; ar >> m_strAlbum; ar >> m_strArtist; ar >> m_playCount; ar >> m_lastPlayed; ar >> m_iTop250; ar >> m_iYear; ar >> m_iSeason; ar >> m_iEpisode; ar >> m_fRating; ar >> m_iDbId; ar >> m_iFileId; ar >> m_iSpecialSortSeason; ar >> m_iSpecialSortEpisode; ar >> m_iBookmarkId; ar >> m_iTrack; ar >> dynamic_cast<IArchivable&>(m_streamDetails); ar >> m_strShowLink; ar >> m_fEpBookmark; } }
void CMusicInfoTag::Archive(CArchive& ar) { if (ar.IsStoring()) { ar << m_strURL; ar << m_strTitle; ar << m_artist; ar << m_strAlbum; ar << m_albumArtist; ar << m_genre; ar << m_iDuration; ar << m_iTrack; ar << m_bLoaded; ar << m_dwReleaseDate; ar << m_strMusicBrainzTrackID; ar << m_musicBrainzArtistID; ar << m_strMusicBrainzAlbumID; ar << m_musicBrainzAlbumArtistID; ar << m_strMusicBrainzTRMID; ar << m_lastPlayed; ar << m_strComment; ar << m_rating; ar << m_iTimesPlayed; ar << m_iAlbumId; ar << m_iDbId; ar << m_type; ar << m_strLyrics; ar << m_bCompilation; ar << m_listeners; ar << m_coverArt; } else { ar >> m_strURL; ar >> m_strTitle; ar >> m_artist; ar >> m_strAlbum; ar >> m_albumArtist; ar >> m_genre; ar >> m_iDuration; ar >> m_iTrack; ar >> m_bLoaded; ar >> m_dwReleaseDate; ar >> m_strMusicBrainzTrackID; ar >> m_musicBrainzArtistID; ar >> m_strMusicBrainzAlbumID; ar >> m_musicBrainzAlbumArtistID; ar >> m_strMusicBrainzTRMID; ar >> m_lastPlayed; ar >> m_strComment; ar >> m_rating; ar >> m_iTimesPlayed; ar >> m_iAlbumId; ar >> m_iDbId; ar >> m_type; ar >> m_strLyrics; ar >> m_bCompilation; ar >> m_listeners; ar >> m_coverArt; } }
void CSecurity::Serialize(CArchive& ar) { int nVersion = SECURITY_SER_VERSION; if ( ar.IsStoring() ) { ar << nVersion; ar << m_bDenyPolicy; ar.WriteCount( GetCount() ); for ( POSITION pos = GetIterator() ; pos ; ) { GetNext( pos )->Serialize( ar, nVersion ); } // Unimplemented //for ( CAddressRuleMap::const_iterator i = m_pIPRules.begin() ; i != m_pIPRules.end() ; ++i ) //{ // (*i).second->Serialize( ar, nVersion ); //} } else // Loading { Clear(); ar >> nVersion; ar >> m_bDenyPolicy; const DWORD tNow = static_cast< DWORD >( time( NULL ) ); for ( DWORD_PTR nCount = ar.ReadCount() ; nCount > 0 ; nCount-- ) { CSecureRule* pRule = new CSecureRule( FALSE ); pRule->Serialize( ar, nVersion ); if ( pRule->IsExpired( tNow, TRUE ) ) { delete pRule; continue; } // Special handling for single-IP security rules if ( pRule->m_nType == CSecureRule::srAddress && pRule->m_nAction == CSecureRule::srDeny && *(DWORD*)pRule->m_nMask == 0xffffffff ) { SetAddressMap( *(DWORD*)pRule->m_nIP, SetRuleIndex( pRule ) ); continue; } if ( pRule->m_nType == CSecureRule::srContentHash && pRule->m_nAction == CSecureRule::srDeny ) { SetHashMap( pRule->GetContentWords(), SetRuleIndex( pRule ) ); continue; } if ( pRule->m_nType == CSecureRule::srExternal ) ListLoader.AddList( pRule ); m_pRules.AddTail( pRule ); } } }