forked from Kistler-Group/sdbus-cpp
- add a list of c++ keywords and common defines - sanitize names so that there are no functions/args with names that are reserved in c++ Co-authored-by: Christian Schneider <cschneider@radiodata.biz>
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include <map>
|
||||
|
||||
#include "generator_utils.h"
|
||||
#include "reserved_names.h"
|
||||
|
||||
|
||||
std::string underscorize(const std::string& str)
|
||||
@ -142,3 +143,11 @@ std::string signature_to_type(const std::string& signature)
|
||||
_parse_signature(signature, type, i);
|
||||
return type;
|
||||
}
|
||||
|
||||
std::string mangle_name(const std::string& name)
|
||||
{
|
||||
if (reserved_names.find(name) != reserved_names.end())
|
||||
return name + "_";
|
||||
else
|
||||
return name;
|
||||
}
|
||||
|
Reference in New Issue
Block a user