13#ifndef ROOT_TClassEdit
14#define ROOT_TClassEdit
17#include "RConfigure.h"
21#ifndef UNDNAME_COMPLETE
22#define UNDNAME_COMPLETE 0x0000
25 char *__unDName(
char *demangled,
const char *mangled,
int out_len,
26 void * (* pAlloc )(
size_t),
void (* pFree )(
void *),
27 unsigned short int flags);
46#if defined(__CYGWIN__)
51 string to_string(T value) {
132 const std::string & ) = 0;
150 void ShortType(std::string &answer,
int mode);
183 if (fBehavior == EBehavior::kDetectStrip || fBehavior == EBehavior::kDetectStripReadd) {
184 fTypeName.erase(0, 8);
185 if (0 == fTypeName.size() ||
')' != fTypeName[fTypeName.size() - 1]) {
186 throw std::runtime_error(
"Cannot remove substring \")\" at the end of typename \"" + typeName +
"\"");
188 fTypeName.pop_back();
205 std::string CleanType (
const char *typeDesc,
int mode = 0,
const char **tail =
nullptr);
207 bool IsDefAlloc(
const char *alloc,
const char *classname);
208 bool IsDefAlloc(
const char *alloc,
const char *keyclassname,
const char *valueclassname);
209 bool IsDefComp (
const char *comp ,
const char *classname);
210 bool IsDefPred(
const char *predname,
const char *classname);
211 bool IsDefHash(
const char *hashname,
const char *classname);
212 bool IsInterpreterDetail(
const char *type);
213 bool IsSTLBitset(
const char *type);
216 int IsSTLCont (
const char *type,
int testAlloc);
217 bool IsStdClass(
const char *type);
218 bool IsVectorBool(
const char *
name);
219 void GetNormalizedName(std::string &norm_name, std::string_view
name);
220 std::string GetLong64_Name(
const char *original);
221 std::string GetLong64_Name(
const std::string& original);
222 int GetSplit (
const char *type, std::vector<std::string> &output,
int &nestedLoc, EModType mode =
TClassEdit::kNone);
224 int STLArgs (
int kind);
225 std::string ResolveTypedef(
const char *tname,
bool resolveAll =
false);
226 std::string ShortType (
const char *typeDesc,
int mode);
227 std::string InsertStd(
const char *tname);
228 const char* GetUnqualifiedName(
const char*
name);
233 return 0 ==
name.compare(0, 10,
"std::pair<") || 0 ==
name.compare(0, 5,
"pair<");
237 return 0 ==
name.compare(0, 17,
"std::__pair_base<") || 0 ==
name.compare(0, 12,
"__pair_base<");
242 std::vector<std::string>
v;
247 std::string GetNameForIO(
const std::string& templateInstanceName,
249 bool* hasChanged =
nullptr);
250 bool GetStdArrayProperties(
const char* typeName,
251 std::string& typeNameBuf,
252 std::array<int, 5>& maxIndices,
262 char *demangled_name = __unDName(0, mangled_name, 0,
malloc,
free, UNDNAME_COMPLETE);
263 if (!demangled_name) {
267 std::string demangledName = demangled_name;
268 if (demangledName.compare(0, 6,
"class ") == 0)
269 demangledName.erase(0, 6);
270 else if (demangledName.compare(0, 7,
"struct ") == 0)
271 demangledName.erase(0, 7);
272 strcpy(demangled_name, demangledName.c_str());
274 char *demangled_name = abi::__cxa_demangle(mangled_name,
nullptr,
nullptr, &errorCode);
275 if (!demangled_name || errorCode) {
276 free(demangled_name);
280 return demangled_name;
282 char* DemangleTypeIdName(
const std::type_info& ti,
int& errorCode);
AtomicTypeNameHandlerRAII(std::string &typeName, EBehavior behavior=EBehavior::kDetectStripReadd)
~AtomicTypeNameHandlerRAII()
virtual bool CheckInClassTable(const std::string &, std::string &)=0
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
bool IsStdPairBase(std::string_view name)
bool IsStdArray(std::string_view name)
bool IsStdPair(std::string_view name)
bool SplitFunction(std::string_view decl, FunctionSplitInfo &result)
Split a function declaration into its different parts.
std::string GetUniquePtrType(std::string_view name)
char * DemangleName(const char *mangled_name, int &errorCode)
bool IsArtificial(std::string_view name)
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.
bool IsUniquePtr(std::string_view name)
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,...
TSplitType(const char *type2split, EModType mode=TClassEdit::kNone)
default constructor
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.