4 #ifndef ROOT_TRootSniffer
5 #define ROOT_TRootSniffer
63 return (fMask &
kScan) && (fStore != 0);
139 const char *foldername = 0,
TCollection *keys_lst = 0);
184 void Restrict(
const char* path,
const char* options);
Bool_t ProduceImage(Int_t kind, const char *path, const char *options, void *&ptr, Long_t &length)
Method to produce image from specified object.
TString fItemName
current level of hierarchy
Bool_t RegisterObject(const char *subfolder, TObject *obj)
Register object in subfolder structure subfolder parameter can have many levels like: ...
Bool_t SetResult(void *obj, TClass *cl, TDataMember *member=0)
Obsolete, use SetFoundResult instead.
A TFolder object is a collection of objects and folders.
Bool_t fScanGlobalDir
indicate if sniffer allowed to change ROOT structures - for instance, read objects from files ...
Bool_t CanExploreItem(const char *path)
Method returns true when object has childs or one could try to expand item.
ULong_t GetItemHash(const char *itemname)
Get hash function for specified item used to detect any changes in the specified object.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
Bool_t Produce(const char *path, const char *file, const char *options, void *&ptr, Long_t &length, TString &str)
Method produce different kind of data out of object Parameter 'path' specifies object or object membe...
Bool_t IsStreamerInfoItem(const char *itemname)
Return true if it is streamer info item name.
UInt_t fMask
pointer on parent record
Bool_t ProduceBinary(const char *path, const char *options, void *&ptr, Long_t &length)
produce binary data for specified item if "zipped" option specified in query, buffer will be compress...
Int_t Depth() const
Returns depth of hierarchy.
void BeforeNextChild()
indicates that new child for current element will be started
TMemFile * fMemFile
default path for registered objects
Int_t CheckRestriction(const char *item_name)
Checked if restriction is applied to the item full_item_name should have full path to the item...
All ROOT classes may have RTTI (run time type identification) support added.
virtual void * FindInHierarchy(const char *path, TClass **cl=0, TDataMember **member=0, Int_t *chld=0)
Search element with specified path Returns pointer on element Optionally one could obtain element cla...
Bool_t GoInside(TRootSnifferScanRec &super, TObject *obj, const char *obj_name=0, TRootSniffer *sniffer=0)
Method verifies if new level of hierarchy should be started with provided object. ...
TString DecodeUrlOptionValue(const char *value, Bool_t remove_quotes=kTRUE)
method replaces all kind of special symbols, which could appear in URL options
Bool_t CanSetFields() const
return true when fields could be set to the hierarchy item
Bool_t HasRestriction(const char *item_name)
Made fast check if item with specified name is in restriction list If returns true, requires precise check with CheckRestriction() method.
Bool_t SetFoundResult(void *obj, TClass *cl, TDataMember *member=0)
Set found element with class and datamember (optional)
Bool_t Done() const
Method indicates that scanning can be interrupted while result is set.
void CreateMemFile()
Creates TMemFile instance, which used for objects streaming One could not use TBufferFile directly...
void Restrict(const char *path, const char *options)
Restrict access to the specified location.
Bool_t UnregisterObject(TObject *obj)
unregister (remove) object from folders structures folder itself will remain even when it will be emp...
Int_t fRestriction
list of created items names, need to avoid duplication
mask for actions, only actions copied to child rec
Bool_t ProduceItem(const char *path, const char *options, TString &res, Bool_t asjson=kTRUE)
produce JSON/XML for specified item contrary to h.json request, only fields for specified item are st...
Abstract interface for storage of hierarchy scan in TRootSniffer.
TString fCurrentAllowedMethods
current restriction for last-found object
Bool_t CreateItem(const char *fullname, const char *title)
create item element
void CloseNode()
close started node
Bool_t ProduceXml(const char *path, const char *options, TString &res)
produce XML data for specified item For object conversion TBufferXML is used
A TMemFile is like a normal TFile except that it reads and writes only from memory.
Bool_t CanExpandItem()
Returns true when item can be expanded.
Bool_t IsScanGlobalDir() const
const char * GetAutoLoad() const
return name of configured autoload scripts (or 0)
Bool_t IsReadOnly(Bool_t dflt=kTRUE)
Returns read-only flag for current item.
#define ClassDef(name, id)
virtual void ScanObjectChilds(TRootSnifferScanRec &rec, TObject *obj)
scans object childs (if any) here one scans collection, branches, trees and so on ...
Bool_t SetItemField(const char *fullname, const char *name, const char *value)
set field for specified item
Bool_t IsReadOnly() const
THttpCallArg * fCurrentArg
when enabled (default), scan gROOT for histograms, canvases, open files
The TNamed class is the base class for all named ROOT classes.
Bool_t ExecuteCmd(const char *path, const char *options, TString &res)
execute command marked as _kind=='Command'
Bool_t fReadOnly
last produced streamer info
Bool_t ScanOnlyFields() const
Bool_t CanDrawItem(const char *path)
Method verifies if object can be drawn.
TFolder * GetSubFolder(const char *foldername, Bool_t force=kFALSE)
creates subfolder where objects can be registered
const char * fSearchPath
defines operation kind
void SetRootClass(TClass *cl)
Mark item with ROOT class and correspondent streamer info.
Int_t fNumChilds
number of fields
virtual ~TRootSniffer()
destructor
Int_t WithCurrentUserName(const char *option)
return 2 when option match to current user name return 1 when option==all return 0 when option does n...
search for specified item (only objects and collections)
expand of specified item - allowed to scan object members
Double_t length(const TVector2 &v)
TRootSniffer(const char *name, const char *objpath="Objects")
Int_t fLevel
current path searched
Collection abstract base class.
Bool_t RegisterCommand(const char *cmdname, const char *method, const char *icon)
Register command which can be executed from web interface.
Int_t fNumFields
indicate if node was started
The ROOT global object gROOT contains a list of all defined classes.
virtual void ScanRoot(TRootSnifferScanRec &rec)
scan complete ROOT objects hierarchy For the moment it includes objects in gROOT directory and list o...
virtual ~TRootSnifferScanRec()
destructor
Bool_t AccessField(TFolder *parent, TObject *item, const char *name, const char *value, TNamed **only_get=0)
set or get field for the child each field coded as TNamed object, placed after chld in the parent hie...
void ScanHierarchy(const char *topname, const char *path, TRootSnifferStore *store, Bool_t only_fields=kFALSE)
Method scans normal objects, registered in ROOT.
TString fAutoLoad
list of restrictions for different locations
void ScanObjectMembers(TRootSnifferScanRec &rec, TClass *cl, char *ptr)
scripts names, which are add as _autoload parameter to h.json request
TRootSnifferScanRec()
number of childs
Bool_t IsReadyForResult() const
Checks if result will be accepted.
TList fItemsNames
name of current item
Bool_t ProduceExe(const char *path, const char *options, Int_t reskind, TString *ret_str, void **ret_ptr=0, Long_t *ret_length=0)
execute command for specified object options include method and extra list of parameters sniffer shou...
Bool_t ProduceMulti(const char *path, const char *options, void *&ptr, Long_t &length, TString &str, Bool_t asjson=kTRUE)
Process several requests, packing all results into binary or JSON buffer Input parameters should be c...
TRootSnifferStore * fStore
restriction 0 - default, 1 - read-only, 2 - full access
TList * fSinfo
file used to manage streamer infos
TRootSnifferScanRec * fParent
Bool_t IsItemField(TObject *obj) const
return true when object is TNamed with kItemField bit set such objects used to keep field values for ...
Bool_t ProduceJson(const char *path, const char *options, TString &res)
produce JSON data for specified item For object conversion TBufferJSON is used
Mother of all ROOT objects.
void SetField(const char *name, const char *value, Bool_t with_quotes=kTRUE)
Set item field only when creating is specified.
void SetAutoLoad(const char *scripts="")
When specified, _autoload attribute will be always add to top element of h.json/h.hml requests Used to instruct browser automatically load special code.
void SetReadOnly(Bool_t on=kTRUE)
void ScanCollection(TRootSnifferScanRec &rec, TCollection *lst, const char *foldername=0, TCollection *keys_lst=0)
scan collection content
Bool_t fHasMore
object to store results
Bool_t fNodeStarted
indicates that potentially there are more items can be found
virtual void ScanObjectProperties(TRootSnifferScanRec &rec, TObject *obj)
scans object properties here such fields as _autoload or _icon properties depending on class or objec...
void MakeItemName(const char *objname, TString &itemname)
Construct item name, using object name as basis.
void SetCurrentCallArg(THttpCallArg *arg)
set current http arguments, which then used in different process methods For instance, if user authorized with some user name, depending from restrictions some objects will be invisible or user get full access to the element
void SetScanGlobalDir(Bool_t on=kTRUE)
void BuildFullName(TString &buf, TRootSnifferScanRec *prnt=0)
Produces full name for the current item.
Int_t fCurrentRestrict
current http arguments (if any)
if set, only fields for specified item will be set (but all fields)
const char * GetItemField(TFolder *parent, TObject *item, const char *name)
return field for specified item
void CreateNode(const char *_node_name)
Starts new node, must be closed at the end.
TObject * GetItem(const char *fullname, TFolder *&parent, Bool_t force=kFALSE, Bool_t within_objects=kTRUE)
return item from the subfolders structure
check if there childs, very similar to search
TList fRestrictions
list of allowed methods, extracted when analyzed object restrictions
ULong_t GetStreamerInfoHash()
Returns hash value for streamer infos At the moment - just number of items in streamer infos list...
TObject * FindTObjectInHierarchy(const char *path)
Search element in hierarchy, derived from TObject.
static Bool_t IsDrawableClass(TClass *cl)
return true if object can be drawn