SNAP Library 2.0, Developer Reference
2013-05-13 16:33:57
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
Go to the source code of this file.
Functions | |
template<class TRec > | |
bool | IsXLoadFromFileOk (const TStr &FNm, const TStr &Nm, TRec &Rec, TStr &MsgStr) |
template<class TRec > | |
void | XLoadFromFile (const TStr &FNm, const TStr &Nm, TRec &Rec) |
bool IsXLoadFromFileOk | ( | const TStr & | FNm, |
const TStr & | Nm, | ||
TRec & | Rec, | ||
TStr & | MsgStr | ||
) |
Definition at line 45 of file xmlser.h.
References TXmlDoc::LoadTxt(), and TPt< TRec >::LoadXml().
Referenced by XLoadFromFile().
{ bool Ok=true; try { PXmlDoc XmlDoc=TXmlDoc::LoadTxt(FNm); if (XmlDoc->IsOk()){ PXmlTok XmlTok=XmlDoc->GetTok(); Rec.LoadXml(XmlTok, Nm); } else { Ok=false; MsgStr=XmlDoc->GetMsgStr(); } } catch (PExcept Except){ Ok=false; MsgStr=Except->GetMsgStr(); } return Ok; }
void XLoadFromFile | ( | const TStr & | FNm, |
const TStr & | Nm, | ||
TRec & | Rec | ||
) |
Definition at line 63 of file xmlser.h.
References IsXLoadFromFileOk(), and TExcept::Throw().
{ TStr MsgStr; if (!IsXLoadFromFileOk(FNm, Nm, Rec, MsgStr)){ TExcept::Throw(MsgStr); } }