17 #ifndef IMPORT_HELPERS_H_
18 #define IMPORT_HELPERS_H_
23 #include <boost/algorithm/string.hpp>
24 #include <boost/algorithm/string/replace.hpp>
26 namespace ImportHelpers {
34 boost::regex invalid_chars{R
"([^0-9a-z_])",
35 boost::regex::extended | boost::regex::icase};
36 std::string sanitized_name = boost::regex_replace(name, invalid_chars, "");
37 boost::regex starts_with_digit{R
"(^[0-9].*)"};
38 if (boost::regex_match(sanitized_name, starts_with_digit)) {
39 sanitized_name =
"_" + sanitized_name;
42 sanitized_name +=
"_";
44 return sanitized_name;
49 #endif // IMPORT_HELPERS_H_
static std::set< std::string > reserved_keywords
bool is_reserved_name(const std::string &name)
std::string sanitize_name(const std::string &name)