SNAP Library, Developer Reference  2012-10-02 12:56:23
SNAP, a general purpose network analysis and graph mining library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
json.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  TJsonValType {
  jvtUndef, jvtNull, jvtBool, jvtNum,
  jvtStr, jvtArr, jvtObj
}

Functions

 UndefCopyAssign (TJsonVal)
 TJsonVal ()
static PJsonVal New ()
 TJsonVal (TSIn &SIn)
static PJsonVal Load (TSIn &SIn)
void Save (TSOut &SOut) const
void PutNull ()
void PutBool (const bool &_Bool)
void PutNum (const double &_Num)
void PutStr (const TStr &_Str)
void PutArr ()
void AddToArr (const PJsonVal &Val)
void PutObj ()
void AddToObj (const TStr &KeyNm, const PJsonVal &Val)
void AddToObj (const TStr &KeyNm, const int &Val)
void AddToObj (const TStr &KeyNm, const double &Val)
void AddToObj (const TStr &KeyNm, const TStr &Val)
void AddToObj (const TStr &KeyNm, const char *Val)
void AddToObj (const TStr &KeyNm, const bool &Val)
void AddToObj (const TStr &KeyNm, const TJsonValV &ValV)
static PJsonVal NewNull ()
static PJsonVal NewBool (const bool &Bool)
static PJsonVal NewNum (const double &Num)
static PJsonVal NewStr (const TStr &Str)
static PJsonVal NewArr ()
static PJsonVal NewArr (const TJsonValV &ValV)
static PJsonVal NewArr (const TStrV &StrV)
static PJsonVal NewObj ()
static PJsonVal NewObj (const TStr &KeyNm, const PJsonVal &ObjVal)
static PJsonVal NewObj (const TStr &KeyNm, const int &ObjVal)
static PJsonVal NewObj (const TStr &KeyNm, const double &ObjVal)
static PJsonVal NewObj (const TStr &KeyNm, const TStr &ObjVal)
static PJsonVal NewObj (const TStr &KeyNm, const bool &ObjVal)
TJsonValType GetJsonValType () const
bool IsNull () const
bool IsBool () const
bool IsNum () const
bool IsStr () const
bool IsArr () const
bool IsObj () const
bool GetBool () const
double GetNum () const
TStr GetStr () const
int GetArrVals () const
PJsonVal GetArrVal (const int &ValN) const
int GetObjKeys () const
void GetObjKeyVal (const int &KeyValN, TStr &Key, PJsonVal &Val) const
bool IsObjKey (const TStr &Key) const
bool IsObjKey (const char *Key) const
PJsonVal GetObjKey (const TStr &Key) const
PJsonVal GetObjKey (const char *Key) const
bool GetObjBool (const TStr &Key) const
bool GetObjBool (const char *Key) const
double GetObjNum (const TStr &Key) const
double GetObjNum (const char *Key) const
TStr GetObjStr (const TStr &Key) const
TStr GetObjStr (const char *Key) const
bool GetObjBool (const TStr &Key, const bool &DefBool) const
bool GetObjBool (const char *Key, const bool &DefBool) const
double GetObjNum (const TStr &Key, const double &DefNum) const
double GetObjNum (const char *Key, const double &DefNum) const
TStr GetObjStr (const TStr &Key, const TStr &DefStr) const
TStr GetObjStr (const char *Key, const TStr &DefStr) const
static PJsonVal GetValFromLx (TILx &Lx)
static PJsonVal GetValFromStr (const TStr &JsonStr)
static void AddEscapeChAFromStr (const TStr &Str, TChA &ChA)
static TStr AddEscapeStrFromStr (const TStr &Str)
static void AddQChAFromStr (const TStr &Str, TChA &ChA)
static void GetChAFromVal (const PJsonVal &Val, TChA &ChA)
static TStr GetStrFromVal (const PJsonVal &Val)

Variables

ClassTPV(TJsonVal, PJsonVal,
TJsonValV) private TBool 
Bool
TFlt Num
TStr Str
TJsonValV ValV
THash< TStr, PJsonVal > KeyValH

Enumeration Type Documentation

Enumerator:
jvtUndef 
jvtNull 
jvtBool 
jvtNum 
jvtStr 
jvtArr 
jvtObj 

Definition at line 4 of file json.h.


Function Documentation

void TJsonVal::AddEscapeChAFromStr ( const TStr Str,
TChA ChA 
) [static]

Definition at line 122 of file json.cpp.

References TChA::AddCh(), TUnicode::DecodeUtf8(), TStr::Fmt(), TUnicodeDef::GetDef(), TUnicodeDef::IsDef(), TVec< TVal >::Len(), and TStr::Len().

Referenced by AddEscapeStrFromStr(), and AddQChAFromStr().

                                                            {
        if (TUnicodeDef::IsDef()) {
                // parse the UTF8 string (old: TUStr InUStr(InStr);)
                TIntV UStr; TUnicodeDef::GetDef()->DecodeUtf8(Str, UStr);
                // escape the string
                for (int ChN = 0; ChN < UStr.Len(); ChN++) {
                        const int UCh = UStr[ChN];
                        if (UCh < 0x80) {
                                // 7-bit ascii
                                const char Ch = (char)UCh;
                                switch (Ch) {
                                        case '"' : ChA.AddCh('\\'); ChA.AddCh('"'); break;
                                        case '\\' : ChA.AddCh('\\'); ChA.AddCh('\\'); break;
                                        case '/' : ChA.AddCh('\\'); ChA.AddCh('/'); break;
                                        case '\b' : ChA.AddCh('\\'); ChA.AddCh('b'); break;
                                        case '\f' : ChA.AddCh('\\'); ChA.AddCh('f'); break;
                                        case '\n' : ChA.AddCh('\\'); ChA.AddCh('n'); break;
                                        case '\r' : ChA.AddCh('\\'); ChA.AddCh('r'); break;
                                        case '\t' : ChA.AddCh('\\'); ChA.AddCh('t'); break;
                                        default :
                                                ChA.AddCh(Ch);
                                }
                        } else {
                                // escape
                                ChA += "\\u";
                                ChA += TStr::Fmt("%04x", UCh);
                        }
                }
        } else {
                // escape the string
                for (int ChN = 0; ChN < Str.Len(); ChN++) {
                        const char Ch = Str[ChN];
                        if ((Ch & 0x80) == 0) {
                                // 7-bit ascii
                                switch (Ch) {
                                        case '"' : ChA.AddCh('\\'); ChA.AddCh('"'); break;
                                        case '\\' : ChA.AddCh('\\'); ChA.AddCh('\\'); break;
                                        case '/' : ChA.AddCh('\\'); ChA.AddCh('/'); break;
                                        case '\b' : ChA.AddCh('\\'); ChA.AddCh('b'); break;
                                        case '\f' : ChA.AddCh('\\'); ChA.AddCh('f'); break;
                                        case '\n' : ChA.AddCh('\\'); ChA.AddCh('n'); break;
                                        case '\r' : ChA.AddCh('\\'); ChA.AddCh('r'); break;
                                        case '\t' : ChA.AddCh('\\'); ChA.AddCh('t'); break;
                                        default : ChA.AddCh(Ch);
                                }
                        } else {
                                // escape
                                ChA += "\\u";
                                ChA += TStr::Fmt("%02x", (int)Ch);
                        }
                }
        }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static TStr AddEscapeStrFromStr ( const TStr Str) [static]

Definition at line 101 of file json.h.

References AddEscapeChAFromStr().

                                                   { 
          TChA ChA; AddEscapeChAFromStr(Str, ChA); return ChA; }

Here is the call graph for this function:

void TJsonVal::AddQChAFromStr ( const TStr Str,
TChA ChA 
) [static]

Definition at line 176 of file json.cpp.

References AddEscapeChAFromStr().

Referenced by GetChAFromVal().

                                                       {
  ChA+="\"";
  AddEscapeChAFromStr(Str, ChA);
  ChA+="\"";
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AddToArr ( const PJsonVal &  Val)

Definition at line 30 of file json.h.

References EAssert, jvtArr, and ValV.

                                    {
    EAssert(JsonValType==jvtArr); ValV.Add(Val);}
void AddToObj ( const TStr KeyNm,
const PJsonVal &  Val 
)

Definition at line 33 of file json.h.

References EAssert, jvtObj, and KeyValH.

Referenced by AddToObj().

                                                       {
    EAssert(JsonValType==jvtObj); KeyValH.AddDat(KeyNm, Val);}

Here is the caller graph for this function:

void AddToObj ( const TStr KeyNm,
const int &  Val 
)

Definition at line 35 of file json.h.

References AddToObj(), and NewNum().

{ AddToObj(KeyNm, NewNum((double)Val)); }

Here is the call graph for this function:

void AddToObj ( const TStr KeyNm,
const double &  Val 
)

Definition at line 36 of file json.h.

References AddToObj(), and NewNum().

{ AddToObj(KeyNm, NewNum(Val)); }

Here is the call graph for this function:

void AddToObj ( const TStr KeyNm,
const TStr Val 
)

Definition at line 37 of file json.h.

References AddToObj(), and NewStr().

{ AddToObj(KeyNm, NewStr(Val)); }

Here is the call graph for this function:

void AddToObj ( const TStr KeyNm,
const char *  Val 
)

Definition at line 38 of file json.h.

References AddToObj(), and NewStr().

{ AddToObj(KeyNm, NewStr(Val)); }

Here is the call graph for this function:

void AddToObj ( const TStr KeyNm,
const bool &  Val 
)

Definition at line 39 of file json.h.

References AddToObj(), and NewBool().

{ AddToObj(KeyNm, NewBool(Val)); }

Here is the call graph for this function:

void AddToObj ( const TStr KeyNm,
const TJsonValV &  ValV 
)

Definition at line 40 of file json.h.

References AddToObj(), and NewArr().

{ AddToObj(KeyNm, NewArr(ValV)); }

Here is the call graph for this function:

PJsonVal GetArrVal ( const int &  ValN) const

Definition at line 76 of file json.h.

References ValV.

{return ValV[ValN];}
int GetArrVals ( ) const

Definition at line 75 of file json.h.

References EAssert, IsArr(), and ValV.

{EAssert(IsArr()); return ValV.Len();}

Here is the call graph for this function:

bool GetBool ( ) const

Definition at line 72 of file json.h.

References Bool, EAssert, and IsBool().

{EAssert(IsBool()); return Bool;}

Here is the call graph for this function:

void TJsonVal::GetChAFromVal ( const PJsonVal &  Val,
TChA ChA 
) [static]

Definition at line 182 of file json.cpp.

References AddQChAFromStr(), TStr::Fmt(), jvtArr, jvtBool, jvtNull, jvtNum, jvtObj, jvtStr, and Throw().

Referenced by GetStrFromVal().

                                                          {
  switch (Val->GetJsonValType()){
    case jvtNull: 
      ChA+="null"; break;
    case jvtBool:
      if (Val->GetBool()){ChA+="true";} else {ChA+="false";} break;
    case jvtNum: 
      ChA+=TStr::Fmt("%g", Val->GetNum()); break;
    case jvtStr:
      AddQChAFromStr(Val->GetStr(), ChA); break;
    case jvtArr:
      ChA+="[";
      for (int ArrValN=0; ArrValN<Val->GetArrVals(); ArrValN++){
        if (ArrValN>0){ChA+=", ";}
        GetChAFromVal(Val->GetArrVal(ArrValN), ChA);
      }
      ChA+="]"; 
      break;
    case jvtObj:
      ChA+="{";
      for (int ObjKeyN=0; ObjKeyN<Val->GetObjKeys(); ObjKeyN++){
        if (ObjKeyN>0){ChA+=", ";}
        TStr ObjKey; PJsonVal ObjVal; Val->GetObjKeyVal(ObjKeyN, ObjKey, ObjVal);
        AddQChAFromStr(ObjKey, ChA);
        ChA+=":";
        GetChAFromVal(ObjVal, ChA);
      }
      ChA+="}"; 
      break;
        default: TExcept::Throw("Error parsing json");
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 63 of file json.h.

{return JsonValType;}
double GetNum ( ) const

Definition at line 73 of file json.h.

References EAssert, IsNum(), and Num.

Referenced by TXmlLx::GetPlainStrFromXmlStr(), TXmlParser::GetPlainStrFromXmlStr(), TXmlLx::GetReference(), TStr::IsInt(), TStr::IsInt64(), TStr::IsUInt(), and TStr::IsUInt64().

{EAssert(IsNum()); return Num;}

Here is the call graph for this function:

Here is the caller graph for this function:

bool GetObjBool ( const TStr Key) const

Definition at line 84 of file json.h.

References GetObjKey().

{ return GetObjKey(Key)->GetBool(); }

Here is the call graph for this function:

bool GetObjBool ( const char *  Key) const

Definition at line 85 of file json.h.

References GetObjKey().

{ return GetObjKey(Key)->GetBool(); }

Here is the call graph for this function:

bool TJsonVal::GetObjBool ( const TStr Key,
const bool &  DefBool 
) const

Definition at line 31 of file json.cpp.

References EAssert, IsObj(), IsObjKey(), and KeyValH.

                                                                    { 
  EAssert(IsObj());
  return (IsObjKey(Key)) ? KeyValH.GetDat(Key)->GetBool() : DefBool;
}

Here is the call graph for this function:

bool TJsonVal::GetObjBool ( const char *  Key,
const bool &  DefBool 
) const

Definition at line 36 of file json.cpp.

References EAssert, IsObj(), IsObjKey(), and KeyValH.

                                                                    { 
  EAssert(IsObj());
  return (IsObjKey(Key)) ? KeyValH.GetDat(Key)->GetBool() : DefBool;
}

Here is the call graph for this function:

PJsonVal TJsonVal::GetObjKey ( const TStr Key) const

Definition at line 19 of file json.cpp.

References EAssert, IsObj(), IsObjKey(), and KeyValH.

Referenced by GetObjBool(), GetObjNum(), and GetObjStr().

                                                  {
  EAssert(IsObj());
  EAssert(IsObjKey(Key)); 
  return KeyValH.GetDat(Key);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PJsonVal TJsonVal::GetObjKey ( const char *  Key) const

Definition at line 25 of file json.cpp.

References EAssert, IsObj(), IsObjKey(), and KeyValH.

                                                  {
  EAssert(IsObj());
  EAssert(IsObjKey(Key));
  return KeyValH.GetDat(Key);
}

Here is the call graph for this function:

int GetObjKeys ( ) const

Definition at line 77 of file json.h.

References EAssert, IsObj(), and KeyValH.

{EAssert(IsObj()); return KeyValH.Len();}

Here is the call graph for this function:

void GetObjKeyVal ( const int &  KeyValN,
TStr Key,
PJsonVal &  Val 
) const

Definition at line 78 of file json.h.

References EAssert, IsObj(), and KeyValH.

                                                                        {
    EAssert(IsObj()); Key=KeyValH.GetKey(KeyValN); Val=KeyValH[KeyValN];}

Here is the call graph for this function:

double GetObjNum ( const TStr Key) const

Definition at line 86 of file json.h.

References GetObjKey().

{ return GetObjKey(Key)->GetNum(); }

Here is the call graph for this function:

double GetObjNum ( const char *  Key) const

Definition at line 87 of file json.h.

References GetObjKey().

{ return GetObjKey(Key)->GetNum(); }

Here is the call graph for this function:

double TJsonVal::GetObjNum ( const TStr Key,
const double &  DefNum 
) const

Definition at line 41 of file json.cpp.

References EAssert, IsObj(), IsObjKey(), and KeyValH.

                                                                      { 
  EAssert(IsObj());
  return (IsObjKey(Key)) ? KeyValH.GetDat(Key)->GetNum() : DefNum;
} 

Here is the call graph for this function:

double TJsonVal::GetObjNum ( const char *  Key,
const double &  DefNum 
) const

Definition at line 46 of file json.cpp.

References EAssert, IsObj(), IsObjKey(), and KeyValH.

                                                                      { 
  EAssert(IsObj());
  return (IsObjKey(Key)) ? KeyValH.GetDat(Key)->GetNum() : DefNum;
}

Here is the call graph for this function:

TStr GetObjStr ( const TStr Key) const

Definition at line 88 of file json.h.

References GetObjKey().

{ return GetObjKey(Key)->GetStr(); }

Here is the call graph for this function:

TStr GetObjStr ( const char *  Key) const

Definition at line 89 of file json.h.

References GetObjKey().

{ return GetObjKey(Key)->GetStr(); }

Here is the call graph for this function:

TStr TJsonVal::GetObjStr ( const TStr Key,
const TStr DefStr 
) const

Definition at line 51 of file json.cpp.

References EAssert, IsObj(), IsObjKey(), and KeyValH.

                                                                  { 
  EAssert(IsObj());
  return (IsObjKey(Key)) ? KeyValH.GetDat(Key)->GetStr() : DefStr;
}

Here is the call graph for this function:

TStr TJsonVal::GetObjStr ( const char *  Key,
const TStr DefStr 
) const

Definition at line 56 of file json.cpp.

References EAssert, IsObj(), IsObjKey(), and KeyValH.

                                                                  { 
  EAssert(IsObj());
  return (IsObjKey(Key)) ? KeyValH.GetDat(Key)->GetStr() : DefStr;
}

Here is the call graph for this function:

TStr GetStr ( ) const

Definition at line 74 of file json.h.

References EAssert, IsStr(), and Str.

{EAssert(IsStr()); return Str;}

Here is the call graph for this function:

TStr TJsonVal::GetStrFromVal ( const PJsonVal &  Val) [static]

Definition at line 215 of file json.cpp.

References GetChAFromVal().

                                               {
  TChA ChA;
  GetChAFromVal(Val, ChA);
  return ChA;
}

Here is the call graph for this function:

PJsonVal TJsonVal::GetValFromLx ( TILx Lx) [static]

Definition at line 61 of file json.cpp.

References TILx::Flt, forever, TILx::GetSym(), New(), TILx::Str, syColon, syComma, syFlt, syIdStr, syLBrace, syLBracket, TILx::Sym, syQStr, syRBrace, syRBracket, and Throw().

                                       {
  static TFSet ValExpect=TFSet()|syIdStr|syFlt|syQStr|syLBracket|syLBrace;
  PJsonVal Val=TJsonVal::New();
  if ((Lx.Sym==syIdStr)&&(Lx.Str=="null")){
    Val->PutNull(); Lx.GetSym();
  } else if ((Lx.Sym==syIdStr)&&(Lx.Str=="true")){
    Val->PutBool(true); Lx.GetSym();
  } else if ((Lx.Sym==syIdStr)&&(Lx.Str=="false")){
    Val->PutBool(false); Lx.GetSym();
  } else if (Lx.Sym==syFlt){
    Val->PutNum(Lx.Flt); Lx.GetSym();
  } else if (Lx.Sym==syQStr){
    Val->PutStr(Lx.Str); Lx.GetSym();
  } else if ((Lx.Sym==syLBracket)){
    Val->PutArr(); Lx.GetSym(ValExpect); // added ValExpect to correctyl parse arrays of floats
    if (Lx.Sym!=syRBracket){
      forever{
        PJsonVal SubVal=TJsonVal::GetValFromLx(Lx);
        Val->AddToArr(SubVal);
        if (Lx.Sym==syComma){Lx.GetSym(ValExpect);} 
        else if (Lx.Sym==syRBracket){break;} 
        else {TExcept::Throw("JSON Array not properly formed.");}
      }
    }
    Lx.GetSym();
  } else if ((Lx.Sym==syLBrace)){
    Val->PutObj(); Lx.GetSym(TFSet()|syRBrace|syQStr);
    if (Lx.Sym!=syRBrace){
      forever{
        TStr SubKey=Lx.Str; 
        Lx.GetSym(syColon); 
        Lx.GetSym(ValExpect);
        PJsonVal SubVal=TJsonVal::GetValFromLx(Lx);
        Val->AddToObj(SubKey, SubVal);
        if (Lx.Sym==syComma){Lx.GetSym(TFSet()|syQStr);} 
        else if (Lx.Sym==syRBrace){break;} 
        else {TExcept::Throw("JSON Object not properly formed.");}
      }
    }
    Lx.GetSym();
  } else {
    TExcept::Throw("Unexpected JSON symbol.");
  }
  return Val;
}

Here is the call graph for this function:

static PJsonVal GetValFromStr ( const TStr JsonStr) [static]

Referenced by TEnv::GetIfArgPrefixBool(), and TILx::GetSym().

Here is the caller graph for this function:

bool IsArr ( ) const

Definition at line 68 of file json.h.

References jvtArr.

Referenced by GetArrVals().

{return JsonValType==jvtArr;}

Here is the caller graph for this function:

bool IsBool ( ) const

Definition at line 65 of file json.h.

References jvtBool.

Referenced by GetBool().

{return JsonValType==jvtBool;}

Here is the caller graph for this function:

bool IsNull ( ) const

Definition at line 64 of file json.h.

References jvtNull.

Referenced by TPt< TRec >::TPt().

{return JsonValType==jvtNull;}

Here is the caller graph for this function:

bool IsNum ( ) const

Definition at line 66 of file json.h.

References jvtNum.

{return JsonValType==jvtNum;}
bool IsObj ( ) const

Definition at line 69 of file json.h.

References jvtObj.

Referenced by GetObjBool(), GetObjKey(), GetObjKeys(), GetObjKeyVal(), GetObjNum(), GetObjStr(), and IsObjKey().

{return JsonValType==jvtObj;}

Here is the caller graph for this function:

bool IsObjKey ( const TStr Key) const

Definition at line 80 of file json.h.

References EAssert, IsObj(), and KeyValH.

Referenced by GetObjBool(), GetObjKey(), GetObjNum(), and GetObjStr().

{EAssert(IsObj()); return KeyValH.IsKey(Key);}

Here is the call graph for this function:

Here is the caller graph for this function:

bool IsObjKey ( const char *  Key) const

Definition at line 81 of file json.h.

References EAssert, IsObj(), and KeyValH.

{EAssert(IsObj()); return KeyValH.IsKey(Key);}

Here is the call graph for this function:

bool IsStr ( ) const

Definition at line 67 of file json.h.

References jvtStr.

Referenced by GetStr().

{return JsonValType==jvtStr;}

Here is the caller graph for this function:

static PJsonVal Load ( TSIn SIn) [static]

Definition at line 21 of file json.h.

References TJsonVal().

{return new TJsonVal(SIn);}

Here is the call graph for this function:

static PJsonVal New ( ) [static]

Definition at line 18 of file json.h.

References TJsonVal().

Referenced by NewArr(), NewBool(), NewNull(), NewNum(), NewObj(), and NewStr().

                       {
    return new TJsonVal();}

Here is the call graph for this function:

Here is the caller graph for this function:

static PJsonVal NewArr ( ) [static]

Definition at line 47 of file json.h.

References New().

Referenced by AddToObj().

{ PJsonVal Val = TJsonVal::New(); Val->PutArr(); return Val; }

Here is the call graph for this function:

Here is the caller graph for this function:

static PJsonVal NewArr ( const TJsonValV &  ValV) [static]
static PJsonVal NewArr ( const TStrV StrV) [static]
static PJsonVal NewBool ( const bool &  Bool) [static]

Definition at line 44 of file json.h.

References New().

Referenced by AddToObj().

{ PJsonVal Val = TJsonVal::New(); Val->PutBool(Bool); return Val; }

Here is the call graph for this function:

Here is the caller graph for this function:

static PJsonVal NewNull ( ) [static]

Definition at line 43 of file json.h.

References New().

{ PJsonVal Val = TJsonVal::New(); Val->PutNull(); return Val; }

Here is the call graph for this function:

static PJsonVal NewNum ( const double &  Num) [static]

Definition at line 45 of file json.h.

References New().

Referenced by AddToObj().

{ PJsonVal Val = TJsonVal::New(); Val->PutNum(Num); return Val; }

Here is the call graph for this function:

Here is the caller graph for this function:

static PJsonVal NewObj ( ) [static]

Definition at line 50 of file json.h.

References New().

{ PJsonVal Val = TJsonVal::New(); Val->PutObj(); return Val; }

Here is the call graph for this function:

static PJsonVal NewObj ( const TStr KeyNm,
const PJsonVal &  ObjVal 
) [static]

Definition at line 51 of file json.h.

References New().

                                                                    {
          PJsonVal Val = TJsonVal::New(); Val->PutObj(); Val->AddToObj(KeyNm, ObjVal); return Val; }

Here is the call graph for this function:

static PJsonVal NewObj ( const TStr KeyNm,
const int &  ObjVal 
) [static]

Definition at line 53 of file json.h.

References New().

                                                               {
          PJsonVal Val = TJsonVal::New(); Val->PutObj(); Val->AddToObj(KeyNm, ObjVal); return Val; }

Here is the call graph for this function:

static PJsonVal NewObj ( const TStr KeyNm,
const double &  ObjVal 
) [static]

Definition at line 55 of file json.h.

References New().

                                                                  {
          PJsonVal Val = TJsonVal::New(); Val->PutObj(); Val->AddToObj(KeyNm, ObjVal); return Val; }

Here is the call graph for this function:

static PJsonVal NewObj ( const TStr KeyNm,
const TStr ObjVal 
) [static]

Definition at line 57 of file json.h.

References New().

                                                                {
          PJsonVal Val = TJsonVal::New(); Val->PutObj(); Val->AddToObj(KeyNm, ObjVal); return Val; }

Here is the call graph for this function:

static PJsonVal NewObj ( const TStr KeyNm,
const bool &  ObjVal 
) [static]

Definition at line 59 of file json.h.

References New().

                                                                {
          PJsonVal Val = TJsonVal::New(); Val->PutObj(); Val->AddToObj(KeyNm, ObjVal); return Val; }

Here is the call graph for this function:

static PJsonVal NewStr ( const TStr Str) [static]

Definition at line 46 of file json.h.

References New().

Referenced by AddToObj(), and TStr::InsStr().

{ PJsonVal Val = TJsonVal::New(); Val->PutStr(Str); return Val; }

Here is the call graph for this function:

Here is the caller graph for this function:

void PutArr ( )

Definition at line 29 of file json.h.

References jvtArr.

{JsonValType=jvtArr;}
void PutBool ( const bool &  _Bool)

Definition at line 26 of file json.h.

References Bool, and jvtBool.

{JsonValType=jvtBool; Bool=_Bool;}
void PutNull ( )

Definition at line 25 of file json.h.

References jvtNull.

{JsonValType=jvtNull;}
void PutNum ( const double &  _Num)

Definition at line 27 of file json.h.

References jvtNum, and Num.

{JsonValType=jvtNum; Num=_Num;}
void PutObj ( )

Definition at line 32 of file json.h.

References jvtObj.

{JsonValType=jvtObj;}
void PutStr ( const TStr _Str)

Definition at line 28 of file json.h.

References jvtStr, and Str.

{JsonValType=jvtStr; Str=_Str;}
void Save ( TSOut SOut) const

Definition at line 22 of file json.h.

{}
TJsonVal ( )

Definition at line 17 of file json.h.

Referenced by Load(), and New().

: JsonValType(jvtUndef){}

Here is the caller graph for this function:

TJsonVal ( TSIn SIn)

Definition at line 20 of file json.h.

{}

Variable Documentation

ClassTPV (TJsonVal, PJsonVal, TJsonValV) private TBool Bool

Definition at line 7 of file json.h.

Referenced by GetBool(), and PutBool().

THash<TStr, PJsonVal> KeyValH

Definition at line 11 of file json.h.

Referenced by GetNum(), and PutNum().

Definition at line 12 of file json.h.

TJsonValV ValV

Definition at line 13 of file json.h.