122 std::string nnn = objname;
127 while ((pos = nnn.find_first_of(
"- []<>#:&?/\'\"\\")) != std::string::npos)
128 nnn.replace(pos, 1,
"_");
130 itemname = nnn.c_str();
134 itemname.
Form(
"%s_%d", nnn.c_str(), cnt++);
242 fStore->
Error(
"SetResult",
"When member specified, pointer on object (not member) should be provided; use SetFoundResult");
315 if ((obj != 0) && (obj_name == 0)) obj_name = obj->
GetName();
318 if ((obj_name == 0) || (*obj_name == 0))
return kFALSE;
320 const char *full_name = 0;
324 const char *
slash = strrchr(obj_name,
'/');
326 full_name = obj_name;
327 obj_name = slash + 1;
328 if (*obj_name == 0) obj_name =
"file";
364 while (*separ ==
'/') {
377 if (!isslash)
return kFALSE;
384 if ((obj_name != 0) && (
fItemName != obj_name))
420 TNamed(name, "sniffer of root objects"),
421 fObjectsPath(objpath),
425 fScanGlobalDir(kTRUE),
428 fCurrentAllowedMethods(0),
432 fRestrictions.SetOwner(kTRUE);
483 const char* rslash = strrchr(path,
'/');
484 if (rslash) rslash++;
485 if ((rslash==0) || (*rslash==0)) rslash = path;
528 if ((username==0) || (option == 0) || (*option==0))
return 0;
530 if (strcmp(option,
"all") == 0)
return 1;
532 if (strcmp(username, option) == 0)
return 2;
534 if (strstr(option, username) == 0)
return -1;
542 return find ? 2 : -1;
556 if ((full_item_name==0) || (*full_item_name==0))
return 0;
558 const char* item_name = strrchr(full_item_name,
'/');
559 if (item_name) item_name++;
560 if ((item_name==0) || (*item_name==0)) item_name = full_item_name;
565 const char* options = 0;
569 while ((obj =
iter()) != 0) {
572 if (strstr(title,pattern1.
Data())==title) { options = title + pattern1.
Length();
break; }
573 if (strstr(title,pattern2.
Data())==title) { options = title + pattern2.
Length();
break; }
576 if (options==0)
return 0;
588 if (can_access > 0)
return 2;
589 if (can_see < 0)
return -1;
594 if (can_access < 0)
return 1;
605 if ((cl == 0) || (ptr == 0) || rec.
Done())
return;
613 while ((obj =
iter()) != 0) {
615 if ((rdata == 0) || strchr(rdata->
GetName(),
'.'))
continue;
622 if (member->
IsaPointer()) member_ptr = *((
char **) member_ptr);
626 if (chld.
GoInside(rec, member, 0,
this)) {
632 if (coll_offset >= 0) {
640 if ((title != 0) && (strlen(title) != 0))
668 if (coll_offset >= 0) {
690 TClass* cl = obj ? obj->IsA() : 0;
692 const char* pos = strstr(cl ? cl->
GetTitle() :
"",
"*SNIFF*");
697 if (*pos ==
' ') { pos++;
continue; }
699 const char* pos0 = pos;
700 while ((*pos != 0) && (*pos !=
'=')) pos++;
701 if (*pos == 0)
return;
704 Bool_t quotes = (*pos ==
'\"');
708 while ((*pos != 0) && (*pos != (quotes ?
'\"' :
' '))) pos++;
729 rec.
SetField(
"_player",
"JSROOT.drawTreePlayer");
746 if (((lst == 0) || (lst->
GetSize() == 0)) && ((keys_lst == 0) || (keys_lst->
GetSize() == 0)))
return;
750 if (!folderrec.
GoInside(rec, 0, foldername,
this))
return;
773 if (!chld.
GoInside(master, obj, 0,
this)) { next =
iter();
continue; }
775 if (chld.
SetResult(obj, obj->IsA()))
return;
781 while ((next =
iter()) != 0) {
796 if (chld.
SetResult(obj, obj->IsA()))
return;
804 while ((kobj =
iter()) != 0) {
805 TKey *key =
dynamic_cast<TKey *
>(kobj);
806 if (key == 0)
continue;
817 if (obj == 0) { obj = key; iskey =
kTRUE; }
822 if (chld.
GoInside(master, obj, fullname.
Data(),
this)) {
827 if (chld.
SetResult(keyobj, keyobj->IsA()))
return;
830 if (chld.
SetResult(obj, obj->IsA()))
return;
832 TClass *obj_class = obj->IsA();
841 if (strcmp(key->
GetClassName(),
"TDirectoryFile") == 0) {
846 obj_class = dir->IsA();
858 if (obj) obj_class = obj->IsA();
860 rec.
SetField(
"_player",
"JSROOT.drawTreePlayerKey");
873 if (chld.
SetResult(obj, obj_class))
return;
902 if (chld.
GoInside(rec, 0,
"StreamerInfo",
this)) {
906 chld.
SetField(
"_after_request",
"JSROOT.MarkAsStreamerInfo");
924 if (cl == 0)
return kFALSE;
996 if ((res_member!=0) && (res_cl!=0) && (member==0)) {
1002 if (res_member->
IsaPointer()) res = *((
char **) res);
1008 if (cl) *cl = res_cl;
1009 if (member) *member = res_member;
1049 return obj == 0 ? 0 :
TString::Hash(obj, obj->IsA()->Size());
1071 return (res != 0) && (obj_chld > 0);
1091 TH1F *
d =
new TH1F(
"d",
"d", 10, 0, 10);
1106 l->
Add(
gROOT->GetListOfStreamerInfo()->FindObject(
"TGraph"));
1107 l->
Add(
gROOT->GetListOfStreamerInfo()->FindObject(
"TH1F"));
1108 l->
Add(
gROOT->GetListOfStreamerInfo()->FindObject(
"TH1"));
1109 l->
Add(
gROOT->GetListOfStreamerInfo()->FindObject(
"TNamed"));
1110 l->
Add(
gROOT->GetListOfStreamerInfo()->FindObject(
"TObject"));
1130 if ((path == 0) || (*path == 0))
return kFALSE;
1132 if (*path ==
'/') path++;
1144 if ((obj_ptr == 0) || ((obj_cl == 0) && (member == 0)))
return kFALSE;
1161 if ((kind == 0) || (strcmp(kind,
"Command") != 0)) {
1162 if (
gDebug > 0)
Info(
"ExecuteCmd",
"Entry %s is not a command", path);
1167 const char *cmethod =
GetItemField(parent, obj,
"method");
1168 if ((cmethod==0) || (strlen(cmethod)==0)) {
1169 if (
gDebug > 0)
Info(
"ExecuteCmd",
"Entry %s do not defines method for execution", path);
1178 if (
gDebug > 0)
Info(
"ExecuteCmd",
"Entry %s not allowed for specified user", path);
1186 const char *cnumargs =
GetItemField(parent, obj,
"_numargs");
1197 if (
gDebug > 0)
Info(
"ExecuteCmd",
"For command %s argument %s not specified in options %s", path, argname.
Data(), options);
1208 if (
gDebug > 0)
Info(
"ExecuteCmd",
"Executing command %s method:%s", path, method.
Data());
1213 if (method.
Index(
"this->") == 0) {
1218 if (separ !=
kNPOS) {
1222 if (item_obj != 0) {
1223 method =
TString::Format(
"((%s*)%lu)->%s", item_obj->ClassName(), (
long unsigned) item_obj, method.
Data() + separ + 3);
1224 if (
gDebug > 2)
Info(
"ExecuteCmd",
"Executing %s", method.
Data());
1258 if ((path == 0) || (*path == 0))
return kFALSE;
1260 if (*path ==
'/') path++;
1264 if ((obj_ptr == 0) || (obj_cl == 0))
return kFALSE;
1276 if ((value == 0) || (strlen(value) == 0))
return TString();
1288 if (remove_quotes && (res.
Length() > 1) &&
1289 ((res[0] ==
'\'') || (res[0] ==
'\"')) && (res[0] == res[res.
Length() - 1])) {
1307 if ((path == 0) || (*path == 0)) {
1308 if (debug) debug->
Append(
"Item name not specified\n");
1312 if (*path ==
'/') path++;
1317 if ((obj_ptr == 0) || (obj_cl == 0))
return debug != 0;
1327 if (method_name != 0) {
1328 if (prototype.
Length() == 0) {
1332 if (debug) debug->
Append(
TString::Format(
"Search for method \'%s\' with prototype \'%s\'\n", method_name, prototype.
Data()));
1340 if (funcname.Length() > 0) {
1341 if (prototype.
Length() == 0) {
1342 if (debug) debug->
Append(
TString::Format(
"Search for any function with name \'%s\'\n", funcname.Data()));
1343 func =
gROOT->GetGlobalFunction(funcname);
1345 if (debug) debug->
Append(
TString::Format(
"Search for function \'%s\' with prototype \'%s\'\n", funcname.Data(), prototype.
Data()));
1346 func =
gROOT->GetGlobalFunctionWithPrototype(funcname, prototype);
1355 if ((method == 0) && (func==0)) {
1356 if (debug) debug->
Append(
"Method not found\n");
1362 if (debug) debug->
Append(
"Server runs in read-only mode, method cannot be executed\n");
1366 if (debug) debug->
Append(
"Server runs in read-only mode, function cannot be executed\n");
1369 if (debug) debug->
Append(
"For that special method server allows access even read-only mode is specified\n");
1384 if ((strcmp(arg->
GetName(),
"rest_url_opt") == 0) &&
1388 const char *pos = strstr(options,
"method=");
1389 if ((pos == 0) || (strlen(pos) < strlen(method_name) + 8))
return debug != 0;
1390 call_args.
Form(
"\"%s\"", pos + strlen(method_name) + 8);
1401 if ((val!=0) && (strcmp(val,
"_this_")==0)) {
1403 sval.
Form(
"(%s*)0x%lx", obj_cl->
GetName(), (
long unsigned) obj_ptr);
1408 if (strcmp(val,
"_post_object_xml_")==0) {
1411 if (post_obj == 0) {
1414 sval.
Form(
"(%s*)0x%lx", post_obj->
ClassName(), (
long unsigned) post_obj);
1415 if (url.
HasOption(
"_destroy_post_")) garbage.
Add(post_obj);
1419 if ((strcmp(val,
"_post_object_")==0) && url.
HasOption(
"_post_class_")) {
1430 post_obj->Streamer(buf);
1431 if (url.
HasOption(
"_destroy_post_")) garbage.
Add(post_obj);
1434 sval.
Form(
"(%s*)0x%lx", clname.
Data(), (
long unsigned) post_obj);
1437 if (strcmp(val,
"_post_data_")==0) {
1438 sval.
Form(
"(void*)0x%lx", (
long unsigned) *res_ptr);
1441 if (strcmp(val,
"_post_length_")==0) {
1442 sval.
Form(
"%ld", (
long) *res_length);
1450 if (val == 0)
return debug != 0;
1452 if (call_args.
Length() > 0) call_args +=
", ";
1455 int len = strlen(val);
1456 if ((strlen(val) < 2) || (*val !=
'\"') || (val[len - 1] !=
'\"'))
1479 if (debug) debug->
Append(
"Fail: invalid TMethodCall\n");
1493 garbage.
Add(resbuf);
1504 else res.
Form(
"%ld", l);
1525 else res.
Form(
"\"%s\"", txt);
1531 if ((ret_kind.length() > 0) && (ret_kind[ret_kind.length() - 1] ==
'*')) {
1532 ret_kind.resize(ret_kind.length() - 1);
1542 if (l != 0) ret_obj = (
void *) l;
1562 if (_ret_object_ != 0) {
1565 if (debug) debug->
Append(
TString::Format(
"Return object %s found %s\n", _ret_object_, obj ?
"true" :
"false"));
1571 ret_cl = obj->IsA();
1575 if ((ret_obj != 0) && (ret_cl != 0)) {
1579 obj->Streamer(*resbuf);
1586 if ((resbuf != 0) && (resbuf->
Length() > 0) && (res_ptr != 0) && (res_length != 0)) {
1589 *res_length = resbuf->
Length();
1594 if ((reskind == 1) && res_str) *res_str = res;
1596 if (url.
HasOption(
"_destroy_result_") && (ret_obj != 0) && (ret_cl != 0)) {
1598 if (debug) debug->
Append(
"Destroy result object at the end\n");
1636 std::vector<void*> mem;
1637 std::vector<Long_t> memlen;
1639 if (asjson) str =
"[";
1642 const char*
next = args;
1643 while ((next < ends) && (*next !=
'\n')) next++;
1645 Error(
"ProduceMulti",
"Not enough arguments in POST block");
1649 TString file1(args, next - args);
1657 opt1 = file1(pos+1, file1.
Length() - pos);
1662 pos = file1.
Last(
'/');
1664 path1 = file1(0, pos);
1668 if ((path!=0) && (*path!=0)) path1 =
TString(path) +
"/" + path1;
1675 Produce(path1, file1, opt1, ptr1, len1, str1);
1679 if (ptr1!=0) { str.
Append(
"\"<non-supported binary>\"");
free(ptr1); }
else
1682 if ((str1.
Length()>0) && (ptr1==0)) {
1685 memcpy(ptr1, str1.
Data(), len1);
1687 mem.push_back(ptr1);
1688 memlen.push_back(len1);
1696 for (
unsigned n=0;
n<mem.size();
n++) {
1697 length += 4 + memlen[
n];
1700 char* curr = (
char*) ptr;
1701 for (
unsigned n=0;
n<mem.size();
n++) {
1703 *curr++ = (char) (l & 0xff); l = l >> 8;
1704 *curr++ = (char) (l & 0xff); l = l >> 8;
1705 *curr++ = (char) (l & 0xff); l = l >> 8;
1706 *curr++ = (char) (l & 0xff);
1707 if ((mem[
n]!=0) && (memlen[
n]>0)) memcpy(curr, mem[
n], memlen[n]);
1712 for (
unsigned n=0;
n<mem.size();
n++)
free(mem[
n]);
1723 if ((itemname == 0) || (*itemname == 0))
return kFALSE;
1725 return (strcmp(itemname,
"StreamerInfo") == 0) || (strcmp(itemname,
"StreamerInfo/") == 0);
1735 if ((path == 0) || (*path == 0))
return kFALSE;
1737 if (*path ==
'/') path++;
1741 if ((obj_ptr == 0) || (obj_cl == 0))
return kFALSE;
1744 Info(
"ProduceBinary",
"Non-TObject class not supported");
1761 obj->Streamer(*sbuf);
1801 const char *options,
void *&ptr,
1807 if ((path == 0) || (*path == 0))
return kFALSE;
1808 if (*path ==
'/') path++;
1812 if ((obj_ptr == 0) || (obj_cl == 0))
return kFALSE;
1815 Error(
"TRootSniffer",
"Only derived from TObject classes can be drawn");
1822 if (img == 0)
return kFALSE;
1827 Info(
"TRootSniffer",
"Crate IMAGE directly from pad");
1832 Info(
"TRootSniffer",
"Crate IMAGE from object %s", obj->
GetName());
1834 Int_t width(300), height(200);
1837 if ((options != 0) && (*options != 0)) {
1842 if (w > 10) width =
w;
1844 if (h > 10) height =
h;
1846 if (opt != 0) drawopt = opt;
1854 TCanvas *
c1 =
new TCanvas(
"__online_draw_canvas__",
"title", width, height);
1870 char *png_buffer(0);
1875 if ((png_buffer != 0) && (size > 0)) {
1878 memcpy(ptr, png_buffer, length);
1881 delete [] png_buffer;
1907 if ((file == 0) || (*file == 0))
return kFALSE;
1909 if (strcmp(file,
"root.bin") == 0)
1912 if (strcmp(file,
"root.png") == 0)
1915 if (strcmp(file,
"root.jpeg") == 0)
1918 if (strcmp(file,
"root.gif") == 0)
1921 if (strcmp(file,
"exe.bin") == 0)
1922 return ProduceExe(path, options, 2, 0, &ptr, &length);
1924 if (strcmp(file,
"root.xml") == 0)
1927 if (strcmp(file,
"root.json") == 0)
1931 if (strcmp(file,
"exe.txt") == 0)
1934 if (strcmp(file,
"exe.json") == 0)
1937 if (strcmp(file,
"cmd.json") == 0)
1940 if (strcmp(file,
"item.json") == 0)
1943 if (strcmp(file,
"item.xml") == 0)
1946 if (strcmp(file,
"multi.bin") == 0)
1949 if (strcmp(file,
"multi.json") == 0)
1963 Error(
"RegisterObject",
"Not found top ROOT folder!!!");
1968 if (httpfold == 0) {
1969 if (!force)
return 0;
1970 httpfold = topf->
AddFolder(
"http",
"ROOT http server");
1973 gROOT->GetListOfCleanups()->Add(httpfold);
1979 if (fullname==0)
return httpfold;
1983 if (within_objects && ((path.
Length()==0) || (path[0]!=
'/')))
1989 while (path.Tokenize(tok,from,
"/")) {
1990 if (tok.
Length()==0)
continue;
1993 if (fold == 0)
return 0;
1996 while ((obj =
iter()) != 0) {
2002 if (!force)
return 0;
2003 obj = fold->
AddFolder(tok,
"sub-folder");
2020 return dynamic_cast<TFolder *
> (
GetItem(subfolder, parent, force));
2047 if (f == 0)
return kFALSE;
2063 if (obj == 0)
return kTRUE;
2068 Error(
"UnregisterObject",
"Not found //root/http folder!!!");
2084 if (f == 0)
return kFALSE;
2107 if (parent==0)
return kFALSE;
2110 Info(
"SetField",
"Should be special case for top folder, support later");
2119 if (parent == chld) { last_find = find =
kTRUE; }
2121 while ((obj =
iter()) != 0) {
2123 if (last_find && (obj->GetName()!=0) && !strcmp(name, obj->GetName())) curr = (
TNamed*) obj;
2125 last_find = (obj == chld);
2126 if (last_find) find =
kTRUE;
2127 if (find && !last_find)
break;
2132 if (!find)
return kFALSE;
2140 if (value!=0) { curr->
SetTitle(value); }
2141 else { parent->
Remove(curr);
delete curr; }
2145 curr =
new TNamed(name, value);
2157 Error(
"SetField",
"Fail cast to TList");
2174 if ((fullname==0) || (name==0))
return kFALSE;
2179 if ((parent==0) || (obj==0))
return kFALSE;
2194 if ((parent==0) || (obj==0) || (name==0))
return 0;
2198 if (!
AccessField(parent, obj, name, 0, &field))
return 0;
2200 return field ? field->
GetTitle() : 0;
2209 if (fullname==0)
return 0;
2251 if (strncmp(icon,
"button;", 7) == 0) {
2261 if (strstr(method,nextname.
Data())==0)
break;
2263 }
while (numargs<100);
Bool_t ProduceImage(Int_t kind, const char *path, const char *options, void *&ptr, Long_t &length)
Method to produce image from specified object.
virtual void Append(const TImage *, const char *="+", const char *="#00000000")
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: ...
virtual const char * GetTitle() const
Returns title of object.
const char * item_prop_user
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Bool_t SetResult(void *obj, TClass *cl, TDataMember *member=0)
Obsolete, use SetFoundResult instead.
A TFolder object is a collection of objects and folders.
virtual void WriteString(const char *s)
Write string to I/O buffer.
Bool_t HasOption(const char *key) const
Returns true if the given key appears in the URL options list.
Bool_t CanExploreItem(const char *path)
Method returns true when object has childs or one could try to expand item.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
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.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual TList * GetListOfKeys() const
void BeforeNextChild()
indicates that new child for current element will be started
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
Collectable string class.
ClassImp(TRootSniffer) TRootSniffer
constructor
TMemFile * fMemFile
default path for registered objects
static const EReturnType kOther
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.
Storage of hierarchy scan in TRootSniffer in JSON format.
This class represents a WWW compatible URL.
TString & ReplaceAll(const TString &s1, const TString &s2)
TDataMember * GetResMember() const
virtual void SetName(const char *name)
Change (i.e.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual TList * GetList() const
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
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. ...
virtual void Remove(TObject *obj)
Remove object from this folder. obj must be a TObject or a TFolder.
Short_t GetCycle() const
Return cycle number associated to this key.
if set, only fields for specified item will be set (but all fields)
search for specified item (only objects and collections)
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
Long_t Property() const
Set TObject::fBits and fStreamerType to cache information about the class.
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.
static const EReturnType kLong
1-D histogram with a float per channel (see TH1 documentation)}
Bool_t SetFoundResult(void *obj, TClass *cl, TDataMember *member=0)
Set found element with class and datamember (optional)
virtual const char * GetClassName() const
Bool_t Done() const
Method indicates that scanning can be interrupted while result is set.
Bool_t IsaPointer() const
Return true if data member is a pointer.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
void SetParent(TObject *parent)
Set parent owning this buffer.
void CreateMemFile()
Creates TMemFile instance, which used for objects streaming One could not use TBufferFile directly...
virtual void BeforeNextChild(Int_t, Int_t, Int_t)
void Restrict(const char *path, const char *options)
Restrict access to the specified location.
Each ROOT method (see TMethod) has a linked list of its arguments.
An abstract interface to image processing library.
std::string GetReturnTypeNormalizedName() const
Get the normalized name of the return type.
void MapObject(const TObject *obj, UInt_t offset=1)
Add object to the fMap container.
Bool_t UnregisterObject(TObject *obj)
unregister (remove) object from folders structures folder itself will remain even when it will be emp...
#define ROOT_VERSION_CODE
Int_t fRestriction
list of created items names, need to avoid duplication
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...
Int_t GetMaxIndex(Int_t dim) const
Return maximum index for array dimension "dim".
Abstract interface for storage of hierarchy scan in TRootSniffer.
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
TString fCurrentAllowedMethods
current restriction for last-found object
Bool_t CreateItem(const char *fullname, const char *title)
create item element
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const char * GetArrayIndex() const
If the data member is pointer and has a valid array size in its comments GetArrayIndex returns a stri...
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.
TList * GetListOfRealData() const
static const EReturnType kString
Bool_t IsScanGlobalDir() const
const char * Data() const
const char * item_prop_rootversion
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
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.
const char * GetTrueTypeName() const
Get full type description of data member, e,g.: "class TDirectory*".
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
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
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
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
const char * item_prop_kind
Bool_t ScanOnlyFields() const
std::map< std::string, std::string >::const_iterator iter
Bool_t CanDrawItem(const char *path)
Method verifies if object can be drawn.
const char * item_prop_typename
TFolder * GetSubFolder(const char *foldername, Bool_t force=kFALSE)
creates subfolder where objects can be registered
Int_t GetResRestrict() const
TString & Append(const char *cs)
std::vector< std::vector< double > > Data
virtual void Add(TObject *obj)
Add object to this folder. obj must be a TObject or a TFolder.
Int_t GetIntValueFromOptions(const char *key) const
Return a value for a given key from the URL options as an Int_t, a missing key returns -1...
const char * fSearchPath
defines operation kind
const char * GetDefault() const
Get default value of method argument.
static const EReturnType kDouble
Int_t Atoi() const
Return integer value of string.
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from a folder.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
void * GetPostData() const
Method or function calling interface.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void SetRootClass(TClass *cl)
Mark item with ROOT class and correspondent streamer info.
TFolder * AddFolder(const char *name, const char *title, TCollection *collection=0)
Create a new folder and add it to the list of folders of this folder, return a pointer to the created...
Int_t fNumChilds
number of fields
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual ~TRootSniffer()
destructor
Storage of hierarchy scan in TRootSniffer in XML format.
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...
TRealData * GetRealData(const char *name) const
Return pointer to TRealData element with name "name".
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
const char * item_prop_arraydim
const char * GetTypeName() const
Get type of data member, e,g.: "class TDirectory*" -> "TDirectory".
const char * GetValueFromOptions(const char *key) const
Return a value for a given key from the URL options.
Double_t length(const TVector2 &v)
const char * item_prop_hidden
void SetResult(void *_res, TClass *_rescl, TDataMember *_resmemb, Int_t _res_chld, Int_t restr=0)
set pointer on found element, class and number of childs
void SetExtraHeader(const char *name, const char *value)
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
virtual void WriteStreamerInfo()
Write the list of TStreamerInfo as a single object in this file The class Streamer description for al...
Int_t WriteObject(const T *obj, const char *name, Option_t *option="", Int_t bufsize=0)
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Int_t fLevel
current path searched
const char * item_prop_realname
Collection abstract base class.
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
const char * item_prop_title
Bool_t TestBit(UInt_t f) const
The most important graphics class in the ROOT system.
Bool_t RegisterCommand(const char *cmdname, const char *method, const char *icon)
Register command which can be executed from web interface.
char * Form(const char *fmt,...)
Int_t fNumFields
indicate if node was started
The TRealData class manages the effective list of all data members for a given class.
virtual const char * GetName() const
Returns name of object.
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...
const char * GetUserName() const
static TString ConvertToXML(const TObject *obj, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Converts object, inherited from TObject class, to XML string fmt contains configuration of XML layout...
virtual TList * GetStreamerInfoList()
Read the list of TStreamerInfo objects written to this file.
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
check if there childs, very similar to search
void ScanObjectMembers(TRootSnifferScanRec &rec, TClass *cl, char *ptr)
scripts names, which are add as _autoload parameter to h.json request
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
TRootSnifferScanRec()
number of childs
Bool_t IsReadyForResult() const
Checks if result will be accepted.
virtual Int_t GetLast() const
Returns index of last object in collection.
TString & Remove(Ssiz_t pos)
TList fItemsNames
name of current item
static TObject * ConvertFromXML(const char *str, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Read object from XML, produced by ConvertToXML() method.
virtual Int_t GetSize() const
static const char * GetFloatFormat()
return current printf format for float/double members, default "%e"
virtual const char * GetPrototype() const
Returns the prototype of a function as defined by CINT, or 0 in case of error.
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...
TCollection * GetListOfFolders() const
virtual void WriteLong(Long_t l)
TList * GetListOfMethodArgs()
Return list containing the TMethodArgs of a TFunction.
virtual const char * GetName() const
Returns name of object.
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
expand of specified item - allowed to scan object members
Describe directory structure in memory.
virtual void FromPad(TVirtualPad *, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
virtual void GetImageBuffer(char **, int *, EImageFileTypes=TImage::kPng)
double func(double *x, double *p)
virtual void WriteDouble(Double_t d)
TList * fSinfo
file used to manage streamer infos
static TString ConvertToJSON(const TObject *obj, Int_t compact=0, const char *member_name=0)
converts object, inherited from TObject class, to JSON string
TRootSnifferScanRec * fParent
virtual void CreateNode(Int_t, const char *)
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual void AddAfter(const TObject *after, TObject *obj)
Insert object after object after in the list.
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.
Global functions class (global functions are obtained from CINT).
Int_t GetArrayDim() const
Return number of array dimensions.
mask for actions, only actions copied to child rec
virtual void SetField(Int_t, const char *, const char *, Bool_t)
Int_t IsSTLContainer()
The return type is defined in TDictionary (kVector, kList, etc.)
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.
virtual TObject * ReadObj()
To read a TObject* from the file.
const char * GetFullTypeName() const
Get full type description of method argument, e.g.: "class TDirectory*".
virtual void Add(TObject *obj)
void ScanCollection(TRootSnifferScanRec &rec, TCollection *lst, const char *foldername=0, TCollection *keys_lst=0)
scan collection content
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
Each ROOT class (see TClass) has a linked list of methods.
virtual void CloseNode(Int_t, Int_t)
A Graph is a graphics object made of two arrays X and Y with npoints each.
void SetOptions(const char *opt)
void ParseOptions() const
Parse URL options into a key/value map.
Bool_t fHasMore
object to store results
const char * item_prop_more
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
Bool_t fNodeStarted
indicates that potentially there are more items can be found
virtual TObject * FindObject(const char *name) const
Search object identified by name in the tree of folders inside this folder.
A TTree object has a header with a name and a title.
const char * item_prop_autoload
Long_t GetPostDataLength() const
TDataMember * GetDataMember() const
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
static const EReturnType kNone
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void ScanObjectProperties(TRootSnifferScanRec &rec, TObject *obj)
scans object properties here such fields as _autoload or _icon properties depending on class or objec...
A TTree is a list of TBranches.
void MakeItemName(const char *objname, TString &itemname)
Construct item name, using object name as basis.
Int_t GetResNumChilds() const
Long_t GetThisOffset() const
virtual const char * GetName() const
Returns name of object.
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
TMethod * GetMethodWithPrototype(const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Find the method with a given prototype.
virtual const char * GetTitle() const
Returns title of object.
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
Vc_ALWAYS_INLINE_L T *Vc_ALWAYS_INLINE_R malloc(size_t n)
Allocates memory on the Heap with alignment and padding suitable for vectorized access.
void BuildFullName(TString &buf, TRootSnifferScanRec *prnt=0)
Produces full name for the current item.
Int_t fCurrentRestrict
current http arguments (if any)
const char * GetItemField(TFolder *parent, TObject *item, const char *name)
return field for specified item
Bool_t IsValid() const
Return true if the method call has been properly initialized and is usable.
Ssiz_t First(char c) const
Find first occurrence of a character c.
EReturnType ReturnType()
Returns the return type of the method.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
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
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
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.
TClass * GetResClass() const
static Bool_t IsDrawableClass(TClass *cl)
return true if object can be drawn
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.