本文整理汇总了C++中CIFile::serialCont方法的典型用法代码示例。如果您正苦于以下问题:C++ CIFile::serialCont方法的具体用法?C++ CIFile::serialCont怎么用?C++ CIFile::serialCont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIFile
的用法示例。
在下文中一共展示了CIFile::serialCont方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toString
//-----------------------------------------------------------------------------
CGmTpPendingCommand::CGmTpPendingCommand()
{
CIFile f;
string fileName = Bsi.getLocalPath() + toString("gm_pending_tp.bin");
bool open = f.open(fileName);
if( open )
{
f.serialCont( _CharacterTpPending );
}
f.close();
}
示例2:
/*
* load()
*/
bool CPrimChecker::load(const string &outputDirectory)
{
string outputfname = CPath::standardizePath(outputDirectory)+"pacs.packed_prims";
CIFile f;
if (f.open(outputfname))
{
f.serial(_Grid);
f.serialCont(_WaterHeight);
}
else
{
nlwarning("Couldn't load pacs.packed_prims file '%s'", outputfname.c_str());
return false;
}
return true;
}
示例3:
void NLPACS::CZoneTessellation::loadTessellation(CIFile &input)
{
input.serialCont(_Vertices);
uint i;
uint32 numTessel;
input.serial(numTessel);
_Tessellation.resize(numTessel);
for (i=0; i<_Tessellation.size(); ++i)
{
_Tessellation[i].serial(input, _Tessellation);
}
Elements.resize(_Tessellation.size());
for (i=0; i<_Tessellation.size(); ++i)
{
Elements[i] = &_Tessellation[i];
}
}
示例4: loadSheetId
void CSheetId::loadSheetId ()
{
H_AUTO(CSheetIdInit);
//nldebug("Loading sheet_id.bin");
// Open the sheet id to sheet file name association
CIFile file;
std::string path = CPath::lookup("sheet_id.bin", false, false);
if(!path.empty() && file.open(path))
{
// clear entries
_FileExtensions.clear ();
_SheetIdToName.clear ();
_SheetNameToId.clear ();
// reserve space for the vector of file extensions
_FileExtensions.resize(1 << (NL_SHEET_ID_TYPE_BITS));
// Get the map from the file
map<uint32,string> tempMap;
contReset(tempMap);
file.serialCont(tempMap);
file.close();
if (_RemoveUnknownSheet)
{
uint32 removednbfiles = 0;
uint32 nbfiles = (uint32)tempMap.size();
// now we remove all files that not available
map<uint32,string>::iterator itStr2;
for( itStr2 = tempMap.begin(); itStr2 != tempMap.end(); )
{
if (CPath::exists ((*itStr2).second))
{
++itStr2;
}
else
{
map<uint32,string>::iterator olditStr = itStr2;
//nldebug ("Removing file '%s' from CSheetId because the file not exists", (*olditStr).second.c_str ());
itStr2++;
tempMap.erase (olditStr);
removednbfiles++;
}
}
nlinfo ("SHEETID: Removed %d files on %d from CSheetId because these files doesn't exists", removednbfiles, nbfiles);
}
// Convert the map to one big string and 1 static map (id to name)
{
// Get the number and size of all strings
vector<CChar> tempVec; // Used to initialise the first map
uint32 nNb = 0;
uint32 nSize = 0;
map<uint32,string>::const_iterator it = tempMap.begin();
while (it != tempMap.end())
{
nSize += (uint32)it->second.size()+1;
nNb++;
it++;
}
// Make the big string (composed of all strings) and a vector referencing each string
tempVec.resize(nNb);
_AllStrings.Ptr = new char[nSize];
it = tempMap.begin();
nSize = 0;
nNb = 0;
while (it != tempMap.end())
{
tempVec[nNb].Ptr = _AllStrings.Ptr+nSize;
strcpy(_AllStrings.Ptr+nSize, it->second.c_str());
toLower(_AllStrings.Ptr+nSize);
nSize += (uint32)it->second.size()+1;
nNb++;
it++;
}
// Finally build the static map (id to name)
_SheetIdToName.reserve(tempVec.size());
it = tempMap.begin();
nNb = 0;
while (it != tempMap.end())
{
_SheetIdToName.add(pair<uint32, CChar>(it->first, CChar(tempVec[nNb])));
nNb++;
it++;
}
// The vector of all small string is not needed anymore we have all the info in
// the static map and with the pointer AllStrings referencing the beginning.
}
// Build the invert map (Name to Id) & file extension vector
{
uint32 nSize = (uint32)_SheetIdToName.size();
_SheetNameToId.reserve(nSize);
CStaticMap<uint32,CChar>::iterator itStr;
//.........这里部分代码省略.........