24 #include <boost/foreach.hpp>
25 #include <drizzled/util/tablename_to_filename.h>
26 #include <drizzled/internal/my_sys.h>
31 static const char* hexchars=
"0123456789abcdef";
45 std::string tablename_to_filename(
const std::string &from)
48 BOOST_FOREACH(
char it, from)
52 if (isdigit(it) || islower(it) || it ==
'_' || it ==
' ' || it ==
'-')
60 to.push_back(tolower(it));
67 to.push_back(hexchars[(it >> 4) & 15]);
68 to.push_back(hexchars[it & 15]);
71 if (drizzled::internal::check_if_legal_tablename(to.c_str()))