MCPcopy Create free account
hub / github.com/assimp/assimp / PrefixString

Function PrefixString

code/Common/SceneCombiner.cpp:77–94  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Add a prefix to a string

Source from the content-addressed store, hash-verified

75// ------------------------------------------------------------------------------------------------
76// Add a prefix to a string
77inline 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

Callers 3

AddNodePrefixesMethod · 0.85
MergeScenesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected