41 static void SetClass(
const TClass* cl) { fgClass = cl; }
43 const char* GetName()
const override {
return fMeth->
GetName(); }
44 ULong_t Hash()
const override {
return fMeth->Hash();}
45 Int_t GetNargs()
const {
return fMeth->GetNargs(); }
47 Bool_t IsSortable()
const override {
return kTRUE; }
49 Int_t GetOverloadIdx()
const override {
return fOverloadIdx; }
52 const TMethodWrapperImpl*
m =
dynamic_cast<const TMethodWrapperImpl*
>(obj);
57 if (GetNargs() <
m->GetNargs())
return -1;
58 else if (GetNargs() >
m->GetNargs())
return 1;
65 const char*
l(GetName());
67 if (
l[0] ==
'~' &&
r[0] ==
'~') {
79 if (
lcl && fgClass->InheritsFrom(
lcl)) {
80 if (
rcl && fgClass->InheritsFrom(
rcl)) {
81 if (
lcl->InheritsFrom(
rcl))
85 }
else if (
rcl && fgClass->InheritsFrom(
rcl))
88 if (
l[0] ==
'~')
return -1;
89 if (
r[0] ==
'~')
return 1;
90 return (
ret < 0) ? -1 : 1;
94 static const TClass* fgClass;
99 const TClass* TMethodWrapperImpl::fgClass = 0;
152 fCurrentClass(cl), fRecentClass(0), fCurrentModule(0),
153 fDirectiveCount(0), fLineNumber(0), fDocContext(kIgnore),
154 fCheckForMethod(
kFALSE), fClassDocState(kClassDoc_Uninitialized),
165 TMethodWrapperImpl::SetClass(cl);
167 for (
int ia = 0;
ia < 3; ++
ia) {
192 fCurrentClass(0), fRecentClass(0), fDirectiveCount(0),
193 fLineNumber(0), fDocContext(kIgnore),
194 fCheckForMethod(
kFALSE), fClassDocState(kClassDoc_Uninitialized),
205 TMethodWrapperImpl::SetClass(0);
217 Info(
"~TDocParser",
"Implementation of method %s::%s could not be found.",
271 if (
mtype == 0)
continue;
279 for (
Int_t access = 0; !hidden && access < 3; ++access) {
281 hidden |= (
other) && (
other->GetMethod()->GetClass() !=
method->GetClass());
295 for (
Int_t access = 0; access < 3; ++access) {
328 if (
mtype == 0)
continue;
369 for (
Int_t access = 0; access < 6; ++access) {
382 const char base64String[65] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.";
506 while(i <
line.Length())
512 for (; i <
line.Length(); ++i) {
523 if (
line[i + 1] ==
':') {
530 if (
line[i + 1] ==
'>') {
537 if (
line[i + 1] !=
'.') {
557 if (i >=
line.Length())
566 && i > 2 &&
line[i] ==
'\'' &&
line[i-1] ==
';';
578 && ( (i > 1 &&
line[i - 2] ==
'\'')
579 || (i > 3 &&
line[i - 2] ==
'\\' &&
line[i - 3] ==
'\'')))
581 && (i == 0 ||
line[i - 1] !=
'\\');
583 if (
line[i] ==
'"' || (
line[i] ==
'\'' && (
585 (
line.Length() > i + 2 &&
line[i + 2] ==
'\'') ||
587 (
line.Length() > i + 3 &&
line[i + 1] ==
'\'' &&
line[i + 3] ==
'\'')))) {
593 }
else if (context ==
kCode
594 &&
line[i] ==
'/' && (
line[i+1] ==
'/' ||
line[i+1] ==
'*')) {
596 if (
line[i+1] ==
'/')
603 &&
line.Length() > i + 1
604 &&
line[i] ==
'*' &&
line[i+1] ==
'/') {
620 && context ==
kCode) {
625 if (i <
line.Length())
654 if ((i == 0 || (i > 0 &&
line[i - 1] !=
'"'))
685 Warning(
"DecorateKeywords",
"type context is empty!");
829 if (i >
line.Length())
935 line +=
"<a href=\"./";
970 else out_module =
"(UNKNOWN MODULE WHILE PARSING)";
998 pos +=
word.Length();
1011 if (begin &&
line[pos] ==
'(') {
1042 pos += params.
Length() + 2;
1074 while (pos <
line.Length())
1077 pos =
line.Length();
1087 pos +=
word.Length();
1088 else pos +=
word.Length() - 2;
1093 Warning(
"HandleDirective",
"Cannot find directive handler object %s !",
1112 pos =
line.Length();
1163 for (std::list<UInt_t>::const_reverse_iterator
iPC =
fParseContext.rbegin();
1257 if (pos > 0 &&
line[pos - 1] ==
'"')
1277 tag[0] -=
'a' -
'A';
1284 Warning(
"IsDirective",
"Unknown THtml directive %s in line %d!",
word.Data(),
fLineNo);
1388 ret.Remove(
ret.Length() - 1, 1);
1393 if (
ret.BeginsWith(
"inline ")) {
1397 if (
ret.BeginsWith(
"static ")) {
1401 if (
ret.BeginsWith(
"virtual ")) {
1413 ret.Contains(
"{") ||
ret.Contains(
"}") ||
ret.Contains(
"(") ||
ret.Contains(
")")
1414 ||
ret.Contains(
"=")) {
1421 if (
name.BeginsWith(
"operator")) {
1446 if (!
name.Length()) {
1481 Error(
"LocateMethodInCurrentLine",
1482 "Cannot find end of signature for function %s!",
1618 Error(
"LocateMethods",
"Can't find source file '%s' for class %s!",
1754 if (methodName.
Length()) {
1818 if (methodName.
Length()) {
1861 kFALSE , pattern,
".cxx.html");
1869 kFALSE , pattern,
".cxx.html");
1918 kTRUE , 0,
".h.html");
2077 Bool_t changed = str[0] ==
' ' || str[0] ==
'\t' || str[0] ==
'\n';
2079 && (str[str.Length() - 1] ==
' ' || str[str.Length() - 1] ==
'\t'
2080 || str[str.Length() - 1] ==
'\n');
2083 while (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\n')
2086 i = str.Length() - 1;
2087 while (i >= 0 && (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\n'))
2089 str.Remove(i + 1, str.Length());
2115 || (
p ==
'>' &&
n ==
'>')) {
2138 case '[': ++
nest;
break;
2141 case ']': --
nest;
break;
2142 case '=': init =
true;
break;
2143 case '\'': ++i;
if (
strippedParams[i] ==
'\\') ++i; ++i;
continue;
2144 case '\\': ++i;
continue;
break;
2200 bool matches =
false;
2265 for (
int access = 0; access < 3; ++access) {
2274 &&
method->GetMethod()->GetListOfMethodArgs()->GetSize() ==
nparams) {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Int_t Compare(const void *item1, const void *item2)
winID h TVirtualViewer3D TVirtualGLPainter p
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 filename
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 r
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 result
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 text
UInt_t Hash(const TString &s)
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD(mutex)
const_iterator begin() const
const_iterator end() const
Each class (see TClass) has a linked list of its base class(es).
TClass instances represent classes, structs and namespaces in the ROOT type system.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
TMethod * GetMethodAny(const char *method)
Return pointer to method without looking at parameters.
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 SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
All ROOT classes may have RTTI (run time type identification) support added.
Long_t Property() const override
Get property description word. For meaning of bits see EProperty.
TDataType * GetDataType() const
Basic data type descriptor (datatype information is obtained from CINT).
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
virtual void DecorateEntityBegin(TString &str, Ssiz_t &pos, TDocParser::EParseContext type)
Add some colors etc to a source entity, contained in str.
virtual void NameSpace2FileName(TString &name)
Replace "::" in name by "__" Replace "<", ">", " ", ",", "~", "=" in name by "_" Replace "A::X<A::Y>"...
void WriteLineNumbers(std::ostream &out, Long_t nLines, const TString &infileBase) const
Create a div containing the line numbers (for a source listing) 1 to nLines.
virtual void ReferenceEntity(TSubString &str, TClass *entity, const char *comment=0)
Create a reference to a class documentation page.
Bool_t CopyHtmlFile(const char *sourceName, const char *destName="")
Copy file to HTML directory.
void WriteHtmlFooter(std::ostream &out, const char *dir, const char *lastUpdate, const char *author, const char *copyright, const char *footer)
Write HTML footer.
virtual const char * ReplaceSpecialChars(char c)
Replace ampersand, less-than and greater-than character, writing to out.
virtual void DecorateEntityEnd(TString &str, Ssiz_t &pos, TDocParser::EParseContext type)
Add some colors etc to a source entity, contained in str.
virtual void FixupAuthorSourceInfo(TString &authors)
Special author treatment; called when TDocParser::fSourceInfo[kInfoAuthor] is set.
virtual void AdjustSourcePath(TString &line, const char *relpath="../")
adjust the path of links for source files, which are in src/, but need to point to relpath (usually "...
static void AnchorFromLine(const TString &line, TString &anchor)
Create an anchor from the given line, by hashing it and convertig the hash into a custom base64 strin...
static Bool_t IsWord(UChar_t c)
Check if c is a valid first character for C++ name.
EParseContext Context() const
void LocateMethodsInSource(std::ostream &out)
Given fCurrentClass, look for methods in its source file, and extract documentation to out,...
void WriteClassDoc(std::ostream &out, Bool_t first=kTRUE)
Write the class description depending (among others) on fClassDocState.
~TDocParser() override
destructor, checking whether all methods have been found for gDebug > 3
std::set< UInt_t > fExtraLinesWithAnchor
void LocateMethodsInHeaderClassDecl(std::ostream &out)
Given fCurrentClass, look for methods in its header file's class declaration block,...
virtual void ExpandCPPLine(TString &line, Ssiz_t &pos)
Expand preprocessor statements.
void LocateMethodsInHeaderInline(std::ostream &out)
Given fCurrentClass, look for methods in its header file, and extract documentation to out.
@ kClassDoc_LookingNothingFound
@ kClassDoc_LookingHaveSomething
virtual TClass * IsDirective(const TString &line, Ssiz_t pos, const TString &word, Bool_t &begin) const
return whether word at line's pos is a valid directive, and returns its TDocDirective's TClass object...
static Bool_t Strip(TString &s)
strips ' ', tabs, and newlines from both sides of str
void WriteMethod(std::ostream &out, TString &ret, TString &name, TString ¶ms, Bool_t isconst, const char *file, TString &anchor, TString &codeOneLiner)
Write a method, forwarding to TClassDocOutput.
TMethod * LocateMethodInCurrentLine(Ssiz_t &posMethodName, TString &ret, TString &name, TString ¶ms, Bool_t &isconst, std::ostream &srcOut, TString &anchor, std::ifstream &sourcefile, Bool_t allowPureVirtual)
Search for a method starting at posMethodName, and return its return type, its name,...
void InitKeywords() const
fill C++ keywords into fgKeywords
void RemoveCommentContext(Bool_t cxxcomment)
remove the top-most comment context that matches cxxcomment,
TString fSourceInfoTags[kNumSourceInfos]
TString fCurrentMethodTag
TString fSourceInfo[kNumSourceInfos]
TDocParser(TClassDocOutput &docOutput, TClass *cl)
Constructor called for parsing class sources.
void DecrementMethodCount(const char *name)
reduce method count for method called name, removing it from fMethodCounts once the count reaches 0.
virtual Bool_t ProcessComment()
Parse the current line as a comment, handling directives and re-formatting the comment: remove "/*",...
static Bool_t IsName(UChar_t c)
Check if c is a valid C++ name character.
void GetCurrentModule(TString &out_module) const
Return the name of module for which sources are currently parsed.
void Convert(std::ostream &out, std::istream &in, const char *relpath, Bool_t isCode, Bool_t interpretDirectives)
Parse text file "in", add links etc, and write output to "out".
void LocateMethods(std::ostream &out, const char *filename, Bool_t lookForSourceInfo=kTRUE, Bool_t useDocxxStyle=kFALSE, Bool_t allowPureVirtual=kFALSE, const char *methodPattern=0, const char *sourceExt=0)
Collect methods from the source or header file called filename.
TDocOutput * GetDocOutput() const
enum TDocParser::@99 fClassDocState
std::list< UInt_t > fParseContext
UInt_t InContext(Int_t context) const
checks whether we are in a parse context, return the entry closest to the current context.
void AddClassMethodsRecursively(TBaseClass *bc)
Add accessible (i.e.
std::map< std::string, Int_t > fMethodCounts
void WriteSourceLine(std::ostream &out)
Write fLineSource to out.
static std::set< std::string > fgKeywords
void AddClassDataMembersRecursively(TBaseClass *bc)
Add data members of fCurrentClass and of bc to datamembers, recursively.
virtual void DecorateKeywords(std::ostream &out, const char *text)
Expand keywords in text, writing to out.
virtual Bool_t HandleDirective(TString &keyword, Ssiz_t &pos, TString &word, Ssiz_t &copiedToCommentUpTo)
Process directives to the documentation engine, like "Begin_Html" / "End_Html", "Begin_Macro" / "End_...
virtual void DeleteDirectiveOutput() const
Delete output generated by prior runs of all known directives; the output file names might have chang...
virtual void Parse(std::ostream &out)
Locate methods, starting in the source file, then inline, then immediately inside the class declarati...
Global variables class (global variables are obtained from CINT).
void Rehash(Int_t newCapacity)
Rehash the hashlist.
const TList * GetListForObject(const char *name) const
Return the THashTable's list (bucket) in which obj can be found based on its hash; see THashTable::Ge...
const TString & GetClassDocTag() const
virtual TClass * GetClass(const char *name) const
Return pointer to class with name.
const TString & GetCopyrightTag() const
const TString & GetAuthorTag() const
const TString & GetDocStyle() const
virtual bool GetDeclFileName(TClass *cl, Bool_t filesys, TString &out_name) const
Return declaration file name; return the full path if filesys is true.
const TString & GetLastUpdateTag() const
virtual void GetModuleNameForClass(TString &module, TClass *cl) const
Return the module name for a given class.
TVirtualMutex * GetMakeClassMutex() const
virtual bool GetImplFileName(TClass *cl, Bool_t filesys, TString &out_name) const
Return implementation file name.
const TPathDefinition & GetPathDefinition() const
Return the TModuleDefinition (or derived) object as set by SetModuleDefinition(); create and return a...
virtual TObjLink * LastLink() const
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
void AddLast(TObject *obj) override
Add object at the end of the list.
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
Each ROOT method (see TMethod) has a linked list of its arguments.
Each ROOT class (see TClass) has a linked list of methods.
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 void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual ULong_t Hash() const
Return hash value for this object.
Wrapper for PCRE library (Perl Compatible Regular Expressions).
void ToLower()
Change string to lower-case.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & Prepend(const char *cs)
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
TString & Remove(Ssiz_t pos)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
Read a line from stream upto newline skipping any whitespace.
A zero length substring is legal.
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
RPY_EXPORTED TCppMethod_t GetMethod(TCppScope_t scope, TCppIndex_t imeth)