本文整理汇总了C++中CArchive::IsLoading方法的典型用法代码示例。如果您正苦于以下问题:C++ CArchive::IsLoading方法的具体用法?C++ CArchive::IsLoading怎么用?C++ CArchive::IsLoading使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArchive
的用法示例。
在下文中一共展示了CArchive::IsLoading方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Serialize
//************************************************************************************
void CBCGPCalendarMenuButton::Serialize (CArchive& ar)
{
CBCGPToolbarMenuButton::Serialize (ar);
if (ar.IsLoading ())
{
ar >> m_nColumns;
ar >> m_nVertDockColumns;
ar >> m_nHorzDockRows;
ar >> m_bStdCalendarDlg;
CObList listButtons;
if (CBCGPToolBar::GetCommandButtons (m_nID, listButtons) > 0)
{
for (POSITION pos = listButtons.GetHeadPosition (); pos != NULL;)
{
CBCGPCalendarMenuButton* pOther =
DYNAMIC_DOWNCAST (CBCGPCalendarMenuButton, listButtons.GetNext (pos));
if (pOther != NULL && pOther != this)
{
m_Calendar = pOther->m_Calendar;
}
}
}
}
示例2: 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
}
示例3: Serialize
void CDevObjDoc::Serialize(CArchive& ar)
{
ASSERT(ar.IsLoading());
m_objects.Serialize(ar); //对象序列化
COleDocument::Serialize(ar);
}
示例4: Serialize
///////////////////////////////////////////////////////////////////////
// Speichern / Laden
///////////////////////////////////////////////////////////////////////
void CTorpedoWeapons::Serialize(CArchive &ar)
{
CObject::Serialize(ar);
m_Firearc.Serialize(ar);
// wenn gespeichert wird
if (ar.IsStoring())
{
ar << m_iTorpedoType;
ar << m_iNumber;
ar << m_iTupeFirerate;
ar << m_iNumberOfTupes;
ar << m_byAccuracy;
ar << m_strTupeName;
ar << m_bOnlyMicroPhoton;
}
// wenn geladen wird
if (ar.IsLoading())
{
ar >> m_iTorpedoType;
ar >> m_iNumber;
ar >> m_iTupeFirerate;
ar >> m_iNumberOfTupes;
ar >> m_byAccuracy;
ar >> m_strTupeName;
ar >> m_bOnlyMicroPhoton;
}
示例5: Serialize
///////////////////////////////////////////////////////////////////////
// Speichern / Laden
///////////////////////////////////////////////////////////////////////
void CHull::Serialize(CArchive &ar)
{
CObject::Serialize(ar);
// wenn gespeichert wird
if (ar.IsStoring())
{
MYTRACE("shipdetails")(MT::LEVEL_DEBUG, "HULL.CPP: BaseHull:%d, CurrentHull:%d, HullMaterial:%d, MaxHull:%d, DblHull:%s, Ablative:%s, Pola:%s\n",
m_iBaseHull, m_iCurrentHull, m_iHullMaterial, m_iMaxHull,
m_bDoubleHull ? "true" : "false",
m_bAblative ? "true" : "false",
m_bPolarisation ? "true" : "false");
//HULL.CPP: BaseHull:600, CurrentHull:600, HullMaterial:0, MaxHull:600
ar << m_bDoubleHull;
ar << m_bAblative;
ar << m_bPolarisation;
ar << m_iBaseHull;
ar << m_iCurrentHull;
ar << m_iHullMaterial;
ar << m_iMaxHull;
}
// wenn geladen wird
if (ar.IsLoading())
{
ar >> m_bDoubleHull;
ar >> m_bAblative;
ar >> m_bPolarisation;
ar >> m_iBaseHull;
ar >> m_iCurrentHull;
ar >> m_iHullMaterial;
ar >> m_iMaxHull;
}
示例6: Serialize
///////////////////////////////////////////////////////////////////////
// Speichern / Laden
///////////////////////////////////////////////////////////////////////
void CBeamWeapons::Serialize(CArchive &ar)
{
CObject::Serialize(ar);
m_Firearc.Serialize(ar);
// wenn gespeichert wird
if (ar.IsStoring())
{
ar << m_strBeamName;
ar << m_iBeamPower;
ar << m_iBeamType;
ar << m_iBeamNumber;
ar << m_byShootNumber;
ar << m_byBonus;
ar << m_byBeamLenght;
ar << m_byRechargeTime;
ar << m_bPiercing;
ar << m_bModulating;
}
// wenn geladen wird
if (ar.IsLoading())
{
ar >> m_strBeamName;
ar >> m_iBeamPower;
ar >> m_iBeamType;
ar >> m_iBeamNumber;
ar >> m_byShootNumber;
ar >> m_byBonus;
ar >> m_byBeamLenght;
ar >> m_byRechargeTime;
ar >> m_bPiercing;
ar >> m_bModulating;
}
示例7: Serialize
void CBrowseHostWnd::Serialize(CArchive& ar, int nVersion /* BROWSER_SER_VERSION */)
{
if ( ar.IsStoring() )
{
ar << nVersion;
ar << m_bOnFiles;
}
else
{
ar >> nVersion;
if ( nVersion < 1 || nVersion > BROWSER_SER_VERSION ) AfxThrowUserException();
ar >> m_bOnFiles;
}
CBaseMatchWnd::Serialize( ar );
m_pBrowser->Serialize( ar, nVersion );
m_wndProfile.Serialize( ar, nVersion );
m_wndFrame.Serialize( ar, nVersion );
if ( ar.IsLoading() )
{
m_wndProfile.Update( m_pBrowser );
PostMessage( WM_TIMER, 1 );
SendMessage( WM_TIMER, 2 );
SetAlert( FALSE );
}
}
示例8: Serialize
void CSchemaObject::Serialize(CArchive& ar)
{
CObject::Serialize(ar);
if (ar.IsLoading())
{
int nVersion = ar.GetObjectSchema();
switch(nVersion)
{
case 0:
// read in previous version of
// this object
break;
case 1:
// read in current version of
// this object
break;
default:
// report unknown version of
// this object
break;
}
}
else
{
// Normal storing code goes here
}
}
示例9: Serialize
void CServerData::Serialize( CArchive& ar )
{
const int iObjectVersion = 7;
if ( ar.IsLoading( ) )
{
int iVersion;
ar >> iVersion;
if ( ( iVersion < 1 ) || ( iVersion > iObjectVersion ) )
::AfxThrowArchiveException( CArchiveException::generic );
ar >> m_bIsTemporary;
ar >> m_sServerName;
ar >> m_sServerIP;
ar >> m_iServerPort;
ar >> m_sUserLogin;
ar >> m_sUserPassword;
ar >> m_pUserStatusData;
ar >> m_bOwnData;
if ( iVersion > 1 )
{
ar >> m_bAutoConnect;
if ( iVersion > 2 )
{
ar >> m_sServerIcon;
if ( iVersion > 3 )
{
ar >> m_pServerOptions;
}
示例10: Serialize
//////////////////////////////////////////////////////////////////////
// Serialisierungsfunktion
//////////////////////////////////////////////////////////////////////
void CWorker::Serialize(CArchive &ar)
{
// wenn gespeichert wird
if (ar.IsStoring())
{
ar << m_Workers.size();
for(const_iterator it = m_Workers.begin(); it != m_Workers.end(); ++it)
{
ar << static_cast<int>(it->first);
ar << it->second;
}
ar << m_AllWorkers;
ar << m_FreeWorkers;
}
// wenn geladen wird
if (ar.IsLoading())
{
m_Workers.clear();
unsigned size;
ar >> size;
for(unsigned i = 0; i < size; ++i)
{
int key;
ar >> key;
int value;
ar >> value;
AssertBotE(WORKER::FOOD_WORKER <= key && key <= WORKER::IRIDIUM_WORKER);
m_Workers.insert(std::pair<WORKER::Typ, int>(static_cast<WORKER::Typ>(key), value));
}
ar >> m_AllWorkers;
ar >> m_FreeWorkers;
}
示例11: Serialize
///////////////////////////////////////////////////////////////////////
// Speichern / Laden
///////////////////////////////////////////////////////////////////////
void CIntelReports::Serialize(CArchive &ar)
{
CObject::Serialize(ar);
if (ar.IsStoring())
{
BYTE type = MAXBYTE;
if (m_pAttemptObject)
type = m_pAttemptObject->GetType();
ar << type;
if (m_pAttemptObject)
m_pAttemptObject->Serialize(ar);
}
else if (ar.IsLoading())
{
m_nActiveReport = -1;
RemoveAllReports();
BYTE type;
ar >> type;
if (type != MAXBYTE)
{
switch (type)
{
case 0: m_pAttemptObject = new CEcoIntelObj(); break;
case 1: m_pAttemptObject = new CScienceIntelObj(); break;
case 2: m_pAttemptObject = new CMilitaryIntelObj(); break;
case 3: m_pAttemptObject = new CDiplomacyIntelObj(); break;
}
m_pAttemptObject->Serialize(ar);
}
else
m_pAttemptObject = 0;
}
示例12: Serialize
///////////////////////////////////////////////////////////////////////
// Speichern / Laden
///////////////////////////////////////////////////////////////////////
void CAssemblyList::Serialize(CArchive &ar)
{
CObject::Serialize(ar);
// wenn gespeichert wird
if (ar.IsStoring())
{
for (int i = 0; i < ALE; i++)
{
ar << m_iEntry[i];
// Variablen geben die noch verbleibenden Kosten der Elemente in der Bauliste an
ar << m_iNeededIndustryInAssemblyList[i];
ar << m_iNeededTitanInAssemblyList[i];
ar << m_iNeededDeuteriumInAssemblyList[i];
ar << m_iNeededDuraniumInAssemblyList[i];
ar << m_iNeededCrystalInAssemblyList[i];
ar << m_iNeededIridiumInAssemblyList[i];
ar << m_iNeededDeritiumInAssemblyList[i];
}
// Variablen, die Angeben, wieviel Industrie und Rohstoffe zum Bau benötigt werden
ar << m_iNeededIndustryForBuild;
ar << m_iNeededTitanForBuild;
ar << m_iNeededDeuteriumForBuild;
ar << m_iNeededDuraniumForBuild;
ar << m_iNeededCrystalForBuild;
ar << m_iNeededIridiumForBuild;
ar << m_iNeededDeritiumForBuild;
// Wurde das Gebäude gekauft in dieser Runde gekauft
ar << m_bWasBuildingBought;
// Die Baukosten eines Auftrages
ar << m_iBuildCosts;
}
// wenn geladen wird
if (ar.IsLoading())
{
for (int i = 0; i < ALE; i++)
{
ar >> m_iEntry[i];
// Variablen geben die noch verbleibenden Kosten der Elemente in der Bauliste an
ar >> m_iNeededIndustryInAssemblyList[i];
ar >> m_iNeededTitanInAssemblyList[i];
ar >> m_iNeededDeuteriumInAssemblyList[i];
ar >> m_iNeededDuraniumInAssemblyList[i];
ar >> m_iNeededCrystalInAssemblyList[i];
ar >> m_iNeededIridiumInAssemblyList[i];
ar >> m_iNeededDeritiumInAssemblyList[i];
}
// Variablen, die Angeben, wieviel Industrie und Rohstoffe zum Bau benötigt werden
ar >> m_iNeededIndustryForBuild;
ar >> m_iNeededTitanForBuild;
ar >> m_iNeededDeuteriumForBuild;
ar >> m_iNeededDuraniumForBuild;
ar >> m_iNeededCrystalForBuild;
ar >> m_iNeededIridiumForBuild;
ar >> m_iNeededDeritiumForBuild;
// Wurde das Gebäude gekauft in dieser Runde gekauft
ar >> m_bWasBuildingBought;
// Die Baukosten eines Auftrages
ar >> m_iBuildCosts;
}
}
示例13: Serialize
void CUserOptions::Serialize( CArchive & ar )
{
if( ar.IsLoading() )
{
ar >> m_bHasTitle >> m_nPoem >> m_nStanzas >> m_nVerses >> m_cbStanza;
ar >> m_nCompiler >> m_strRootWords >> m_strSyntaxPath >> m_strSavePath;
}
示例14: Serialize
//************************************************************************************
void CBCGColorMenuButton::Serialize (CArchive& ar)
{
CBCGToolbarMenuButton::Serialize (ar);
if (ar.IsLoading ())
{
int nColorsCount;
ar >> nColorsCount;
m_Colors.SetSize (nColorsCount);
for (int i = 0; i < nColorsCount; i++)
{
COLORREF color;
ar >> color;
m_Colors [i] = color;
}
ar >> m_nColumns;
if (g_pWorkspace != NULL && g_pWorkspace->GetDataVersion () >= 0x40710)
{
ar >> m_nVertDockColumns;
ar >> m_nHorzDockRows;
}
示例15: Serialize
//*****************************************************************************************
void CBCGPDropDownToolbarButton::Serialize (CArchive& ar)
{
CBCGPToolbarButton::Serialize (ar);
UINT uiToolbarResID = 0;
if (ar.IsLoading ())
{
m_pToolBar = NULL;
ar >> uiToolbarResID;
ar >> m_strName;
ar >> m_iSelectedImage;
// Find toolbar with required resource ID:
for (POSITION pos = gAllToolbars.GetHeadPosition (); pos != NULL;)
{
CBCGPDropDownToolBar* pToolBar = DYNAMIC_DOWNCAST (CBCGPDropDownToolBar,
gAllToolbars.GetNext (pos));
if (pToolBar != NULL &&
CWnd::FromHandlePermanent (pToolBar->m_hWnd) != NULL)
{
ASSERT_VALID (pToolBar);
if (pToolBar->m_uiOriginalResID == uiToolbarResID)
{
m_pToolBar = pToolBar;
break;
}
}
}
SetDefaultCommand (m_nID);
}