Compare two descriptors. If only one of them has a checksum, the checksum is ignored. */
| 48 | |
| 49 | /** Compare two descriptors. If only one of them has a checksum, the checksum is ignored. */ |
| 50 | bool EqualDescriptor(std::string a, std::string b) |
| 51 | { |
| 52 | bool a_check = (a.size() > 9 && a[a.size() - 9] == '#'); |
| 53 | bool b_check = (b.size() > 9 && b[b.size() - 9] == '#'); |
| 54 | if (a_check != b_check) { |
| 55 | if (a_check) a = a.substr(0, a.size() - 9); |
| 56 | if (b_check) b = b.substr(0, b.size() - 9); |
| 57 | } |
| 58 | return a == b; |
| 59 | } |
| 60 | |
| 61 | std::string UseHInsteadOfApostrophe(const std::string& desc) |
| 62 | { |