ROOT » CORE » METAUTILS » TClassEdit

namespace TClassEdit

Function Members (Methods)

public:
stringCleanType(const char* typeDesc, int mode = 0, const char** tail = 0)
char*DemangleName(const char* mangled_name, int& errorCode)
char*DemangleTypeIdName(const type_info& ti, int& errorCode)
TClassEdit::EComplexTypeGetComplexType(const char*)
stringGetLong64_Name(const char* original)
stringGetLong64_Name(const string& original)
voidGetNormalizedName(string& norm_name, string_view name)
intGetSplit(const char* type, vector<string>& output, int& nestedLoc, TClassEdit::EModType mode = TClassEdit::kNone)
const char*GetUnqualifiedName(const char* name)
voidInit(TClassEdit::TInterpreterLookupHelper* helper)
stringInsertStd(const char* tname)
boolIsDefAlloc(const char* alloc, const char* classname)
boolIsDefAlloc(const char* alloc, const char* keyclassname, const char* valueclassname)
boolIsDefComp(const char* comp, const char* classname)
boolIsDefHash(const char* hashname, const char* classname)
boolIsDefPred(const char* predname, const char* classname)
boolIsInterpreterDetail(const char* type)
boolIsStdClass(const char* type)
boolIsSTLBitset(const char* type)
ROOT::ESTLTypeIsSTLCont(string_view type)
intIsSTLCont(const char* type, int testAlloc)
boolIsVectorBool(const char* name)
stringResolveTypedef(const char* tname, bool resolveAll = false)
stringShortType(const char* typeDesc, int mode)
intSTLArgs(int kind)
ROOT::ESTLTypeSTLKind(string_view type)
ROOT::ESTLTypeUnderlyingIsSTLCont(string_view type)

Data Members

Class Charts

Function documentation

void Init(TClassEdit::TInterpreterLookupHelper* helper)
ROOT::ESTLType STLKind(string_view type)
 Converts STL container name to number. vector -> 1, etc..
 If len is greater than 0, only look at that many characters in the string.
int STLArgs(int kind)
      Return number of arguments for STL container before allocator
bool IsDefAlloc(const char* alloc, const char* classname)
 return whether or not 'allocname' is the STL default allocator for type
 'classname'
bool IsDefAlloc(const char* alloc, const char* keyclassname, const char* valueclassname)
 return whether or not 'allocname' is the STL default allocator for a key
 of type 'keyclassname' and a value of type 'valueclassname'
bool IsDefComp(const char* comp, const char* classname)
 return whether or not 'compare' is the STL default comparator for type
 'classname'
bool IsDefPred(const char* predname, const char* classname)
 return whether or not 'predname' is the STL default predicate for type
 'classname'
bool IsDefHash(const char* hashname, const char* classname)
 return whether or not 'hashname' is the STL default hash for type
 'classname'
void GetNormalizedName(string& norm_name, string_view name)
 Return the normalized name.  See TMetaUtils::GetNormalizedName.

 Return the type name normalized for ROOT,
 keeping only the ROOT opaque typedef (Double32_t, etc.) and
 removing the STL collections default parameter if any.

 Compare to TMetaUtils::GetNormalizedName, this routines does not
 and can not add default template parameters.
string GetLong64_Name(const char* original)
 Replace 'long long' and 'unsigned long long' by 'Long64_t' and 'ULong64_t'
string GetLong64_Name(const string& original)
 Replace 'long long' and 'unsigned long long' by 'Long64_t' and 'ULong64_t'
const char * GetUnqualifiedName(const char* name)
 Return the start of the unqualified name include in 'original'.
int GetSplit(const char* type, vector<string>& output, int& nestedLoc, TClassEdit::EModType mode = TClassEdit::kNone)
  Stores in output (after emptying it) the splited type.
  Stores the location of the tail (nested names) in nestedLoc (0 indicates no tail).
  Return the number of elements stored.

  First in list is the template name or is empty
         "vector<list<int>,alloc>**" to "vector" "list<int>" "alloc" "**"
   or    "TNamed*" to "" "TNamed" "*"

string CleanType(const char* typeDesc, int mode = 0, const char** tail = 0)
      Cleanup type description, redundant blanks removed
      and redundant tail ignored
      return *tail = pointer to last used character
      if (mode==0) keep keywords
      if (mode==1) remove keywords outside the template params
      if (mode>=2) remove the keywords everywhere.
      if (tail!=0) cut before the trailing *

      The keywords currently are: "const" , "volatile" removed


      CleanType(" A<B, C< D, E> > *,F,G>") returns "A<B,C<D,E> >*"

string ShortType(const char* typeDesc, int mode)
 Return the absolute type of typeDesc.
 E.g.: typeDesc = "class const volatile TNamed**", returns "TNamed**".
 if (mode&1) remove last "*"s                     returns "TNamed"
 if (mode&2) remove default allocators from STL containers
 if (mode&4) remove all     allocators from STL containers
 if (mode&8) return inner class of stl container. list<innerClass>
 if (mode&16) return deapest class of stl container. vector<list<deapest>>
 if (mode&kDropAllDefault) remove default template arguments

bool IsInterpreterDetail(const char* type)
 Return true if the type is one the interpreter details which are
 only forward declared (ClassInfo_t etc..)
bool IsSTLBitset(const char* type)
 Return true is the name is std::bitset<number> or bitset<number>
ROOT::ESTLType UnderlyingIsSTLCont(string_view type)
 Return the type of STL collection, if any, that is the underlying type
 of the given type.   Namely return the value of IsSTLCont after stripping
 pointer, reference and constness from the type.
    UnderlyingIsSTLCont("vector<int>*") == IsSTLCont("vector<int>")
 See TClassEdit::IsSTLCont

  type     : type name: vector<list<classA,allocator>,allocator>*
  result:    0          : not stl container
             code of container 1=vector,2=list,3=deque,4=map
                     5=multimap,6=set,7=multiset
ROOT::ESTLType IsSTLCont(string_view type)
  type     : type name: vector<list<classA,allocator>,allocator>
  result:    0          : not stl container
             code of container 1=vector,2=list,3=deque,4=map
                     5=multimap,6=set,7=multiset
int IsSTLCont(const char* type, int testAlloc)
  type     : type name: vector<list<classA,allocator>,allocator>
  testAlloc: if true, we test allocator, if it is not default result is negative
  result:    0          : not stl container
             abs(result): code of container 1=vector,2=list,3=deque,4=map
                           5=multimap,6=set,7=multiset
             positive val: we have a vector or list with default allocator to any depth
                   like vector<list<vector<int>>>
             negative val: STL container other than vector or list, or non default allocator
                           For example: vector<deque<int>> has answer -1
bool IsStdClass(const char* type)
 return true if the class belongs to the std namespace
bool IsVectorBool(const char* name)
string ResolveTypedef(const char* tname, bool resolveAll = false)
string InsertStd(const char* tname)
char* DemangleTypeIdName(const type_info& ti, int& errorCode)
 Demangle in a portable way the type id name.
 IMPORTANT: The caller is responsible for freeing the returned const char*
EComplexType GetComplexType(const char* )
char* DemangleName(const char* mangled_name, int& errorCode)
 Demangle in a portable way the name.
 IMPORTANT: The caller is responsible for freeing the returned const char*