MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / getPathName

Method getPathName

physx/samples/samplebase/TestGroup.cpp:84–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void Test::TestGroup::getPathName(char* strBuffer, unsigned strBufferMaxLength, bool omitRoot)
85{
86 SampleArray<TestGroup*> path;
87 getPath(path);
88
89 unsigned charCount = 1; //\0
90 for (unsigned i = omitRoot ? 1 : 0; i < path.size(); ++i)
91 {
92 const TestGroup& node = *path[i];
93
94 unsigned nodeNameLength = unsigned(strlen(node.getName()));
95 if (node.getFirstChild())
96 nodeNameLength += 1;
97
98 if (charCount + nodeNameLength < strBufferMaxLength)
99 {
100 sprintf(strBuffer + (charCount - 1), "%s%s", node.getName(), node.getFirstChild() ? "/" : "");
101 charCount += nodeNameLength;
102 }
103 }
104}
105
106Test::TestGroup* Test::TestGroup::getGroupFromPathName(const char* pathName, bool omitRoot)
107{

Callers 1

onRenderMethod · 0.80

Calls 3

sizeMethod · 0.45
getNameMethod · 0.45
getFirstChildMethod · 0.45

Tested by

no test coverage detected