15 #include "nameUniquifier.h" 36 const string &empty) :
37 _separator(separator),
77 string NameUniquifier::
78 add_name_body(
const string &name,
const string &prefix) {
80 if (_names.insert(name).second) {
93 static const int max_len = 16;
94 char num_str[max_len];
95 sprintf(num_str,
"%d", ++_counter);
96 nassertr((
int)strlen(num_str) <= max_len,
"");
99 temp_name = _empty + num_str;
101 temp_name = prefix + _separator + num_str;
103 }
while (!_names.insert(temp_name).second);
NameUniquifier(const string &separator=string(), const string &empty=string())
Creates a new NameUniquifier.