本文整理汇总了C++中TSIn::Eof方法的典型用法代码示例。如果您正苦于以下问题:C++ TSIn::Eof方法的具体用法?C++ TSIn::Eof怎么用?C++ TSIn::Eof使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSIn
的用法示例。
在下文中一共展示了TSIn::Eof方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadCascadesTxt
void TNetInfBs::LoadCascadesTxt(TSIn& SIn, const int& Model, const double& alpha) {
TStr Line;
SIn.GetNextLn(Line);
while (!SIn.Eof() && Line != "") {
TStrV NIdV; Line.SplitOnAllCh(',', NIdV);
AddNodeNm(NIdV[0].GetInt(), TNodeInfo(NIdV[1], 0)); SIn.GetNextLn(Line); }
printf("All nodes read!\n");
while (!SIn.Eof()) { SIn.GetNextLn(Line); AddCasc(Line, Model, alpha); }
printf("All cascades read!\n");
}
示例2: loadCascadesFromFile
void TGreedyAlg::loadCascadesFromFile(TSIn& SIn) {
TStr line;
SIn.GetNextLn(line);
while (!SIn.Eof() && line != "") {
TStrV NIdV;
line.SplitOnAllCh(',', NIdV);
addNodeNm(NIdV[0].GetInt(), TNodeInfo(NIdV[1], 0)); SIn.GetNextLn(line);
}
printf("All nodes read!\n");
while (!SIn.Eof()) {
SIn.GetNextLn(line); addCascade(line);
}
printf("All cascades read!\n");
}
示例3: Save
void TSOut::Save(TSIn& SIn, const int& BfL){
if (BfL==-1){
while (!SIn.Eof()){Save(SIn.GetCh());}
} else {
for (int BfC=0; BfC<BfL; BfC++){Save(SIn.GetCh());}
}
}
示例4: Save
void TSOut::Save(TSIn& SIn, const TSize& BfL){
Fail;
if (BfL==0){ //J: used to be ==-1
while (!SIn.Eof()){Save(SIn.GetCh());}
} else {
for (TSize BfC=0; BfC<BfL; BfC++){Save(SIn.GetCh());}
}
}
示例5: LoadGroundTruthTxt
void TNetInfBs::LoadGroundTruthTxt(TSIn& SIn) {
GroundTruth = TNGraph::New(); TStr Line;
// add nodes
SIn.GetNextLn(Line);
while (!SIn.Eof() && Line != "") {
TStrV NIdV; Line.SplitOnAllCh(',', NIdV);
GroundTruth->AddNode(NIdV[0].GetInt()); SIn.GetNextLn(Line); }
// add edges
while (!SIn.Eof()) {
SIn.GetNextLn(Line);
TStrV NIdV; Line.SplitOnAllCh(',', NIdV);
GroundTruth->AddEdge(NIdV[0].GetInt(), NIdV[1].GetInt());
Alphas.AddDat(TIntPr(NIdV[0].GetInt(), NIdV[1].GetInt())) = NIdV[2].GetFlt();
}
printf("groundtruth nodes:%d edges:%d\n", GroundTruth->GetNodes(), GroundTruth->GetEdges());
}
示例6: Load
void TWebPgFetchPersist::Load(TSIn& SIn)
{
// load PUrls and call FetchUrl on each of them
int Count = 0;
while (!SIn.Eof()) {
try {
PUrl Url = TUrl::Load(SIn);
FetchUrl(Url);
Count++;
}
catch (PExcept ex) {
Notify->OnStatusFmt("TWebPgFetchPersist.Load. Exception while loading url: %s", ex->GetMsgStr().CStr());
}
catch (...) {
Notify->OnStatus("TWebPgFetchPersist.Load. Unrecognized exception while loading a url.");
}
}
}