| 5 | #include <fstream> |
| 6 | |
| 7 | std::string varSafeName(const std::string& name) { |
| 8 | std::string ret = name; |
| 9 | |
| 10 | auto pos = ret.rfind('/'); |
| 11 | |
| 12 | if (pos != ret.npos) { |
| 13 | ret = ret.substr(pos + 1); |
| 14 | } |
| 15 | |
| 16 | pos = ret.find('.'); |
| 17 | if (pos != ret.npos) { |
| 18 | ret = ret.substr(0, pos); |
| 19 | } |
| 20 | |
| 21 | return ret; |
| 22 | } |
| 23 | |
| 24 | static char hexdigit[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; |
| 25 |