AliPhysics  e59a9ba (e59a9ba)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliJSONData.cxx File Reference
#include <sstream>
#include <TString.h>
#include <AliJSONData.h>
Include dependency graph for AliJSONData.cxx:

Go to the source code of this file.

Functions

return jsonbuilder str ().c_str()
 
std::ostream & operator<< (std::ostream &os, const AliJSONValue &val)
 
std::ostream & operator<< (std::ostream &os, const AliJSONData &obj)
 

Variables

ClassImp(AliJSONValue)
ClassImp(AliJSONInt) ClassImp(AliJSONFloat)
ClassImp(AliJSONDouble)
ClassImp(AliJSONBool) ClassImp(AliJSONString)
ClassImp(AliJSONData) std
stringbuilder<< fValue;return
stringbuilder.str();}std::string
AliJSONFloat::ToString() const
{std::stringstream
stringbuilder;stringbuilder
<< fValue;return
stringbuilder.str();}std::string
AliJSONDouble::ToString()
const {std::stringstream
stringbuilder;stringbuilder
<< fValue;return
stringbuilder.str();}AliJSONData::AliJSONData(const
char *key, const char *value):TNamed(key,""),
fValue(NULL){TString valstring(value);if(!valstring.CompareTo("true"))
fValue=new AliJSONBool(kTRUE);else
if(!valstring.CompareTo("false"))
fValue=new AliJSONBool(kFALSE);else
if(valstring.IsDigit()){if(valstring.IsFloat())
fValue=new AliJSONDouble(valstring.Atof());else
fValue=new AliJSONInt(valstring.Atoi());}else
fValue=new AliJSONString(value);}std::string
AliJSONData::ToString() const
{std::stringstream jsonbuilder;jsonbuilder
<< "\""<< GetName()
<< "\":\""<< fValue-> 
ToString ()<< "\""
 

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const AliJSONValue val 
)

Definition at line 62 of file AliJSONData.cxx.

std::ostream& operator<< ( std::ostream &  os,
const AliJSONData obj 
)

Definition at line 67 of file AliJSONData.cxx.

Variable Documentation

ClassImp (AliJSONValue) ClassImp(AliJSONInt) ClassImp(AliJSONFloat) ClassImp(AliJSONDouble) ClassImp(AliJSONBool) ClassImp(AliJSONString) ClassImp(AliJSONData) std stringbuilder<< fValue; return stringbuilder.str();}std::string AliJSONFloat::ToString() const { std::stringstream stringbuilder; stringbuilder << fValue; return stringbuilder.str();}std::string AliJSONDouble::ToString() const { std::stringstream stringbuilder; stringbuilder << fValue; return stringbuilder.str();}AliJSONData::AliJSONData(const char* key, const char* value): TNamed(key, ""), fValue(NULL){ TString valstring(value); if(!valstring.CompareTo("true")) fValue = new AliJSONBool(kTRUE); else if(!valstring.CompareTo("false")) fValue = new AliJSONBool(kFALSE); else if(valstring.IsDigit()){ if(valstring.IsFloat()) fValue = new AliJSONDouble(valstring.Atof()); else fValue = new AliJSONInt(valstring.Atoi()); } else fValue = new AliJSONString(value);}std::string AliJSONData::ToString() const { std::stringstream jsonbuilder; jsonbuilder << "\"" << GetName() << "\":\"" << fValue-> ToString()<< "\""

Definition at line 58 of file AliJSONData.cxx.