本文整理汇总了C++中nlmisc::IStream类的典型用法代码示例。如果您正苦于以下问题:C++ IStream类的具体用法?C++ IStream怎么用?C++ IStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serial
void CScriptData::serial(NLMISC::IStream &f)
{
uint16 size;
if (f.isReading())
{
Scripts.clear();
f.serial(size);
uint32 i = 0;
for (; i < size; ++i)
{
//std::string tmpKey;
CCustomElementId tmpKey;
std::vector<std::string> tmpVal;
f.serial(tmpKey);
f.serialCont(tmpVal);
Scripts.insert(make_pair(tmpKey,tmpVal));
}
}
else
{
size = (uint16)Scripts.size();
f.serial(size);
for (TScripts::iterator it = Scripts.begin(); it != Scripts.end(); ++it)
{
//std::string tmp = it->first;
nlWrite(f, serial, it->first);
nlWrite(f, serialCont, it->second);
}
}
}
示例2: dataBaseToStream
// ***************************************************************************
void CInterfaceConfig::dataBaseToStream (NLMISC::IStream &f)
{
if (f.isReading())
{
nlwarning("stream is not in writing mode");
return;
}
CInterfaceManager *pIM = CInterfaceManager::getInstance();
// Save branch of the database
SDBLeaf leafTmp;
CCDBNodeBranch *pDB = pIM->getDbBranch ("UI:SAVE");
if (pDB != NULL)
{
// Number of leaf to save
uint32 nbLeaves = pDB->countLeaves();
f.serial(nbLeaves);
for (uint32 i = 0; i < nbLeaves; ++i)
{
uint count = i;
CCDBNodeLeaf *pNL = pDB->findLeafAtCount(count);
leafTmp.setFrom(pNL);
f.serial(leafTmp);
}
}
}
示例3: serial
void CStreamSound::serial(NLMISC::IStream &s)
{
CSound::serial(s);
s.serial(_MinDist);
s.serial(m_Alpha);
}
示例4: throw
// ***************************************************************************
void CSkeletonShape::CLod::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
(void)f.serialVersion(0);
f.serial(Distance);
f.serialCont(ActiveBones);
}
示例5:
void CSimpleSound::serial(NLMISC::IStream &s)
{
std::string bufferName;
CSound::serial(s);
s.serial(_MinDist);
s.serial(_Alpha);
if (s.isReading())
{
s.serial(bufferName);
_Buffername = CStringMapper::map(bufferName);
setBuffer(NULL);
// contain % so it need a context to play
if (bufferName.find ("%") != string::npos)
{
_NeedContext = true;
}
}
else
{
bufferName = CStringMapper::unmap(_Buffername);
s.serial(bufferName);
}
}
示例6:
// ---------------------------------------------------------------------------
void CZoneRegion::SZoneUnit2::serial (NLMISC::IStream &f)
{
/*sint32 version =*/ f.serialVersion (0);
SZoneUnit::serial (f);
f.xmlSerial (DateLow, "LOW");
f.xmlSerial (DateHigh, "HIGH");
}
示例7:
// ***************************************************************************
void CSkills::serial(NLMISC::IStream &f)
{
if (ShowDebugInChat) nlinfo("Skill are about to...");
uint ver= f.serialVersion(0);
f.serialCont(_I16Skills);
f.serialCont(_I16Tallies);
if (ShowDebugInChat) nlinfo("Skills are in!");
}
示例8:
// ***************************************************************************
void CTrackSampledCommon::CTimeBlock::serial(NLMISC::IStream &f)
{
(void)f.serialVersion(0);
f.serial(TimeOffset);
f.serial(KeyOffset);
f.serial(Times);
}
示例9:
void CPrimitivePlugin::TCreatureInfo::serial (NLMISC::IStream &s)
{
s.serial(HaveRadius);
s.serial(Radius);
s.serial(HaveBox);
s.serial(Width);
s.serial(Length);
}
示例10: serial
void CBackgroundSound::serial(NLMISC::IStream &s)
{
CSound::serial(s);
s.serialCont(_Sounds);
if (s.isReading())
_DurationValid = false;
}
示例11: serial
void CModifierInDB::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
f.serial(Disabled);
if(Disabled)
{
f.serial(ActivationDate);
f.serial(SheetId);
}
}
示例12: serial
// ***************************************************************************
void CShapeStream::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
// First, serial an header or checking if it is correct
f.serialCheck (NELID("PAHS"));
// Then, serial the shape
f.serialPolyPtr (_Shape);
// Ok, it's done
}
示例13: serial
///=======================================================================================
void CPSFloatCurveFunctor::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
f.serialVersion(1);
f.serial(_NumSamples, _Smoothing);
f.serialCont(_CtrlPoints);
if (f.isReading())
{
updateTab();
}
}
示例14:
// ***************************************************************************
void CAABBox::serial(NLMISC::IStream &f)
{
/* ***********************************************
* WARNING: This Class/Method must be thread-safe (ctor/dtor/serial): no static access for instance
* It can be loaded/called through CAsyncFileManager for instance
* ***********************************************/
(void)f.serialVersion(0);
f.serial(Center);
f.serial(HalfSize);
}
示例15: serial
//***********************************************************************************************
void CParticleWorkspace::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
f.xmlPush("PARTICLE_WORKSPACE");
f.serialVersion(0);
f.xmlSerial(_Name, "NAME");
f.xmlPush("PS_LIST");
uint32 numNodes = (uint32)_Nodes.size();
// TODO : avoid to store the number of nodes
f.xmlSerial(numNodes, "NUM_NODES");
if (f.isReading())
{
for(uint k = 0; k < numNodes; ++k)
{
_Nodes.push_back(new CNode());
_Nodes.back()->init(this);
f.serial(*_Nodes.back());
}
}
else
{
for(uint k = 0; k < numNodes; ++k)
{
f.serial(*_Nodes[k]);
}
}
f.xmlPop();
f.xmlPop();
}