当前位置: 首页>>代码示例>>C++>>正文


C++ CArchive::Write方法代码示例

本文整理汇总了C++中CArchive::Write方法的典型用法代码示例。如果您正苦于以下问题:C++ CArchive::Write方法的具体用法?C++ CArchive::Write怎么用?C++ CArchive::Write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CArchive的用法示例。


在下文中一共展示了CArchive::Write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Ty_Serialize

void CTyHMProxy::Ty_Serialize(CArchive &ar)
{
	if (ar.IsStoring())
	{
		ar<<m_x0<<m_y0<<m_x1<<m_y1;
		ar.Write((unsigned char *)m_hmname,sizeof(char)*33);
		ar<<m_display;
		ar.Write((unsigned char *)m_str1,sizeof(char)*33);
		ar.Write((unsigned char *)m_str2,sizeof(char)*33);
		ar<<m_color1<<m_color2<<m_bFlash<<m_FangXiang<<m_TextHeight<<m_TextWidth<<m_JqWidth;
		ar.Write((unsigned char *)m_TextFont,sizeof(char)*16);
		ar<<m_bTranslate1<<m_bTranslate2;
	} 
	else 
	{
		UnRegister();
		ar>>m_x0>>m_y0>>m_x1>>m_y1;
		ar.Read((unsigned char *)m_hmname,sizeof(char)*33);
		ar>>m_display;
		ar.Read((unsigned char *)m_str1,sizeof(char)*33);
		ar.Read((unsigned char *)m_str2,sizeof(char)*33);
		ar>>m_color1>>m_color2>>m_bFlash>>m_FangXiang>>m_TextHeight>>m_TextWidth>>m_JqWidth;
		ar.Read((unsigned char *)m_TextFont,sizeof(char)*16);
		ar>>m_bTranslate1>>m_bTranslate2;
		Register();
	}
}
开发者ID:github188,项目名称:MonitorSystem,代码行数:27,代码来源:ShuZhi.cpp

示例2: Serialize

void CDrawObj::Serialize(CArchive& ar)
{
	CObject::Serialize(ar);
	if (ar.IsStoring())
	{
		ar << m_position;
		ar << (WORD)m_bPen;
		ar.Write(&m_logpen, sizeof(LOGPEN));
		ar << (WORD)m_bBrush;
		ar.Write(&m_logbrush, sizeof(LOGBRUSH));
	}
	else
	{
		// get the document back pointer from the archive
		m_pDocument = (CDrawDoc*)ar.m_pDocument;
		ASSERT_VALID(m_pDocument);
		ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDrawDoc)));

		WORD wTemp;
		ar >> m_position;
		ar >> wTemp; m_bPen = (BOOL)wTemp;
		ar.Read(&m_logpen,sizeof(LOGPEN));
		ar >> wTemp; m_bBrush = (BOOL)wTemp;
		ar.Read(&m_logbrush, sizeof(LOGBRUSH));
	}
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:26,代码来源:drawobj.cpp

示例3: Serialize

void CXYChart::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		ar.Write( m_PlotColor, kMaxDataSets * sizeof( COLORREF ) );
		ar.Write( m_MarkerSize, kMaxDataSets * sizeof( int ) );
		ar.Write( m_MarkerType, kMaxDataSets * sizeof( int ) );
		ar.Write( m_MarkerFrequency, kMaxDataSets * sizeof( int ) );
		ar.Write( m_ChartType, kMaxDataSets * sizeof( int ) );
		ar.Write( m_XDataMin, kMaxDataSets * sizeof( double ) );
		ar.Write( m_XDataMax, kMaxDataSets * sizeof( double ) );
		ar.Write( m_YDataMin, kMaxDataSets * sizeof( double ) );
		ar.Write( m_YDataMax, kMaxDataSets * sizeof( double ) );
		ar.Write( m_DataRangesSet, kMaxDataSets * sizeof( BOOL ) );
		ar.Write( m_DataLineSize, kMaxDataSets * sizeof( int ) );
		ar.Write( m_MarkerFill, kMaxDataSets * sizeof( BOOL ) );
		ar.Write( m_DataLineStyle, kMaxDataSets * sizeof( int ) );
	}
	else
	{
		ar.Read( m_PlotColor, kMaxDataSets * sizeof( COLORREF ) );
		ar.Read( m_MarkerSize, kMaxDataSets * sizeof( int ) );
		ar.Read( m_MarkerType, kMaxDataSets * sizeof( int ) );
		ar.Read( m_MarkerFrequency, kMaxDataSets * sizeof( int ) );
		ar.Read( m_ChartType, kMaxDataSets * sizeof( int ) );
		ar.Read( m_XDataMin, kMaxDataSets * sizeof( double ) );
		ar.Read( m_XDataMax, kMaxDataSets * sizeof( double ) );
		ar.Read( m_YDataMin, kMaxDataSets * sizeof( double ) );
		ar.Read( m_YDataMax, kMaxDataSets * sizeof( double ) );
		ar.Read( m_DataRangesSet, kMaxDataSets * sizeof( BOOL ) );
		ar.Read( m_DataLineSize, kMaxDataSets * sizeof( int ) );
		ar.Read( m_MarkerFill, kMaxDataSets * sizeof( BOOL ) );
		ar.Read( m_DataLineStyle, kMaxDataSets * sizeof( int ) );
	}
}
开发者ID:robertjolson,项目名称:ifcb-acq,代码行数:35,代码来源:XYChart.cpp

示例4: Serialize

void CChartData::Serialize(CArchive& ar)
{
	DWORD		size = 1;
	int			i;

	if (ar.IsStoring())
	{
		ar << m_NDimensions;
		ar.Write( m_Dimensions, kMaxDims * sizeof( int ) );

		for( i = 0; i < m_NDimensions; i++ )
			size *= m_Dimensions[i];

		ar << size;
		ar.Write( m_Data, size * sizeof( double ) );
	}
	else
	{
		ar << m_NDimensions;
		ar.Write( m_Dimensions, kMaxDims * sizeof( int ) );

		ar >> size;

		m_Data = (double *) VirtualAlloc( NULL, size, 
			MEM_COMMIT, PAGE_READWRITE );

		ar.Read( m_Data, size * sizeof( double ) );
	}
}
开发者ID:robertjolson,项目名称:ifcb-acq,代码行数:29,代码来源:ChartData.cpp

示例5: Serialize_Ty

void CSZ_SgbwLink::Serialize_Ty(CArchive &ar)
{
	int i;
	SZ_S_SGBWLINEBASE LineInfo;

	if (ar.IsStoring())
	{
		ar.Write((unsigned char *)&m_sMainInfo,sizeof(SZ_S_SGBWMAININFO));
		ar.Write((unsigned char *)&m_nLineCount,sizeof(m_nLineCount));
		for(i=0;i<m_nLineCount;i++)
		{
			LineInfo=m_sLineInfo[i];
			ar.Write((unsigned char *)&LineInfo,sizeof(SZ_S_SGBWLINEBASE));
		}
	}
	else
	{
		ar.Read((unsigned char *)&m_sMainInfo,sizeof(SZ_S_SGBWMAININFO));
		ar.Read((unsigned char *)&m_nLineCount,sizeof(m_nLineCount));
		for(i=0;i<m_nLineCount;i++)
		{
			ar.Read((unsigned char *)&LineInfo,sizeof(SZ_S_SGBWLINEBASE));
			m_sLineInfo[i]=LineInfo;
		}
	}
}
开发者ID:github188,项目名称:MonitorSystem,代码行数:26,代码来源:SZ_SgbwLink.cpp

示例6: SerializeEx

/////////////////////////////////////////////////////////////////////////////
// serialization
void CGXGridCellData::SerializeEx(CArchive& ar, CString& strProperty )
{
	ASSERT_VALID(this);
	DWORD dwDataLen;
	if (ar.IsStoring())		// Write
	{
		CMemFile  memFile;
		CArchive  arMem(&memFile, CArchive::store );
		Serialize ( arMem );
		arMem.Flush();

		dwDataLen = memFile.GetLength();
		if ( dwDataLen > 0 )
		{
			BYTE *pTemp = new BYTE [dwDataLen+1];
			memFile.Seek(0, CFile::begin);
			memFile.Read(pTemp, dwDataLen );
		
			ar.Write(&dwDataLen, sizeof(DWORD));
			ar.Write(pTemp, dwDataLen);

			// Property Save CString
			strProperty = BinaryToStringEx ( pTemp, dwDataLen );

			if ( pTemp )
				delete []pTemp;
		}
	}
	else					// Read
	{
		ar >> dwDataLen;
		if ( dwDataLen > 0 )
		{
			BYTE *pTemp = new BYTE[dwDataLen+1];
			ar.Read(pTemp, dwDataLen );
			
			CMemFile memFile;
			memFile.Attach ( (BYTE*)pTemp, dwDataLen );

			CArchive arMem(&memFile, CArchive::load );
			Serialize ( arMem );

			// Property Save CString
			DWORD dwTotLen = 	dwDataLen + sizeof(DWORD);
			BYTE *pvData = new BYTE[dwTotLen];
			*(DWORD*)pvData = dwTotLen;
			memcpy ( pvData + sizeof(DWORD), pTemp, dwDataLen );
			
			if ( pTemp )
				delete[] pTemp;

			strProperty = BinaryToStringEx ( pvData, dwTotLen );
			if ( pvData )
				delete[] pvData;
		}
	}
}
开发者ID:JaeJoonLee,项目名称:Common,代码行数:59,代码来源:GxGridCellData.cpp

示例7: Serialize

void CDownloadWithTiger::Serialize(CArchive& ar, int nVersion)
{
	CDownloadWithTorrent::Serialize( ar, nVersion );

	m_pTigerTree.Serialize( ar );

	if ( m_pTigerTree.IsAvailable() )
	{
		if ( ar.IsStoring() )
		{
			ar << m_nTigerBlock;
			ar << m_nTigerSize;
			ar << m_nTigerSuccess;
			ar.Write( m_pTigerBlock, sizeof(BYTE) * m_nTigerBlock );
		}
		else
		{
			m_pTigerTree.SetupParameters( m_nSize );

			ar >> m_nTigerBlock;
			ar >> m_nTigerSize;
			ar >> m_nTigerSuccess;

			m_pTigerBlock = new BYTE[ m_nTigerBlock ];
			ar.Read( m_pTigerBlock, sizeof(BYTE) * m_nTigerBlock );
		}
	}

	if ( nVersion >= 19 )
	{
		m_pHashset.Serialize( ar );

		if ( m_pHashset.IsAvailable() )
		{
			if ( ar.IsStoring() )
			{
				ar << m_nHashsetBlock;
				ar << m_nHashsetSuccess;
				ar.Write( m_pHashsetBlock, sizeof(BYTE) * m_nHashsetBlock );
			}
			else
			{
				ar >> m_nHashsetBlock;
				ar >> m_nHashsetSuccess;

				m_pHashsetBlock = new BYTE[ m_nHashsetBlock ];
				ar.Read( m_pHashsetBlock, sizeof(BYTE) * m_nHashsetBlock );
			}
		}
	}
开发者ID:ericfillipe1,项目名称:shareaza-code,代码行数:50,代码来源:DownloadWithTiger.cpp

示例8: Serialize_Ty

void CMNP_SHXG::Serialize_Ty(CArchive &ar)
{
	if(ar.IsStoring())  
	{
		ar.Write((unsigned char *)&Node,sizeof(Node));
		ar.Write((unsigned char *)&Line,sizeof(Line));
		ar.Write((unsigned char *)&Unit,sizeof(Unit));
	}
	else
	{
		ar.Read((unsigned char *)&Node,sizeof(Node));
		ar.Read((unsigned char *)&Line,sizeof(Line));
		ar.Read((unsigned char *)&Unit,sizeof(Unit));
	}
}
开发者ID:github188,项目名称:MonitorSystem,代码行数:15,代码来源:MNP_SHXG.cpp

示例9: Serialize

void CTestCBotDoc::Serialize(CArchive& ar)
{
    if (ar.IsStoring())
    {
        m_pEdit->GetWindowText(m_DocText);
        int     w = m_DocText.GetLength();
        ar.Write((LPCTSTR)m_DocText, w);
    }
    else
    {
        int     r;
        char    buf[10001];

        r = ar.Read(buf, 10000);
        buf[r] = 0;
        m_DocText = buf;

        if ( m_pProg == NULL ) m_pProg = new CBotProgram();

        if (!m_pProg->Compile(m_DocText, m_Liste, NULL))
        {
            delete m_pProg;
            m_pProg = NULL;
        }
    }
}
开发者ID:Zaba999,项目名称:colobot,代码行数:26,代码来源:TestCBotDoc.cpp

示例10: Serialize

void CMetaparm::Serialize(CArchive& ar)
{
	if (ar.IsStoring()) {
#ifdef METAFFREND	// MetaFFRend DLL never stores, so save space
		ASSERT(0);
#else
		ar << m_Name;
		METAPARM_BASE_INFO&	mpbi = *this;
		ar.Write(&mpbi, sizeof(mpbi));	// write base struct
		m_Slave.Serialize(ar);
		ar << m_Master;
#endif
	} else {
		ar >> m_Name;
		if (m_Version < 5) {
			METAPARM_BASE_INFO_V1&	mpbi = *this;
			ar.Read(&mpbi, sizeof(mpbi));	// read version 1 base struct
		} else {
			METAPARM_BASE_INFO&	mpbi = *this;
			ar.Read(&mpbi, sizeof(mpbi));	// read base struct
			m_Slave.Serialize(ar);
			ar >> m_Master;
		}
	}
}
开发者ID:victimofleisure,项目名称:FFRend,代码行数:25,代码来源:Metaparm.cpp

示例11: Serialize

void CWinProfDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		ar << m_ExeFileName << m_Frequency;
		symbol_manager.Serialize(ar);
		filter_manager.Serialize(ar);
		ar << m_ActiveFilter;
		ar << (unsigned int)call_info.size();
		for (list<CALL_INFO>::const_iterator iter = call_info.begin(); iter != call_info.end(); ++iter)
			ar.Write(&*iter, sizeof(CALL_INFO));
	}
	else
	{
		ar >> m_ExeFileName >> m_Frequency;
		symbol_manager.Serialize(ar);
		filter_manager.Serialize(ar);
		ar >> m_ActiveFilter;
		unsigned int size;
		CALL_INFO ci;
		ar >> size;
		call_info.clear();
		while (size--)
		{
			ar.Read(&ci, sizeof(CALL_INFO));
			call_info.push_back(ci);
		}
	}
}
开发者ID:BackupTheBerlios,项目名称:winprof-svn,代码行数:29,代码来源:WinProfDoc.cpp

示例12: Ty_Serialize

void CTyStationAssistPng::Ty_Serialize(CArchive &ar)
{
	try
	{
		if(ar.IsStoring())  
		{
			ar<<m_x0<<m_y0<<m_x1<<m_y1;
			ar.Write(m_szPngName,sizeof(m_szPngName));
			ar<<m_bHScale<<m_bVScale;
			ar<<m_fRotateAngle;
		}
		else
		{
			ar>>m_x0>>m_y0>>m_x1>>m_y1;
			ar.Read(m_szPngName,sizeof(m_szPngName));
			ar>>m_bHScale>>m_bVScale;
			ar>>m_fRotateAngle;

			g_ImagePngMapX.RegisterImagePng(m_szPngName);
		}
	}
	catch(...)
	{

	}
}
开发者ID:github188,项目名称:MonitorSystem,代码行数:26,代码来源:TyStationAssistPng.cpp

示例13: SerializeRaw

void CEditView::SerializeRaw( CArchive &ar )
/******************************************/
{
    if( ar.IsStoring() ) {
        int     nLength = ::GetWindowTextLength( m_hWnd );
        LPCTSTR lpszBuffer = LockBuffer();
        if( lpszBuffer != NULL ) {
            ar.Write( lpszBuffer, nLength );
        }
    } else {
        CFile *pFile = ar.GetFile();
        ASSERT( pFile != NULL );

        ULONGLONG   nLength = pFile->GetLength();
        LRESULT     lLimit = ::SendMessage( m_hWnd, EM_GETLIMITTEXT, 0, 0L );
        if( nLength > lLimit ) {
            throw new CArchiveException( CArchiveException::badIndex );
        } else if( nLength == 0LL ) {
            ::SetWindowText( m_hWnd, NULL );
        } else {
            LPTSTR lpszBuffer = new TCHAR[nLength + 1];
            ar.Read( lpszBuffer, (UINT)nLength * sizeof( TCHAR ) );
            lpszBuffer[nLength] = _T('\0');
            ::SetWindowText( m_hWnd, lpszBuffer );
        }
    }
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:27,代码来源:editview.cpp

示例14: sizeof

void		AsfParser::Serialize(CArchive& ar)
{
	if ( ar.IsStoring() )
	{
		ar << numOfIndex;

		//ar << streamCount;
		ar << audioNumber;
		ar << videoNumber;

		ar << Bitrate;
		ar << PacketSize;

		ar << duration;

		

		ar << Title;
		ar << Copyright;
		ar << Author;

		ar << sdp;

		ar.Write(index,(numOfIndex + 1)*sizeof(INDEX));

	}
	else
	{
		ar >> numOfIndex;

		//ar >> streamCount;
		ar >> audioNumber;
		ar >> videoNumber;

		ar >> Bitrate;
		ar >> PacketSize;

		ar >> duration;

		

		ar >> Title;
		ar >> Copyright;
		ar >> Author;

		ar >> sdp;

		
		index = new INDEX[numOfIndex + 1];

		ar.Read(index,(numOfIndex + 1)*sizeof(INDEX));

		pTimeSlotLenTable	= new DWORD[numOfIndex];

		for(DWORD i = 0; i < numOfIndex; i++)
			pTimeSlotLenTable[i] = (index[i+1]-index[i])*(PacketSize + sizeof(DATAPACKET_HEADER) + RtpPacket::RTP_HEAD_LEN + 4 );

	}
}
开发者ID:tempbottle,项目名称:TestSet,代码行数:59,代码来源:AsfParser.cpp

示例15: Serialize

void CLibraryHistory::Serialize(CArchive& ar, int nVersion)
{
	if ( nVersion < 7 ) return;

	int nCount = 0;
	POSITION pos;

	if ( ar.IsStoring() )
	{
		for ( pos = GetIterator() ; pos ; )
		{
			if ( GetNext( pos )->m_pFile != NULL ) nCount ++;
		}

		ar.WriteCount( nCount );

		for ( pos = GetIterator() ; pos ; )
		{
			CLibraryRecent* pRecent = GetNext( pos );
			if ( pRecent->m_pFile != NULL ) pRecent->Serialize( ar, nVersion );
		}

		ar << LastSeededTorrent.m_sPath;
		if ( LastSeededTorrent.m_sPath.GetLength() )
		{
			ar << LastSeededTorrent.m_sName;
			ar << LastSeededTorrent.m_tLastSeeded;
			ar.Write( &LastSeededTorrent.m_pBTH, sizeof(SHA1) );
		}
	}
	else
	{
		Clear();

		for ( nCount = ar.ReadCount() ; nCount > 0 ; nCount-- )
		{
			CLibraryRecent* pRecent = new CLibraryRecent();
			pRecent->Serialize( ar, nVersion );

			if ( pRecent->m_pFile != NULL )
			{
				m_pList.AddTail( pRecent );
			}
			else
			{
				delete pRecent;
			}
		}

		if ( nVersion > 22 )
		{
			ar >> LastSeededTorrent.m_sPath;
			if ( LastSeededTorrent.m_sPath.GetLength() )
			{
				ar >> LastSeededTorrent.m_sName;
				ar >> LastSeededTorrent.m_tLastSeeded;
				ar.Read( &LastSeededTorrent.m_pBTH, sizeof(SHA1) );
			}
		}
开发者ID:ericfillipe1,项目名称:shareaza-code,代码行数:59,代码来源:LibraryHistory.cpp


注:本文中的CArchive::Write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。