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);
44#if defined(__CYGWIN__)
49 string to_string(
T value) {
61 namespace TMetaUtils {
62 class TNormalizedCtxt;
129 const std::string & ) = 0;
145 void ShortType(std::string &answer,
int mode);
155 std::string
CleanType (
const char *typeDesc,
int mode = 0,
const char **tail=0);
156 bool IsDefAlloc(
const char *alloc,
const char *classname);
157 bool IsDefAlloc(
const char *alloc,
const char *keyclassname,
const char *valueclassname);
158 bool IsDefComp (
const char *comp ,
const char *classname);
159 bool IsDefPred(
const char *predname,
const char *classname);
160 bool IsDefHash(
const char *hashname,
const char *classname);
178 std::string
ResolveTypedef(
const char *tname,
bool resolveAll =
false);
179 std::string
ShortType (
const char *typeDesc,
int mode);
180 std::string
InsertStd(
const char *tname);
189 std::vector<std::string>
v;
195 std::string
GetNameForIO(
const std::string& templateInstanceName,
197 bool* hasChanged =
nullptr);
199 std::string& typeNameBuf,
200 std::array<int, 5>& maxIndices,
210 char *demangled_name = __unDName(0, mangled_name, 0,
malloc,
free, UNDNAME_COMPLETE);
211 if (!demangled_name) {
216 char *demangled_name = abi::__cxa_demangle(mangled_name, 0, 0, &errorCode);
217 if (!demangled_name || errorCode) {
218 free(demangled_name);
222 return demangled_name;
virtual bool IsAlreadyPartiallyDesugaredName(const std::string &, const std::string &)=0
virtual bool IsDeclaredScope(const std::string &, bool &)=0
TInterpreterLookupHelper()
virtual bool GetPartiallyDesugaredNameWithScopeHandling(const std::string &, std::string &)=0
virtual void GetPartiallyDesugaredName(std::string &)=0
virtual bool ExistingTypeCheck(const std::string &, std::string &)=0
virtual ~TInterpreterLookupHelper()
Namespace for new ROOT classes and functions.
ROOT::ESTLType STLKind(std::string_view type)
Converts STL container name to number.
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)
std::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 ...
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 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 ShortType(const char *typeDesc, int mode)
Return the absolute type of typeDesc.
char * DemangleName(const char *mangled_name, int &errorCode)
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 *)
Print a TSeq at the prompt:
basic_string_view< char > string_view
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 & operator=(const TSplitType &)
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,...
TSplitType(const char *type2split, EModType mode=TClassEdit::kNone)
default constructor
TSplitType(const TSplitType &)
std::vector< std::string > fElements
ROOT::ESTLType IsInSTL() const
type : type name: vector<list<classA,allocator>,allocator>[::iterator] result: 0 : not stl container ...
void ShortType(std::string &answer, int mode)
Return the absolute type of typeDesc into the string answ.