Converts: cc/ops/gen_foo_ops.h to: CC_OPS_GEN_FOO_OPS_H_
| 84 | // to: |
| 85 | // CC_OPS_GEN_FOO_OPS_H_ |
| 86 | string ToGuard(const string& path) { |
| 87 | string guard; |
| 88 | guard.reserve(path.size() + 1); // + 1 -> trailing _ |
| 89 | for (const char c : path) { |
| 90 | if (c >= 'A' && c <= 'Z') { |
| 91 | guard += c; |
| 92 | } else if (c >= 'a' && c <= 'z') { |
| 93 | guard += c + 'A' - 'a'; |
| 94 | } else { |
| 95 | guard += '_'; |
| 96 | } |
| 97 | } |
| 98 | guard += '_'; |
| 99 | return guard; |
| 100 | } |
| 101 | |
| 102 | // Converts: some_name_xyz |
| 103 | // to: Some Name Xyz |
no test coverage detected