Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TDocParser Class Reference

Definition at line 44 of file TDocParser.h.

Public Types

enum  EAccess { kPrivate , kProtected , kPublic }
 
enum  EParseContext {
  kNoContext , kCode , kComment , kDirective ,
  kString , kKeyword , kCPP , kVerbatim ,
  kNumParseContexts , kParseContextMask = (1ULL << ( 4 )) - 1
}
 
enum  EParseContextFlag { kCXXComment = (1ULL << ( 4 )) , kParseContextFlagMask = (UInt_t)(~((1ULL << ( 4 )) - 1)) }
 
enum  ESourceInfo {
  kInfoLastUpdate , kInfoAuthor , kInfoCopyright , kInfoLastChanged ,
  kInfoLastGenerated , kNumSourceInfos
}
 
- Public Types inherited from TObject
enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = (1ULL << ( 0 )) , kOverwrite = (1ULL << ( 1 )) , kWriteDelete = (1ULL << ( 2 )) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << ( 3 )) }
 
enum  EStatusBits {
  kCanDelete = (1ULL << ( 0 )) , kMustCleanup = (1ULL << ( 3 )) , kIsReferenced = (1ULL << ( 4 )) , kHasUUID = (1ULL << ( 5 )) ,
  kCannotPick = (1ULL << ( 6 )) , kNoContextMenu = (1ULL << ( 8 )) , kInvalidObject = (1ULL << ( 13 ))
}
 

Public Member Functions

 TDocParser (TClassDocOutput &docOutput, TClass *cl)
 Constructor called for parsing class sources.
 
 TDocParser (TDocOutput &docOutput)
 constructor called for parsing text files with Convert()
 
 ~TDocParser () override
 destructor, checking whether all methods have been found for gDebug > 3
 
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".
 
virtual void DecorateKeywords (std::ostream &out, const char *text)
 Expand keywords in text, writing to out.
 
virtual void DecorateKeywords (TString &text)
 Find keywords in line and create URLs around them.
 
void DecrementMethodCount (const char *name)
 reduce method count for method called name, removing it from fMethodCounts once the count reaches 0.
 
virtual void DeleteDirectiveOutput () const
 Delete output generated by prior runs of all known directives; the output file names might have changes.
 
TClassGetCurrentClass () const
 
void GetCurrentModule (TString &out_module) const
 Return the name of module for which sources are currently parsed.
 
const TListGetDataMembers (EAccess access) const
 
TDocOutputGetDocOutput () const
 
const TListGetEnums (EAccess access) const
 
Long_t GetLineNumber () const
 
const TListGetMethods (EAccess access) const
 
const char * GetSourceInfo (ESourceInfo type) const
 
UInt_t InContext (Int_t context) const
 checks whether we are in a parse context, return the entry closest to the current context.
 
TClassIsA () const override
 
virtual void Parse (std::ostream &out)
 Locate methods, starting in the source file, then inline, then immediately inside the class declaration.
 
void SetCurrentModule (const char *module)
 
void Streamer (TBuffer &) override
 Stream an object of class TObject.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TObject
 TObject ()
 TObject constructor.
 
 TObject (const TObject &object)
 TObject copy ctor.
 
virtual ~TObject ()
 TObject destructor.
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract.
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad.
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action.
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs.
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility.
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method.
 
virtual void Copy (TObject &object) const
 Copy this to obj.
 
virtual void Delete (Option_t *option="")
 Delete this object.
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object.
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects.
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs.
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
 
virtual void Dump () const
 Dump contents of object on stdout.
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message.
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 Execute method on this object with the given parameter string, e.g.
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 Execute method on this object with parameters stored in the TObjArray.
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py).
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message.
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes.
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes.
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object.
 
virtual const char * GetIconName () const
 Returns mime type name of object.
 
virtual const char * GetName () const
 Returns name of object.
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py).
 
virtual Option_tGetOption () const
 
virtual const char * GetTitle () const
 Returns title of object.
 
virtual UInt_t GetUniqueID () const
 Return the unique object id.
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out.
 
virtual ULong_t Hash () const
 Return hash value for this object.
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message.
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname".
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl.
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas.
 
void InvertBit (UInt_t f)
 
Bool_t IsDestructed () const
 IsDestructed.
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory).
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void ls (Option_t *option="") const
 The ls function lists the contents of a class on stdout.
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification (the base implementation is no-op).
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete.
 
void operator delete (void *ptr)
 Operator delete.
 
void operator delete (void *ptr, void *vp)
 Only called by placement new when throwing an exception.
 
void operator delete[] (void *ptr)
 Operator delete [].
 
void operator delete[] (void *ptr, void *vp)
 Only called by placement new[] when throwing an exception.
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *vp)
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator.
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself.
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list.
 
virtual void Print (Option_t *option="") const
 This method must be overridden when a class wants to print itself.
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory.
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list.
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename.
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out".
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f.
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object.
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message.
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory.
 

Static Public Member Functions

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 string.
 
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Bool_t IsName (UChar_t c)
 Check if c is a valid C++ name character.
 
static Bool_t IsWord (UChar_t c)
 Check if c is a valid first character for C++ name.
 
static Bool_t Strip (TString &s)
 strips ' ', tabs, and newlines from both sides of str
 
- Static Public Member Functions inherited from TObject
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 Return destructor only flag.
 
static Bool_t GetObjectStat ()
 Get status of object stat flag.
 
static void SetDtorOnly (void *obj)
 Set destructor only flag.
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable.
 

Protected Types

enum  {
  kClassDoc_Uninitialized , kClassDoc_LookingNothingFound , kClassDoc_LookingHaveSomething , kClassDoc_Written ,
  kClassDoc_Ignore , kClassDoc_NumStates
}
 
enum  EDocContext { kIgnore , kDocFunc , kDocClass , kNumDocContexts }
 
- Protected Types inherited from TObject
enum  { kOnlyPrepStep = (1ULL << ( 3 )) }
 

Protected Member Functions

void AddClassDataMembersRecursively (TBaseClass *bc)
 Add data members of fCurrentClass and of bc to datamembers, recursively.
 
void AddClassMethodsRecursively (TBaseClass *bc)
 Add accessible (i.e.
 
EParseContext Context () const
 
virtual void ExpandCPPLine (TString &line, Ssiz_t &pos)
 Expand preprocessor statements.
 
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_Macro", and "Begin_Latex" / "End_Latex".
 
void InitKeywords () const
 fill C++ keywords into fgKeywords
 
virtual TClassIsDirective (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, or 0 if it's not a directive.
 
TMethodLocateMethodInCurrentLine (Ssiz_t &posMethodName, TString &ret, TString &name, TString &params, 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, and its arguments.
 
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.
 
void LocateMethodsInHeaderClassDecl (std::ostream &out)
 Given fCurrentClass, look for methods in its header file's class declaration block, and extract documentation to out, while beautifying the header file in parallel.
 
void LocateMethodsInHeaderInline (std::ostream &out)
 Given fCurrentClass, look for methods in its header file, and extract documentation to out.
 
void LocateMethodsInSource (std::ostream &out)
 Given fCurrentClass, look for methods in its source file, and extract documentation to out, while beautifying the source file in parallel.
 
virtual Bool_t ProcessComment ()
 Parse the current line as a comment, handling directives and re-formatting the comment: remove "/*", "*&zwj;/", "//", similar characters surrounding lines, etc.
 
void RemoveCommentContext (Bool_t cxxcomment)
 remove the top-most comment context that matches cxxcomment,
 
void WriteClassDoc (std::ostream &out, Bool_t first=kTRUE)
 Write the class description depending (among others) on fClassDocState.
 
void WriteMethod (std::ostream &out, TString &ret, TString &name, TString &params, Bool_t isconst, const char *file, TString &anchor, TString &codeOneLiner)
 Write a method, forwarding to TClassDocOutput.
 
void WriteSourceLine (std::ostream &out)
 Write fLineSource to out.
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected).
 
void MakeZombie ()
 

Protected Attributes

Bool_t fAllowDirectives
 
Bool_t fCheckForMethod
 
TString fClassDescrTag
 
enum TDocParser:: { ... }  fClassDocState
 
TString fComment
 
Bool_t fCommentAtBOL
 
TClassfCurrentClass
 
TString fCurrentFile
 
TString fCurrentMethodTag
 
TString fCurrentModule
 
TList fDataMembers [6]
 
Int_t fDirectiveCount
 
TList fDirectiveHandlers
 
EDocContext fDocContext
 
TDocOutputfDocOutput
 
std::set< UInt_tfExtraLinesWithAnchor
 
TString fFirstClassDoc
 
THtmlfHtml
 
TString fLastClassDoc
 
TString fLineComment
 
UInt_t fLineNo
 
Long_t fLineNumber
 
TString fLineRaw
 
TString fLineSource
 
TString fLineStripped
 
std::map< std::string, Int_tfMethodCounts
 
THashList fMethods [3]
 
std::list< UInt_tfParseContext
 
TClassfRecentClass
 
TString fSourceInfo [kNumSourceInfos]
 
TString fSourceInfoTags [kNumSourceInfos]
 

Static Protected Attributes

static std::set< std::string > fgKeywords
 

#include <TDocParser.h>

Inheritance diagram for TDocParser:
[legend]

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
kClassDoc_Uninitialized 
kClassDoc_LookingNothingFound 
kClassDoc_LookingHaveSomething 
kClassDoc_Written 
kClassDoc_Ignore 
kClassDoc_NumStates 

Definition at line 107 of file TDocParser.h.

◆ EAccess

Enumerator
kPrivate 
kProtected 
kPublic 

Definition at line 62 of file TDocParser.h.

◆ EDocContext

enum TDocParser::EDocContext
protected
Enumerator
kIgnore 
kDocFunc 
kDocClass 
kNumDocContexts 

Definition at line 46 of file TDocParser.h.

◆ EParseContext

Enumerator
kNoContext 
kCode 
kComment 
kDirective 
kString 
kKeyword 
kCPP 
kVerbatim 
kNumParseContexts 
kParseContextMask 

Definition at line 67 of file TDocParser.h.

◆ EParseContextFlag

Enumerator
kCXXComment 
kParseContextFlagMask 

Definition at line 79 of file TDocParser.h.

◆ ESourceInfo

Enumerator
kInfoLastUpdate 
kInfoAuthor 
kInfoCopyright 
kInfoLastChanged 
kInfoLastGenerated 
kNumSourceInfos 

Definition at line 54 of file TDocParser.h.

Constructor & Destructor Documentation

◆ TDocParser() [1/2]

TDocParser::TDocParser ( TClassDocOutput docOutput,
TClass cl 
)

Constructor called for parsing class sources.

Definition at line 150 of file TDocParser.cxx.

◆ TDocParser() [2/2]

TDocParser::TDocParser ( TDocOutput docOutput)

constructor called for parsing text files with Convert()

Definition at line 190 of file TDocParser.cxx.

◆ ~TDocParser()

TDocParser::~TDocParser ( )
override

destructor, checking whether all methods have been found for gDebug > 3

Definition at line 211 of file TDocParser.cxx.

Member Function Documentation

◆ AddClassDataMembersRecursively()

void TDocParser::AddClassDataMembersRecursively ( TBaseClass bc)
protected

Add data members of fCurrentClass and of bc to datamembers, recursively.

Real data members are in idx 0..2 (public, protected, private access), enum constants in idx 3..5.

Definition at line 306 of file TDocParser.cxx.

◆ AddClassMethodsRecursively()

void TDocParser::AddClassMethodsRecursively ( TBaseClass bc)
protected

Add accessible (i.e.

non-private) methods of base class bc and its base classes' methods to methodNames. If bc==0, we add fCurrentClass's methods (and also private functions).

Definition at line 235 of file TDocParser.cxx.

◆ AnchorFromLine()

void TDocParser::AnchorFromLine ( const TString line,
TString anchor 
)
static

Create an anchor from the given line, by hashing it and convertig the hash into a custom base64 string.

Definition at line 381 of file TDocParser.cxx.

◆ Class()

static TClass * TDocParser::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TDocParser::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TDocParser::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 187 of file TDocParser.h.

◆ Context()

EParseContext TDocParser::Context ( ) const
inlineprotected

Definition at line 129 of file TDocParser.h.

◆ Convert()

void TDocParser::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".

If "isCode", "in" is assumed to be C++ code.

Definition at line 402 of file TDocParser.cxx.

◆ DeclFileName()

static const char * TDocParser::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 187 of file TDocParser.h.

◆ DecorateKeywords() [1/2]

void TDocParser::DecorateKeywords ( std::ostream &  out,
const char *  text 
)
virtual

Expand keywords in text, writing to out.

Definition at line 450 of file TDocParser.cxx.

◆ DecorateKeywords() [2/2]

void TDocParser::DecorateKeywords ( TString line)
virtual

Find keywords in line and create URLs around them.

Escape characters with a special meaning for HTML. Protect "Begin_Html"/"End_Html" pairs, and set the parsing context. Evaluate sequences like a::b->c. Skip regions where directives are active.

Definition at line 463 of file TDocParser.cxx.

◆ DecrementMethodCount()

void TDocParser::DecrementMethodCount ( const char *  name)

reduce method count for method called name, removing it from fMethodCounts once the count reaches 0.

Definition at line 869 of file TDocParser.cxx.

◆ DeleteDirectiveOutput()

void TDocParser::DeleteDirectiveOutput ( ) const
virtual

Delete output generated by prior runs of all known directives; the output file names might have changes.

Definition at line 884 of file TDocParser.cxx.

◆ ExpandCPPLine()

void TDocParser::ExpandCPPLine ( TString line,
Ssiz_t pos 
)
protectedvirtual

Expand preprocessor statements.

Input: line - line containing the CPP statement, pos - position of '#'

NOTE: Looks for the #include statements and creates link to the corresponding file if such file exists

Definition at line 911 of file TDocParser.cxx.

◆ GetCurrentClass()

TClass * TDocParser::GetCurrentClass ( ) const
inline

Definition at line 171 of file TDocParser.h.

◆ GetCurrentModule()

void TDocParser::GetCurrentModule ( TString out_module) const

Return the name of module for which sources are currently parsed.

Definition at line 967 of file TDocParser.cxx.

◆ GetDataMembers()

const TList * TDocParser::GetDataMembers ( EAccess  access) const
inline

Definition at line 175 of file TDocParser.h.

◆ GetDocOutput()

TDocOutput * TDocParser::GetDocOutput ( ) const
inline

Definition at line 173 of file TDocParser.h.

◆ GetEnums()

const TList * TDocParser::GetEnums ( EAccess  access) const
inline

Definition at line 176 of file TDocParser.h.

◆ GetLineNumber()

Long_t TDocParser::GetLineNumber ( ) const
inline

Definition at line 174 of file TDocParser.h.

◆ GetMethods()

const TList * TDocParser::GetMethods ( EAccess  access) const
inline

Definition at line 170 of file TDocParser.h.

◆ GetSourceInfo()

const char * TDocParser::GetSourceInfo ( ESourceInfo  type) const
inline

Definition at line 177 of file TDocParser.h.

◆ HandleDirective()

Bool_t TDocParser::HandleDirective ( TString keyword,
Ssiz_t pos,
TString word,
Ssiz_t copiedToCommentUpTo 
)
protectedvirtual

Process directives to the documentation engine, like "Begin_Html" / "End_Html", "Begin_Macro" / "End_Macro", and "Begin_Latex" / "End_Latex".

Definition at line 977 of file TDocParser.cxx.

◆ InContext()

UInt_t TDocParser::InContext ( Int_t  context) const

checks whether we are in a parse context, return the entry closest to the current context.

If context is a EParseContextFlag just look for the first match in the flags

Definition at line 1158 of file TDocParser.cxx.

◆ InitKeywords()

void TDocParser::InitKeywords ( ) const
protected

fill C++ keywords into fgKeywords

Definition at line 1175 of file TDocParser.cxx.

◆ IsA()

TClass * TDocParser::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TObject.

Definition at line 187 of file TDocParser.h.

◆ IsDirective()

TClass * TDocParser::IsDirective ( const TString line,
Ssiz_t  pos,
const TString word,
Bool_t begin 
) const
protectedvirtual

return whether word at line's pos is a valid directive, and returns its TDocDirective's TClass object, or 0 if it's not a directive.

Set begin to kTRUE for "Begin_..." You can implement your own handlers by implementing a class deriving from TDocHandler, and calling it TDocTagDirective for "BEGIN_TAG", "END_TAG" blocks.

Definition at line 1253 of file TDocParser.cxx.

◆ IsName()

Bool_t TDocParser::IsName ( UChar_t  c)
static

Check if c is a valid C++ name character.

Input: c - a single character

Output: TRUE if c is a valid C++ name character and FALSE if it's not.

NOTE: Valid name characters are [a..zA..Z0..9_~],

Definition at line 1301 of file TDocParser.cxx.

◆ IsWord()

Bool_t TDocParser::IsWord ( UChar_t  c)
static

Check if c is a valid first character for C++ name.

Input: c - a single character

Output: TRUE if c is a valid first character for C++ name, and FALSE if it's not.

NOTE: Valid first characters are [a..zA..Z_~]

Definition at line 1324 of file TDocParser.cxx.

◆ LocateMethodInCurrentLine()

TMethod * TDocParser::LocateMethodInCurrentLine ( Ssiz_t posMethodName,
TString ret,
TString name,
TString params,
Bool_t isconst,
std::ostream &  srcOut,
TString anchor,
std::ifstream &  sourceFile,
Bool_t  allowPureVirtual 
)
protected

Search for a method starting at posMethodName, and return its return type, its name, and its arguments.

If the end of arguments is not found in the current line, get a new line from sourceFile, beautify it to srcOut, creating an anchor as necessary. When this function returns, posMethodName points to the end of the function declaration, i.e. right after the arguments' closing bracket. If posMethodName == kNPOS, we look for the first matching method in fMethodCounts.

Definition at line 1343 of file TDocParser.cxx.

◆ LocateMethods()

void TDocParser::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 
)
protected

Collect methods from the source or header file called filename.

It generates a beautified version of the source file on the fly; the output file is given by the fCurrentClass's name, and sourceExt. Documentation is extracted to out. lookForSourceInfo: if set, author, lastUpdate, and copyright are extracted (i.e. the values contained in fSourceInfo) useDocxxStyle: if set, documentation can be in front of the method name, not only inside the method. Useful doc Doc++/Doxygen style, and inline methods. lookForClassDescr: if set, the first line matching the class description rules is assumed to be the class description for fCurrentClass; the description is written to out. methodPattern: if set, methods have to be prepended by this tag. Usually the class name + "::". In header files, looking for in-place function definitions, this should be 0. In that case, only functions in fMethodCounts are searched for.

Definition at line 1607 of file TDocParser.cxx.

◆ LocateMethodsInHeaderClassDecl()

void TDocParser::LocateMethodsInHeaderClassDecl ( std::ostream &  out)
protected

Given fCurrentClass, look for methods in its header file's class declaration block, and extract documentation to out, while beautifying the header file in parallel.

Definition at line 1913 of file TDocParser.cxx.

◆ LocateMethodsInHeaderInline()

void TDocParser::LocateMethodsInHeaderInline ( std::ostream &  out)
protected

Given fCurrentClass, look for methods in its header file, and extract documentation to out.

Definition at line 1879 of file TDocParser.cxx.

◆ LocateMethodsInSource()

void TDocParser::LocateMethodsInSource ( std::ostream &  out)
protected

Given fCurrentClass, look for methods in its source file, and extract documentation to out, while beautifying the source file in parallel.

Definition at line 1846 of file TDocParser.cxx.

◆ Parse()

void TDocParser::Parse ( std::ostream &  out)
virtual

Locate methods, starting in the source file, then inline, then immediately inside the class declaration.

While doing that also find the class description and special tags like the macro tag etc.

Definition at line 1573 of file TDocParser.cxx.

◆ ProcessComment()

Bool_t TDocParser::ProcessComment ( )
protectedvirtual

Parse the current line as a comment, handling directives and re-formatting the comment: remove "/*", "*&zwj;/", "//", similar characters surrounding lines, etc.

Return kFALSE if the line is not a comment.

Definition at line 1928 of file TDocParser.cxx.

◆ RemoveCommentContext()

void TDocParser::RemoveCommentContext ( Bool_t  cxxcomment)
protected

remove the top-most comment context that matches cxxcomment,

Definition at line 2060 of file TDocParser.cxx.

◆ SetCurrentModule()

void TDocParser::SetCurrentModule ( const char *  module)
inline

Definition at line 178 of file TDocParser.h.

◆ Streamer()

void TDocParser::Streamer ( TBuffer R__b)
overridevirtual

Stream an object of class TObject.

Reimplemented from TObject.

◆ StreamerNVirtual()

void TDocParser::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 187 of file TDocParser.h.

◆ Strip()

Bool_t TDocParser::Strip ( TString s)
static

strips ' ', tabs, and newlines from both sides of str

Definition at line 2075 of file TDocParser.cxx.

◆ WriteClassDoc()

void TDocParser::WriteClassDoc ( std::ostream &  out,
Bool_t  first = kTRUE 
)
protected

Write the class description depending (among others) on fClassDocState.

Definition at line 2096 of file TDocParser.cxx.

◆ WriteMethod()

void TDocParser::WriteMethod ( std::ostream &  out,
TString ret,
TString name,
TString params,
Bool_t  isconst,
const char *  file,
TString anchor,
TString codeOneLiner 
)
protected

Write a method, forwarding to TClassDocOutput.

Definition at line 2242 of file TDocParser.cxx.

◆ WriteSourceLine()

void TDocParser::WriteSourceLine ( std::ostream &  out)
protected

Write fLineSource to out.

Adjust relative paths first.

Definition at line 2307 of file TDocParser.cxx.

Member Data Documentation

◆ fAllowDirectives

Bool_t TDocParser::fAllowDirectives
protected

Definition at line 119 of file TDocParser.h.

◆ fCheckForMethod

Bool_t TDocParser::fCheckForMethod
protected

Definition at line 106 of file TDocParser.h.

◆ fClassDescrTag

TString TDocParser::fClassDescrTag
protected

Definition at line 116 of file TDocParser.h.

◆ []

enum { ... } TDocParser::fClassDocState

◆ fComment

TString TDocParser::fComment
protected

Definition at line 93 of file TDocParser.h.

◆ fCommentAtBOL

Bool_t TDocParser::fCommentAtBOL
protected

Definition at line 115 of file TDocParser.h.

◆ fCurrentClass

TClass* TDocParser::fCurrentClass
protected

Definition at line 96 of file TDocParser.h.

◆ fCurrentFile

TString TDocParser::fCurrentFile
protected

Definition at line 102 of file TDocParser.h.

◆ fCurrentMethodTag

TString TDocParser::fCurrentMethodTag
protected

Definition at line 99 of file TDocParser.h.

◆ fCurrentModule

TString TDocParser::fCurrentModule
protected

Definition at line 98 of file TDocParser.h.

◆ fDataMembers

TList TDocParser::fDataMembers[6]
protected

Definition at line 123 of file TDocParser.h.

◆ fDirectiveCount

Int_t TDocParser::fDirectiveCount
protected

Definition at line 100 of file TDocParser.h.

◆ fDirectiveHandlers

TList TDocParser::fDirectiveHandlers
protected

Definition at line 118 of file TDocParser.h.

◆ fDocContext

EDocContext TDocParser::fDocContext
protected

Definition at line 104 of file TDocParser.h.

◆ fDocOutput

TDocOutput* TDocParser::fDocOutput
protected

Definition at line 87 of file TDocParser.h.

◆ fExtraLinesWithAnchor

std::set<UInt_t> TDocParser::fExtraLinesWithAnchor
protected

Definition at line 120 of file TDocParser.h.

◆ fFirstClassDoc

TString TDocParser::fFirstClassDoc
protected

Definition at line 94 of file TDocParser.h.

◆ fgKeywords

std::set< std::string > TDocParser::fgKeywords
staticprotected

Definition at line 125 of file TDocParser.h.

◆ fHtml

THtml* TDocParser::fHtml
protected

Definition at line 86 of file TDocParser.h.

◆ fLastClassDoc

TString TDocParser::fLastClassDoc
protected

Definition at line 95 of file TDocParser.h.

◆ fLineComment

TString TDocParser::fLineComment
protected

Definition at line 91 of file TDocParser.h.

◆ fLineNo

UInt_t TDocParser::fLineNo
protected

Definition at line 88 of file TDocParser.h.

◆ fLineNumber

Long_t TDocParser::fLineNumber
protected

Definition at line 101 of file TDocParser.h.

◆ fLineRaw

TString TDocParser::fLineRaw
protected

Definition at line 89 of file TDocParser.h.

◆ fLineSource

TString TDocParser::fLineSource
protected

Definition at line 92 of file TDocParser.h.

◆ fLineStripped

TString TDocParser::fLineStripped
protected

Definition at line 90 of file TDocParser.h.

◆ fMethodCounts

std::map<std::string , Int_t > TDocParser::fMethodCounts
protected

Definition at line 103 of file TDocParser.h.

◆ fMethods

THashList TDocParser::fMethods[3]
protected

Definition at line 122 of file TDocParser.h.

◆ fParseContext

std::list<UInt_t> TDocParser::fParseContext
protected

Definition at line 105 of file TDocParser.h.

◆ fRecentClass

TClass* TDocParser::fRecentClass
protected

Definition at line 97 of file TDocParser.h.

◆ fSourceInfo

TString TDocParser::fSourceInfo[kNumSourceInfos]
protected

Definition at line 121 of file TDocParser.h.

◆ fSourceInfoTags

TString TDocParser::fSourceInfoTags[kNumSourceInfos]
protected

Definition at line 117 of file TDocParser.h.

  • html/inc/TDocParser.h
  • html/src/TDocParser.cxx