mirror of
https://github.com/hyprwm/hyprwayland-scanner.git
synced 2024-11-22 13:35:58 +01:00
core: fix usage of reserved C++ types
This commit is contained in:
parent
94e32ec37e
commit
232fa45d54
1 changed files with 14 additions and 2 deletions
16
src/main.cpp
16
src/main.cpp
|
@ -46,6 +46,18 @@ struct {
|
|||
std::vector<SEnum> enums;
|
||||
} XMLDATA;
|
||||
|
||||
std::string sanitize(const std::string& in) {
|
||||
if (in == "namespace")
|
||||
return "namespace_";
|
||||
if (in == "class")
|
||||
return "class_";
|
||||
if (in == "delete")
|
||||
return "delete_";
|
||||
if (in == "new")
|
||||
return "new_";
|
||||
return in;
|
||||
}
|
||||
|
||||
std::string argsToShort(std::vector<SRequestArgument>& args, const std::string& since) {
|
||||
std::string shortt = since;
|
||||
for (auto& a : args) {
|
||||
|
@ -174,7 +186,7 @@ void parseXML(pugi::xml_document& doc) {
|
|||
|
||||
for (auto& arg : rq.children("arg")) {
|
||||
SRequestArgument sargm;
|
||||
sargm.name = arg.attribute("name").as_string();
|
||||
sargm.name = sanitize(arg.attribute("name").as_string());
|
||||
sargm.wlType = arg.attribute("type").as_string();
|
||||
sargm.interface = arg.attribute("interface").as_string();
|
||||
sargm.enumName = arg.attribute("enum").as_string();
|
||||
|
@ -193,7 +205,7 @@ void parseXML(pugi::xml_document& doc) {
|
|||
|
||||
for (auto& arg : ev.children("arg")) {
|
||||
SRequestArgument sargm;
|
||||
sargm.name = arg.attribute("name").as_string();
|
||||
sargm.name = sanitize(arg.attribute("name").as_string());
|
||||
sargm.interface = arg.attribute("interface").as_string();
|
||||
sargm.wlType = arg.attribute("type").as_string();
|
||||
sargm.enumName = arg.attribute("enum").as_string();
|
||||
|
|
Loading…
Reference in a new issue