MCPcopy Create free account
hub / github.com/DFHack/dfhack / getNameChunk

Function getNameChunk

library/modules/Gui.cpp:136–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134*/
135
136static std::string getNameChunk(const virtual_identity *id, int start, int end)
137{
138 if (!id)
139 return "UNKNOWN";
140 const char *name = id->getName();
141 int len = strlen(name);
142 if (len > start + end)
143 return std::string(name+start, len-start-end);
144 else
145 return name;
146}
147
148/*
149 * Classifying focus context by means of a string path.

Callers 1

getFocusStringsMethod · 0.85

Calls 1

getNameMethod · 0.45

Tested by

no test coverage detected