|
SNAP Library , User Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <dt.h>
Public Member Functions | |
| TUInt () | |
| TUInt (const uint &_Val) | |
| operator uint () const | |
| TUInt (TSIn &SIn) | |
| void | Load (TSIn &SIn) |
| void | Save (TSOut &SOut) const |
| void | LoadXml (const PXmlTok &XmlTok, const TStr &Nm) |
| void | SaveXml (TSOut &SOut, const TStr &Nm) const |
| TUInt & | operator= (const TUInt &UInt) |
| TUInt & | operator= (const uint &_Val) |
| TUInt | operator++ (int) |
| TUInt | operator-- (int) |
| uint | operator() () const |
| uint & | operator() () |
| TUInt & | operator~ () |
| TUInt & | operator&= (const TUInt &UInt) |
| TUInt & | operator|= (const TUInt &UInt) |
| TUInt & | operator^= (const TUInt &UInt) |
| TUInt & | operator>>= (const int &ShiftBits) |
| TUInt & | operator<<= (const int &ShiftBits) |
| int | GetMemUsed () const |
| int | GetPrimHashCd () const |
| int | GetSecHashCd () const |
| TStr | GetStr () const |
Static Public Member Functions | |
| static uint | GetRnd (const uint &Range=0) |
| static TStr | GetStr (const uint &Val) |
| static TStr | GetStr (const TInt &UInt) |
| static TStr | GetStr (const uint &Val, const char *FmtStr) |
| static TStr | GetStr (const uint &Val, const TStr &FmtStr) |
| static TStr | GetKiloStr (const uint &Val) |
| static TStr | GetMegaStr (const uint &Val) |
| static uint | JavaUIntToCppUInt (const uint &JavaUInt) |
| static bool | IsIpStr (const TStr &IpStr, uint &Ip, const char &SplitCh= '.') |
| static bool | IsIpStr (const TStr &IpStr, const char &SplitCh= '.') |
| static uint | GetUIntFromIpStr (const TStr &IpStr, const char &SplitCh= '.') |
| static TStr | GetStrFromIpUInt (const uint &Ip) |
Public Attributes | |
| uint | Val |
Static Public Attributes | |
| static const uint | Mn = 0 |
| static const uint | Mx = UINT_MAX |
| static TRnd | Rnd |
| TUInt::TUInt | ( | ) | [inline] |
| TUInt::TUInt | ( | const uint & | _Val | ) | [inline] |
| TUInt::TUInt | ( | TSIn & | SIn | ) | [inline, explicit] |
| static TStr TUInt::GetKiloStr | ( | const uint & | Val | ) | [inline, static] |
| static TStr TUInt::GetMegaStr | ( | const uint & | Val | ) | [inline, static] |
| int TUInt::GetMemUsed | ( | ) | const [inline] |
| int TUInt::GetPrimHashCd | ( | ) | const [inline] |
| static uint TUInt::GetRnd | ( | const uint & | Range = 0 | ) | [inline, static] |
Definition at line 1168 of file dt.h.
{return Rnd.GetUniDevUInt(Range);}
| int TUInt::GetSecHashCd | ( | ) | const [inline] |
| TStr TUInt::GetStr | ( | ) | const [inline] |
Definition at line 1170 of file dt.h.
{return TUInt::GetStr(Val);}
| static TStr TUInt::GetStr | ( | const uint & | Val | ) | [inline, static] |
| static TStr TUInt::GetStr | ( | const TInt & | UInt | ) | [inline, static] |
| TStr TUInt::GetStr | ( | const uint & | Val, |
| const char * | FmtStr | ||
| ) | [static] |
| static TStr TUInt::GetStr | ( | const uint & | Val, |
| const TStr & | FmtStr | ||
| ) | [inline, static] |
| TStr TUInt::GetStrFromIpUInt | ( | const uint & | Ip | ) | [static] |
| uint TUInt::GetUIntFromIpStr | ( | const TStr & | IpStr, |
| const char & | SplitCh = '.' |
||
| ) | [static] |
Definition at line 2075 of file dt.cpp.
{
TStrV IpStrV; IpStr.SplitOnAllCh(SplitCh, IpStrV);
uint Ip = 0; int Byte = 0;
EAssertR(IpStrV[0].IsInt(true, 0, 255, Byte), TStr::Fmt("Bad IP: '%s;", IpStr.CStr())); Ip = (uint)Byte;
EAssertR(IpStrV[1].IsInt(true, 0, 255, Byte), TStr::Fmt("Bad IP: '%s;", IpStr.CStr())); Ip = (Ip << 8) | (uint)Byte;
EAssertR(IpStrV[2].IsInt(true, 0, 255, Byte), TStr::Fmt("Bad IP: '%s;", IpStr.CStr())); Ip = (Ip << 8) | (uint)Byte;
EAssertR(IpStrV[3].IsInt(true, 0, 255, Byte), TStr::Fmt("Bad IP: '%s;", IpStr.CStr())); Ip = (Ip << 8) | (uint)Byte;
return Ip;
}
| bool TUInt::IsIpStr | ( | const TStr & | IpStr, |
| uint & | Ip, | ||
| const char & | SplitCh = '.' |
||
| ) | [static] |
Definition at line 2065 of file dt.cpp.
{
TStrV IpStrV; IpStr.SplitOnAllCh(SplitCh, IpStrV);
Ip = 0; int Byte = 0;
if (!IpStrV[0].IsInt(true, 0, 255, Byte)) { return false; }; Ip = (uint)Byte;
if (!IpStrV[1].IsInt(true, 0, 255, Byte)) { return false; }; Ip = (Ip << 8) | (uint)Byte;
if (!IpStrV[2].IsInt(true, 0, 255, Byte)) { return false; }; Ip = (Ip << 8) | (uint)Byte;
if (!IpStrV[3].IsInt(true, 0, 255, Byte)) { return false; }; Ip = (Ip << 8) | (uint)Byte;
return true;
}
| static bool TUInt::IsIpStr | ( | const TStr & | IpStr, |
| const char & | SplitCh = '.' |
||
| ) | [inline, static] |
| static uint TUInt::JavaUIntToCppUInt | ( | const uint & | JavaUInt | ) | [inline, static] |
| void TUInt::LoadXml | ( | const PXmlTok & | XmlTok, |
| const TStr & | Nm | ||
| ) |
Definition at line 2046 of file dt.cpp.
{
XLoadHd(Nm);
Val=TXmlObjSer::GetIntArg(XmlTok, "Val");
}
| TUInt TUInt::operator++ | ( | int | ) | [inline] |
| TUInt TUInt::operator-- | ( | int | ) | [inline] |
| TUInt& TUInt::operator<<= | ( | const int & | ShiftBits | ) | [inline] |
| TUInt& TUInt::operator>>= | ( | const int & | ShiftBits | ) | [inline] |
| TUInt& TUInt::operator~ | ( | ) | [inline] |
| void TUInt::Save | ( | TSOut & | SOut | ) | const [inline] |
| void TUInt::SaveXml | ( | TSOut & | SOut, |
| const TStr & | Nm | ||
| ) | const |
Definition at line 2051 of file dt.cpp.
{
XSaveBETagArg(Nm, "Val", TInt::GetStr(Val));
}
TRnd TUInt::Rnd [static] |