------------------------------------------------------------------------------------------------ Add a prefix to a string
| 75 | // ------------------------------------------------------------------------------------------------ |
| 76 | // Add a prefix to a string |
| 77 | inline void PrefixString(aiString &string, const char *prefix, unsigned int len) { |
| 78 | // If the string is already prefixed, we won't prefix it a second time |
| 79 | if (string.length >= 1 && string.data[0] == '$') |
| 80 | return; |
| 81 | |
| 82 | if (len + string.length >= AI_MAXLEN - 1) { |
| 83 | ASSIMP_LOG_VERBOSE_DEBUG("Can't add an unique prefix because the string is too long"); |
| 84 | ai_assert(false); |
| 85 | return; |
| 86 | } |
| 87 | |
| 88 | // Add the prefix |
| 89 | ::memmove(string.data + len, string.data, string.length + 1); |
| 90 | ::memcpy(string.data, prefix, len); |
| 91 | |
| 92 | // And update the string's length |
| 93 | string.length += len; |
| 94 | } |
| 95 | |
| 96 | // ------------------------------------------------------------------------------------------------ |
| 97 | // Add node identifiers to a hashing set |
no outgoing calls
no test coverage detected