| 135 | } |
| 136 | |
| 137 | std::string DescriptorToDot(const char* descriptor) { |
| 138 | size_t length = strlen(descriptor); |
| 139 | if (length > 1) { |
| 140 | if (descriptor[0] == 'L' && descriptor[length - 1] == ';') { |
| 141 | // Descriptors have the leading 'L' and trailing ';' stripped. |
| 142 | std::string result(descriptor + 1, length - 2); |
| 143 | std::replace(result.begin(), result.end(), '/', '.'); |
| 144 | return result; |
| 145 | } else { |
| 146 | // For arrays the 'L' and ';' remain intact. |
| 147 | std::string result(descriptor); |
| 148 | std::replace(result.begin(), result.end(), '/', '.'); |
| 149 | return result; |
| 150 | } |
| 151 | } |
| 152 | // Do nothing for non-class/array descriptors. |
| 153 | return descriptor; |
| 154 | } |
| 155 | |
| 156 | std::string DescriptorToName(const char* descriptor) { |
| 157 | size_t length = strlen(descriptor); |