MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / trimNumber

Function trimNumber

Engine/NodeName.cpp:37–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35#include "Engine/NodeSerialization.h"
36
37NATRON_NAMESPACE_ENTER
38
39// Trim underscore followed by digits at the end of baseName (see #732).
40static
41void trimNumber(std::string &baseName)
42{
43 std::size_t found_underscore = baseName.rfind('_');
44 if (found_underscore != std::string::npos && found_underscore != (baseName.size() - 1)) {
45 std::size_t found_nondigit = baseName.find_last_not_of("0123456789");
46 if (found_nondigit == found_underscore) {
47 baseName.erase(found_underscore);
48 }
49 }
50}
51
52void
53Node::initNodeScriptName(const NodeSerialization* serialization, const QString& fixedName)

Callers 1

initNodeScriptNameMethod · 0.70

Calls 2

sizeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected