u/var: Expose root object raw name

This commit is contained in:
Jakob Bornecrantz 2023-06-22 16:36:37 +01:00
parent ea77386887
commit cd7e921a03
2 changed files with 8 additions and 1 deletions

View file

@ -41,6 +41,7 @@ class Obj
{
public:
std::string name = {};
std::string raw_name = {};
struct u_var_root_info info = {};
std::vector<Var> vars = {};
};
@ -130,6 +131,7 @@ u_var_add_root(void *root, const char *c_name, bool suffix_with_number)
}
auto name = std::string(c_name);
auto raw_name = name;
uint32_t count = 0; // Zero means no number.
if (suffix_with_number) {
@ -142,7 +144,9 @@ u_var_add_root(void *root, const char *c_name, bool suffix_with_number)
auto &obj = gTracker.map[(ptrdiff_t)root] = Obj();
obj.name = name;
obj.raw_name = raw_name;
obj.info.name = obj.name.c_str();
obj.info.raw_name = obj.raw_name.c_str();
obj.info.number = count;
}

View file

@ -286,7 +286,10 @@ struct u_var_root_info
//! The displayed name.
const char *name;
//! The number of the window, or zero.
//! Raw name without any suffix.
const char *raw_name;
//! The number of the window, or zero (name and raw_name are the same).
uint32_t number;
};