File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -605,6 +605,19 @@ bool split_comma_saparated_types(const std::string& name,
605605 return true ;
606606}
607607
608+ Cpp::TCppScope_t GetEnumFromCompleteName (const std::string &name) {
609+ std::string delim = " ::" ;
610+ size_t start = 0 ;
611+ size_t end = name.find (delim);
612+ Cpp::TCppScope_t curr_scope = 0 ;
613+ while (end != std::string::npos) {
614+ curr_scope = Cpp::GetNamed (name.substr (start, end - start), curr_scope);
615+ start = end + delim.length ();
616+ end = name.find (delim, start);
617+ }
618+ return Cpp::GetNamed (name.substr (start, end), curr_scope);
619+ }
620+
608621// returns true if no new type was added.
609622bool Cppyy::AppendTypesSlow (const std::string& name,
610623 std::vector<Cpp::TemplateArgInfo>& types, Cppyy::TCppScope_t parent) {
@@ -668,6 +681,10 @@ bool Cppyy::AppendTypesSlow(const std::string& name,
668681
669682 if (is_integral (i))
670683 integral_value = strdup (i.c_str ());
684+ if (Cpp::TCppScope_t scope = GetEnumFromCompleteName (i))
685+ if (Cpp::IsEnumConstant (scope))
686+ integral_value =
687+ strdup (std::to_string (Cpp::GetEnumConstantValue (scope)).c_str ());
671688 types.emplace_back (type, integral_value);
672689 }
673690 return false ;
You can’t perform that action at this time.
0 commit comments