128#include "RConfigure.h"
153#define IfDebug(x) if(gDebug==TTabCom::kDebug) x
437 while (
const auto key = next()) {
439 const char* className = key->GetName();
440 if (!strncmp(className,
"Library.", 8))
443 if (!strstr(className,
".h"))
465 const char* className =
gInterpreter->ClassInfo_FullName(ci);
466 if (strstr(className,
"(anonymous)") || strstr(className,
"(unnamed)"))
511 if (path &&
fpFiles && strcmp(path, previousPath) == 0) {
530 FILE *fout =
gSystem->TempFileName(outf);
531 if (!fout)
return nullptr;
550 std::ifstream file1(outf);
552 Error(
"TTabCom::GetListOfEnvVars",
"could not open file \"%s\"",
564 line.ReadToDelim(file1,
'=');
565 file1.ignore(32000,
'\n');
589 return gROOT->GetListOfGlobalFunctions(
true);
646 passwd.open(
"/etc/passwd");
650 passwd.ignore(32000,
'\n');
685 Int_t & nGoodStrings)
687 assert(pList !=
nullptr);
694 Bool_t atLeast1GoodString;
698 atLeast1GoodString =
kFALSE;
702 if ((pObj = next())) {
706 atLeast1GoodString =
kTRUE;
725 if ((pObj = next())) {
733 while (((
int) strlen(s) >= i && s[i] == ch0) ||
734 (atLeast1GoodString && !isGood));
752 assert(dirName !=
nullptr);
753 assert(pList !=
nullptr);
756 void *dir =
gSystem->OpenDirectory(dirName);
767 while ((tmp_ptr =
gSystem->GetDirEntry(dir))) {
771 if (fileName ==
"." || fileName ==
"..")
813 assert(varName !=
nullptr);
814 IfDebug(std::cerr <<
"DetermineClass(\"" << varName <<
"\");" << std::endl);
818 FILE *fout =
gSystem->TempFileName(outf);
819 if (!fout)
return "";
827 cmd =
"gROOT->ProcessLine(\"";
835 gROOT->ProcessLineSync(
".>");
841 std::ifstream file1(outf);
843 Error(
"TTabCom::DetermineClass",
"could not open file \"%s\"",
849 if (!file1 ||
c <= 0 ||
c !=
'(') {
850 Error(
"TTabCom::DetermineClass",
"variable \"%s\" not defined?",
854 IfDebug(std::cerr << (
char)
c << std::flush);
860 if (type ==
"const" || type ==
"class") {
864 IfDebug(std::cerr << (
char)
c << std::flush);
869 IfDebug(std::cerr << type << std::endl);
899 const char *fignore =
gEnv->GetValue(
"TabCom.FileIgnore", (
char *)
nullptr);
905 std::istringstream endings((
char *) fignore);
907 std::istrstream endings((
char *) fignore);
913 while (!ending.
IsNull()) {
975 FILE *fout =
gSystem->TempFileName(outf);
976 if (!fout)
return "";
977 gCling->DisplayIncludePath(fout);
981 std::ifstream file1(outf);
983 Error(
"TTabCom::GetSysIncludePath",
"could not open file \"%s\"",
995 if (!token.IsNull()) {
998 path.
Append(token.Data() + 2);
1010 TString sCINTSYSDIR(
"$ROOTSYS/cint");
1012 TString sCINTSYSDIR(CINTINCDIR);
1014 path.
Append(
":" + sCINTSYSDIR +
"/include");
1018 path.
Append(
":/usr/include");
1037 if (!
gSystem->GetPathInfo(fileName, stat))
1056 assert(path1 !=
nullptr);
1057 if (!path1[0]) path1 =
".";
1061 std::istringstream path((
char *) path1);
1063 std::istrstream path((
char *) path1);
1073 IfDebug(std::cerr <<
"NewListOfFilesInPath(): dirName = " << dirName <<
1095 char c1 = (fileName.
Length() > 0) ? fileName[0] : 0;
1128 const Int_t kNotDefined = -2;
1129 static Int_t old_level = kNotDefined;
1133 if (old_level == kNotDefined) {
1134 std::cerr <<
"NoMsg(): ERROR 1. old_level==" << old_level << std::endl;
1139 old_level = kNotDefined;
1142 if (old_level != kNotDefined) {
1143 std::cerr <<
"NoMsg(): ERROR 2. old_level==" << old_level << std::endl;
1170 const char appendage[],
1182 IfDebug(std::cerr <<
"TTabCom::Complete() ..." << std::endl);
1183 assert(
fpLoc !=
nullptr);
1184 assert(pListOfCandidates !=
nullptr);
1187 const int loc = *
fpLoc;
1205 IfDebug(std::cerr <<
" s1: " <<
s1 << std::endl);
1206 IfDebug(std::cerr <<
" s2: " << s2 << std::endl);
1207 IfDebug(std::cerr <<
" s3: " << s3 << std::endl);
1209 IfDebug(std::cerr << std::endl);
1215 TList listOfMatches;
1216 TList listOfFullPaths;
1222 TIter next_candidate(pListOfCandidates);
1223 TIter next_match(&listOfMatches);
1224 TIter next_fullpath(&listOfFullPaths);
1227 while ((pObj = next_candidate())) {
1229 const char *s4 = pObj->
GetName();
1231 assert(s4 !=
nullptr);
1234 const char *s5 = strrchr(s4,
'/');
1246 IfDebug(std::cerr <<
"adding " << s5 <<
'\t' << s4 << std::endl);
1254 IfDebug(std::cerr <<
"adding " << s5 <<
'\t' << s4 << std::endl);
1270 if (nMatches == 0) {
1279 if (nMatches == 1) {
1281 const char *short_name = next_match()->GetName();
1282 const char *full_name = next_fullpath()->GetName();
1284 pObj = pListOfCandidates->
FindObject(short_name);
1286 IfDebug(std::cerr << std::endl <<
"class: " << pObj->
ClassName() << std::endl);
1289 else if (className ==
"TMethod" || className ==
"TFunction") {
1295 }
else if (className ==
"TDataMember") {
1300 CopyMatch(match,
sizeof(match), short_name, appendage, full_name);
1309 IfDebug(std::cerr <<
" i=" << i <<
" ch=" << ch << std::endl);
1317 if (nGoodStrings == 1) {
1321 s = next_match()->GetName();
1322 s0 = next_fullpath()->GetName();
1327 CopyMatch(match,
sizeof(match), s, appendage,
s0);
1329 IfDebug(std::cerr <<
"more than 1 GoodString" << std::endl);
1340 IfDebug(std::cerr <<
"printing ambiguous matches" << std::endl);
1341 std::set<std::string> alreadyPrinted;
1342 while ((pObj = next_match())) {
1344 if (alreadyPrinted.insert(s).second) {
1346 s0 = next_fullpath()->GetName();
1349 out << s <<
"/" << std::endl;
1351 out << s << std::endl;
1372 const int old_len = strlen(
fBuf);
1373 const int match_len = strlen(match);
1374 const int added_len = match_len - (loc -
start);
1378 Error(
"TTabCom::Complete",
"buffer overflow");
1383 IfDebug(std::cerr <<
" i=" << old_len << std::endl);
1384 IfDebug(std::cerr <<
" L=" << added_len << std::endl);
1385 IfDebug(std::cerr <<
"loc=" << loc << std::endl);
1388 for (
int i = old_len; i >= loc; i -= 1) {
1406 *
fpLoc = loc + added_len;
1421 const char *localName,
1422 const char *appendage,
1423 const char *fullName)
const
1434 assert(dest !=
nullptr);
1435 assert(localName !=
nullptr);
1438 strlcpy(dest, localName, dest_len);
1440 const char *key =
"filename";
1441 const int key_len = strlen(key);
1443 IfDebug(std::cerr <<
"CopyMatch()." << std::endl);
1444 IfDebug(std::cerr <<
"localName: " << (localName ? localName :
"0") <<
1446 IfDebug(std::cerr <<
"appendage: " << (appendage ? appendage :
"0") <<
1448 IfDebug(std::cerr <<
" fullName: " << (fullName ? fullName :
"0") <<
1453 if (appendage && strncmp(appendage, key, key_len) == 0) {
1455 appendage += key_len;
1456 IfDebug(std::cerr <<
"new appendage: " << appendage << std::endl);
1459 strlcat(dest,
"/", dest_len);
1462 strlcat(dest, appendage, dest_len);
1466 strlcat(dest, appendage, dest_len);
1475 assert(
fBuf !=
nullptr);
1480 for (
int context = 0; context <
kNUM_PAT; ++context) {
1483 IfDebug(std::cerr << std::endl
1484 <<
"context=" << context <<
" "
1485 <<
"RegExp=" <<
fRegExp[context]
1498 const char defaultPath[])
const
1502 gSystem->ExpandPathName(path);
1504 if (end>0 && path[end]!=
'/' && path[end]!=
'\\') {
1505 path =
gSystem->GetDirName(path);
1509 TString newBase, extendedPath;
1512 if (fileName[end] !=
'/' && fileName[end] !=
'\\') {
1513 newBase =
gSystem->GetDirName(fileName);
1517 extendedPath =
ExtendPath(defaultPath, newBase);
1520 extendedPath = defaultPath;
1522 IfDebug(std::cerr << std::endl);
1523 IfDebug(std::cerr <<
" fileName: " << fileName << std::endl);
1524 IfDebug(std::cerr <<
" pathBase: " << newBase << std::endl);
1526 IfDebug(std::cerr <<
" defaultPath: " << defaultPath << std::endl);
1528 IfDebug(std::cerr <<
" defaultPath: " << std::endl);
1530 IfDebug(std::cerr <<
"extendedPath: " << extendedPath << std::endl);
1531 IfDebug(std::cerr << std::endl);
1533 return extendedPath;
1545 std::stringstream str;
1551 if (originalPath) str << originalPath;
1588 const char dummy[] =
".";
1596 std::cerr << std::endl <<
"tab completion not implemented for this context" <<
1605 pos =
Complete(
"[^~]*$", pListOfUsers,
"/", out);
1612 pos =
Complete(
"[^$]*$", pEnv,
"", out);
1620 const TString fileName = s3(
"[^ ><]*$");
1626 pos =
Complete(
"[^ /]*$", pListOfFiles,
"filename ", out);
1635 const TString fileName = s3(
"[^ ]*$");
1642 pos =
Complete(
"[^ /]*$", pListOfFiles,
"filename ", out);
1653 TString fileName = s3(
"[^<]*$");
1671 const TString fileName = s3(
"[^\"]*$");
1677 pos =
Complete(
"[^\"/]*$", pListOfFiles,
"filename\" ", out);
1689 const TString fileName = s3(
"[^\"]*$");
1694 pos =
Complete(
"[^\"/]*$", pListOfFiles,
"filename\");", out);
1700 const TString fileName = s3(
"[^ \"]*$");
1704 pos =
Complete(
"[^\" /]*$", pListOfFiles,
"filename\"", out);
1716 IfDebug(std::cerr << std::endl);
1717 IfDebug(std::cerr <<
"name: " <<
'"' <<
name <<
'"' << std::endl);
1722 TString partname = s3(
"[_a-zA-Z][_a-zA-Z0-9]*$");
1733 TString sym = str(
"[_a-zA-Z][_a-zA-Z0-9]*::$");
1737 prefix = sym + prefix;
1743 TString sym = prefix(
"[_a-zA-Z][_a-zA-Z0-9]*::$");
1746 IfDebug(std::cerr <<
"prefix: " <<
'"' << prefix <<
'"' << std::endl);
1747 IfDebug(std::cerr <<
"preprefix: " <<
'"' << preprefix <<
'"' << std::endl);
1750 if (namesp.
Length() >= 2)
1752 IfDebug(std::cerr <<
"namesp: " <<
'"' << namesp <<
'"' << std::endl);
1764 for (i = 0; i < tmp->
GetSize(); i++) {
1788 pos =
Complete(
"[^: ]*$", pList,
"", out);
1792 if (context != original_context)
1812 IfDebug(std::cerr << std::endl);
1813 IfDebug(std::cerr <<
"name: " <<
'"' <<
name <<
'"' << std::endl);
1823 Fatal(
"TTabCom::Hook",
"Conext case %d not handled",context);
1839 int* store_fpLoc =
fpLoc;
1840 char* store_fBuf =
fBuf;
1841 pos =
Complete(
"[^. ]*$", pList,
"(", out);
1843 fpLoc = store_fpLoc;
1850 pos =
Complete(
"[^> ]*$", pList,
"(", out);
1853 Fatal(
"TTabCom::Hook",
"Conext case %d not handled",context);
1859 if (context != original_context)
1873 IfDebug(std::cerr << std::endl);
1874 IfDebug(std::cerr <<
"name: " <<
'"' <<
name <<
'"' << std::endl);
1879 TString partname = s3(
"[_a-zA-Z][_a-zA-Z0-9]* *($");
1890 TString sym = str(
"[_a-zA-Z][_a-zA-Z0-9]*::$");
1894 prefix = sym + prefix;
1900 TString sym = prefix(
"[_a-zA-Z][_a-zA-Z0-9]*::$");
1903 IfDebug(std::cerr <<
"prefix: " <<
'"' << prefix <<
'"' << std::endl);
1904 IfDebug(std::cerr <<
"preprefix: " <<
'"' << preprefix <<
'"' << std::endl);
1915 methodName = s3(
"[^:>\\.(]*($");
1919 IfDebug(std::cerr << methodName << std::endl);
1927 TIter nextMethod(pList);
1929 while ((pMethod = (
TMethod *) nextMethod())) {
1930 if (methodName == pMethod->
GetName()) {
1936 if (comment && comment[0] !=
'\0') {
1937 out <<
" \t// " << comment;
1954 if (context != original_context)
1970 name = s3(
"[_a-zA-Z][_a-zA-Z0-9:]* *($", 3);
1975 name = s3(
"^[_a-zA-Z][_a-zA-Z0-9:]*");
1978 IfDebug(std::cerr << std::endl);
1979 IfDebug(std::cerr <<
"name: " <<
'"' <<
name <<
'"' << std::endl);
2001 Fatal(
"TTabCom::Hook",
"Conext case %d not handled",context);
2012 methodName =
name(
"[_a-zA-Z][_a-zA-Z0-9]*$");
2015 methodName = s3(
"[^:>\\.(]*($");
2019 IfDebug(std::cerr << methodName << std::endl);
2027 TIter nextMethod(pList);
2029 while ((pMethod = (
TMethod *) nextMethod())) {
2030 if (methodName == pMethod->
GetName()) {
2036 if (comment && comment[0] !=
'\0') {
2037 out <<
" \t// " << comment;
2054 if (context != original_context)
2065 if (l2 > l3 && s2[l2 - l3 - 1] ==
'.') {
2066 std::cerr << std::endl <<
2067 "tab completion not implemented for this context" << std::endl;
2071 if (l2 > l3 + 1 && s2(l2 - l3 - 2, 2) ==
"->") {
2072 std::cerr << std::endl <<
2073 "tab completion not implemented for this context" << std::endl;
2080 if (pL2) pList->
AddAll(pL2);
2084 if (pC1) pList->
AddAll(pC1);
2087 if (pC3) pList->
AddAll(pC3);
2089 pos =
Complete(
"[_a-zA-Z][_a-zA-Z0-9]*$", pList,
"", out);
2098 TString functionName = s3(
"[_a-zA-Z][_a-zA-Z0-9]*");
2099 IfDebug(std::cerr << functionName << std::endl);
2104 while ((pObj = nextGlobalFunc())) {
2105 if (strcmp(pObj->
GetName(), functionName) == 0) {
2106 listOfMatchingGlobalFuncs.
Add(pObj);
2110 if (listOfMatchingGlobalFuncs.
IsEmpty()) {
2111 std::cerr << std::endl <<
"no such function: " <<
dblquote(functionName)
2114 TIter next(&listOfMatchingGlobalFuncs);
2116 while ((pFunction = (
TFunction *) next())) {
2118 <<
" " << pFunction->
GetName()
2134 Fatal(
"TTabCom::Hook",
"Conext case %d not handled",context);
2183 "[_a-zA-Z][_a-zA-Z0-9:]* +[_a-zA-Z][_a-zA-Z0-9]* *($");
2185 "[_a-zA-Z][_a-zA-Z0-9]* *:: *[_a-zA-Z0-9]* *($");
2187 "[_a-zA-Z][_a-zA-Z0-9()]* *\\. *[_a-zA-Z0-9]* *($");
2189 "[_a-zA-Z][_a-zA-Z0-9()]* *-> *[_a-zA-Z0-9]* *($");
2192 "[_a-zA-Z][_a-zA-Z0-9]* *:: *[_a-zA-Z0-9]*$");
2194 "[_a-zA-Z][_a-zA-Z0-9()]* *\\. *[_a-zA-Z0-9()]*$");
2197 "[_a-zA-Z][_a-zA-Z0-9()]* *-> *[_a-zA-Z0-9()]*$");
2220 Error(
"TTabCom::MakeClassFromClassName",
"Unknown class \"%s\"", className);
2230 Error(
"TTabCom::MakeClassFromClassName",
"class \"%s\" is not defined.", className);
2278 (
gROOT->FindObject(varName) !=
nullptr);
2284 if (0) printf(
"varName is [%s] with iteration [%i]\n", varName, iter);
2290 if (!varName_exists && cut != 0)
2298 parentName[cut] = 0;
2299 if (0) printf(
"Parent string is [%s]\n", parentName.
Data());
2305 for(
Int_t i = cut-1; i>=0; --i) {
2306 switch (parentName[i]) {
2310 parentName = parentName(i+1,cut-i-1);
2322 if (varName[cut] ==
'.') {
2323 memberName = varName+cut+1;
2324 if (0) printf(
"Member/method is [%s]\n", memberName.
Data());
2328 memberName = varName+cut+2;
2329 if (0) printf(
"Member/method is [%s]\n", memberName.
Data());
2334 if (0) printf(
"I got [%s] from MakeClassFromVarName()\n", pclass->
GetName());
2338 if (0) printf(
"Variable [%s] exists!\n", parentName.
Data());
2341 if (iter == 0)
return pclass;
2343 if (0) printf(
"Trying data member [%s] of class [%s] ...\n",
2350 if (memberName == dmptr->
GetName())
break;
2354 if (0) printf(
"It's a member!\n");
2367 char *parentesis_ptr = (
char*)strrchr(memberName.
Data(),
'(');
2368 if (parentesis_ptr) *parentesis_ptr = 0;
2371 if (0) printf(
"Trying method [%s] of class [%s] ...\n",
2378 while ((mptr = (
TMethod *) next())) {
2379 if (strcmp(memberName.
Data(),mptr->
GetName())==0)
break;
2385 if (0) printf(
"It's a method called [%s] with return type [%s]\n",
2386 memberName.
Data(), returnName.
Data());
2389 if (returnName[returnName.
Length()-1] ==
'*')
2391 returnName[returnName.
Length()-1] = 0;
2411 if (!varName_exists) {
2413 std::cerr << std::endl <<
"variable " <<
dblquote(varName) <<
" not defined." << std::endl;
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;
2506 if (cl !=
nullptr) {
2507 auto op = cl->GetMethod(
"operator->",
"");
2508 if (op !=
nullptr) {
2510 className = op->GetReturnTypeNormalizedName();
2511 if (className[className.
Length() - 1] ==
'*') {
2533 Fatal(
"TTabCom::MakeClassFromVarName",
"Conext case %d not handled",context);
2539 for (i = *
fpLoc;
fBuf[i - 1] !=
'-' &&
fBuf[i] !=
'>'; i -= 1) {
2542 int len = strlen(
fBuf);
2543 for (; i < len; i += 1) {
2549 std::cerr << std::endl <<
dblquote(varName) <<
2550 " is not of pointer type. Use this operator: ." << std::endl;
2567 std::cerr << std::endl
2569 << (
int) handle <<
" >= kNUM_PAT=" << (
int)
kNUM_PAT << std::endl;
2588 if (
start > (
int)strlen(var_str))
start = strlen(var_str);
2590 for (
int i =
start; i > 0; i--)
2592 if (var_str[i] ==
'.')
return i;
2593 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.
int Int_t
Signed integer 4 bytes (int).
char Char_t
Character 1 byte (char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
externInt_t gErrorIgnoreLevel
errors with level below this value will be ignored. Default is kUnset.
void Fatal(const char *location, const char *msgfmt,...)
Use this function in case of a fatal error. It will abort the program.
externTInterpreter * gCling
Bool_t R_ISDIR(Int_t mode)
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
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,...
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...
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.
virtual TObject * At(Int_t idx) const =0
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
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]
TSeqCollection * fpGlobals
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]/////////////////////////////
Pattern_t fPat[kNUM_PAT][1024]
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.
void RehashClasses()
Do the class rehash.
static Char_t AllAgreeOnChar(int i, const TSeqCollection *pList, Int_t &nGoodStrings)
[static utility function]///////////////////////////////////////////