MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getUniqueObjectName

Method getUniqueObjectName

src/App/Document.cpp:3883–3895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3881}
3882
3883std::string Document::getUniqueObjectName(std::string_view proposedName) const
3884{
3885 if (proposedName.empty()) {
3886 return {};
3887 }
3888 std::string cleanName = Base::Tools::getIdentifier(proposedName);
3889
3890 if (!d->objectNameManager.containsName(cleanName)) {
3891 // Not in use yet, name is OK
3892 return cleanName;
3893 }
3894 return d->objectNameManager.makeUniqueName(cleanName, 3);
3895}
3896
3897bool Document::haveSameBaseName(std::string_view name, std::string_view label)
3898{

Callers 3

updateMethod · 0.45
setLinkMethod · 0.45
createDatumMethod · 0.45

Calls 3

containsNameMethod · 0.80
makeUniqueNameMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected