Warning, file /include/root/TRootSnifferStore.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TRootSnifferStore
0013 #define ROOT_TRootSnifferStore
0014
0015 #include "TObject.h"
0016
0017 #include "TString.h"
0018
0019 class TDataMember;
0020 class TFolder;
0021
0022
0023
0024 class TRootSnifferStore : public TObject {
0025 protected:
0026 void *fResPtr{nullptr};
0027 TClass *fResClass{nullptr};
0028 TDataMember *fResMember{nullptr};
0029 Int_t fResNumChilds{-1};
0030 Int_t fResRestrict{0};
0031 public:
0032 virtual ~TRootSnifferStore() = default;
0033
0034 virtual void CreateNode(Int_t, const char *) {}
0035 virtual void SetField(Int_t, const char *, const char *, Bool_t) {}
0036 virtual void BeforeNextChild(Int_t, Int_t, Int_t) {}
0037 virtual void CloseNode(Int_t, Int_t) {}
0038
0039 void SetResult(void *_res, TClass *_rescl, TDataMember *_resmemb, Int_t _res_chld, Int_t restr = 0);
0040
0041 void *GetResPtr() const { return fResPtr; }
0042 TClass *GetResClass() const { return fResClass; }
0043 TDataMember *GetResMember() const { return fResMember; }
0044 Int_t GetResNumChilds() const { return fResNumChilds; }
0045 Int_t GetResRestrict() const { return fResRestrict; }
0046 virtual Bool_t IsXml() const { return kFALSE; }
0047
0048 ClassDefOverride(TRootSnifferStore, 0)
0049 };
0050
0051
0052
0053
0054
0055 class TRootSnifferStoreXml : public TRootSnifferStore {
0056 protected:
0057 TString &fBuf;
0058 Bool_t fCompact{kFALSE};
0059
0060 public:
0061 explicit TRootSnifferStoreXml(TString &_buf, Bool_t _compact = kFALSE) : TRootSnifferStore(), fBuf(_buf), fCompact(_compact)
0062 {
0063 }
0064
0065 void CreateNode(Int_t lvl, const char *nodename) final;
0066 void SetField(Int_t lvl, const char *field, const char *value, Bool_t) final;
0067 void BeforeNextChild(Int_t lvl, Int_t nchld, Int_t) final;
0068 void CloseNode(Int_t lvl, Int_t numchilds) final;
0069
0070 Bool_t IsXml() const final { return kTRUE; }
0071
0072 ClassDefOverride(TRootSnifferStoreXml, 0)
0073 };
0074
0075
0076
0077
0078
0079 class TRootSnifferStoreJson : public TRootSnifferStore {
0080 protected:
0081 TString &fBuf;
0082 Bool_t fCompact{kFALSE};
0083 public:
0084 explicit TRootSnifferStoreJson(TString &_buf, Bool_t _compact = kFALSE) : TRootSnifferStore(), fBuf(_buf), fCompact(_compact)
0085 {
0086 }
0087
0088 void CreateNode(Int_t lvl, const char *nodename) final;
0089 void SetField(Int_t lvl, const char *field, const char *value, Bool_t with_quotes) final;
0090 void BeforeNextChild(Int_t lvl, Int_t nchld, Int_t nfld) final;
0091 void CloseNode(Int_t lvl, Int_t numchilds) final;
0092
0093 ClassDefOverride(TRootSnifferStoreJson, 0)
0094 };
0095
0096 #endif