13#ifndef ROOT_TClassEdit
14#define ROOT_TClassEdit
17#include "RConfigure.h"
20#ifndef UNDNAME_COMPLETE
21#define UNDNAME_COMPLETE 0x0000
24 char *__unDName(
char *demangled,
const char *mangled,
int out_len,
25 void * (* pAlloc )(
size_t),
void (* pFree )(
void *),
26 unsigned short int flags);
45#if defined(__CYGWIN__)
50 string to_string(T
value) {
62 namespace TMetaUtils {
63 class TNormalizedCtxt;
130 const std::string & ) = 0;
158 std::string
CleanType (
const char *typeDesc,
int mode = 0,
const char **tail =
nullptr);
161 bool IsDefAlloc(
const char *alloc,
const char *classname);
162 bool IsDefAlloc(
const char *alloc,
const char *keyclassname,
const char *valueclassname);
163 bool IsDefComp (
const char *comp ,
const char *classname);
164 bool IsDefPred(
const char *predname,
const char *classname);
165 bool IsDefHash(
const char *hashname,
const char *classname);
183 std::string
ResolveTypedef(
const char *tname,
bool resolveAll =
false);
185 std::string
InsertStd(
const char *tname);
193 return 0 ==
name.compare(0, 10,
"std::pair<") || 0 ==
name.compare(0, 5,
"pair<");
198 return 0 ==
name.compare(0, 17,
"std::__pair_base<") || 0 ==
name.compare(0, 12,
"__pair_base<");
204 std::vector<std::string>
v;
210 std::string
GetNameForIO(
const std::string& templateInstanceName,
212 bool* hasChanged =
nullptr);
214 std::string& typeNameBuf,
215 std::array<int, 5>& maxIndices,
225 char *demangled_name = __unDName(0, mangled_name, 0,
malloc,
free, UNDNAME_COMPLETE);
226 if (!demangled_name) {
230 std::string demangledName = demangled_name;
231 if (demangledName.compare(0, 6,
"class ") == 0)
232 demangledName.erase(0, 6);
233 else if (demangledName.compare(0, 7,
"struct ") == 0)
234 demangledName.erase(0, 7);
235 strcpy(demangled_name, demangledName.c_str());
237 char *demangled_name = abi::__cxa_demangle(mangled_name,
nullptr,
nullptr, &errorCode);
238 if (!demangled_name || errorCode) {
239 free(demangled_name);
243 return demangled_name;
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 value
Option_t Option_t TPoint TPoint const char mode
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
virtual bool GetPartiallyDesugaredNameWithScopeHandling(const std::string &, std::string &, bool=true)=0
virtual ~TInterpreterLookupHelper()
virtual bool IsAlreadyPartiallyDesugaredName(const std::string &, const std::string &)=0
virtual bool IsDeclaredScope(const std::string &, bool &)=0
virtual void ShuttingDownSignal()=0
TInterpreterLookupHelper()
virtual void GetPartiallyDesugaredName(std::string &)=0
virtual bool ExistingTypeCheck(const std::string &, std::string &)=0
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
ROOT::ESTLType STLKind(std::string_view type)
Converts STL container name to number.
bool IsStdPairBase(std::string_view name)
bool IsDefComp(const char *comp, const char *classname)
return whether or not 'compare' is the STL default comparator for type 'classname'
std::string ResolveTypedef(const char *tname, bool resolveAll=false)
bool IsStdArray(std::string_view name)
bool IsStdClass(const char *type)
return true if the class belongs to the std namespace
bool IsDefHash(const char *hashname, const char *classname)
return whether or not 'hashname' is the STL default hash for type 'classname'
bool IsStdPair(std::string_view name)
bool IsInterpreterDetail(const char *type)
Return true if the type is one the interpreter details which are only forward declared (ClassInfo_t e...
std::string InsertStd(const char *tname)
bool SplitFunction(std::string_view decl, FunctionSplitInfo &result)
Split a function declaration into its different parts.
std::string GetLong64_Name(const char *original)
Replace 'long long' and 'unsigned long long' by 'Long64_t' and 'ULong64_t'.
bool IsDefPred(const char *predname, const char *classname)
return whether or not 'predname' is the STL default predicate for type 'classname'
char * DemangleTypeIdName(const std::type_info &ti, int &errorCode)
Demangle in a portable way the type id name.
const char * GetUnqualifiedName(const char *name)
Return the start of the unqualified name include in 'original'.
std::string GetUniquePtrType(std::string_view name)
bool IsVectorBool(const char *name)
void Init(TClassEdit::TInterpreterLookupHelper *helper)
ROOT::ESTLType IsSTLCont(std::string_view type)
type : type name: vector<list<classA,allocator>,allocator> result: 0 : not stl container code of cont...
std::string CleanType(const char *typeDesc, int mode=0, const char **tail=nullptr)
Cleanup type description, redundant blanks removed and redundant tail ignored return *tail = pointer ...
std::string ShortType(const char *typeDesc, int mode)
Return the absolute type of typeDesc.
char * DemangleName(const char *mangled_name, int &errorCode)
bool IsArtificial(std::string_view name)
bool GetStdArrayProperties(const char *typeName, std::string &typeNameBuf, std::array< int, 5 > &maxIndices, int &ndim)
std::string GetNameForIO(const std::string &templateInstanceName, TClassEdit::EModType mode=TClassEdit::kNone, bool *hasChanged=nullptr)
int STLArgs(int kind)
Return number of arguments for STL container before allocator.
int GetSplit(const char *type, std::vector< std::string > &output, int &nestedLoc, EModType mode=TClassEdit::kNone)
Stores in output (after emptying it) the split type.
void GetNormalizedName(std::string &norm_name, std::string_view name)
Return the normalized name.
bool IsDefAlloc(const char *alloc, const char *classname)
return whether or not 'allocname' is the STL default allocator for type 'classname'
bool IsUniquePtr(std::string_view name)
bool IsSTLBitset(const char *type)
Return true is the name is std::bitset<number> or bitset<number>
ROOT::ESTLType UnderlyingIsSTLCont(std::string_view type)
Return the type of STL collection, if any, that is the underlying type of the given type.
EComplexType GetComplexType(const char *)
Result of splitting a function declaration into fReturnType fScopeName::fFunctionName<fFunctionTempla...
std::string fFunctionName
Name of the function.
std::vector< std::string > fFunctionTemplateArguments
Template arguments of the function template specialization, if any; will contain one element "" for f...
std::string fScopeName
Name of the scope qualification of the function, possibly empty.
std::vector< std::string > fFunctionParameters
Function parameters.
std::string fReturnType
Return type of the function, might be empty if the function declaration string did not provide it.
TSplitType(const TSplitType &)=delete
bool IsTemplate()
Check if the type is a template.
int IsSTLCont(int testAlloc=0) const
type : type name: vector<list<classA,allocator>,allocator> testAlloc: if true, we test allocator,...
std::vector< std::string > fElements
ROOT::ESTLType IsInSTL() const
type : type name: vector<list<classA,allocator>,allocator>[::iterator] result: 0 : not stl container ...
TSplitType & operator=(const TSplitType &)=delete
void ShortType(std::string &answer, int mode)
Return the absolute type of typeDesc into the string answ.