128#include "RConfigure.h"
153#define IfDebug(x) if(gDebug==TTabCom::kDebug) x
179 fPrevInterpMarker(0),
180 fpDirectives(nullptr),
185 fpSysIncFiles(nullptr),
438 while (
const auto key = next()) {
440 const char* className = key->GetName();
441 if (!strncmp(className,
"Library.", 8))
444 if (!strstr(className,
".h"))
466 const char* className =
gInterpreter->ClassInfo_FullName(ci);
467 if (strstr(className,
"(anonymous)") || strstr(className,
"(unnamed)"))
512 if (path &&
fpFiles && strcmp(path, previousPath) == 0) {
532 if (!fout)
return nullptr;
551 std::ifstream file1(outf);
553 Error(
"TTabCom::GetListOfEnvVars",
"could not open file \"%s\"",
565 line.ReadToDelim(file1,
'=');
566 file1.ignore(32000,
'\n');
590 return gROOT->GetListOfGlobalFunctions(
true);
647 passwd.open(
"/etc/passwd");
651 passwd.ignore(32000,
'\n');
686 Int_t & nGoodStrings)
688 assert(pList !=
nullptr);
695 Bool_t atLeast1GoodString;
699 atLeast1GoodString =
kFALSE;
703 if ((pObj = next())) {
707 atLeast1GoodString =
kTRUE;
726 if ((pObj = next())) {
734 while (((
int) strlen(s) >= i && s[i] == ch0) ||
735 (atLeast1GoodString && !isGood));
753 assert(dirName !=
nullptr);
754 assert(pList !=
nullptr);
772 if (fileName ==
"." || fileName ==
"..")
814 assert(varName !=
nullptr);
815 IfDebug(std::cerr <<
"DetermineClass(\"" << varName <<
"\");" << std::endl);
820 if (!fout)
return "";
828 cmd =
"gROOT->ProcessLine(\"";
836 gROOT->ProcessLineSync(
".>");
842 std::ifstream file1(outf);
844 Error(
"TTabCom::DetermineClass",
"could not open file \"%s\"",
850 if (!file1 ||
c <= 0 ||
c !=
'(') {
851 Error(
"TTabCom::DetermineClass",
"variable \"%s\" not defined?",
855 IfDebug(std::cerr << (
char)
c << std::flush);
861 if (
type ==
"const" ||
type ==
"class") {
865 IfDebug(std::cerr << (
char)
c << std::flush);
869 type.ReadToDelim(file1,
')');
874 if (
type.EndsWith(
" *const"))
877 if (
type.BeginsWith(
"const "))
879 if (
type.BeginsWith(
"volatile "))
900 const char *fignore =
gEnv->
GetValue(
"TabCom.FileIgnore", (
char *)
nullptr);
906 std::istringstream endings((
char *) fignore);
908 std::istrstream endings((
char *) fignore);
914 while (!ending.
IsNull()) {
977 if (!fout)
return "";
982 std::ifstream file1(outf);
984 Error(
"TTabCom::GetSysIncludePath",
"could not open file \"%s\"",
996 if (!token.IsNull()) {
999 path.
Append(token.Data() + 2);
1011 TString sCINTSYSDIR(
"$ROOTSYS/cint");
1013 TString sCINTSYSDIR(CINTINCDIR);
1015 path.
Append(
":" + sCINTSYSDIR +
"/include");
1019 path.
Append(
":/usr/include");
1057 assert(path1 !=
nullptr);
1058 if (!path1[0]) path1 =
".";
1062 std::istringstream path((
char *) path1);
1064 std::istrstream path((
char *) path1);
1074 IfDebug(std::cerr <<
"NewListOfFilesInPath(): dirName = " << dirName <<
1096 char c1 = (fileName.
Length() > 0) ? fileName[0] : 0;
1129 const Int_t kNotDefined = -2;
1130 static Int_t old_level = kNotDefined;
1134 if (old_level == kNotDefined) {
1135 std::cerr <<
"NoMsg(): ERROR 1. old_level==" << old_level << std::endl;
1140 old_level = kNotDefined;
1143 if (old_level != kNotDefined) {
1144 std::cerr <<
"NoMsg(): ERROR 2. old_level==" << old_level << std::endl;
1171 const char appendage[],
1183 IfDebug(std::cerr <<
"TTabCom::Complete() ..." << std::endl);
1184 assert(
fpLoc !=
nullptr);
1185 assert(pListOfCandidates !=
nullptr);
1188 const int loc = *
fpLoc;
1204 int start = s2.
Index(re);
1206 IfDebug(std::cerr <<
" s1: " <<
s1 << std::endl);
1207 IfDebug(std::cerr <<
" s2: " << s2 << std::endl);
1208 IfDebug(std::cerr <<
" s3: " << s3 << std::endl);
1209 IfDebug(std::cerr <<
"start: " << start << std::endl);
1210 IfDebug(std::cerr << std::endl);
1216 TList listOfMatches;
1217 TList listOfFullPaths;
1223 TIter next_candidate(pListOfCandidates);
1224 TIter next_match(&listOfMatches);
1225 TIter next_fullpath(&listOfFullPaths);
1228 while ((pObj = next_candidate())) {
1230 const char *s4 = pObj->
GetName();
1232 assert(s4 !=
nullptr);
1235 const char *s5 = strrchr(s4,
'/');
1247 IfDebug(std::cerr <<
"adding " << s5 <<
'\t' << s4 << std::endl);
1255 IfDebug(std::cerr <<
"adding " << s5 <<
'\t' << s4 << std::endl);
1271 if (nMatches == 0) {
1280 if (nMatches == 1) {
1282 const char *short_name = next_match()->GetName();
1283 const char *full_name = next_fullpath()->GetName();
1285 pObj = pListOfCandidates->
FindObject(short_name);
1287 IfDebug(std::cerr << std::endl <<
"class: " << pObj->
ClassName() << std::endl);
1290 else if (className ==
"TMethod" || className ==
"TFunction") {
1296 }
else if (className ==
"TDataMember") {
1301 CopyMatch(match,
sizeof(match), short_name, appendage, full_name);
1310 IfDebug(std::cerr <<
" i=" << i <<
" ch=" << ch << std::endl);
1318 if (nGoodStrings == 1) {
1322 s = next_match()->GetName();
1323 s0 = next_fullpath()->GetName();
1328 CopyMatch(match,
sizeof(match), s, appendage,
s0);
1330 IfDebug(std::cerr <<
"more than 1 GoodString" << std::endl);
1341 IfDebug(std::cerr <<
"printing ambiguous matches" << std::endl);
1342 std::set<std::string> alreadyPrinted;
1343 while ((pObj = next_match())) {
1345 if (alreadyPrinted.insert(s).second) {
1347 s0 = next_fullpath()->GetName();
1350 out << s <<
"/" << std::endl;
1352 out << s << std::endl;
1373 const int old_len = strlen(
fBuf);
1374 const int match_len = strlen(match);
1375 const int added_len = match_len - (loc - start);
1378 if (old_len + added_len + 1 >
BUF_SIZE || start > loc || start + match_len + 1 >
BUF_SIZE) {
1379 Error(
"TTabCom::Complete",
"buffer overflow");
1384 IfDebug(std::cerr <<
" i=" << old_len << std::endl);
1385 IfDebug(std::cerr <<
" L=" << added_len << std::endl);
1386 IfDebug(std::cerr <<
"loc=" << loc << std::endl);
1389 for (
int i = old_len; i >= loc; i -= 1) {
1394 memcpy(
fBuf + start, match, match_len);
1407 *
fpLoc = loc + added_len;
1422 const char *localName,
1423 const char *appendage,
1424 const char *fullName)
const
1435 assert(
dest !=
nullptr);
1436 assert(localName !=
nullptr);
1439 strlcpy(
dest, localName, dest_len);
1441 const char *key =
"filename";
1442 const int key_len = strlen(key);
1444 IfDebug(std::cerr <<
"CopyMatch()." << std::endl);
1445 IfDebug(std::cerr <<
"localName: " << (localName ? localName :
"0") <<
1447 IfDebug(std::cerr <<
"appendage: " << (appendage ? appendage :
"0") <<
1449 IfDebug(std::cerr <<
" fullName: " << (fullName ? fullName :
"0") <<
1454 if (appendage && strncmp(appendage, key, key_len) == 0) {
1456 appendage += key_len;
1457 IfDebug(std::cerr <<
"new appendage: " << appendage << std::endl);
1460 strlcat(
dest,
"/", dest_len);
1463 strlcat(
dest, appendage, dest_len);
1467 strlcat(
dest, appendage, dest_len);
1476 assert(
fBuf !=
nullptr);
1481 for (
int context = 0; context <
kNUM_PAT; ++context) {
1484 IfDebug(std::cerr << std::endl
1485 <<
"context=" << context <<
" "
1486 <<
"RegExp=" <<
fRegExp[context]
1499 const char defaultPath[])
const
1505 if (end>0 && path[end]!=
'/' && path[end]!=
'\\') {
1510 TString newBase, extendedPath;
1513 if (fileName[end] !=
'/' && fileName[end] !=
'\\') {
1518 extendedPath =
ExtendPath(defaultPath, newBase);
1521 extendedPath = defaultPath;
1523 IfDebug(std::cerr << std::endl);
1524 IfDebug(std::cerr <<
" fileName: " << fileName << std::endl);
1525 IfDebug(std::cerr <<
" pathBase: " << newBase << std::endl);
1527 IfDebug(std::cerr <<
" defaultPath: " << defaultPath << std::endl);
1529 IfDebug(std::cerr <<
" defaultPath: " << std::endl);
1531 IfDebug(std::cerr <<
"extendedPath: " << extendedPath << std::endl);
1532 IfDebug(std::cerr << std::endl);
1534 return extendedPath;
1546 std::stringstream str;
1552 if (originalPath) str << originalPath;
1589 const char dummy[] =
".";
1597 std::cerr << std::endl <<
"tab completion not implemented for this context" <<
1606 pos =
Complete(
"[^~]*$", pListOfUsers,
"/", out);
1613 pos =
Complete(
"[^$]*$", pEnv,
"", out);
1621 const TString fileName = s3(
"[^ ><]*$");
1627 pos =
Complete(
"[^ /]*$", pListOfFiles,
"filename ", out);
1636 const TString fileName = s3(
"[^ ]*$");
1643 pos =
Complete(
"[^ /]*$", pListOfFiles,
"filename ", out);
1654 TString fileName = s3(
"[^<]*$");
1672 const TString fileName = s3(
"[^\"]*$");
1678 pos =
Complete(
"[^\"/]*$", pListOfFiles,
"filename\" ", out);
1690 const TString fileName = s3(
"[^\"]*$");
1695 pos =
Complete(
"[^\"/]*$", pListOfFiles,
"filename\");", out);
1701 const TString fileName = s3(
"[^ \"]*$");
1705 pos =
Complete(
"[^\" /]*$", pListOfFiles,
"filename\"", out);
1717 IfDebug(std::cerr << std::endl);
1718 IfDebug(std::cerr <<
"name: " <<
'"' <<
name <<
'"' << std::endl);
1723 TString partname = s3(
"[_a-zA-Z][_a-zA-Z0-9]*$");
1734 TString sym = str(
"[_a-zA-Z][_a-zA-Z0-9]*::$");
1738 prefix = sym + prefix;
1744 TString sym = prefix(
"[_a-zA-Z][_a-zA-Z0-9]*::$");
1747 IfDebug(std::cerr <<
"prefix: " <<
'"' << prefix <<
'"' << std::endl);
1748 IfDebug(std::cerr <<
"preprefix: " <<
'"' << preprefix <<
'"' << std::endl);
1751 if (namesp.
Length() >= 2)
1753 IfDebug(std::cerr <<
"namesp: " <<
'"' << namesp <<
'"' << std::endl);
1765 for (i = 0; i < tmp->GetSize(); i++) {
1789 pos =
Complete(
"[^: ]*$", pList,
"", out);
1793 if (context != original_context)
1813 IfDebug(std::cerr << std::endl);
1814 IfDebug(std::cerr <<
"name: " <<
'"' <<
name <<
'"' << std::endl);
1824 Fatal(
"TTabCom::Hook",
"Conext case %d not handled",context);
1840 int* store_fpLoc =
fpLoc;
1841 char* store_fBuf =
fBuf;
1842 pos =
Complete(
"[^. ]*$", pList,
"(", out);
1844 fpLoc = store_fpLoc;
1851 pos =
Complete(
"[^> ]*$", pList,
"(", out);
1854 Fatal(
"TTabCom::Hook",
"Conext case %d not handled",context);
1860 if (context != original_context)
1874 IfDebug(std::cerr << std::endl);
1875 IfDebug(std::cerr <<
"name: " <<
'"' <<
name <<
'"' << std::endl);
1880 TString partname = s3(
"[_a-zA-Z][_a-zA-Z0-9]* *($");
1891 TString sym = str(
"[_a-zA-Z][_a-zA-Z0-9]*::$");
1895 prefix = sym + prefix;
1901 TString sym = prefix(
"[_a-zA-Z][_a-zA-Z0-9]*::$");
1904 IfDebug(std::cerr <<
"prefix: " <<
'"' << prefix <<
'"' << std::endl);
1905 IfDebug(std::cerr <<
"preprefix: " <<
'"' << preprefix <<
'"' << std::endl);
1916 methodName = s3(
"[^:>\\.(]*($");
1920 IfDebug(std::cerr << methodName << std::endl);
1928 TIter nextMethod(pList);
1930 while ((pMethod = (
TMethod *) nextMethod())) {
1931 if (methodName == pMethod->
GetName()) {
1937 if (comment && comment[0] !=
'\0') {
1938 out <<
" \t// " << comment;
1955 if (context != original_context)
1971 name = s3(
"[_a-zA-Z][_a-zA-Z0-9:]* *($", 3);
1976 name = s3(
"^[_a-zA-Z][_a-zA-Z0-9:]*");
1979 IfDebug(std::cerr << std::endl);
1980 IfDebug(std::cerr <<
"name: " <<
'"' <<
name <<
'"' << std::endl);
2002 Fatal(
"TTabCom::Hook",
"Conext case %d not handled",context);
2013 methodName =
name(
"[_a-zA-Z][_a-zA-Z0-9]*$");
2016 methodName = s3(
"[^:>\\.(]*($");
2020 IfDebug(std::cerr << methodName << std::endl);
2028 TIter nextMethod(pList);
2030 while ((pMethod = (
TMethod *) nextMethod())) {
2031 if (methodName == pMethod->
GetName()) {
2037 if (comment && comment[0] !=
'\0') {
2038 out <<
" \t// " << comment;
2055 if (context != original_context)
2066 if (l2 > l3 && s2[l2 - l3 - 1] ==
'.') {
2067 std::cerr << std::endl <<
2068 "tab completion not implemented for this context" << std::endl;
2072 if (l2 > l3 + 1 && s2(l2 - l3 - 2, 2) ==
"->") {
2073 std::cerr << std::endl <<
2074 "tab completion not implemented for this context" << std::endl;
2081 if (pL2) pList->
AddAll(pL2);
2085 if (pC1) pList->
AddAll(pC1);
2088 if (pC3) pList->
AddAll(pC3);
2090 pos =
Complete(
"[_a-zA-Z][_a-zA-Z0-9]*$", pList,
"", out);
2099 TString functionName = s3(
"[_a-zA-Z][_a-zA-Z0-9]*");
2100 IfDebug(std::cerr << functionName << std::endl);
2105 while ((pObj = nextGlobalFunc())) {
2106 if (strcmp(pObj->
GetName(), functionName) == 0) {
2107 listOfMatchingGlobalFuncs.
Add(pObj);
2111 if (listOfMatchingGlobalFuncs.
IsEmpty()) {
2112 std::cerr << std::endl <<
"no such function: " <<
dblquote(functionName)
2115 TIter next(&listOfMatchingGlobalFuncs);
2117 while ((pFunction = (
TFunction *) next())) {
2119 <<
" " << pFunction->
GetName()
2135 Fatal(
"TTabCom::Hook",
"Conext case %d not handled",context);
2184 "[_a-zA-Z][_a-zA-Z0-9:]* +[_a-zA-Z][_a-zA-Z0-9]* *($");
2186 "[_a-zA-Z][_a-zA-Z0-9]* *:: *[_a-zA-Z0-9]* *($");
2188 "[_a-zA-Z][_a-zA-Z0-9()]* *\\. *[_a-zA-Z0-9]* *($");
2190 "[_a-zA-Z][_a-zA-Z0-9()]* *-> *[_a-zA-Z0-9]* *($");
2193 "[_a-zA-Z][_a-zA-Z0-9]* *:: *[_a-zA-Z0-9]*$");
2195 "[_a-zA-Z][_a-zA-Z0-9()]* *\\. *[_a-zA-Z0-9()]*$");
2198 "[_a-zA-Z][_a-zA-Z0-9()]* *-> *[_a-zA-Z0-9()]*$");
2221 Error(
"TTabCom::MakeClassFromClassName",
"Unknown class \"%s\"", className);
2231 Error(
"TTabCom::MakeClassFromClassName",
"class \"%s\" is not defined.", className);
2279 (
gROOT->FindObject(varName) !=
nullptr);
2285 if (0) printf(
"varName is [%s] with iteration [%i]\n", varName, iter);
2291 if (!varName_exists && cut != 0)
2299 parentName[cut] = 0;
2300 if (0) printf(
"Parent string is [%s]\n", parentName.
Data());
2306 for(
Int_t i = cut-1; i>=0; --i) {
2307 switch (parentName[i]) {
2311 parentName = parentName(i+1,cut-i-1);
2323 if (varName[cut] ==
'.') {
2324 memberName = varName+cut+1;
2325 if (0) printf(
"Member/method is [%s]\n", memberName.
Data());
2329 memberName = varName+cut+2;
2330 if (0) printf(
"Member/method is [%s]\n", memberName.
Data());
2335 if (0) printf(
"I got [%s] from MakeClassFromVarName()\n", pclass->
GetName());
2339 if (0) printf(
"Variable [%s] exists!\n", parentName.
Data());
2342 if (iter == 0)
return pclass;
2344 if (0) printf(
"Trying data member [%s] of class [%s] ...\n",
2351 if (memberName == dmptr->
GetName())
break;
2355 if (0) printf(
"It's a member!\n");
2368 char *parentesis_ptr = (
char*)strrchr(memberName.
Data(),
'(');
2369 if (parentesis_ptr) *parentesis_ptr = 0;
2372 if (0) printf(
"Trying method [%s] of class [%s] ...\n",
2379 while ((mptr = (
TMethod *) next())) {
2380 if (strcmp(memberName.
Data(),mptr->
GetName())==0)
break;
2386 if (0) printf(
"It's a method called [%s] with return type [%s]\n",
2387 memberName.
Data(), returnName.
Data());
2390 if (returnName[returnName.
Length()-1] ==
'*')
2392 returnName[returnName.
Length()-1] = 0;
2412 if (!varName_exists) {
2413 std::cerr << std::endl <<
"variable " <<
dblquote(varName) <<
" not defined."
2429 if (className.
IsNull() || className ==
"*") {
2433 std::cerr << std::endl <<
"problem determining class of " <<
dblquote(varName)
2443 className[className.
Length()-1] = 0;
2472 Fatal(
"TTabCom::MakeClassFromVarName",
"Conext case %d not handled",context);
2478 for (i = *
fpLoc;
fBuf[i] !=
'.'; i -= 1) {
2481 for (i = strlen(
fBuf); i >= loc; i -= 1) {
2485 fBuf[loc + 1] =
'>';
2489 std::cerr << std::endl <<
dblquote(varName) <<
2490 " is of pointer type. Use this operator: ->" << std::endl;
2499 if (className[className.
Length() - 1] ==
'*') {
2500 std::cerr << std::endl <<
"can't handle pointers to pointers." << std::endl;
2519 Fatal(
"TTabCom::MakeClassFromVarName",
"Conext case %d not handled",context);
2525 for (i = *
fpLoc;
fBuf[i - 1] !=
'-' &&
fBuf[i] !=
'>'; i -= 1) {
2529 for (; i <
len; i += 1) {
2535 std::cerr << std::endl <<
dblquote(varName) <<
2536 " is not of pointer type. Use this operator: ." << std::endl;
2553 std::cerr << std::endl
2555 << (
int) handle <<
" >= kNUM_PAT=" << (
int)
kNUM_PAT << std::endl;
2574 if (start > (
int)strlen(var_str)) start = strlen(var_str);
2576 for (
int i = start; i > 0; i--)
2578 if (var_str[i] ==
'.')
return i;
2579 if (var_str[i] ==
'>' && i > 0 && var_str[i-1] ==
'-')
return i-1;
int Makepat(const char *, Pattern_t *, int)
Make a pattern template from the string pointed to by exp.
const char * Matchs(const char *, size_t len, const Pattern_t *, const char **)
Match a string with a pattern.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Int_t gErrorIgnoreLevel
Error handling routines.
void Fatal(const char *location, const char *msgfmt,...)
Use this function in case of a fatal error. It will abort the program.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN TInterpreter * gCling
Bool_t R_ISDIR(Int_t mode)
R__EXTERN TSystem * gSystem
static char * Next()
Returns next class from sorted class table.
TClass instances represent classes, structs and namespaces in the ROOT type system.
const TList * GetListOfAllPublicMethods(Bool_t load=kTRUE)
Returns a list of all public methods of this class and its base classes.
TList * GetListOfAllPublicDataMembers(Bool_t load=kTRUE)
Returns a list of all public data members of this class and its base classes.
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.
Collection abstract base class.
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
virtual Bool_t IsEmpty() const
void Delete(Option_t *option="") override=0
Delete this object.
Bool_t Contains(const char *name) const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
All ROOT classes may have RTTI (run time type identification) support added.
const char * GetTypeName() const
Get the decayed type name of this data member, removing const and volatile qualifiers,...
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Global functions class (global functions are obtained from CINT).
const char * GetSignature()
Return signature of function.
Int_t GetNargs() const
Number of function arguments.
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
virtual int DisplayIncludePath(FILE *) const
void Add(TObject *obj) override
Each ROOT class (see TClass) has a linked list of methods.
virtual const char * GetCommentString()
Returns a comment string from the class declaration.
const char * GetName() const override
Returns name of object.
Collectable string class.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
static const char * GetMacroPath()
Get macro search path. Static utility function.
Regular expression class.
Sequenceable collection abstract base class.
void Add(TObject *obj) override
std::istream & ReadToDelim(std::istream &str, char delim='\n')
Read up to an EOF, or a delimiting character, whichever comes first.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Prepend(const char *cs)
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual FILE * TempFileName(TString &base, const char *dir=nullptr, const char *suffix=nullptr)
Create a secure temporary file by appending a unique 6 letter string to base.
void Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE)
Beep for duration milliseconds with a tone of frequency freq.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual const char * GetDynamicPath()
Return the dynamic path (used to find shared libraries).
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
virtual int Unlink(const char *name)
Unlink, i.e.
static void NoMsg(Int_t errorLevel)
[static utility function]/////////////////////////////
const TSeqCollection * GetListOfCppDirectives()
Return the list of CPP directives.
Int_t Hook(char *buf, int *pLoc, std::ostream &out)
[private]
ULong64_t fPrevInterpMarker
void ClearFiles()
Close all files.
static TString DetermineClass(const char varName[])
[static utility function]/////////////////////////////
static Bool_t ExcludedByFignore(TString s)
[static utility function]/////////////////////////////
void InitPatterns()
[private]
void CopyMatch(char *dest, int dest_len, const char *localName, const char *appendage=nullptr, const char *fullName=nullptr) const
[private]
void RehashEnvVars()
Environemnt variables rehashing.
const TSeqCollection * GetListOfSysIncFiles()
Return the list of system include files.
void ClearAll()
clears all lists except for user names and system include files.
TSeqCollection * fpDirectives
const TSeqCollection * GetListOfFilesInPath(const char path[])
"path" should be initialized with a colon separated list of system directories
TSeqCollection * fpClasses
TSeqCollection * fpEnvVars
void ClearSysIncFiles()
Close system files.
const TSeqCollection * GetListOfEnvVars()
Uses "env" (Unix) or "set" (Windows) to get list of environment variables.
TString DeterminePath(const TString &fileName, const char defaultPath[]) const
[private]
const TSeqCollection * GetListOfPragmas()
Return the list of pragmas.
static TSeqCollection * NewListOfFilesInPath(const char path[])
[static utility function]/////////////////////////////
TClass * MakeClassFromVarName(const char varName[], EContext_t &context, int iter=0)
[private] (does some specific error handling that makes the function unsuitable for general use....
const TSeqCollection * GetListOfGlobals()
Return the list of globals.
void SetPattern(EContext_t handle, const char regexp[])
[private]
TSeqCollection * fpSysIncFiles
void RehashGlobals()
Reload globals.
TClass * MakeClassFromClassName(const char className[]) const
[private] (does some specific error handling that makes the function unsuitable for general use....
void RehashGlobalFunctions()
Reload global functions.
void ClearGlobalFunctions()
Forget all global functions seen so far.
void ClearPragmas()
Forget all pragmas seen so far.
static Bool_t PathIsSpecifiedInFileName(const TString &fileName)
[static utility function]/////////////////////////////
TString ExtendPath(const char originalPath[], TString newBase) const
[private]
TTabCom()
Default constructor.
void RehashPragmas()
Reload pragmas.
const TSeqCollection * GetListOfClasses()
Return the list of classes.
void RehashCppDirectives()
Cpp rehashing.
void RehashUsers()
Reload users.
const TSeqCollection * GetListOfUsers()
reads from "/etc/passwd"
static void AppendListOfFilesInDirectory(const char dirName[], TSeqCollection *pList)
[static utility function]/////////////////////////////
void ClearClasses()
Clear classes and namespace collections.
TSeqCollection * fpPragmas
Int_t Complete(const TRegexp &re, const TSeqCollection *pListOfCandidates, const char appendage[], std::ostream &out, TString::ECaseCompare cmp=TString::kExact)
[private]
const char * fRegExp[kNUM_PAT]
int ParseReverse(const char *var_str, int start)
Returns the place in the string where to put the \0, starting the search from "start".
TCollection * GetListOfGlobalFunctions()
Return the list of global functions.
void RehashSysIncFiles()
Reload system include files.
static Bool_t IsDirectory(const char fileName[])
[static utility function]/////////////////////////////
EContext_t DetermineContext() const
[private]
static TString GetSysIncludePath()
[static utility function]/////////////////////////////
void ClearEnvVars()
Forget all environment variables seen so far.
void ClearCppDirectives()
Forget all Cpp directives seen so far.
void ClearGlobals()
Forget all global variables seen so far.
void ClearUsers()
Forget all user seen so far.
void RehashAll()
clears and then rebuilds all lists except for user names and system include files.
void RehashFiles()
Close files.
TClass * TryMakeClassFromClassName(const char className[]) const
Same as above but does not print the error message.
Pattern_t fPat[kNUM_PAT][1024]
void RehashClasses()
Do the class rehash.
static Char_t AllAgreeOnChar(int i, const TSeqCollection *pList, Int_t &nGoodStrings)
[static utility function]///////////////////////////////////////////