MCPcopy Create free account
hub / github.com/PDAL/PDAL / generateTag

Function generateTag

pdal/PipelineWriter.cpp:47–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45{
46
47std::string generateTag(Stage *stage, PipelineWriter::TagMap& tags)
48{
49 auto tagExists = [tags](const std::string& tag)
50 {
51 for (auto& t : tags)
52 {
53 if (t.second == tag)
54 return true;
55 }
56 return false;
57 };
58
59 std::string tag = stage->tag();
60 if (tag.empty())
61 {
62 for (size_t i = 1; ; ++i)
63 {
64 tag = stage->getName() + std::to_string(i);
65 tag = Utils::replaceAll(tag, ".", "_");
66 if (!tagExists(tag))
67 break;
68 }
69 }
70 return tag;
71}
72
73void generateTags(Stage *stage, PipelineWriter::TagMap& tags)
74{

Callers 1

generateTagsFunction · 0.85

Calls 2

emptyMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected