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


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

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: Serialize

void CDrawWarn::Serialize(CArchive& ar)
{
	ASSERT_VALID(this);

	CDrawObj::Serialize(ar);
	if (ar.IsStoring())
	{
	}
	else
	{
		WORD wTemp;
		ar.Read(&m_ctlBackColor,sizeof(COLORREF));
		ar.Read(&m_ctlLineColor,sizeof(COLORREF));
		ar.Read(&m_ctlTextColor,sizeof(COLORREF));
		ar.Read(&m_ctlTitleColor,sizeof(COLORREF));
		ar >> m_nColCount;
		ar >> m_nRowCount;
		ar >> m_nCellWidth;
		ar >> m_nCellHeight;
		ar >> wTemp;		m_bIsAutoSize = (BOOL)wTemp;
		m_nPercent = new UINT[m_nRowCount];
		for(int i=0;i<m_nRowCount;i++)
			ar >> m_nPercent[i];

		m_fontStyle			= FontStyleRegular;
		m_fontSize			= 9;
		m_fontName			= "Arial";
		m_trimmingSyle		= StringTrimmingNone;
	}
}
开发者ID:xiaoyugm,项目名称:chtproject,代码行数:30,代码来源:DrawWarn.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: 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

示例10: Serialize

void CMyFirstDocWindowDoc::Serialize(CArchive& ar)
{
	// CEditView contains an edit control which handles all serialization
	if (!m_viewList.IsEmpty())
	{
		reinterpret_cast<CEditView*>(m_viewList.GetHead())->SerializeRaw(ar);
	}
#ifdef SHARED_HANDLERS

	if (m_viewList.IsEmpty() && ar.IsLoading())
	{
		CFile* pFile = ar.GetFile();
		pFile->Seek(0, FILE_BEGIN);
		ULONGLONG nFileSizeBytes = pFile->GetLength();
		ULONGLONG nFileSizeChars = nFileSizeBytes/sizeof(TCHAR);
		LPTSTR lpszText = (LPTSTR)malloc(((size_t)nFileSizeChars + 1) * sizeof(TCHAR));
		if (lpszText != NULL)
		{
			ar.Read(lpszText, (UINT)nFileSizeBytes);
			lpszText[nFileSizeChars] = '\0';
			m_strThumbnailContent = lpszText;
			m_strSearchContent = lpszText;
		}
	}
#endif
}
开发者ID:seanedwards,项目名称:COS-420,代码行数:26,代码来源:MyFirstDocWindowDoc.cpp

示例11: 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

示例12: Serialize

void CMarkdownEditorDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		ar.WriteString(Util::ANSIToUTF8(_strText.c_str()).c_str());
		// TODO: 在此添加存储代码
	}
	else
	{
		CString str;
		const int BUF_SIZE = 64*1024;
		unsigned char buf[BUF_SIZE + 1];
		while(true){
			UINT uRead = ar.Read(buf, BUF_SIZE);
			buf[uRead] = '\0';
			str += (const char*)buf;
			if(uRead < BUF_SIZE)
				break;
		}

		_strText = Util::UTF8ToANSI(str);
		this->UpdateAllViews(NULL);
		// TODO: 在此添加加载代码
	}
}
开发者ID:cloudAi,项目名称:MarkdownEditor,代码行数:25,代码来源:MarkdownEditorDoc.cpp

示例13: 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

示例14: 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

示例15: 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


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