SNAP Library , Developer Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <exp.h>
Public Member Functions | |
TExpHelp () | |
~TExpHelp () | |
TExpHelp (TSIn &SIn) | |
void | Save (TSOut &SOut) const |
TExpHelp & | operator= (const TExpHelp &) |
bool | operator== (const TExpHelp &) const |
void | AddObj (const PExpHelpObj &Obj) |
void | GetCatNmV (TStrV &CatNmV) const |
void | GetObjHdNmV (const TStr &CatNm, TStrV &ObjHdNmV) const |
PExpHelpObj | GetObj (const TStr &ObjNm) const |
Static Public Member Functions | |
static PExpHelp | New () |
static PExpHelp | Load (TSIn &SIn) |
static PExpHelp | LoadXml (const PSIn &SIn) |
static PExpHelp | LoadXml (const TStr &FNm) |
Private Attributes | |
TCRef | CRef |
TExpHelpObjV | ObjV |
Friends | |
class | TPt< TExpHelp > |
TExpHelp::TExpHelp | ( | ) | [inline] |
TExpHelp::~TExpHelp | ( | ) | [inline] |
TExpHelp::TExpHelp | ( | TSIn & | SIn | ) | [inline] |
void TExpHelp::AddObj | ( | const PExpHelpObj & | Obj | ) | [inline] |
void TExpHelp::GetCatNmV | ( | TStrV & | CatNmV | ) | const |
Definition at line 1126 of file exp.cpp.
References TVec< TVal >::AddUnique(), TVec< TVal >::Clr(), TVec< TVal >::Ins(), TVec< TVal >::Len(), and ObjV.
{ CatNmV.Clr(); for (int ObjN=0; ObjN<ObjV.Len(); ObjN++){ TStr CatNm=ObjV[ObjN]->GetCatNm(); CatNmV.AddUnique(CatNm); } CatNmV.Ins(0, "All"); }
PExpHelpObj TExpHelp::GetObj | ( | const TStr & | ObjNm | ) | const |
Definition at line 1146 of file exp.cpp.
References TStr::GetUc(), TVec< TVal >::Len(), and ObjV.
{ PExpHelpObj Obj; for (int ObjN=0; ObjN<ObjV.Len(); ObjN++){ if (ObjV[ObjN]->GetHdItem()->GetNm().GetUc()==ObjNm.GetUc()){ return ObjV[ObjN];} } return NULL; }
void TExpHelp::GetObjHdNmV | ( | const TStr & | CatNm, |
TStrV & | ObjHdNmV | ||
) | const |
Definition at line 1135 of file exp.cpp.
References TVec< TVal >::AddUnique(), TVec< TVal >::Clr(), TStr::Empty(), TVec< TVal >::Len(), ObjV, and TVec< TVal >::Sort().
{ ObjHdNmV.Clr(); for (int ObjN=0; ObjN<ObjV.Len(); ObjN++){ TStr ObjCatNm=ObjV[ObjN]->GetCatNm(); TStr ObjHdNm=ObjV[ObjN]->GetHdItem()->GetNm(); if ((CatNm.Empty())||(CatNm=="All")||(CatNm==ObjCatNm)){ ObjHdNmV.AddUnique(ObjHdNm);} } ObjHdNmV.Sort(); }
static PExpHelp TExpHelp::Load | ( | TSIn & | SIn | ) | [inline, static] |
PExpHelp TExpHelp::LoadXml | ( | const PSIn & | SIn | ) | [static] |
Definition at line 1084 of file exp.cpp.
References TVec< TVal >::Add(), TExpHelpObj::GetObjTypeFromStr(), TXmlTok::GetTagTok(), TXmlTok::GetTagTokV(), TXmlTok::GetTokStr(), TVec< TVal >::Len(), TXmlDoc::LoadTxt(), and New().
{ // create expression help PExpHelp ExpHelp=TExpHelp::New(); // load xml with expression help PXmlDoc Doc=TXmlDoc::LoadTxt(SIn); // retrieve objects TXmlTokV ObjTokV; Doc->GetTagTokV("ExpHelp|Obj", ObjTokV); for (int ObjTokN=0; ObjTokN<ObjTokV.Len(); ObjTokN++){ PXmlTok ObjTok=ObjTokV[ObjTokN]; // type TStr TypeStr=ObjTok->GetTagTok("Type")->GetTokStr(false); // category TStr CatNm=ObjTok->GetTagTok("Cat")->GetTokStr(false); // header TStr HdNm=ObjTok->GetTagTok("Head|Name")->GetTokStr(false); TStr HdTypeStr=ObjTok->GetTagTok("Head|Type")->GetTokStr(false); TStr HdDescStr=ObjTok->GetTagTok("Head|Desc")->GetTokStr(false); PExpHelpItem HdItem= TExpHelpItem::New(HdNm, HdTypeStr, HdDescStr, ""); // arguments TXmlTokV ArgTokV; ObjTok->GetTagTokV("Args|Arg", ArgTokV); TExpHelpItemV ArgItemV; for (int ArgTokN=0; ArgTokN<ArgTokV.Len(); ArgTokN++){ PXmlTok ArgTok=ArgTokV[ArgTokN]; // argument TStr ArgNm=ArgTok->GetTagTok("Name")->GetTokStr(false); TStr ArgTypeStr=ArgTok->GetTagTok("Type")->GetTokStr(false); TStr ArgDescStr=ArgTok->GetTagTok("Desc")->GetTokStr(false); TStr ArgDfValStr=ArgTok->GetTagTok("Default")->GetTokStr(false); PExpHelpItem ArgItem= TExpHelpItem::New(ArgNm, ArgTypeStr, ArgDescStr, ArgDfValStr); ArgItemV.Add(ArgItem); } // create & add object TExpHelpObjType Type=TExpHelpObj::GetObjTypeFromStr(TypeStr); PExpHelpObj Obj=TExpHelpObj::New(Type, CatNm, HdItem, ArgItemV); ExpHelp->AddObj(Obj); } // return result return ExpHelp; }
static PExpHelp TExpHelp::LoadXml | ( | const TStr & | FNm | ) | [inline, static] |
static PExpHelp TExpHelp::New | ( | ) | [inline, static] |
bool TExpHelp::operator== | ( | const TExpHelp & | ) | const [inline] |
void TExpHelp::Save | ( | TSOut & | SOut | ) | const [inline] |
TCRef TExpHelp::CRef [private] |
TExpHelpObjV TExpHelp::ObjV [private] |
Definition at line 353 of file exp.h.
Referenced by GetCatNmV(), GetObj(), and GetObjHdNmV().